Setup note · 3 steps
SayGM in Anthropic SDK
Some gateways convert every model to an OpenAI-shaped API. SayGM serves Claude on the native Anthropic Messages API.
§ 01
Steps
Step 1: Install the anthropic package.
Step 2: Construct the client with base_url set to https://api.saygm.com and api_key set to your SayGM key. The SDK adds /v1/messages itself.
Step 3: Call messages.create with claude-opus-5-5, claude-sonnet-5-5 or claude-haiku-5-5.
import osfrom anthropic import Anthropic client = Anthropic( base_url="https://api.saygm.com", api_key=os.environ["SAYGM_API_KEY"],) message = client.messages.create( model="claude-sonnet-5-5", max_tokens=1024, messages=[{"role": "user", "content": "Write a release note for v2.1."}],)§ 02
Why route Anthropic SDK through a gateway
- 01
Prompt caching works because SayGM pins a conversation to one provider.
- 02
Provider-specific features are not stripped by a translation layer.
- 03
Claude models are 5 to 7 percent below OpenRouter in the November snapshot: SayGM bills them at Anthropic list price or 2.1 percent below, and OpenRouter adds a 5.5 percent fee.
§ 03
Models worth trying in Anthropic SDK
Snapshot SayGM prices per million tokens, input then output.
- Claude Opus 5.5Agentic coding, long multi-step tasks, hard reasoning$3.91 / $19.57
- Claude Sonnet 5.5Daily coding in Claude Code and other coding agents$2.00 / $10.00
- Claude Haiku 5.5Classification, extraction, high-volume pipelines and cheap agent steps$0.10 / $0.49
- Claude Fable 5.2The hardest coding, reasoning and agent tasks on Claude$8.00 / $40.00
Other notes: Cursor · Cline · Claude Code · Vercel AI SDK · OpenAI SDK
§ 04
Anthropic SDK questions
Does Anthropic SDK work with SayGM?
Yes, for Claude models. Some gateways convert every model to an OpenAI-shaped API. SayGM serves Claude on the native Anthropic Messages API.
Which models can I use in Anthropic SDK 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.