OpenAI compatibility
Set the OpenAI client’s base URL to https://api.saygm.com/v1 and replace the
OpenAI key with a GM key.
Python
Section titled “Python”import osfrom openai import OpenAI
client = OpenAI( base_url="https://api.saygm.com/v1", api_key=os.environ["GM_API_KEY"],)
response = client.chat.completions.create( model="gpt-5.5", messages=[{"role": "user", "content": "Say gm."}],)print(response.choices[0].message.content)Node.js
Section titled “Node.js”import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.saygm.com/v1", apiKey: process.env.GM_API_KEY,});
const response = await client.chat.completions.create({ model: "gpt-5.5", messages: [{ role: "user", content: "Say gm." }],});console.log(response.choices[0].message.content);Responses API
Section titled “Responses API”Use the same client and base URL:
response = client.responses.create( model="gpt-5.5", input="Say gm.",)print(response.output_text)Use /v1/models?api_shape=responses to discover models compatible with the
Responses API.
Usage and cost
Section titled “Usage and cost”Every successful response carries settled cost inside usage, alongside the
normal token counts:
{ "usage": { "prompt_tokens": 12, "completion_tokens": 9, "total_tokens": 21, "cost": 0.000140000, "cost_nano_usd": 140000 }}cost is USD, rendered as a JSON number with exactly nine fractional digits —
the amount actually settled against the account’s prepaid balance, not an
estimate from /v1/models rates. cost_nano_usd is the same amount as an
integer in nano-USD (1 nUSD = 10⁻⁹ USD), matching GET /v1/credits. Both
fields appear on Chat Completions and Responses in the same place. Error
responses carry neither. See per-request cost
for how to use the figure.