Error Response Format
All API errors follow a consistent format:HTTP Status Codes
Status Code | Description |
---|---|
200 | Success |
201 | Created successfully |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid or missing API key |
402 | Payment Required - Insufficient credits |
403 | Forbidden - Enterprise plan required or unauthorized access |
404 | Not Found - Resource doesn’t exist |
409 | Conflict - Resource already exists |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error |
Common Error Codes
Authentication Errors
invalid_api_key
invalid_api_key
Status: 401
Cause: API key is invalid, expired, or malformed
Solution: Check your API key format and regenerate if necessary
Cause: API key is invalid, expired, or malformed
Solution: Check your API key format and regenerate if necessary
plan_required
plan_required
Status: 403
Cause: Enterprise plan required for API access
Solution: Upgrade to Enterprise plan
Cause: Enterprise plan required for API access
Solution: Upgrade to Enterprise plan
Rate Limiting Errors
rate_limit_exceeded
rate_limit_exceeded
Status: 429
Cause: Too many requests in a short period
Solution: Implement exponential backoff and respect rate limits
Cause: Too many requests in a short period
Solution: Implement exponential backoff and respect rate limits
Validation Errors
missing_content
missing_content
Status: 400
Cause: No prompt, script, voice_url, or avatar_url provided
Solution: Provide at least one content parameter
Cause: No prompt, script, voice_url, or avatar_url provided
Solution: Provide at least one content parameter
missing_voice
missing_voice
Status: 400
Cause: Script provided but no voice specified
Solution: Add voice_id or voice_url when using script
Cause: Script provided but no voice specified
Solution: Add voice_id or voice_url when using script
invalid_voice_id
invalid_voice_id
Status: 400
Cause: Specified voice_id not found
Solution: Use GET /resources/voices to get valid voice IDs
Cause: Specified voice_id not found
Solution: Use GET /resources/voices to get valid voice IDs
invalid_avatar_id
invalid_avatar_id
Status: 400
Cause: Specified avatar_id not found
Solution: Use GET /resources/avatars to get valid avatar IDs
Cause: Specified avatar_id not found
Solution: Use GET /resources/avatars to get valid avatar IDs
invalid_format
invalid_format
Status: 400
Cause: Invalid video format specified
Solution: Use ‘vertical’, ‘square’, or ‘ads’
Cause: Invalid video format specified
Solution: Use ‘vertical’, ‘square’, or ‘ads’
Resource Errors
insufficient_credits
insufficient_credits
Status: 402
Cause: Not enough credits for the operation
Solution: Purchase more credits or reduce resource usage
Cause: Not enough credits for the operation
Solution: Purchase more credits or reduce resource usage
job_not_found
job_not_found
Status: 404
Cause: Job ID doesn’t exist
Solution: Verify the job_id is correct
Cause: Job ID doesn’t exist
Solution: Verify the job_id is correct
unauthorized_job
unauthorized_job
video_not_found
video_not_found
Status: 404
Cause: Video ID doesn’t exist
Solution: Verify the video_id is correct
Cause: Video ID doesn’t exist
Solution: Verify the video_id is correct
Error Handling Best Practices
1. Always Check Status Codes
2. Implement Retry Logic
3. Handle Validation Errors
4. Monitor Rate Limits
Webhook Error Handling
When using webhooks, you may receive error notifications:Always implement proper error handling and logging in production applications to diagnose issues quickly.