Skip to main content
Point a coding tool or SDK at the AI Gateway with your personal xpander key. Calls run as you: on your enabled models, within your budgets, under your name in Logs. The fastest path is one copied command from AI models & keys. This page is the manual setup, which Set up manually in the same card shows with your address, a new key and a Model filled in. If your company installed xpander-connect, your coding clients are already set up.

Gateway address

Your exact address is under Gateway address in AI models & keys. Examples below use https://llm-gw.xpander.ai.

Claude Code

Your xpander key signs Claude Code in, with no /login. Add to ~/.claude/settings.json (%USERPROFILE%\.claude\settings.json on Windows):
The address has no /v1, and no model is set. CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY adds the Claude models the gateway offers you to /model. Claude Code lists only model IDs that contain claude or anthropic (Model discovery). To use a model from another vendor, start Claude Code with its ID: claude --model <model ID> (Which model ID to use). To try it in one terminal:
Check it: run claude -p "reply with exactly: OK". In Claude Code, /status shows the gateway address.

Codex

Codex reads your key from XPANDER_GATEWAY_KEY. Add to ~/.codex/config.toml (%USERPROFILE%\.codex\config.toml on Windows), with a model from AI models & keys:
Keep the key for every new terminal:
Open a new terminal and start codex. Switch models with /model. Check it: codex exec --skip-git-repo-check "reply with exactly: OK" answers OK.

OpenCode

OpenCode reads your key from XPANDER_GATEWAY_KEY. Add a provider to ~/.config/opencode/opencode.json (%USERPROFILE%\.config\opencode\opencode.json on Windows):
List your models under models and pick one as xpander/<name>. Keep XPANDER_GATEWAY_KEY as for Codex, then start opencode. Check it: opencode run "reply with exactly: OK" answers OK.

Your own code (SDKs)

Both SDKs take your xpander key as their API key. The Anthropic base URL has no /v1. The OpenAI one has /v1.
The gateway accepts these formats: A call in one format can be served by a provider that speaks another, so Codex can run an enabled Claude model.

Sending your key next to another sign-in

The gateway reads your key from Authorization: Bearer, x-api-key or x-xpander-api-key. When Authorization already carries another sign-in, such as your own Claude plan, use x-xpander-api-key:
The header is removed before the call reaches the provider and is never logged.

Check the connection

A list of models and aliases means it works. 401 means the key is unknown, revoked or expired. Your newest call shows at the top of Logs (admins) and in your Usage.

Next steps

Fix a refused call

Messages and fixes.

Create and manage your keys

AI models and keys.