Documentation
Multigrid speaks the OpenAI wire format, so most of what you already know applies. These pages cover the parts that are ours (routing, billing, limits and guardrails) and they document what the gateway does today, not what it is going to do. Where something is not built, the page says so.
Your first request
2 minutescurl https://api.multigrid.ai/v1/chat/completions \
-H "Authorization: Bearer $MULTIGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "multigrid/auto",
"messages": [{"role": "user", "content": "Hello"}]
}'Pick a path
Make your first request
Swap a base URL and a key, then read what the call cost you.
Understand how routing works
The exact order a request is resolved in, and why a route gets dropped.
Stop a bill before it happens
Per-key caps, an account ceiling, and a balance that simply runs out.
Survive a provider outage
What gets retried, what fails over, and what is handed straight back.
Lock it down
Guardrails, roles, your own provider keys, and what we do not store.
Move off another gateway
What carries over unchanged, and the two fields we accept and ignore.
Everything, by section
Getting started
- QuickstartMake your first request, and read what it cost.3 min
- AuthenticationBearer keys, the two key scopes, and how to mint keys from the API.5 min
- OAuth for end-user credentialsLet the people using your app spend their own credit, not yours.7 min
- SDKs and clientsThere is no Multigrid SDK. Point an OpenAI client at our base URL instead.3 min
- Migrating from another gatewayWhat carries over unchanged, what is named differently, and what we do not implement.6 min
Core API
- Chat completionsThe main endpoint: its parameters, its streaming protocol and its errors.9 min
- Responses APIPOST /v1/responses, translated onto the same engine as chat completions. Stateless: store and previous_response_id are refused rather than quietly reversing a privacy promise.6 min
- EmbeddingsVectors through the same key, the same limits and the same bill.4 min
- Tool callingOne tool schema across vendors, translated on the way out and back.6 min
- Structured outputresponse_format reaches OpenAI-format providers untouched, and is translated into a forced tool call on Anthropic ones.5 min
- ReasoningOne dial, three spellings. reasoning, reasoning_effort and thinking all work on every reasoning model here, whichever wire format serves it.6 min
- Images and rerankingThe endpoints that are billed per unit rather than per token.5 min
Routing
- How a request is routedThe exact order a request is resolved in, from preset expansion to the last provider tried.7 min
- Provider preferencesOrder, exclude, sort, split and pin the providers behind one model id.6 min
- The auto routerWhat multigrid/auto actually picks, and why it is not a quality score.4 min
- Failover and retriesWhich failures are retried, which move to the next provider, and which are handed straight back.6 min
- PresetsSave a model, a system prompt and its parameters under a name, then change them without a deploy.5 min
Cost and billing
- What a request costsInteger micro-dollars, where the number comes from, and the three places you can check it.6 min
- Spending limitsPer-key caps, an account ceiling, and a balance that simply runs out.5 min
- CachingAn opt-in exact-match response cache, and the provider-side prompt caching it is not.5 min
- Batch jobsQueue up to 50,000 requests from one JSONL file and collect them later.5 min
Operations
- IdempotencySend a key and a retry replays the stored answer instead of paying twice.4 min
- Logs, traces and usageWhat is recorded about a request, what is not, and the three ways to read it.6 min
- Measuring answer qualitySend quality scores back, so cost and latency are not the only numbers you have.4 min
- WebhooksSix events, a Stripe-shaped signature, and delivery that can never slow a request down.4 min
- Rate limitsOne limit per key, its defaults, and the honest caveat about how it is enforced.4 min
Governance
- GuardrailsRules of your own that refuse a request before it costs anything, or flag a response after.6 min
- Bring your own keyRoute on your own provider contracts and pay us nothing on that traffic.5 min
- Where your requests goHow to see and restrict which companies handle your traffic, and why region pinning is not among them.4 min
- Teams, projects and rolesFour roles, what each can do, and how projects divide up keys and spend.4 min
Found something wrong?
A page that disagrees with the API is a bug, not a difference of opinion. Tell us and it gets fixed.