Tiers and routing headers
The request headers that steer a request, and what the gateway does with them.
How a request is routed#
- The gateway resolves the canonical model id.
- It applies the project's policy.
- It keeps only the offers of that model that match the tier, the minimum level, the allowed regions, the capabilities and context the request needs, and that have fresh verification evidence and capacity.
- It serves the request from one of them.
The same headers work on every inference endpoint. A header can tighten what the policy allows and never loosen it.
Request headers#
| Header | What it does |
|---|---|
| panward-tier | Tier to serve the request in. Without it the model's default tier applies, or Sealed when the policy is "Sealed only". Asking for `routed` where the policy forbids it returns `403 policy_blocked`. A `sealed` request is never served by a Routed offer; with no eligible Sealed offer the answer is `503 sealed_unavailable`. |
| panward-fallback | Opt in to the project's fallback models. When the requested model has no capacity, the gateway tries each model of the policy's fallback list in order, with every policy constraint unchanged. The `panward-model` response header and the body's `model` name the model that answered. |
| panward-hold-until-verified | Non-streaming requests only. Delays the response until the verification level is known and returns `503 verification_unavailable` instead of an unverified answer. Combined with `stream: true` it returns `400 unsupported_parameter`. |
| X-Request-Id | Client correlation id, echoed in the `panward-client-request-id` response header. It is not forwarded upstream. |
curl -i https://api.panward.ai/v1/chat/completions \ -H "Authorization: Bearer $PANWARD_API_KEY" \ -H "Content-Type: application/json" \ -H "panward-tier: sealed" \ -H "X-Request-Id: discharge-4711" \ -d '{"model": "z-ai/glm-5.3", "messages": [{"role": "user", "content": "Summarise this discharge note."}]}'
raw = client.chat.completions.with_raw_response.create( model="z-ai/glm-5.3", messages=[{"role": "user", "content": "Summarise this discharge note."}], extra_headers={"panward-tier": "sealed", "X-Request-Id": "discharge-4711"}, ) for name in ("panward-tier", "panward-model", "panward-region", "panward-client-request-id"): print(name, raw.headers.get(name))
import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://api.panward.ai/v1", apiKey: process.env.PANWARD_API_KEY, }); const { response } = await client.chat.completions .create( { model: "z-ai/glm-5.3", messages: [{ role: "user", content: "Summarise this discharge note." }], }, { headers: { "panward-tier": "sealed", "X-Request-Id": "discharge-4711" } }, ) .withResponse(); for (const name of ["panward-tier", "panward-model", "panward-region", "panward-client-request-id"]) console.log(name, response.headers.get(name));
panward-tier#
sealed or routed. Without it the model's default tier applies, or Sealed when the policy is "Sealed only". Asking for routed where the policy forbids it returns 403 policy_blocked. A sealed request is never served by a Routed offer: with no eligible Sealed offer the answer is 503 sealed_unavailable.
{
"error": {
"type": "policy_blocked",
"message": "This project's policy allows Sealed models only, and 'acme/atlas-2' is offered in the Routed tier.",
"param": "model",
"request_id": "req_01JC7Q6D4H9K2M5P8R1T3V6X7Z",
"doc_url": "https://panward.ai/docs/errors#policy_blocked"
}
}panward-fallback#
panward-fallback: allow opts in to the project's fallback models. They are used only when the requested model has no capacity: the gateway tries each model of the list in order, with every policy constraint unchanged. The panward-model header and the body's model name the model that answered.
The list is set in the project's policy: models.fallback_models for every model, and models.fallbacks for one model, where never_routed keeps its fallbacks off the Routed tier (Policies).
curl -s -D - -o /dev/null https://api.panward.ai/v1/chat/completions \ -H "Authorization: Bearer $PANWARD_API_KEY" \ -H "Content-Type: application/json" \ -H "panward-fallback: allow" \ -d '{"model": "z-ai/glm-5.3", "messages": [{"role": "user", "content": "Hello"}]}'
panward-hold-until-verified#
panward-hold-until-verified: true is for non-streaming requests. The response waits until the verification level is known, which adds latency, and if the gateway cannot verify it you get 503 verification_unavailable instead of an unverified answer. With stream: true it is refused with 400 unsupported_parameter.
curl https://api.panward.ai/v1/chat/completions \ -H "Authorization: Bearer $PANWARD_API_KEY" \ -H "Content-Type: application/json" \ -H "panward-hold-until-verified: true" \ -d '{"model": "z-ai/glm-5.3", "messages": [{"role": "user", "content": "Summarise this discharge note."}]}'
X-Request-Id#
Your own correlation id, up to 128 characters of letters, digits and ., _, : and -. It is echoed in the panward-client-request-id response header and is not forwarded upstream.
Response headers#
panward-tier: the tier that served the request.panward-model: the model that answered.panward-region: the gateway region that served it.panward-request-id: Panward's id for the request. Quote it to support.panward-receipt-id: the receipt's id.
Retries and failover inside the gateway#
Before the first byte reaches you, the gateway may try again or fail over to another eligible offer, up to three attempts. After the first byte there is no retry. A retry never changes the tier or relaxes the policy. Each attempt is recorded in the receipt as a repeated route.selected group with an increasing attempt number, and only the last attempt's response is returned.
What you cannot steer#
You cannot choose which capacity serves a request. The region is chosen by the hostname you call (Regions and residency).
Decision table#
| Request and policy | Outcome |
|---|---|
| No header | The model's default tier, or Sealed under Sealed only. |
| panward-tier: sealed, a Sealed offer is eligible | Served Sealed. |
| panward-tier: sealed, no Sealed offer is eligible | 503 sealed_unavailable |
| panward-tier: routed, the policy is Sealed only | 403 policy_blocked |
| The model has no capacity, no panward-fallback | 503 no_capacity, with Retry-After |
| The model has no capacity, panward-fallback: allow | The first fallback model with capacity answers; panward-model names it. |
| panward-hold-until-verified: true, the gateway cannot verify the level | 503 verification_unavailable |
| panward-hold-until-verified: true with stream: true | 400 unsupported_parameter |