Supported tools
CodeGateway exposes three compatible surfaces, so most mainstream Agent CLIs can connect directly:
Claude Code: set two environment variables. See Claude Code one-line setup.
OpenAI Codex CLI: set the base URL and key. See Codex CLI integration.
OpenClaw: change one base URL plus one key. See OpenClaw setup.
Qwen Code: register a compatible provider in its settings. See Qwen Code integration.
DeepSeek Harness: add a custom provider in model settings. See DeepSeek Harness integration.
Reasonix: point its config at the gateway. See Reasonix integration.
GitHub Copilot CLI: point it at a custom provider via four environment variables. See Copilot CLI integration.
opencode / Aider / Crush: OpenAI-compatible or Anthropic-compatible tools; see the docs hub.
Gemini CLI: officially supports only the Gemini-native protocol, so it cannot connect to this gateway. See Gemini CLI compatibility note.
Cursor CLI: officially supports only Cursor account auth. See Cursor CLI compatibility note.
Step 1: Register and create an API key
Open codegateway.dev and click Sign up — email + password, and you get a trial credit after you bind a card (current amount shown on the signup/pricing page).
Log into the Dashboard, go to API Keys, and create a key.
Keys start with sk-cg-. The full key is shown only once — save it immediately.
You can create multiple keys (one per project or tool).
Step 2: Choose your endpoint
CodeGateway speaks three compatible protocols; pick the one your tool speaks:
Anthropic Messages (Claude Code, Crush, etc.): base URL
https://api.codegateway.dev, path/v1/messages.OpenAI Chat Completions (Codex CLI, Qwen Code, opencode, Aider, Copilot CLI, etc.): base URL
https://api.codegateway.dev/v1, path/v1/chat/completions.OpenAI Responses (Codex CLI response mode): same base URL, path
/v1/responses.
Step 3: Configure your tool
Each tool stores its config differently (env vars vs config files). The two most common setups:
Claude Code:
export ANTHROPIC_BASE_URL="https://api.codegateway.dev"
export ANTHROPIC_AUTH_TOKEN="sk-cg-your-key"Codex CLI:
export OPENAI_BASE_URL="https://api.codegateway.dev/v1"
export OPENAI_API_KEY="sk-cg-your-key"For the rest (Qwen Code, DeepSeek Harness, Reasonix, opencode, Aider, Crush, Copilot CLI), see each tool's page.
Step 4: Verify the connection
Verify the underlying link before touching the tool:
curl https://api.codegateway.dev/v1/models \
-H "Authorization: Bearer sk-cg-your-key"A model list means the link is up. Then send one short prompt inside your tool.
Model routing rules (important)
Model support differs per protocol — this is the most common stumbling block:
Anthropic Messages protocol: Claude models (e.g. claude-sonnet-4-6) and Gemini models (e.g. gemini-3.8-flash) work with standard payloads.
OpenAI Chat Completions protocol: DeepSeek (deepseek-v4-pro), Kimi (kimi-k2.7-code), GLM (glm-5.3), Qwen (qwen3.8-27b) and others work. GPT-series models (gpt-5.3-codex, gpt-5.5, etc.) can be affected by upstream regional policy — affected requests are rejected with unsupported country/region/territory. This is usually transient (retrying recovers it); the gateway returns 503 (retryable) with Retry-After and the SDK retries automatically. Switch model or egress only if it keeps failing.
Claude- and Gemini-series text models are not available on the OpenAI-compatible protocol, and vice versa GPT-series models can hit the same transient regional rejection on the Messages protocol (retryable 503 — retry first).
The full model list is always available in the Dashboard Models page, or via the models endpoint above.
For coding, we recommend deepseek-v4-pro, kimi-k2.7-code, or glm-5.3 for OpenAI-protocol tools; claude-sonnet-4-6 for Claude Code.
Billing and trial credit
Pay as you go per token, with tiered markup — see Tier pricing explained.
Free trial credit (after card binding) covers any model.
Top up by credit card (Visa / Mastercard / AmEx), Stripe Link, Alipay, or bank transfer — see Billing & recharge guide.
FAQ
Q: Can one key be used across multiple tools? Yes. Keys are scoped to your account/project, not to a protocol — the same key works for Claude Code and Qwen Code.
Q: 401 Unauthorized after configuration? Check that the whole key was copied (sk-cg- prefix included) and that it hasn't expired; you can regenerate keys in the Dashboard. See Troubleshooting.
Q: GPT models return an unsupported-region error (503 unsupported country/region/territory)?This is usually transient: the gateway returns 503 with Retry-After and the SDK retries automatically — retrying recovers it (one controlled retry succeeded after 94 s; median recovery across 10 cases in 48 h was ~3 min, an upper bound). If it keeps failing, switch to DeepSeek / Kimi / GLM / Qwen models, or use a supported network region.
Q: Can I use Gemini models in Claude Code? Yes. gemini-3.8-flash is available on the Anthropic Messages protocol — set the model to gemini-3.8-flash in your Claude Code config.
Q: Where do I find the latest model IDs? Dashboard → Models, or the models endpoint above. Docs list a review date, but the endpoint is authoritative.
Q: I lost my key. Keys are shown once. Delete and recreate one in the Dashboard; your balance is unaffected.
Q: Can I get an invoice? Yes. Contact support after a recharge — see Billing & recharge guide.