API overview
SayGM exposes several familiar HTTP interfaces through one gateway.
| Interface | Base URL | Primary endpoint |
|---|---|---|
| OpenAI-compatible | https://api.saygm.com/v1 |
/chat/completions, /responses |
| Anthropic-compatible | https://api.saygm.com |
/v1/messages |
| Gemini-compatible | https://api.saygm.com |
/v1beta/models/{model}:generateContent |
| OpenAI Images | https://api.saygm.com/v1 |
/images/generations |
Model IDs are provider-free. The gateway chooses an upstream route for each request; use the routing headers to prefer the cheapest or fastest route, or to limit which upstream providers may serve it.
Supported surfaces
Section titled “Supported surfaces”- OpenAI Chat Completions, streaming and non-streaming.
- OpenAI Responses.
- Anthropic Messages, streaming and non-streaming.
- Gemini
generateContentandstreamGenerateContentwith SSE. - OpenAI Images generation at
/v1/images/generationsfor models whoseapi_shapesincludeimages.generations. - OpenAI-compatible model listing and retrieval at
/v1/models. - Current SayGM balance at
GET /v1/credits.
The generated API reference documents the OpenAPI-described request and response shapes. The compatibility guides explain SDK setup and surface-specific behavior.
Check credits
Section titled “Check credits”curl -fsS "https://api.saygm.com/v1/credits" \ -H "Authorization: Bearer $GM_API_KEY"This authenticated read returns the key’s current spendable balance. See
check balance and current spend
for the response fields. For history, see Usage.
Request lifecycle
Section titled “Request lifecycle”Requests enter a gateway running inside an Intel TDX trusted execution environment. The gateway validates the SayGM key, checks available prepaid credit, selects an eligible route under the request’s routing mode, applies configured guardrails, forwards the request, and settles actual usage.
Versioning
Section titled “Versioning”The compatibility paths currently use the upstream interfaces’ versioned conventions. Avoid depending on undocumented fields. Additive SayGM metadata may appear on discovery responses.