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
| Header | Required | Meaning |
|---|---|---|
Authorization | Yes | Bearer sk-kt-..., see Authentication. Not needed for /healthz. |
Content-Type | Yes, with a body | application/json, or multipart/form-data for transcriptions. |
X-Request-Id | No | Your 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
| Header | On | Meaning |
|---|---|---|
X-Request-Id | Every API response (not /healthz) | Your id, or one Kontinent generated. Quote it when you contact support. |
X-Generation-Id | Every 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-Provider | Served responses | The provider that actually answered, for example scaleway after a failover from mistral. |
X-Served-Model | Served responses | The model that actually answered. Differs from the requested id after a fallback or when you call a routing policy. |
Retry-After | Some 429 and 503 | Seconds 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:
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"));raw = client.chat.completions.with_raw_response.create(
model="mistral/mistral-small-4", messages=messages
)
print(raw.headers.get("x-served-model"))
completion = raw.parse()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.