What this error means
OpenCode Zen returns HTTP 401 with ModelError when the model id in your request is not one the gateway currently serves. Despite the status code, the key is usually fine — free preview models get retired or renamed, and client model catalogs go stale.
How to fix it
- Check the model id against the models Zen currently serves.
- Update opencode or your harness so its model catalog matches the live list.
- Pin a model that is still served instead of a retired free preview.
Example error message
{
"type": "error",
"error": {
"type": "ModelError",
"message": "Model trinity-large-preview-free is not supported"
}
}How Manifest handles it
Manifest auto-fixes deprecated and not-found model ids on the fly, and falls back to the next model in your chain when the gateway drops one.
Frequently asked
Why is this a 401 if my API key works?
The status code is misleading. Zen answers 401 for a model id it no longer serves; a key problem would fail on every model, not just one.
More Opencode-zen errors
| Code | Error | Affected teams / 30 days | |
|---|---|---|---|
| 429 | OpenCode Zen 429: FreeUsageLimitError on free models | 136 | View |
| View all Opencode-zen errors | |||