API reference

Rate limits

The AI API allows 100 requests per minute per IP address. This covers /ai, /ai/stream and /ai/sanitize-context.

When you hit the limit

Requests over the limit fail with HTTP 429 and the message Rate limit exceeded. The limit resets at the start of the next one-minute window.

Headers

Responses can include these headers so you can pace requests:

HeaderMeaning
X-RateLimit-LimitRequests allowed per window.
X-RateLimit-RemainingRequests left in the current window.
X-RateLimit-ResetWhen the window resets, as Unix time in seconds.
Calling from your server
The limit is per IP address, so all requests from one server share it. Spread heavy jobs out, and retry with a short delay after a 429.