Claude Code
Works fully: Claude Code speaks the Anthropic Messages API, which the proxy serves natively, and any connected provider can answer, not only Claude.
Set it up with the CLI
With the kano-proxy CLI installed:
$ kano-proxy login # once per machine
$ kano-proxy agent setup claude-code- For each of Claude Code's slots, Fable, Opus, Sonnet and Haiku, pick which models on your proxy answer, in order. Any provider works. The first one answers; the rest take over when it is benched or out of quota.
- The CLI creates a model group named
claude-code, mints an API key named after this machine, and writes anenvblock into~/.claude/settings.jsonthat points at the group. - Start
claude.
Keep the Haiku slot on a cheap model: Claude Code also runs its background work there, such as session titles.
Why the CLI goes through a model group
Claude Code decides which features to enable from the model id it sees. The group's endpoint, /g/claude-code/anthropic, serves plain Claude ids such as claude-opus-5, even when the proxy routes them to another provider. So a slot can be answered by antigravity or codex first while Claude Code still sees a Claude id. See Groups.
The CLI also turns on gateway model discovery, so every name in the group shows up in /model. It never writes ANTHROPIC_MODEL, so the default you save with /model sticks.
To undo it, or to see what the CLI manages, see Set up agents. The group stays on the Groups page, where you can reorder or add fallback targets at any time.
Set it up by hand
- Create a key on the Access page.
- Add this to
~/.claude/settings.json. Fill theANTHROPIC_DEFAULT_*_MODELvalues with ids from your own Models page; the ones below are examples.
{
"disableClaudeAiConnectors": true,
"env": {
"ANTHROPIC_BASE_URL": "https://<your-domain>/anthropic",
"ANTHROPIC_AUTH_TOKEN": "<your-api-key>",
"CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-code/claude-opus-5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-code/claude-sonnet-5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-code/claude-haiku-4-5",
"ANTHROPIC_DEFAULT_FABLE_MODEL": "claude-code/claude-fable-5-1"
}
}- Start
claude.
Do not put the key in a project's committed .claude/settings.json.
What each setting does
- Values in the
envblock apply to every session and take precedence over the shell environment. ANTHROPIC_BASE_URLis the gateway root without/v1. Claude Code appends/v1/messagesitself.ANTHROPIC_AUTH_TOKENis sent asAuthorization: Bearer.ANTHROPIC_API_KEYalso works and is sent asx-api-key; the proxy accepts both. Use one of them.- The
ANTHROPIC_DEFAULT_*_MODELvalues are what the Fable, Opus, Sonnet and Haiku entries in/modelresolve to. Haiku is also what Claude Code uses for background work. CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1makes Claude Code readGET /v1/modelsfrom the proxy at startup and add the results to the/modelpicker.disableClaudeAiConnectors: truesits at the top level, besideenv. It stops the start-up notice that claude.ai connectors are disabled because another auth source takes precedence. With the proxy's token set they are disabled either way.- Leave
ANTHROPIC_MODELunset unless you want to pin the start model. It overrides whatever you save with/model, every launch.
For a one-off session, export the same variables in your shell instead:
export ANTHROPIC_BASE_URL=https://<your-domain>/anthropic
export ANTHROPIC_AUTH_TOKEN=<your-api-key>
export ANTHROPIC_MODEL=claude-code/claude-opus-5
claude$env:ANTHROPIC_BASE_URL = "https://<your-domain>/anthropic"
$env:ANTHROPIC_AUTH_TOKEN = "<your-api-key>"
$env:ANTHROPIC_MODEL = "claude-code/claude-opus-5"
claudeSwitch models
/model <id> inside a session switches to any id your proxy serves, for example /model codex/gpt-5.6-sol. Press Enter to save it as your default, or s to keep it for this session only.
Gateway model discovery keeps only ids containing claude or anthropic. Claude ids appear in the picker; codex/... ids do not, so type those by hand. Model id rules are in Endpoints and model ids.
Check it
- Run
/statusin Claude Code. It shows the base URL and whether an auth token is in use. - Send a message. The request appears on the Logs page within seconds.
Limits
- Fast mode and the WebFetch safety check call Anthropic directly and ignore the base URL.
- The Claude desktop app ignores these variables. It has its own third-party inference form, where the same base URL and key go.
- The VS Code extension reads them from the
claudeCode.environmentVariablessetting instead of the shell.
Checked against
Claude Code documentation, 2026-09-04: Connect to an LLM gateway, Gateway protocol, Model configuration.