OpenCode
Terminal coding agent with Anthropic, OpenAI, or Gemini providers
OpenCode talks to custom providers through
~/.config/opencode/opencode.json. Use the Anthropic SDK package for Messages models, or the OpenAI
/ Google packages for the other two wire formats.
| Anthropic | https://api.orientx.ai/v1 (@ai-sdk/anthropic) |
| OpenAI | https://api.orientx.ai/v1 (@ai-sdk/openai) |
| Gemini | https://api.orientx.ai/v1beta (@ai-sdk/google) |
| Auth | apiKey in the provider options |
| Config | ~/.config/opencode/opencode.json |
| Official docs | Providers |
Add a provider
Register a custom provider (opencode auth login → other), then write the config. Anthropic
is the usual choice for coding agents:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"orientx": {
"npm": "@ai-sdk/anthropic",
"name": "orientx",
"options": {
"baseURL": "https://api.orientx.ai/v1",
"apiKey": "sk-..."
},
"models": {
"<MODEL_ID>": {
"name": "<MODEL_ID>"
}
}
}
}
}Replace <MODEL_ID> with an id from GET /v1/models. Add more keys under models as needed. For
Chat Completions, switch npm to @ai-sdk/openai and keep the same /v1 base URL.
@ai-sdk/anthropic expects the /v1 suffix on baseURL. Claude Code's ANTHROPIC_BASE_URL does
not — that CLI appends /v1 itself.