# Response Headers

Source: https://staging-docs.aiand.com/reference/response-headers/

ai& exposes request metadata through HTTP headers rather than modifying the OpenAI- or Anthropic-shaped response body. This preserves wire-format compatibility with the official SDKs.

## Identity & tracing

| Header         | Description                                                                                                                                                                                                                                                                                                                                         |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `X-Request-ID` | Unique ID for this request on traced API routes (inference, auth, billing, and files). Include it in support tickets.                                                                                                                                                                                                                               |
| `traceparent`  | [OpenTelemetry trace context](https://opentelemetry.io/docs/concepts/context-propagation/) header. On traced inference routes and auth/files/billing HTTP requests, ai& accepts an incoming value or starts a new trace, propagates it downstream where applicable, and returns the server's trace context so you can correlate distributed traces. |

<Aside type="note">
  The current request telemetry wrapper covers inference generation/catalog/analytics/logs routes
  and all HTTP requests in auth, files, and billing. Worker-admin, worker-notifications, and
  worker-openapi are not currently wrapped.
</Aside>

## Cost metrics (opt-in)

Cost and timing headers are **not** sent by default. To receive them, send the request header `X-Aiand-Metrics: true`. They are emitted on non-streaming responses only:

| Header            | Description                                                            |
| ----------------- | ---------------------------------------------------------------------- |
| `X-Cost`          | Cost of this request in your billing currency.                         |
| `X-Cost-Currency` | The currency `X-Cost` is denominated in (`usd` or `jpy`).              |
| `X-Inference-Ms`  | Time the upstream model spent producing the response, in milliseconds. |

Token counts are not exposed as headers — read the `usage` block in the response body.

## Reasoning effort

| Header               | Description                                                                                                                                                                                                                           |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `X-Reasoning-Effort` | The effort level actually applied, on requests that sent a `reasoning_effort`. Always one of the model's published levels. Absent if you didn't send one — the model's own default then applies, and we don't substitute one for you. |

Sending an effort a model doesn't support is normally a 400 naming the values it takes — see [`reasoning_efforts`](/models/catalog/) per model. A few models are configured to fall back to a supported level instead; there this header differs from what you sent, and the reasoning tokens you are billed for are the applied level's, not the requested one's. Compare it against your request if that distinction matters to you.

## Rate limiting

See [Rate Limits](/reference/rate-limits/) for the full set of rate-limit headers.

## Streaming

Streaming responses carry `X-Request-ID` immediately but never carry cost headers. With `X-Aiand-Metrics: true`, chat-completion streams append a trailing `event: metrics` SSE event with tokens, cost, and currency after the model's terminal message. See [Streaming Events](/reference/streaming-events/).

<Aside type="note">
  For streaming requests, read the trailer event — don't try to parse cost from headers, which are
  sent before the body completes.
</Aside>
