Platform API Errors and Limits
Platform API errors use a different body shape from model endpoint errors: the HTTP status carries the result, and the JSON body always includes success and, on failure, a machine-readable code.
Response format
Section titled “Response format”On success, HTTP 200 is returned:
{ "success": true, "message": "", "data": {}}On failure, the real HTTP status code is used and the body includes a machine-readable code:
{ "success": false, "message": "Invalid Management Key", "code": "invalid_token"}message is localized and may change between versions. Use the HTTP status code and code in program logic.
Error codes
Section titled “Error codes”| HTTP | code | Scenario |
|---|---|---|
| 400 | invalid_request | Invalid parameters, such as amount out of range, missing or overlong name on create, status outside 1 / 2, enabling a Key that is still expired or exhausted, invalid expiration time, invalid pagination or time range, or an unencoded ; in the query |
| 401 | invalid_token | Missing Authorization header, malformed Key, or Key not found or deleted |
| 401 | token_expired | The Management Key has expired |
| 401 | token_revoked | The Management Key was revoked (legacy Keys only; newly created Keys can only be deleted) |
| 403 | user_disabled | The Management Key owner’s account is disabled |
| 403 | insufficient_scope | The Management Key does not have the permission this endpoint requires |
| 404 | not_found | The API Key does not exist or does not belong to you (not distinguished); or the path does not exist under /api/open/v1 |
| 405 | method_not_allowed | The path exists but does not support that HTTP method |
| 429 | rate_limited | Per-Management-Key rate limit exceeded |
| 500 | internal_error | Server error; internal details are not returned |
Unknown paths under /api/open/v1 return 404 and a wrong HTTP method returns 405, both with the unified error body above; use code to tell “retry with another method” from “wrong path or parameters”.
Rate limits
Section titled “Rate limits”| Range | Limit | Applies to | Response when exceeded |
|---|---|---|---|
| Per Management Key | 120 requests/minute | All Platform API endpoints | 429 with code rate_limited |
| Per user | 30 requests/minute (default) | Account logs, Export logs, Usage, Usage by model, Usage by Key | 429; the response body may be empty |
| Per client IP | 180 requests/180 seconds (default) | Shared across all /api endpoints | 429 |
| Per client IP | 100 requests/20 minutes (default) | Sensitive endpoints such as Reveal an API Key | 429; the response body may be empty |
Handle rate limiting by HTTP status code. When you receive 429, slow down and retry later.
Model endpoints use a different error body and separate limits; see Common Errors.