API errors, retries and limits
Use the HTTP status and stable error.code to decide what to do next. Preserve error.request_id for support; do not expose API keys or resumable upload URLs in logs.
Error envelope
{
"error": {
"code": "invalid_api_key",
"message": "The API key is invalid, expired, or revoked.",
"request_id": "REQUEST_ID_FROM_RESPONSE",
"details": {}
}
}Responses also contain X-Request-Id. Success responses use data, so check the status before reading a successful result shape.
Retry rules
| Response | Action |
|---|---|
| 401 invalid_api_key | Verify Authorization, expiry and revocation. Replace the credential if necessary. |
| 403 insufficient_scope or account/plan restriction | Correct permission or account state; repeated identical requests will not help. |
| 400 / 415 / 422 validation error | Correct the request or media according to error.code and message. |
| 409 conflict | Check idempotency, file allocation or dataset state before retrying. |
| 429 | Honor Retry-After; distinguish rate limiting from a full training queue. |
| 500 / 503 or uncertain network response | Back off. Retry an identical POST with its original Idempotency-Key. |
Use bounded retries and save operation state. The Python and Node.js examples illustrate stateful recovery. Do not replace an uncertain training request with a new key: that can create another job.
Idempotency
POST requests require an Idempotency-Key containing 1–128 printable nonspace ASCII characters. Generate a unique value for each logical operation and store it before sending. Reuse it for an identical retry. Reusing a key for a changed body returns idempotency_conflict.
Results are retained for seven days. The operation is scoped to the account and endpoint path. Key rotation within the same account does not mean you should generate a new operation key for an uncertain retry.
Validation errors
| Code | Likely correction |
|---|---|
| invalid_content_type / invalid_json | Send application/json and a valid JSON body to metadata endpoints. |
| request_too_large | Keep JSON metadata within 65,536 bytes; upload media to the storage URL. |
| invalid_path | Use a safe relative path; nested directories only for dataset input. |
| unsupported_media_type | Match the extension, MIME type and selected input type. |
| media_metadata_unavailable | Check the original media/container; use a supported conventional export when appropriate. |
| invalid_input_type | Use the correct regular or panoramic input category. |
| insufficient_input | Supply sufficient photo/video coverage. |
| dataset_not_ready | Complete validation until status is ready. |
| inactive_parameter | Remove settings that are not active at the selected quality level. |
| invalid_configuration | Use values permitted by the current configuration schema. |
| file_already_complete | Continue with the dataset instead of uploading an already validated file again. |
Rate and account limits
The current API allows 120 authenticated requests per key per minute and 300 per account per minute. More keys do not bypass the account limit. Read Retry-After when rate_limit_exceeded is returned.
Separate errors identify account allowances: plan_limit_exceeded, project_limit_exceeded, training_concurrency_exceeded, model_not_allowed and api_allowance_exceeded. Check the UTC monthly API point balance with GET /usage and the operational input limits with GET /capabilities.
See capabilities for API ceilings, datasets for file validation and pricing for current plans.