Claude Code
Claude Code speaks the Anthropic Messages protocol on every surface —
CLI, IDE (VS Code and JetBrains), and
Desktop. Point any of them at the /oss lane
root (no /v1) and every call routes through
OpenGateway to open-weight models.
Desktop
The standalone Desktop app connects via Settings → Connection → Gateway:
Connection: Gateway Gateway base URL: https://api.opengateway.one/oss Gateway API key: YOUR_KEY Gateway auth scheme: bearer Model list: leave empty
Click Test connection. With
model discovery enabled, each picker
entry is labeled From gateway and shows the real open model via
display_name — e.g. GLM 5.2,
Kimi K2.7 Code, MiniMax M3. Wire ids stay
claude-* for Desktop compatibility; labels are never Sonnet/Opus/Haiku tiers.
For 1M context on GLM 5.2 or MiniMax M3, Desktop does not
expose custom headers — set CLAUDE_CODE_MAX_CONTEXT_TOKENS and
DISABLE_COMPACT in ~/.claude/settings.json under
env, then quit and relaunch Desktop (see
troubleshooting).
If the picker still shows old models after switching, restart Claude Code Desktop so it clears its model-discovery cache.
IDE (VS Code & JetBrains)
The VS Code and JetBrains extensions share configuration with the CLI via
~/.claude/settings.json. Set the gateway in the env block:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.opengateway.one/oss",
"ANTHROPIC_AUTH_TOKEN": "YOUR_KEY",
"CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1"
}
}
Reload the window after changing settings. The IDE picker uses the same Anthropic-shaped discovery as Desktop — entries show real open-weight names including GLM 5.2, Kimi K2.x, and Qwen3 Coder. See Model discovery for the usable-model contract.
Third-party gateway config in the IDE is the same ANTHROPIC_BASE_URL + ANTHROPIC_AUTH_TOKEN pair documented for the Claude Code LLM gateway. No separate IDE-specific endpoint is required.
CLI
Set the base URL and auth via environment variables (or ~/.claude/settings.json under env):
export ANTHROPIC_BASE_URL="https://api.opengateway.one/oss" export ANTHROPIC_AUTH_TOKEN="YOUR_KEY" # → Authorization: Bearer # or: export ANTHROPIC_API_KEY="YOUR_KEY" # → x-api-key
Pass the model with friendly open-model ids:
claude --model glm-5.2 "Refactor the auth module." claude --model kimi-k2.6 "Add tests for the payment handler." claude --model qwen3-coder "Implement the retry logic."
Raw catalog ids with routing policies also work:
claude --model "zai-org/GLM-5.2:preferred" "Profile this hot path." claude --model "moonshotai/Kimi-K2.7-Code:preferred" "Review the API layer."
Model discovery (optional)
Claude Code only calls the gateway's models endpoint when you opt in:
export CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1
The picker filters to ids beginning claude/anthropic
(a Claude Code client-side constraint). OpenGateway sets display_name
to the native open model — e.g. GLM 5.2 — so IDE
and Desktop pickers stay honest. Discovery is optional; CLI ids like
glm-5.2 work directly through /v1/messages. See
Model discovery.
1M context (GLM 5.2, MiniMax M3)
OpenGateway advertises the real context window per model. GLM 5.2 and MiniMax M3
expose context_window: 1000000 and
metadata.context_tier: "one-million" in discovery. No beta header is
required on the OSS lane.
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.opengateway.one/oss",
"ANTHROPIC_AUTH_TOKEN": "YOUR_KEY",
"CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1",
"CLAUDE_CODE_MAX_CONTEXT_TOKENS": "1000000",
"DISABLE_COMPACT": "1"
},
"model": "claude-sonnet-4-6"
}
Set both CLAUDE_CODE_MAX_CONTEXT_TOKENS=1000000 and
DISABLE_COMPACT=1 — required on current Desktop builds when the discovery
wire id is a known claude-* alias. Without
DISABLE_COMPACT=1, Claude Code ignores
MAX_CONTEXT_TOKENS per
official env-var docs.
No custom headers or beta headers are needed on the OSS lane.
Pick GLM 5.2 or MiniMax M3 from the gateway picker, or pass
claude --model glm-5.2 on CLI. See 1M context.
If the context panel shows 200K instead of 1M
Symptom: Desktop shows GLM 5.2 from the gateway picker, but the context panel reads 200.0k (200K).
Why: Discovery keeps wire ids like claude-sonnet-4-6 (a Claude Code
Desktop requirement). Labels come from display_name, but Desktop still defaults known
claude-* ids to Anthropic's 200K unless you set
CLAUDE_CODE_MAX_CONTEXT_TOKENS client-side. OpenGateway already returns
context_window: 1000000 and metadata.context_tier: "one-million".
- Add to
~/.claude/settings.jsonunderenv:CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1,CLAUDE_CODE_MAX_CONTEXT_TOKENS=1000000, andDISABLE_COMPACT=1. Both context vars are required —DISABLE_COMPACT=1is not optional; Claude Code ignoresCLAUDE_CODE_MAX_CONTEXT_TOKENSunless compaction is disabled. - Desktop has no custom-headers UI — env vars in
settings.jsonare the only client-side override. Noanthropic-betaheader is needed on OSS. - Quit and relaunch Claude Code Desktop (not just reload a window) so env vars and the discovery cache reload.
- CLI bypass:
claude --model glm-5.2uses the native id and avoids the wire-id cap.
Verify the gateway: curl -s https://api.opengateway.one/oss/v1/models — GLM 5.2 entries
should show all three context fields at 1000000. No beta header is required on OSS.
Effort
Extended thinking is on by default. Newer models use
CLAUDE_CODE_EFFORT_LEVEL (low/medium/high); OpenGateway maps it
onto whatever the upstream model expects — see Effort
levels.
Models to try
| Open model | CLI id | Discovery label (IDE/Desktop) |
|---|---|---|
| GLM 5.2 | glm-5.2 | GLM 5.2 |
| Kimi K2.7 Code | moonshotai/Kimi-K2.7-Code:preferred | Kimi K2.7 Code |
| Kimi K2.6 | kimi-k2.6 | Kimi K2.6 |
| Qwen3 Coder 480B | qwen3-coder | Qwen3 Coder 480B |
| DeepSeek V4 Pro | deepseek-v4-pro | DeepSeek V4 Pro |
| GPT-OSS 120B | gpt-oss-120b | GPT-OSS 120B |
Call GET /oss/v1/models for the full live catalog. Lane-backed
discovery aliases (e.g. claude-sonnet-4-6 → GLM 5.2) exist for
picker compatibility; CLI and scripted use should prefer the CLI id
column.