API referenceDocumentation
Errors & limits
Status codes, retry guidance, and platform limits.
On this page
Standard OpenAI-style error responses:
| Status | Meaning | Retry? |
|---|---|---|
401 | Missing or invalid API key | no — fix the key |
400 | Malformed request or unsupported parameter | no — fix the request |
402 | Your prepaid balance (or $1 trial credit) is used up. The message includes a billing link | no — top up, then retry |
403 | This key reached the spending limit set on it | no — raise the key limit or use another key |
429 | Edge, per-key, or provider rate limit, or a rolling-window key budget | yes, with backoff |
5xx | Upstream provider issue | yes |
Error bodies follow the OpenAI shape:
json
{"error": {"message": "...","type": "invalid_request_error","code": "..."}}
When a request is rejected by a key budget or your available balance, read the returned error.message and error.code before retrying. A retry cannot raise a hard budget or restore a zero balance. Top up (402) or raise the key limit (403) first.
Platform limits #
- Requests are limited to 60/s per IP at the edge. This is separate from optional per-key RPM/TPM limits and the tighter limits on promotional accounts.
- Request bodies up to 50 MB (plenty for base64 vision payloads).
- Streams stay open for up to 10 minutes.