Claude Code

Point Claude Code at the Admesh gateway with two environment variables and keep your existing workflow.

Configure

export ANTHROPIC_BASE_URL="https://api.admesh.ai"
export ANTHROPIC_AUTH_TOKEN="$ADMESH_API_KEY"

Claude Code appends /v1/... to ANTHROPIC_BASE_URL itself, so set the root address here without /v1.

Verify

Run claude and call a model. If you see 401 invalid_api_key, check that ANTHROPIC_AUTH_TOKEN holds the full sk-live-* secret.

Notes

  • Model IDs use the anthropic/* namespace (e.g. anthropic/claude-sonnet-5-5).
  • The same base URL and key are shared across tools — no separate upstream account needed.
  • Model IDs without a namespace (such as the claude-haiku-* IDs Claude Code sends by default) resolve to the same-named model your key can call.
  • Server-executed tools with per-use fees (web_search, web_fetch, code_execution) are not supported yet: Claude Code's WebSearch tool will fail; all other tools work.
  • Prompt cache writes and reads are billed at the cache-write and cache-read prices respectively; see the breakdown under Usage.

One-click import to CC Switch

CC Switch is a desktop app that manages Claude Code provider settings. After creating a key under API Keys in the console, click “Import to CC Switch” in the success dialog, pick a main model, click “Open CC Switch” and confirm in CC Switch — the environment variables and model settings above are written for you.

The full key is shown only once, right after creation, so one-click import is only available then; for existing keys, configure manually as above.