HridaSpro Docs

Routing

Response Headers

X-Spro-* headers that tell you how your request was routed, cached, and served.

Spro adds a small number of headers to every API response so you can inspect how your request was routed. They tell you which model served the call (in the same provider-prefixed format you'd pass as model) and what the gateway did along the way; they don't expose internal details like credential identities or upstream backend URLs.

For the request side — the headers you can send, like x-spro-request-id and x-spro-cache-config — see Caching and Tracing.

Headers

HeaderPresent whenExampleMeaning
x-spro-request-idAlways20261018-abc123This request's id. Echoed back if you sent one on the request, otherwise generated. Quote it to support, or use it to correlate with usage logs and traces.
x-spro-resolved-modelAlwaysopenai/gpt-oss-120bThe canonical model slug that actually served the response, after resolution and any upgrades.
x-spro-cacheAlwayshitWhat the response cache did: hit (served from cache, no model call), miss (fetched and stored), bypass (no cache config sent), or error.
x-spro-cached-request-idCache hitd167b694-b414-...The request id of the original request that populated the cache.
x-spro-attemptsAlways2How many upstream attempts the request took. 1 means the first provider call succeeded; up to 5 after transient-failure retries.
x-spro-upgraded-fromA model upgrade occurredgpt-4o-2024-08-01The model you asked for, when Spro auto-upgraded it to its successor. Absent when you got exactly what you requested.
x-spro-upgrade-reasonA model upgrade occurred (sent alongside x-spro-upgraded-from)model_retiredWhy the upgrade happened: model_retired (the requested model is retired) or model_deprecated (it is deprecated).
x-spro-deprecation-noticeThe served model is retiringmodel 'gpt-4-turbo' is retiring (retirement_at=2026-12-01)Advance warning that the model serving this request is scheduled for retirement.
x-spro-fallback-fromA fallback served the requestopenai/gpt-oss-120bThe model that was tried first and skipped, either because you listed a fallback chain and it failed or was retired, or because its provider failed and another provider served instead. The x-spro-resolved-model header is the one that answered. See Routing Strategies.
retry-afterResponse is 429 Too Many Requests5How many seconds to wait before retrying. Also sent on 429s surfaced from the provider.

Reading them in code

response = client.chat.completions.with_raw_response.create(    model="gpt-oss-20b",    messages=[{"role": "user", "content": "hi"}],)print(response.headers.get("x-spro-resolved-model"))print(response.headers.get("x-spro-cache"))print(response.headers.get("x-spro-attempts"))

Upgrades for deprecated models

If you request a model that has been retired or deprecated, Spro transparently serves its successor instead — the response body comes from the new model, and two headers tell you what happened:

x-spro-upgraded-from: gemini-2.5-prox-spro-upgrade-reason: model_retiredx-spro-resolved-model: google/gemini-3.1-pro-preview

x-spro-upgraded-from is the model you asked for, x-spro-upgrade-reason is why it was swapped (model_retired or model_deprecated), and x-spro-resolved-model always names the model that actually served the response. If you want to stop relying on retired models, treat x-spro-upgraded-from as a signal to update your model config.

What Spro does not expose

We deliberately do not add:

  • A provider credential or upstream API key indicator
  • Any internal routing identifier, channel id, or upstream backend URL
  • Any header that tells a caller which specific deployment or account served the request

Spro is a single endpoint from your application's point of view. Internal routing is our concern, not your dependency.