All runtime traffic goes to a single host, whatever products your project uses:
https://api.aigridapp.com/v1/chat/completionshttps://api.aigridapp.com/v1/modelshttps://api.aigridapp.com/v1/sandbox/{id}/invokehttps://api.aigridapp.com/v1/sandbox/{id}/mcphttps://api.aigridapp.com/v1/embeddingshttps://api.aigridapp.com/v1/rerankhttps://api.aigridapp.com/v1/imageshttps://api.aigridapp.com/v1/images/generationshttps://api.aigridapp.com/v1/audio/speechhttps://api.aigridapp.com/v1/audio/transcriptionshttps://api.aigridapp.com/v1/videoshttps://api.aigridapp.com/v1/videos/{videoID}https://api.aigridapp.com/v1/videos/{videoID}/content- Chat completions is the OpenAI-compatible endpoint you will call most — see Chat completions.
- Models lists exactly what your key can call right now — see Models.
- Sandbox invoke and the MCP endpoint run your project's private sandbox products — see Sandbox products.
Authentication#
Every request carries a bearer key (aig_…). A key is bound to exactly one
project at creation; that project is the execution and charging context of every
call the key makes. There is no per-call project picking — a selector header may
restate the bound project and is refused if it disagrees. See
Authentication.
Compatibility#
The chat endpoint follows OpenAI API semantics: request and response shapes,
streaming (text/event-stream) and tool-call fields behave the way your existing
SDK expects. If your code runs against the OpenAI API, changing base_url and
the key is normally the entire migration.
The Grid is deliberately stricter in one place: unknown request fields are
rejected with 422 unsupported_parameter rather than silently dropped.
Errors are always JSON#
API error responses use a JSON envelope. Successful response types depend on the
endpoint: ordinary chat responses are JSON, streaming chat uses
text/event-stream, speech returns audio, and video content returns media.
Use the selected product’s supported endpoint and inspect its response content type.
The error envelope and codes worth branching on are in
Errors.
{ "error": { "code": "model_not_found", "message": "…", "requestId": "…" } }The invocation id#
Every admitted call answers with an X-AIGrid-Invocation response header, set
before any provider traffic. It is the id of the usage record, so a reply that
fails, is truncated or is stopped can still be reconciled against what was
reserved and charged. Keep it — it is the thread through
usage and metering and support.
Next#
- Authentication — keys, project binding, rotation
- Chat completions — the request and response shape
- Sandbox products — invoking your own flows over the API