@ai-sdk/openai-compatible (Chat Completions at /v1/chat/completions).
Modellix model IDs are
provider/name (for example openai/gpt-5.5). Put that full string in the custom provider models map so OpenCode sends it unchanged in the request body. See Models & Pricing.1. Store credentials
In OpenCode, run/connect, choose Other, and enter a provider ID such as modellix. Paste your Modellix API key from the console.
The provider ID from /connect must match the key under provider in opencode.json.
Alternatively, set the key in config with options.apiKey (for example {env:MODELLIX_API_KEY}).
2. Add a custom provider
Create or updateopencode.json (project) or ~/.config/opencode/opencode.json:
Add or remove entries under
models as needed. Full catalog: Models & Pricing.
Then run /models and select a Modellix model.
Anthropic and Google models
You do not need a separate AnthropicbaseURL without /v1 for OpenCode. Register anthropic/... and google/... IDs on the same Modellix custom provider above; traffic goes through OpenAI-compatible Chat Completions on https://llm.modellix.ai/v1.
Native Anthropic Messages (ANTHROPIC_BASE_URL without /v1) is for the Anthropic SDK and Claude Code, not required here.
Troubleshooting
Related
- OpenCode custom provider — official setup
- Models & Pricing — Model IDs and rates
- LLM API guide — protocols and curl examples
- OpenAI SDK — same
/v1Chat Completions gateway