Documentation

Limits

Rate limits and the size of a single request.

Rate limits

Each key gets its own allowance of 60 requests per minute by default. You can set a different one per key when you create it, up to 10,000. Keys do not share a budget, so a busy integration cannot starve a quiet one.

Over the limit you get 429 rate_limit_exceeded with a Retry-After header in seconds. The check runs before the body is read, so a throttled request costs you nothing.

Request size

LimitValueError
Request body8 MB413 request_too_large
Messages1,000400 too_many_messages
Tools128400 too_many_tools
Images8, each under 5 MB400 too_many_images
Audio clips4, each under 5 MB400 too_many_audio
Videos2, each under 5 MB400 too_many_video

A model's own context window is separate and usually the tighter constraint. Exceeding it comes back as 400 upstream_validation.

Spending limits

Three caps can refuse a request before it runs: the key's own credit limit, the workspace budget, and any guardrail covering that key. The error message names the one that stopped you. See Billing.