Skip to main content
Watch: I Built an AI App Without Leaving Databricks

OpenCode error

OpenCode: ProviderModelNotFoundError

Error message
ProviderModelNotFoundError

Status: By designLast verified 4 documented fixes3 sources

What it means

OpenCode could not resolve the model you referenced to a provider and model it knows about. The official troubleshooting docs say that if you see this error, you have most likely referenced a model incorrectly somewhere.

Causes

  • The model is not referenced in the required <providerId>/<modelId> form (official docs).
  • An agent or subagent config references a model through a provider you are not signed in to. A maintainer in #916: "You are referencing an anthropic model using anthropic provider and aren't signed in w/ anthropic. You can use anthropic models through github copilot but you need to specify them using github-copilot prefix".
  • The model ID is not in OpenCode's model list, which comes from models.dev (#916).

How to fix it

  1. Fix 1.

    Reference models as <providerId>/<modelId>. Examples from the docs: openai/gpt-4.1, openrouter/google/gemini-2.5-flash, opencode/kimi-k2.

    Snippet
    openai/gpt-4.1
    openrouter/google/gemini-2.5-flash
    opencode/kimi-k2
  2. Fix 2.

    List the models you can actually use, then copy the exact ID into your config or agent definition (official docs, and a maintainer in #916).

    Terminal
    opencode models
  3. Fix 3.

    To use a model through GitHub Copilot, use the github-copilot prefix rather than the original vendor's prefix (maintainer, #916).

    Snippet
    github-copilot/claude-sonnet-4
  4. Fix 4.

    Look up the correct provider and model IDs on models.dev, which OpenCode uses as its model reference (maintainer, #916). Since v1.14.50 the CLI and typed callers suggest alternatives when a model is missing.

More OpenCode errors

All 17 OpenCode errors

FAQ

What does "ProviderModelNotFoundError" mean in OpenCode?

OpenCode could not resolve the model you referenced to a provider and model it knows about. The official troubleshooting docs say that if you see this error, you have most likely referenced a model incorrectly somewhere.

How do I fix "ProviderModelNotFoundError"?

There are 4 documented fixes. Start with the first: Reference models as <providerId>/<modelId>. Examples from the docs: openai/gpt-4.1, openrouter/google/gemini-2.5-flash, opencode/kimi-k2.

Is this OpenCode error fixed?

Status: By design. Expected behavior, not a bug. The documented fixes change the setup that triggers it. Affected versions: Reported from 0.2.33 (Jul 2025) onward. v1.14.50 improved missing-model errors with suggestions.

Sources

Last verified against 3 sources: official docs, maintainer replies and release notes.

Newsletter

Fixes for the tools you use, weekly

One email per week. New coding agent releases, what broke, and how developers are working around it.