OpenCode
Connect OpenCode through the Anthropic-compatible Model Gate API
OpenCode
Configure the Anthropic provider in ~/.config/opencode/opencode.jsonc on Linux/macOS or C:\Users\%USERNAME%\.config\opencode\opencode.jsonc on Windows.
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"anthropic": {
"options": {
"baseURL": "https://api.model-gate.com/v1",
"apiKey": "mg_live_..."
}
}
}
}
For OpenCode, baseURL includes /v1. Save the file and launch OpenCode normally.