Coding tools
Claude Code
Two environment variables point Claude Code at xKiro. It speaks the Anthropic wire format, so the base URL has no /v1 suffix — the one detail that trips up most setups.
Wire format
Anthropic format
Base URL
https://api.xkiro.com
Configured by
~/.claude/settings.json
Model IDs always carry the vendor prefix
Use anthropic/claude-opus-5, never a bare claude-opus-5. Full list at GET /v1/models.
Settings file or shell export#
Two variables and you are done. Put them in a settings file to apply everywhere Claude Code runs, or export them in a shell for one session.
// ~/.claude/settings.json
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.xkiro.com",
"ANTHROPIC_AUTH_TOKEN": "sk-xt-...",
"ANTHROPIC_MODEL": "anthropic/claude-opus-5"
}
}Settings file or shell export?
Shell exports reach only that terminal and what you launch from it — an editor opened from the dock or Start menu will not see them. A settings file applies everywhere, including background agents, and wins when both set the same variable. Run /status inside Claude Code to see which base URL and credential it actually picked up.
ANTHROPIC_AUTH_TOKEN vs ANTHROPIC_API_KEY#
The two variables put your key in different headers — ANTHROPIC_AUTH_TOKEN in Authorization: Bearer, ANTHROPIC_API_KEY in x-api-key. xKiro reads the key from either header, so both work — but ANTHROPIC_API_KEY triggers a one-time approval prompt in interactive sessions and is then ignored silently if you ever declined it.ANTHROPIC_AUTH_TOKENtakes effect immediately, which is why Anthropic's own guidance is to use it when you have not been told otherwise.
Getting xKiro models into the /model picker#
Claude Code can pull the list from xKiro at startup instead of you typing IDs. Add one more variable alongside the two above:
export CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1This flag needs Claude Code v2.1.129 or newer. On older versions it is ignored silently — nothing appears in the picker and nothing tells you why.
Discovery only surfaces anthropic/* models
Claude Code ignores any model whose ID does not begin with claude or anthropic. Of the 66 models xKiro serves, that is the 8 anthropic/* entries — they appear in the picker labelled From gateway. Everything else (GPT, GLM, Qwen, DeepSeek, MiniMax, Mistral) is filtered out by Claude Code itself and will never appear there, no matter what the gateway returns.
To use one of those, set ANTHROPIC_MODEL directly, or add a single custom entry to the picker:
export ANTHROPIC_CUSTOM_MODEL_OPTION="z-ai/glm-5.2"
export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="GLM-5.2"
export ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION="Long context, low cost, via xKiro"VS Code extension#
The extension checks credentials before it launches the CLI, so the variables must be in VS Code's own settings — values in ~/.claude/settings.json reach the spawned process but not that check. Open Preferences: Open User Settings (JSON) and add:
{
"claudeCode.environmentVariables": [
{ "name": "ANTHROPIC_BASE_URL", "value": "https://api.xkiro.com" },
{ "name": "ANTHROPIC_AUTH_TOKEN", "value": "sk-xt-..." }
]
}If requests come back 400#
Recent Claude Code versions attach fields aimed at Anthropic's own API — adaptive thinking, context_management, output_config — and they apply them to any model name they do not recognise, which includes every gateway model ID. If a model rejects one of those fields you get a 400 that looks like a broken key but is not. Turn them off:
export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1
export CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1Two more things a custom base URL changes
Pointing ANTHROPIC_BASE_URL at a non-Anthropic host disables MCP tool search by default — set ENABLE_TOOL_SEARCH=true to get it back — and, from v2.1.196, disables Remote Control. Neither affects normal chat or file editing.
Anthropic also states plainly that they do not support routing Claude Code to non-Claude models through a gateway. It works, and we serve it; it is simply not something they will help you with.
anthropic/* models behave differently outside Claude Code
Claude models run on subscription accounts that are only served to Anthropic's own clients. A request for an anthropic/* model from a different tool is not rejected — it is served by a comparable model instead, billed at the price of the model you asked for, and the response still reports the model you requested. If you specifically need Claude itself, use Claude Code. Everything else on the catalog behaves identically in every tool.
If it does not work#
Send one request by hand before touching Claude Code's settings again. A reply proves the URL and key are both fine, which means whatever is left is in the tool's own configuration — and that is a much smaller place to look.
curl https://api.xkiro.com/v1/chat/completions \
-H "Authorization: Bearer $XKIRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/gpt-5.6-sol","messages":[{"role":"user","content":"ping"}],"max_tokens":8}'An error naming an unknown model still counts as a success here: the request was authenticated before the model was rejected. Common failures and what each one means are on the overview page.
