integrations/coding agent/Claude Code

Claude Code + AIgateway

Point Anthropic's CLI at AIgateway — one env var, any model.

Claude Code is Anthropic's terminal coding agent. AIgateway now serves the Anthropic Messages API natively, so Claude Code points straight at it — set two environment variables, no router or proxy. The same session can run on any of our 1000+ models — Opus, GPT-5.4, Gemini, Kimi, Llama — by setting one more variable.

Claude Code homepage →
Setup

Three steps or fewer.

STEP 01

Set the env vars

Point ANTHROPIC_BASE_URL at AIgateway and use your sk-aig- key as ANTHROPIC_API_KEY, then run claude. Claude Code sends the key as x-api-key and the gateway accepts it — bare Claude model names map to the catalog automatically.

export ANTHROPIC_BASE_URL="https://api.aigateway.sh"
export ANTHROPIC_API_KEY="sk-aig-..."
claude
STEP 02

Run on any model

Set ANTHROPIC_MODEL to any AIgateway slug to route the same Claude Code session through any model — not just Claude. Leave it unset and the bare Claude defaults map automatically.

# run Claude Code on Claude Opus 4.7 (the default family)
export ANTHROPIC_MODEL="anthropic/claude-opus-4.7"

# or route the same session through any other model
export ANTHROPIC_MODEL="moonshot/kimi-k2.7-code"
export ANTHROPIC_MODEL="openai/gpt-5.4"
STEP 03

Or switch in-session

Already running? Use /model inside Claude Code to switch the active model for the session without restarting.

Notes
  • AIgateway now serves the Anthropic Messages API (POST /v1/messages) plus count_tokens, so ANTHROPIC_BASE_URL works directly — no router, proxy, or shim needed.
  • Streaming returns the full Anthropic SSE event sequence (message_start, content_block_start/delta/stop, message_delta, message_stop).
  • Swap models any time via ANTHROPIC_MODEL or /model to any provider/slug — anthropic/claude-opus-4.7, openai/gpt-5.4, moonshot/kimi-k2.7-code; bare Claude names (claude-opus-4.7, claude-sonnet-4.6, claude-haiku-4.5) resolve automatically.
More integrations

Same key. Every other tool.