Error Response Format
All each::labs APIs return errors in a clean, consistent JSON format:Prediction-Envelope Errors
Prediction-based products (including the Video API) report failures asynchronously. The submit call succeeds with a prediction ID, and the failure arrives when you poll: the prediction returnsstatus: "error" and its output carries an error envelope with error_code and error_message fields — not the HTTP {"error": ...} shape above. For the full envelope and the catalog of error codes, see the Video API error catalog.
HTTP Status Codes
Common Errors
400: Bad Request
- Missing required parameters
- Invalid parameter types or values
- Malformed JSON body
- Input validation failure
401: Unauthorized
Authorization: Bearer YOUR_API_KEYheader not included- API key is invalid or expired
402: Payment Required
- The requested model costs more than your current balance
- The combined estimated cost of your in-flight predictions would exceed your balance — each running prediction reserves its estimated cost until it settles
- Top up your balance, or wait for an in-flight prediction to finish. A settled prediction releases the difference between its estimate and its real cost.
403: Forbidden
- Attempting to modify a locked workflow or version
- Insufficient permissions for the requested operation
404: Not Found
- Invalid model slug
- Non-existent prediction ID, workflow ID, or execution ID
- Resource was deleted
429: Too Many Requests
details for the cap that was hit — it always names the number that applied.
Handling:
- Keep your balance above $10.00 — the cap does not apply above that threshold
- Otherwise, wait for an in-flight prediction to reach a terminal status and resubmit; the slot frees when it settles
- Retry with exponential backoff when
detailsreports that too many executions were started at once — that variant is transient
500: Internal Server Error
- Retry with exponential backoff
- If persistent, contact support
Product-Specific Errors
each::api: Prediction Errors
each::workflows: Execution Errors
each::sense: Agent Errors
Retry Strategy
We recommend exponential backoff for transient errors (429, 500). Here’s how to set that up:Backoff alone does not clear a 429 concurrency cap: the slot frees when an in-flight prediction settles, so retry a bounded number of times and surface the
details text rather than looping.