OpenCode: ProviderModelNotFoundError: Model not found

OpenCode couldn't match the model reference to a provider and model it knows. The exact message, why OpenCode prints it, and the fix.

Updated November 23, 2026

The message

ProviderModelNotFoundError: Model not found

What it means

OpenCode couldn’t match the model reference to a provider and model it knows. Models are written as <providerId>/<modelId>; a typo, a provider you haven’t connected, a model dropped from the catalog, or a model ID that itself contains a slash all end here.

Fix

  1. Run opencode models to list the provider/model IDs you can use, and copy the exact string.
  2. Fix the model value in opencode.json (and small_model and any agent’s model) to that <providerId>/<modelId> form.
  3. Connect the provider with /connect in the TUI so its models are listed.
  4. On OpenCode 2 the same failure reads ‘Model not found: <provider>/<model>’ followed by ‘Try: opencode models to list available models’.

In an EnvHaven workspace

Yes, until OpenCode is signed in once. Sign in once from the workspace’s Launch menu (Sign in, or Set key for an API key); the sign-in stays on the workspace, across restarts and on every device.

Where this comes from

From OpenCode’s documentation and issue tracker: