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.

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. Then run /models and select a Modellix model.
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.

Anthropic and Google models

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