OpenCode

How to fix OpenCode 403 Forbidden

A 403 differs from a 401 or invalid JSON. Check permissions and model routing without exposing or storing the API key in plaintext.

Start with these checks

The request was authenticated, but the credential or route cannot access the target model.

  • OpenCode returns 403 or Forbidden.
  • The key cannot access the model
  • Confirm account and key permissions
403Forbidden

01

Separate 403 from authentication failure

A 403 usually means the request was recognized but cannot access the target resource.

02

Check permissions and routing

Keep the key, Provider, Base URL, and Model ID in one coherent setup.

  1. 1Confirm account and key permissions
  2. 2Compare Provider, Base URL, and Model ID

03

Confirm recovery and prevent recurrence

A short message succeeds after access is restored; check route status whenever changing models.

  1. 1Compare Provider, Base URL, and Model ID
  2. 2Check model and channel status

If it is still not fixed

Sources

Reconfigure

Return to the integration center and continue the setup steps.

Return to the related setup step