AI GridDocs
Sign Up

Overview

Runtime endpoints, authentication, response types and errors — the shape of the public API.

Updated Sep 10, 2026

All runtime traffic goes to a single host, whatever products your project uses:

POSThttps://api.aigridapp.com/v1/chat/completions
GEThttps://api.aigridapp.com/v1/models
POSThttps://api.aigridapp.com/v1/sandbox/{id}/invoke
POSThttps://api.aigridapp.com/v1/sandbox/{id}/mcp
POSThttps://api.aigridapp.com/v1/embeddings
POSThttps://api.aigridapp.com/v1/rerank
POSThttps://api.aigridapp.com/v1/images
POSThttps://api.aigridapp.com/v1/images/generations
POSThttps://api.aigridapp.com/v1/audio/speech
POSThttps://api.aigridapp.com/v1/audio/transcriptions
POSThttps://api.aigridapp.com/v1/videos
GEThttps://api.aigridapp.com/v1/videos/{videoID}
GEThttps://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.
A walkthrough of the API reference: the endpoint list, a model's Call this model drawer, and reading an error envelope.

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.

json
{ "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#