Skip to main content
The HTTP API is the operator surface of a running server. Every route lives under /api/*, takes and returns JSON, and authenticates with an API key. The per-endpoint pages in this section render directly from the server’s OpenAPI 3.1 specification, so they never drift from the code.

Base URL

The API is served by the running server, alongside the MCP endpoint and the Studio. Prefix every path with the server’s address:
A local server started with tai serve answers at http://127.0.0.1:8000/api.

Authentication

Every request carries an API key in the x-api-key header. Mint and manage keys with tai keys or the /api/auth/api-keys routes.
A missing or invalid key returns 401 with the error envelope below.
A key’s access-control condition scopes what it may call. See access control for the policy model.

Response envelope

Successful responses wrap their payload in a data field:
Errors return an error field carrying a human-readable message:
The two envelopes never mix — a response carries data or error, never both.

Error model

The reload-gated 503

When the server applies a configuration reload, routes that mutate state return 503 until the reload completes. The body sets reloading to true and the response carries a Retry-After header with the seconds to wait:
Retry the request after the Retry-After interval. Read-only routes stay available throughout a reload.
Regenerate this reference from the running code with tai openapi --out openapi.json — the same offline emitter the docs pipeline runs.