Skip to main content

Error Response Format

When an error occurs, the API returns a JSON response with the following structure:
Generation endpoints return HTTP 200 for failures. /api/v6, /api/v7 and /api/v8 answer errors with a 200 status line and "status": "error" in the body. Branch on the body’s status and code — never on the HTTP status code alone, or a failed generation reads as a success.
Branch on code, not on message: code is a stable token, while message is prose that gets reworded and is sometimes forwarded verbatim from a third-party provider.

Error codes

The same list is published as x-error-model.codes in openapi.json, typed as the GenerationError schema.
Some legacy endpoints may return messege instead of message. Handle both fields for compatibility.

Control-plane errors

The agent control plane (/api/agents/v1) uses real HTTP status codes and a different envelope — every response, success or failure, has the same three keys:
On success error is null and data carries the payload. Quote meta.request_id when reporting a failure. Typed as AgentErrorEnvelope in agents-openapi.json.

HTTP Status Codes

Cause: The request contains invalid parameters or is malformed.Common Issues:
  • Missing required parameter (e.g., prompt, key)
  • Invalid parameter type (e.g., string instead of number)
  • Parameter value out of allowed range
  • Malformed JSON in request body
Example Response:
Solution: Review your request parameters against the API documentation. Ensure all required fields are included and properly formatted.
Cause: Authentication failed or API key is invalid.Common Issues:
  • Missing key parameter in request body
  • Invalid or revoked API key
  • Expired API key
Example Response:
Solution:
  1. Verify your API key is correct
  2. Check the key is included in the request body
  3. Ensure the key hasn’t been revoked in your dashboard
Cause: Insufficient credits or expired subscription.Example Response:
Solution: Add credits or renew your subscription from your dashboard or view pricing plans.
Cause: The requested feature is not available on your current plan.Example Response:
Solution: Upgrade your subscription to access this feature.
Cause: You’ve exceeded your rate limit (queue limit).Example Response:
Solution:
  1. Wait for current requests to complete
  2. Implement exponential backoff in your code
  3. Consider upgrading your plan for higher limits
See Rate Limits for plan-specific queue limits.
Cause: An internal server error occurred during processing.Example Response:
Solution:
  1. Wait a few seconds and retry the request
  2. If the error persists, check the status page
  3. Contact support if the issue continues
Cause: The service is temporarily unavailable, usually due to high load or maintenance.Example Response:
Solution: Wait and retry with exponential backoff. Check the status page for any ongoing maintenance.

Common Error Scenarios

Missing Required Parameters

Invalid Model ID

Image URL Issues

When using image URLs, ensure the image is publicly accessible and returns proper CORS headers.

Handling Errors in Code

Python

JavaScript

Validation Errors

When request validation fails, you’ll receive specific error messages:

Processing Status vs Errors

Not all non-success responses are errors. Some indicate the request is still processing:
Use the fetch endpoint to check the status of processing requests.

Getting Help

Discord

Get community help

Email Support

Contact support team

Status Page

Check service status