Skip to main content
Configure OpenCode to call the Modellix LLM gateway. The recommended approach is a custom provider using @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.
If you prefer Responses instead of Chat Completions, set npm to @ai-sdk/openai (see OpenCode custom provider). Most setups should keep @ai-sdk/openai-compatible.
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