Skip to content
OfferSign up and get $10 of credit for any model in Chat and the API. Top up from $1, with no processing fees. See free models →·Some free models are at the daily cap — refills 05:30 IST; requests auto-route to a live backup. Status →
One AI API Key
DocsHeaders

Docs

Request and response headers

Every HTTP header the gateway reads from your requests or adds to its replies, what each one does and where it is described in full.

Updated
On this page

Most clients never need a header beyond the API key. The ones below are for tracking calls, steering routing and reading limits without an extra request. Header names are not case-sensitive.

Headers you can send

HeaderWhat it does
Authorization: Bearer <key>Your API key. x-api-key and x-goog-api-key are accepted too. Details
X-Client-Request-IdYour own id for the request (printable ASCII, up to 128 characters), for feedback and the request lookup. Details
X-TitleYour app or tool name. Used to group usage by coding tool; the header itself is not stored. Details
X-Session-IdGroups requests into one session on the usage page. Details
X-Fallback-ModelsUp to 3 comma-separated model ids tried in order when the provider fails before answering. Details
X-MetadataA JSON object (up to 4096 characters) read by the routing rules of a virtual model. Details
X-Auto-Allow
X-Auto-Deny
Narrow automatic model choice: up to 20 comma-separated model ids, * matches any text. Details
X-TagYour own label for the call (printable ASCII, up to 64 characters). Usage > Tags shows spend per tag. Details
X-Request-TimeoutMilliseconds (1000 to 600000) to wait for the reply to start; after that you get 408. Details
X-Response-Healing: onRepairs a JSON-mode reply that does not parse (non-streaming). Details
X-No-Log: trueLeaves this call out of the key’s prompt log. Details
X-Couponoff keeps coupon credit out of this call, so your balance or plan pays; a code makes that coupon pay for the call. Case and spaces are ignored. Not read for free models. Details

Headers in the reply

HeaderWhat it holds
X-Request-IdReplies from the model.
The request id. Quote it to support, score the answer with it or look up its cost. Details
x-ratelimit-limit-requests
x-ratelimit-remaining-requests
x-ratelimit-reset-requests
x-ratelimit-policy
Keys with a requests-per-minute limit.
The limit and what is left, after this request. Details
x-key-budget-limit
x-key-budget-remaining
x-key-budget-reset
Keys with a spend budget.
The budget and what was left before this request’s cost, in USD; the reset in Unix seconds. Details
X-Daily-Limit
X-Daily-Remaining
X-Daily-Reset
Models with a daily cap.
The cap, what is left today and the next reset (00:00 UTC) in Unix seconds. Details
Retry-AfterA 429 from a daily cap, key limit or spend limit.
Seconds to wait before trying again. Details
X-Fallback-FromYour fallback model answered.
The model that failed. Details
X-Tools-Dropped: 1The request was resent without tools.
The model refused tool calling, so tools were removed. Details
X-Virtual-ModelThe request named a virtual model or an auto model.
The name you sent; the reply’s model field names the model that answered. Details
X-Route-RuleA routing rule matched.
The rule’s number, 1 for the first. Details
X-Canary: 1The canary model was tried first.
The request was picked for the canary. Details
X-PII-RedactionPII redaction is on for the key.
What was redacted: input, output, or input, output. Details
X-GuardrailA guardrail logged a match and let the request pass.
The checks that matched. Details
X-Context-TrimmedA middle-out trim shortened the conversation.
How many messages were removed or shortened so the prompt fits the context window. Details
X-Coupon: 1A coupon paid for the request.
Coupon credit paid for this call, not your plan or balance. Details

Replies do not carry a cost header: a request’s price is only final once the reply has finished. To see what one request cost, look it up by its id, or read the usage object in the reply and the prices on the model list.

See the headers of a reply

-D - prints the reply’s headers and -o /dev/null hides its body:

Terminal
curl -sS -D - -o /dev/null https://api.oneaiapikey.com/v1/chat/completions \
  -H "Authorization: Bearer $ONEAIAPIKEY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "glm-5.3-flash:free", "messages": [{"role": "user", "content": "Hi"}]}'

In the OpenAI Python SDK, client.chat.completions.with_raw_response.create(...) returns the reply with its headers.

↑ ↓ moveEnter openEsc close