Top.Mail.Ru
General icon
General
Галерея icon
Галерея
Unitool Labs icon
Unitool Labs
Блог icon
Блог
MCP icon
MCP

Limits and headers

Limits

LimitApplies toWhen exceeded
Requests per minuteThe key and, separately, all keys of the account429 rate_limit_exceeded
Concurrent requestsThe account429 concurrency_limit_exceeded
Concurrent chat requests with filesThe account, one429 concurrency_limit_exceeded with details.lane: "files"
Concurrent media generationsThe accountExtra ones wait in queued
Spend limitThe key, if set in your account402 key_spend_limit_reached

The limits are generous and exist against runaway code, not as plans. Your current values: GET /v1/key, field rate_limit. Need more: contact support.

How the request limit works

The quota refills continuously instead of resetting once a minute (GCRA): with a limit of 600 per minute, one request comes back every 100 ms. The burst allowance equals the per-minute quota, so after a pause up to 600 requests can go at once. The key's limit and the account's (all keys together) are checked together: a request spends quota only if it passes both. A refusal by the limit spends nothing.

On 429 rate_limit_exceeded the Retry-After header is the exact time in seconds until the request would pass.

HTTP
RateLimit-Policy: "key";q=600;w=60, "user";q=1800;w=60
RateLimit: "key";r=599;t=1
x-ratelimit-limit-requests: 600
x-ratelimit-remaining-requests: 599
x-ratelimit-reset-requests: 1s

RateLimit-Policy lists both limits: q is the quota, w the window in seconds. RateLimit describes the limit that refused, or the tighter one when nothing refused: r is how many requests can go right now, t how many seconds until the quota is full again. x-ratelimit-* repeat the same in the OpenAI shape for SDKs.

Response headers

HeaderWhenMeaning
x-request-idAlwaysRequest id req_...: receipts, support
request-id/v1/messagesThe same as x-request-id, under Anthropic's name
x-unitool-ignored-betas/v1/messagesanthropic-beta values that had no effect
RateLimit-Policy, RateLimitAfter the key checkRequest limits, see above
x-ratelimit-limit-requestsAfter the key checkRequests per minute
x-ratelimit-remaining-requestsAfter the key checkRequests that can go right now
x-ratelimit-reset-requestsAfter the key checkTime until the quota is full again, e.g. 1s
Retry-After429, 503, generation 202Seconds to wait
Deprecation, Sunset, LinkCalls to a model being retiredSee Retiring models
x-should-retrybalance_heldSDK hint whether to retry
x-unitool-cost-tokensNon-streamed chatThe request's price in balance tokens
x-unitool-output-cappedChattrue: the output limit was lowered to fit the balance
x-unitool-ignored-paramsChatAccepted but unused parameters
x-unitool-incompleteNon-streamed chatIncomplete answer: upstream_error, deadline, shutdown
LocationGeneration 202Where to poll
Idempotent-ReplayedGenerationstrue: an earlier generation was returned
ETag/v1/modelsFor If-None-Match and a 304

Request headers

HeaderMeaning
Authorization: Bearer ut_live_...The key. x-api-key works too
X-Client-Request-IdYour label for the request, up to 128 printable ASCII characters. Saved in the receipt as client_request_id
Idempotency-KeyFor POST /v1/generations, see Generations
Prefer: wait=NWait for a finished generation up to N seconds, 60 at most
If-None-MatchFor /v1/models

Request ids

Every answer, errors included, carries x-request-id. The same id is in error.request_id, in the chat answer id (chatcmpl-...) and in the receipt GET /v1/requests/{id}. Your own X-Request-Id is never used as the id, only saved as a client label.

Retries

  • 429, 503: wait Retry-After and retry.
  • 500, 502, 504: retry with exponential backoff, 2 or 3 attempts.
  • Retry generations only with the same Idempotency-Key, or you get a second paid generation.
  • Chat has no idempotency: each retry is a separate paid request.
  • Do not retry other 4xx without fixing the request.

Versions

The version is in the path: /v1. Changes inside v1 are additive only: new fields, models, error codes. Your code should skip fields it does not know. History is in the Changelog.

This page as Markdown

We use cookies

By continuing to use the site you agree to our Privacy Policy.