Error Codes
The API uses standard HTTP status codes. The error response body format is:
json
{
"error": {
"message": "Error description",
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}Common Error Reference
| HTTP Status | Common Cause | Troubleshooting |
|---|---|---|
| 400 | Request parameter error (missing required field, invalid value, unsupported resolution, etc.) | Check request body fields and values against the docs |
| 401 | Invalid API Key, malformed header, or deleted Key | Check Authorization: Bearer <key> format; confirm Key status in the console |
| 403 | Insufficient balance, Key quota exhausted, or no permission for this model | Check balance and Key configuration in the console |
| 404 | Wrong request path, or queried task ID does not exist | Check URL spelling; confirm the task ID comes from the creation endpoint |
| 429 | Request rate limit exceeded | Reduce request frequency and retry later; contact us for higher quota |
| 500 / 503 | Internal service error or upstream model service temporarily unavailable | Retry later; contact support if persistent |
Video Task Errors
Video generation is asynchronous. Task failures are returned via the query endpoint's status and error fields:
| Task Status | Description |
|---|---|
queued / in_progress | Queued / in progress; keep polling |
completed | Generation succeeded; result URL is in the response body |
failed | Generation failed; error.message contains the reason. Failed tasks are not charged (deducted amounts are automatically refunded) |
Polling Recommendation
Poll the task status every 5–10 seconds. Generation usually completes within tens of seconds to a few minutes, depending on video length and resolution.
Get Help
If you encounter an unresolved issue, record the complete request (remove the API Key), response body and occurrence time, then contact support: 控制台内联系管理员
