API Reference

API reference

Auto-generated reference for every endpoint, every parameter, every error.

FIG.
FIG. 00 · API REFERENCEENDPOINT TABLE

The full reference is auto-generated from our OpenAPI spec — pricing, parameters, request/response schemas, and error envelopes for every endpoint we expose. Most callers will go through the AI SDK's streamText and never touch raw HTTP, but the wire format is fully documented here for when you need it.

FIG. 01V1 SURFACE
SCHEMATIC
Six endpoints cover the entire product: chat completions, messages, embeddings, rerank, images, videos, and the catalog. All share the same `Authorization: Bearer mg_live_*` header and the same error envelope.

Endpoints

POST /v1/chat/completions

OpenAI-compatible chat. Streaming, tools, structured output, vision input. Spans every text+vision model.

POST /v1/messages

Anthropic-compatible Messages API. Use existing Anthropic SDK with our base URL.

POST /v1/embeddings

OpenAI-compatible embeddings. Vector dim varies by model — see /models.

POST /v1/responses

OpenResponses API. Coming soon.

GET /v1/models

The catalog. Returns every model your project can call.

GET /v1/models/{creator}/{model}/endpoints

Per-model details — providers, latency, throughput, uptime.

Auto-generation in progress

The full per-endpoint reference is being generated from our Zod schemas via fumadocs-openapi. The auto-built pages will appear under /docs/api-reference/<endpoint> once the OpenAPI spec build runs. For now, see the Quickstart and Authentication pages for working examples.

OpenAPI spec

The machine-readable spec is at https://synapse.garden/api/openapi.json. Plug it into your favorite tool (Postman, Insomnia, Stoplight, Hoppscotch) for autocomplete-driven exploration.

curl https://synapse.garden/api/openapi.json -o synapse-garden.openapi.json

Common request shape

Every endpoint takes:

HeaderRequiredNotes
Authorization: Bearer mg_live_*yesYour API key
Content-Type: application/jsonyes for bodyOmit for GET
Idempotency-Keyoptional24-hour dedup window
X-Request-IdoptionalWe accept yours; otherwise we generate one

Every response includes:

HeaderNotes
X-Request-IdUnique ID — use when reporting issues
X-RateLimit-RemainingTokens left in the current window
X-RateLimit-ResetUnix timestamp when the window rolls
Retry-AfterSeconds (only on 429)

See Errors & retries for the full error contract.