Setup note · 3 steps
SayGM in OpenAI SDK
SayGM accepts OpenAI-format requests. Existing code, prompts and response parsing stay the same.
§ 01
Steps
Step 1: Install the openai package for your language.
Step 2: Construct the client with base_url set to the SayGM endpoint and api_key set to your SayGM key.
Step 3: Pass the model ID exactly as listed on the SayGM models page.
import osfrom openai import OpenAI client = OpenAI( base_url=os.environ["SAYGM_BASE_URL"], api_key=os.environ["SAYGM_API_KEY"],) response = client.chat.completions.create( model="gpt-5.5", messages=[{"role": "user", "content": "Explain TEE attestation in one paragraph."}],)§ 02
Why route OpenAI SDK through a gateway
- 01
No code changes beyond the client constructor.
- 02
GPT-5.5 and GPT-5.6 are about 29 percent below OpenRouter in the October snapshot.
- 03
Gateway privacy backed by published hardware attestation.
§ 03
Models worth trying in OpenAI SDK
Snapshot SayGM prices per million tokens, input then output.
- Claude Fable 5.1The hardest reasoning and agent tasks, where cost matters least$8.89 / $44.45
- Claude Opus 5.5Agentic coding, long multi-step tasks, hard reasoning$3.56 / $17.78
- Claude Sonnet 5.5Daily coding in Cursor, Cline and Claude Code$1.78 / $8.89
- Claude Opus 5Agentic coding, long multi-step tasks, hard reasoning$4.45 / $22.23
- Claude Sonnet 5Daily coding in Cursor, Cline and Claude Code$1.78 / $8.89
- Claude Haiku 4.5Classification, extraction, high-volume pipelines$0.89 / $4.45
Other notes: Cursor · Cline · Claude Code · Vercel AI SDK · Anthropic SDK
§ 04
OpenAI SDK questions
Does OpenAI SDK work with SayGM?
Yes. SayGM accepts OpenAI-format requests. Existing code, prompts and response parsing stay the same.
Which models can I use in OpenAI SDK through SayGM?
Any model in the SayGM catalogue, including Claude Fable 5.1, Claude Opus 5.5, Claude Sonnet 5.5, Claude Opus 5 and confidential open-weight models.
Where do I find the SayGM base URL?
The endpoints for the OpenAI, Anthropic and Gemini compatible APIs are listed in the SayGM developer docs, linked from the SayGM website after sign-up.