Response headers
Every x-agent-stream-* header below is the exact header name Agent Stream sends. A client can read cost and usage figures directly from these headers without parsing the response body. Agent Stream adds them to a successful chat response in any of the three request formats a surface accepts: OpenAI Chat, Anthropic Messages, and OpenAI Responses.
Every-request headers
Set on every successful chat response.
| Header | Meaning | Buffered | Streamed |
|---|---|---|---|
x-agent-stream-trace-id | Request trace id. | Yes | Yes |
x-agent-stream-provider | Upstream provider that served the call. | Yes | Yes |
x-agent-stream-model | The model that produced the response: the routed, failover, or load-balanced model when one was used, the Merger LLM’s model in Summarise output from multiple LLMs mode, and collect in Compare output from multiple LLMs mode. The main model call is priced at this model. The Judge, Jury, Decider, and each compared or summarised model are priced at their own rates, and x-agent-stream-cost-usd includes them all. | Yes | Yes |
x-agent-stream-cache | Cache status: hit or miss. | Yes | Yes: hit when served from the response cache, otherwise miss. |
x-agent-stream-input-tokens | Input tokens for the execution. On a cache hit, the input tokens the cache saved. | Yes | Only on a cache hit |
x-agent-stream-output-tokens | Output tokens for the execution. On a cache hit, the output tokens the cache saved. | Yes | Only on a cache hit |
x-agent-stream-total-tokens | Total tokens for the execution. On a cache hit, the total tokens the cache saved. | Yes | Only on a cache hit |
x-agent-stream-cached-tokens | Provider-side cached input tokens. 0 on a cache hit. | Yes | Only on a cache hit |
x-agent-stream-cache-write-tokens | Provider-side cache-write tokens, 0 when the provider doesn’t report them. 0 on a cache hit. | Yes | Only on a cache hit |
x-agent-stream-reasoning-tokens | Reasoning tokens, already counted in the output tokens. 0 when the provider doesn’t report them, and on a cache hit. | Yes | Only on a cache hit |
x-agent-stream-cost-usd | USD cost for the execution, to 6 decimal places. 0.000000 on a cache hit. | Yes | Only on a cache hit |
x-agent-stream-cache-saved-usd | Provider spend avoided by a cache hit. Present only on a cache-hit response. | Only on a cache hit | Only on a cache hit |
The response cache is checked before the streaming path, so a streamed request can be served from the cache. A streamed cache hit carries the same headers as a buffered one. A stream that runs live starts before its tokens and cost are known, so it carries only the trace id, provider, model, and x-agent-stream-cache: miss, all set at stream start.
Conditional headers
Present only when the surface used the corresponding feature for this request. Buffered responses only.
| Header | Meaning | Present when |
|---|---|---|
x-agent-stream-schema-valid | true if the completion matched the requested schema, otherwise false. | The request set a json_schema response format. |
x-agent-stream-context-transform | Which context-window compression ran and how many messages it removed. | Context-window compression removed at least one message. |
x-agent-stream-documents | Document-ingestion summary for the request. | The request included ingested documents. |
x-agent-stream-audio | Audio-input handling summary for the request. | The request included audio input. |
x-agent-stream-images | Image-input handling summary for the request. | The request included image input. |
Negotiated dialect
| Header | Meaning | Buffered | Streamed |
|---|---|---|---|
x-agent-stream-ingress-skin | The negotiated client dialect (openai_chat, anthropic_messages, openai_responses), set on success, error, and streamed responses alike. | Yes | Yes |
Inbound-only headers
These are headers a caller sends, not response headers: listed here because they share the x-agent-stream-* / X-Agent-Stream-* prefix and are easy to mistake for response headers.
| Header | Meaning |
|---|---|
X-Agent-Stream-Presentation (configurable name) | Default header name a caller uses to present verifiable-presentation (VP) evidence, when a surface’s VP evidence source is header. |
X-Agent-Stream-Upstream-Authorization | Lets a caller supply a distinct upstream credential (e.g. a Microsoft Graph token for Copilot) alongside the front-door token, separate from the surface’s own configured provider auth. |
Related
- Telemetry and exports: The per-request telemetry record these headers are derived from.
- Observability concept: Why these figures are exposed on the response rather than only in the dashboard.
- Server tools and modalities: The document/audio/image ingestion and context-compression features the conditional headers report on.
- Providers: Upstream provider auth, including the upstream-authorization override header.
Glad to hear it! Please tell us how we can improve more.
Sorry to hear that. Please tell us how we can improve.
Thank you for sharing your feedback so we can improve your experience.