Troubleshooting · opencode
opencode Model Not Found — Declaring Custom Provider Models
opencode only offers models it knows about, and custom provider models are not in the models.dev catalog. How to declare a model in opencode.json so it appears and works.
What you see
opencode model not foundWhy it happens
- The model is not declared in the provider's models map, and custom provider models are not in the models.dev catalog opencode consults — so the model simply is not offered.
- The declared model id does not match what the endpoint serves — a typo or a retired id returns 404 from the provider.
- The model was added to opencode.json but opencode was not restarted, so the old config is still active.
How to fix it
- Declare each model explicitly in the provider's models map in opencode.json, with the id exactly as the endpoint serves it.
- List the endpoint's live models with GET /v1/models rather than guessing ids.
- Restart opencode after the change.
Declare the model explicitly
{
"provider": {
"apitoken": {
"npm": "@ai-sdk/openai-compatible",
"name": "apiToken.sale",
"options": {
"baseURL": "https://openai.api.apitoken.sale/v1",
"apiKey": "{env:APITOKEN_API_KEY}"
},
"models": {
"gpt-5.6-sol": { "name": "GPT-5.6 Sol" }
}
}
}
}Related searches
ModelNotFoundErroropencode custom provider model missing
FAQ
Why doesn't my custom provider's model show up in opencode?+
Models outside the models.dev catalog must be declared by hand in the provider's models map. Undeclared models are not offered at all.
How do I find the exact model id to declare?+
Query the provider's GET /v1/models with your key and copy the id verbatim.
The model is declared but requests 404 — what else?+
The id in opencode.json must match the endpoint's id character for character, and the baseURL must be the documented one. Check both, then restart opencode.