Limits
Rate limits, capacity, request size and time limits, and how to retry.
Two different conditions#
429 rate_limit_exceeded means a limit of yours was reached: the key's, the project's, the organization's, or the caller address's. 503 no_capacity and 503 sealed_unavailable mean there is no eligible capacity for the model, tier and region right now. Limits need you to slow down; capacity needs you to wait, to allow fallback, or to allow another region. Panward never answers a missing Sealed capacity by sending the request to a Routed offer.
{
"error": {
"type": "rate_limit_exceeded",
"message": "Rate limit reached for this key. Retry in 12 seconds.",
"param": null,
"request_id": "req_01JC7Q4N8G5T2R9X1M3K6P7W4D",
"doc_url": "https://panward.ai/docs/errors#rate_limit_exceeded"
}
}Rate-limit headers#
| Header | Meaning |
|---|---|
panward-ratelimit-limit | Request limit (requests per minute) of the current window: the tightest that applies (key, project or organization). |
panward-ratelimit-remaining | Requests left in the current window of that limit. |
panward-ratelimit-reset | Seconds until the current window resets. |
panward-ratelimit-limit-tokens | Token limit (tokens per minute) of the current window: the tightest tokens-per-minute limit that applies to this request (key, project or organization). Sent only when such a limit applies. |
panward-ratelimit-remaining-tokens | Tokens left in the current window of that limit (input, cached input included, and output, as counted). |
panward-ratelimit-reset-tokens | Seconds until the current window of that limit resets. |
Retry-After | Seconds to wait before retrying, on 429 and on 503. |
curl -i https://api.panward.ai/v1/chat/completions \ -H "Authorization: Bearer $PANWARD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "z-ai/glm-5.3", "messages": [{"role": "user", "content": "Hello"}]}'
import os import requests r = requests.post( "https://api.panward.ai/v1/chat/completions", headers={"Authorization": f"Bearer {os.environ['PANWARD_API_KEY']}"}, json={"model": "z-ai/glm-5.3", "messages": [{"role": "user", "content": "Hello"}]}, ) for name in ("panward-ratelimit-limit", "panward-ratelimit-remaining", "panward-ratelimit-reset", "Retry-After"): print(name, r.headers.get(name))
const response = await fetch("https://api.panward.ai/v1/chat/completions", { method: "POST", headers: { Authorization: `Bearer ${process.env.PANWARD_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ model: "z-ai/glm-5.3", messages: [{ role: "user", content: "Hello" }] }), }); for (const name of ["panward-ratelimit-limit", "panward-ratelimit-remaining", "panward-ratelimit-reset", "Retry-After"]) console.log(name, response.headers.get(name));
The headers reflect Panward's own limits only.
When to retry#
429: wait forRetry-After, then back off with a growing delay and some jitter; stop after a few attempts.503 no_capacity: wait forRetry-After, or sendpanward-fallback: allowto let the project's fallback models serve the request. Thepanward-modelheader names the model that answered.503 sealed_unavailableand503 verification_unavailable: retry later.502 upstream_unavailable,504 upstream_timeoutand500 internal_error: retry. Inside the gateway a request may already have been attempted up to three times before the first byte; there is no retry after it.- Every other 4xx error: change the request or your account first.
curl -i 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"}]}'
After an event: error frame in a stream, decide what to do with the partial output before you retry. The Errors page lists every type and whether it is retryable.
Request size and time#
- A request body may be up to 10 MB unless the endpoint says otherwise; an audio file for transcription may be up to 25 MB. A larger body returns
413 request_too_large. - The first byte of a response is expected within 30 seconds, or you get a retryable
504 upstream_timeoutor502 upstream_unavailable. The total budget of a request is 600 seconds. Set your client's timeouts to match.
No idempotency keys#
Inference requests do not accept an Idempotency-Key, and responses are never stored, so they cannot be replayed. A retried request is a new request with a new receipt, and it is billed if it produces output.