Direct answer
This page explains how UK teams use NextModel's OpenAI-compatible gateway. Add NextModel as an OpenAI-compatible provider in opencode.json. It adds the practical steps, configuration notes, and common questions.
Config file
Put the block in ~/.config/opencode/opencode.json (global) or opencode.json in the project root (higher priority). The npm package must be @ai-sdk/openai-compatible; model ids must match the catalog exactly — copy them from GET /v1/models.
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"nextmodel": {
"npm": "@ai-sdk/openai-compatible",
"name": "NextModel",
"options": {
"baseURL": "https://api.nextmodel.app/v1",
"apiKey": "$NEXTMODEL_API_KEY"
},
"models": {
"qwen/qwen3.7-max": { "name": "Qwen 3.7 Max" },
"anthropic/claude-sonnet-4.5": { "name": "Claude Sonnet 4.5" }
}
}
},
"model": "nextmodel/qwen/qwen3.7-max"
}