Skip to main content

Limits

Spending​

Your balance is the hard limit: a request that would take available credits below zero is refused with 400 insufficient_credits before it runs. Each key can carry its own credit limit, optionally resetting daily, weekly or monthly, and an expiration; a key that has used its limit gets 400 key_budget_exceeded while the account may still have credits. See Create an API key.

Video jobs and deep research hold their estimated cost against your balance when they start and settle to the actual cost when they finish; a failed job releases the hold.

Rate limits​

Rate limits are per key, as requests per minute and tokens per minute, and are set by us for your account. Every response tells you where you stand:

HeaderMeaning
x-ratelimit-limit-requests / x-ratelimit-remaining-requestsRequests allowed per minute on this key, and how many are left in the current minute
x-ratelimit-limit-tokens / x-ratelimit-remaining-tokensTokens allowed per minute on this key, and how many are left

Exceeding either returns 429 rate_limited with a Retry-After header giving the seconds until the minute window resets. A key with no limits configured has none of these headers.

Separately, a model's providers have their own capacity. When every deployment of a model is busy you get 429 provider_overloaded; that is the moment to retry with backoff or switch models. If your application needs sustained throughput beyond what your key allows, contact us and we will raise it.

Request size​

The whole request, JSON or multipart, may be at most 10 MB. That is a gateway limit and cannot be raised per account. For images and audio, send a URL or upload the file where the endpoint allows it rather than embedding a large base64 payload.

Timeouts​

A synchronous request is held open for at most 240 seconds, measured from the start of the request to the last byte of the response. Past that the connection is closed and the client sees 504 timeout. Long text generations should use "stream": true; a stream stays open as long as tokens keep flowing. Video generation is a job you poll, so it is never affected.

Retention​

WhatKept for
Image and video download URLs in API responses24 hours. Download the file promptly; the URL is not a permanent address.
A stored Idempotency-Key response24 hours
Request logs in the console (prompt and response content)365 days; usage and cost records are kept indefinitely
Console chat historyUntil you delete it

Model access​

An account can be limited to a set of models. GET /v1/models lists what your key can call; anything outside it returns 403 model_not_allowed. The console's Models page shows the same set.