Request & response headers

The HTTP headers Kontinent reads and sets, and what to do with them.

Kontinent speaks the OpenAI wire format, so the only header you must send is Authorization. A few more help you trace requests and react to limits.

Request headers

HeaderRequiredMeaning
AuthorizationYesBearer sk-kt-..., see Authentication. Not needed for /healthz.
Content-TypeYes, with a bodyapplication/json, or multipart/form-data for transcriptions.
X-Request-IdNoYour own trace id. Kontinent keeps it and returns it, so one id follows a request from your system through ours. Up to 64 printable ASCII characters; anything else is replaced by an id of our own.

There are no headers for routing, sovereignty or guardrails. Those are configured in the console and apply by key, so a request cannot loosen them.

Response headers

HeaderOnMeaning
X-Request-IdEvery API response (not /healthz)Your id, or one Kontinent generated. Quote it when you contact support.
X-Generation-IdEvery API response, refusals included (not /healthz)The id of the billing record for this call. Use it to match a call against your logs and invoice. You cannot set it yourself.
X-ProviderServed responsesThe provider that actually answered, for example scaleway after a failover from mistral.
X-Served-ModelServed responsesThe model that actually answered. Differs from the requested id after a fallback or when you call a routing policy.
Retry-AfterSome 429 and 503Seconds to wait before retrying: 60 on rate_limit_exceeded, 10 on transcriptions_busy.

X-Provider and X-Served-Model arrive with the headers, before the body. On a stream you know where the answer comes from before the first token. On the endpoints whose body Kontinent builds itself, the body's id is the generation id with an endpoint prefix (chatcmpl- or resp_), see Streaming.

Reading headers with the OpenAI SDK

The SDKs hide headers by default. Use the raw response:

typescript
const { data, response } = await client.chat.completions
  .create({ model: "mistral/mistral-small-4", messages })
  .withResponse();
 
console.log(response.headers.get("x-served-model"));
console.log(response.headers.get("x-generation-id"));

Browser access

The API answers cross-origin requests only from https://docs.kontinent.ai, so the interactive API reference can send test requests. Call the API from your backend, never from a browser with your key in it.

API reference Handling errors Limits & conventions