Skip to content
TokenGauge
Menu

Setup note · 5 steps

SayGM in Claude Code

Claude Code talks the Anthropic API. SayGM exposes that API natively, so the CLI works unchanged. Only two environment variables change.

Updated 11 Nov 2026

§ 01

Steps

  1. Step 1: Generate an API key in the SayGM dashboard. Or run npx saygm install claude-code, which signs you in, creates a key for the tool and writes its config.

  2. Step 2: Set ANTHROPIC_BASE_URL to https://api.saygm.com, in your shell or in ~/.claude/settings.json.

  3. Step 3: Set ANTHROPIC_API_KEY to your SayGM key.

  4. Step 4: Run claude and choose Yes when it asks to use the custom API key. Run /status to check the base URL.

  5. Step 5: On 400 errors that mention context_management, set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1.

Shell
export ANTHROPIC_BASE_URL="https://api.saygm.com"export ANTHROPIC_API_KEY="gm_live_..."claude

§ 02

Why route Claude Code through a gateway

  • 01

    Pay per token instead of a fixed plan. Cost tracks usage.

  • 02

    Claude at or below Anthropic list price. In the November snapshot, Opus 5.5 is 2.1 percent below list and Sonnet 5.5 is at list.

  • 03

    Requests are decrypted only inside the gateway enclave before going to the provider.

§ 03

Models worth trying in Claude Code

Snapshot SayGM prices per million tokens, input then output.

§ 04

Claude Code questions

Does Claude Code work with SayGM?

Yes, for Claude models. Claude Code talks the Anthropic API. SayGM exposes that API natively, so the CLI works unchanged. Only two environment variables change.

Which models can I use in Claude Code through SayGM?

Claude models, which SayGM serves on the Anthropic Messages API, including Claude Opus 5.5, Claude Sonnet 5.5 and Claude Haiku 5.5. GPT, Gemini and open-weight models use other API formats on SayGM.

Where do I find the SayGM base URL?

The steps above give it for this tool. The SayGM developer docs list the endpoint for each API format: Anthropic Messages, OpenAI Chat Completions and Responses, and Gemini generateContent.