@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.Set Up OpenCode
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 update
opencode.json (project) or ~/.config/opencode/opencode.json:Add or remove entries under
models as needed. Full catalog: Models & Pricing.3
Select a Modellix Model
Run
/models and select a Modellix model.You do not need a separate Anthropic baseURL 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