Authentication
Create a SayGM API key in the dashboard and send it using the convention expected by the API surface.
Connect your application with OAuth
Section titled “Connect your application with OAuth”Use Sign in with SayGM to let customers authorize your app without copying an API key. Customers approve permissions and a spending limit; your app receives its own inference credential when inference access is granted.
OpenAI-compatible requests
Section titled “OpenAI-compatible requests”Authorization: Bearer gm_live_…Anthropic Messages
Section titled “Anthropic Messages”x-api-key: gm_live_…anthropic-version: 2023-06-01The Anthropic SDK sets both headers when configured with api_key.
Gemini requests
Section titled “Gemini requests”Use a bearer header:
Authorization: Bearer gm_live_…Gemini-compatible requests also accept Gemini’s native x-goog-api-key header:
x-goog-api-key: gm_live_…The native ?key=<saygm-key> query parameter is also accepted. Prefer a header
where your client supports it because URLs are more likely to appear in logs
and diagnostic tooling.
Anthropic Messages requests must also include a non-empty
anthropic-version header (for example, 2023-06-01). Gemini
streamGenerateContent requests must include ?alt=sse; the gateway rejects
the legacy JSON-array streaming form.
Authentication failures
Section titled “Authentication failures”A missing, malformed, revoked, or invalid key returns an authentication error. Do not retry an authentication error without changing the credentials.
See Create and protect an API key for storage and rotation guidance.