โ† API reference

HTTP headers: what the API reads and what it sends back

Six headers do all the work: one to authenticate, two you can send to make calls traceable and safe to retry, and the rest come back telling you where you stand against your limits.

Updated ยท values generated from the engine

What this catalog is

Everything below is behaviour recorded from the API itself; each row links the page with the full detail.

Request headers

Headers the API reads
HeaderWhenDetail
AuthorizationEvery callBearer <key>. Checked before the body: no key or a bad key gets 401 even when the body is also invalid.
Content-TypePOSTapplication/json. Bodies are validated strictly; unknown fields are a 400.
Idempotency-KeyOptional, POSTUp to 255 characters. The response is stored for 24 hours per API key; a retry with the same key and body replays it, a different body gets 409 IDEMPOTENCY_KEY_REUSED.
x-request-idOptionalreq_ plus at least 20 letters or digits: the API adopts it instead of minting its own, so one id traces a call across your services. Anything else is ignored.

Response headers

Headers the API sends
HeaderWhenDetail
x-request-idEvery responseAlso request_id in the body. On a replayed response the header is new while the body keeps the first call's id.
x-ratelimit-limitSuccessful responses and limiter 429sCalls allowed per minute for the key.
x-ratelimit-remainingSuccessful responses and limiter 429sCalls left in the current one-minute window. Throttle on it before it reaches zero.
x-ratelimit-resetSuccessful responses and limiter 429sUnix seconds at which the window next frees a slot: the oldest call in it plus 60 seconds.
Retry-After429Seconds. For RATE_LIMITED, the wait for a slot; for QUOTA_EXCEEDED, the time until the next UTC month - do not sleep on it.
idempotent-replayedReplaystrue when the response is a stored answer to an earlier call with the same Idempotency-Key.

Parsing notes

  • A request rejected by schema validation (400) is answered before the rate limiter, so it carries no x-ratelimit-* headers and does not count toward any limit.
  • A replayed response is a 2xx, so it passes the rate limiter and is billed like any successful call. Refused and failed calls are not billed.
  • The chat API takes the same Authorization header and keys.

In a real response

POST /v1/charts/birth - Recorded replay of POST /v1/charts/birth with Idempotency-Key: order-8812-chart (other headers omitted).

http
HTTP/1.1 200 OK
x-request-id: req_01M8RK47T0DX2ECGJRXDKMN3QF
idempotent-replayed: true
x-ratelimit-remaining: 5993

Questions

Which endpoints does this page apply to?
Every endpoint: this page describes behaviour common to the whole API.