Setup note · 3 steps
SayGM in OpenAI SDK
SayGM accepts OpenAI-format requests for GPT and open-weight models. 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 https://api.saygm.com/v1 and api_key set to your SayGM key.
Step 3: Pass a GPT or open-model ID exactly as listed on the SayGM models page. Send Claude through the Anthropic SDK and Gemini through the Google GenAI SDK.
import osfrom openai import OpenAI client = OpenAI( base_url="https://api.saygm.com/v1", api_key=os.environ["SAYGM_API_KEY"],) response = client.chat.completions.create( model="gpt-6.1-sol", 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-6 and GPT-5.6 models are 42 to 46 percent below OpenRouter in the November 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.
- GPT-6.1 SolGeneral assistants and agents at mid-tier cost$1.13 / $5.67
- GPT-6.1 TerraVisual reasoning, computer use and everyday writing$0.61 / $3.04
- GPT-6 LunaChat products, summarisation, cheap tool calls$0.06 / $0.28
- Kimi K3Open-weight coding and agent workloads$1.69 / $8.45
- DeepSeek V4.1 Flash 1017Bulk generation, cheap open-weight inference$0.06 / $0.22
- DeepSeek V4.1 FlashBulk generation, cheap open-weight inference$0.04 / $0.17
Other notes: Cursor · Cline · Claude Code · Vercel AI SDK · Anthropic SDK
§ 04
OpenAI SDK questions
Does OpenAI SDK work with SayGM?
Yes, for GPT and open-weight models. SayGM accepts OpenAI-format requests for GPT and open-weight models. Existing code, prompts and response parsing stay the same.
Which models can I use in OpenAI SDK through SayGM?
GPT and open-weight models, including GPT-6.1 Sol, GPT-6.1 Terra and GPT-6 Luna and confidential -tee variants. SayGM serves Claude only on the Anthropic Messages API and Gemini only on generateContent, so neither works through an OpenAI-format setup.
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.