Skip to main content

Overview

APIXO API uses two layers of error information:
  1. HTTP Status Codes — Returned immediately when request fails
  2. Failure Codes — Returned as failCode for failed tasks, or as a provider error identifier for some immediate errors

HTTP Status Codes


Failure Codes

When an async task fails, the status response includes failCode and failMsg:
Some immediate HTTP errors may use the same normalized codes and return the HTTP status shown in the tables below.
The same failCode can appear with slightly different failMsg text depending on the upstream provider. Use failCode for programmatic handling and show failMsg to support/debugging tools.

Content Policy and Safety

Prompt and Parameter Validation

Image, Video, and Media Inputs

Authentication, Quota, and Rate Limits

Upstream and Processing Failures


Error Response Examples

HTTP Error (Immediate Return)

400 - Parameter Error
401 - Authentication Failed
402 - Insufficient Quota
429 - Rate Limited
504 - Timeout

Task Failure (When Querying Status)

Content Violation
NSFW Content
Image Format Error
Transient Upstream Error

Error Handling Best Practices

For immediate HTTP errors, retry only transient statuses such as 429, 500, 502, 503, and 504. For task failures, retry only transient failCode values such as RateLimited, RateLimitExceeded, Timeout, CreateTaskFailed, StreamError, UpstreamInternalError, UpstreamError, UpstreamResultError, and Website TimeOut.

1. Retry Strategy

2. Exponential Backoff Example

3. Content Moderation Tips

Content moderation is handled by upstream AI providers. Violations cannot be appealed through APIXO — modify your content and resubmit.
To avoid content violation errors:
  • Avoid violence, pornography, politically sensitive content
  • Check that input images comply with content policy
  • Use clear, specific descriptions, avoid ambiguous expressions
  • Test with simple, safe content first

4. Monitoring and Logging

Recommended to log for debugging:
  • taskId — Unique task identifier
  • failCode — Failure code
  • failMsg — Failure message
  • Request parameters (sanitized)

Provider-Specific Errors

OpenAI

MidJourney

Seedream (ByteDance)


FAQ

Q: Got 429 error, how long should I wait?
A: Wait 60 seconds then retry, or use exponential backoff strategy.
Q: How to avoid PromptLengthExceeded error?
A: Each model has different prompt length limits, check the model documentation. Generally keep under 2000 characters.
Q: Can I appeal SensitiveContentDetected error?
A: This is the upstream AI provider’s content moderation result. Recommend modifying content and resubmitting.
Q: What should I do with 5xx errors?
A: These are temporary server issues. Use exponential backoff retry, max 3 times. If persistent, contact support.
Q: Why does task status return 200 but state is failed? A: HTTP 200 means the status query succeeded, but task execution failed. Use failCode and failMsg for the actual failure reason.

Support

Experiencing persistent errors? Contact support with:
  • taskId — Failed task ID
  • failCode — Error code
  • Request parameters (sanitized)
  • Error occurrence time
Technical Support: support@apixo.ai