OpenCode with a custom API endpoint

I run qcode.cc, an independent API service (not official Anthropic, OpenAI or Google). The examples use QCode paths; swap the host for any compatible gateway.

Provider Base URLs

Each OpenCode provider appends its own path, so each needs a different Base URL:

ProviderbaseURLWhy
anthropichttps://api.qcode.cc/claude/v1The SDK appends /messages. /claude and /api are equivalent prefixes on QCode.
openaihttps://api.qcode.cc/openai/v1Built-in provider uses the Responses API for gpt-* models.
googlehttps://api.qcode.cc/gemini/v1betaThe google provider does not append /v1beta, unlike the Gemini CLI and @google/genai.

opencode.json

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "anthropic": { "options": { "baseURL": "https://api.qcode.cc/claude/v1" } },
    "openai":    { "options": { "baseURL": "https://api.qcode.cc/openai/v1" } },
    "google":    { "options": { "baseURL": "https://api.qcode.cc/gemini/v1beta" } }
  },
  "model": "anthropic/claude-opus-5-5"
}

Config lives at ~/.config/opencode/opencode.json (Windows: %USERPROFILE%\.config\opencode\opencode.json). Add the cr_ key through OpenCode's credential flow (/connect) for each provider you use; a missing key shows up as "API key is missing".

Which models go where

Live model list and prices: qcode.cc/models. Full OpenCode walkthrough: docs.qcode.cc OpenCode. Endpoint reference: endpoints and API paths. See also the Gemini setup guide.

Facts checked against docs.qcode.cc on 2026-12-05. I run qcode.cc. Pricing: qcode.cc/pricing (no free quota). Contact: hi@qcode.cc.