Skip to content
SayGMDocs
Dashboard

Authentication

Create a SayGM API key in the dashboard and send it using the convention expected by the API surface.

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.

Authorization: Bearer gm_live_…
x-api-key: gm_live_…
anthropic-version: 2023-06-01

The Anthropic SDK sets both headers when configured with api_key.

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.

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.