API Errors
Understanding and handling API errors.
Error Response Format
All errors return JSON with an error field:
{
"error": "Error message here"
}
Common Errors
401 Unauthorized
{ "error": "Invalid API key" }
Cause: Missing or invalid Authorization header.
Fix: Include valid API key:
Authorization: Bearer YOUR_API_KEY
400 Bad Request
{ "error": "video_url is required" }
Cause: Missing required parameter.
Fix: Include all required fields (video_url, video_type).
400 Invalid Video Type
{
"error": "video_type is required",
"valid_values": ["conversation", "solo", "gaming", "vlog", "faceless", "movies"]
}
Cause: Missing or invalid video_type.
Fix: Use one of the valid values.
403 No Credits
{
"error": "No credits remaining",
"credits_remaining": 0
}
Cause: Account has no credits left.
Fix: Upgrade your plan or wait for monthly reset.
429 Rate Limited
{
"error": "Rate limit exceeded",
"retry_after": 60
}
Cause: Too many requests (60/min limit).
Fix: Wait and retry after the retry_after period.
Active Job Exists
{
"status": "active_job_exists",
"job_id": "job_xxx",
"job_status": "processing"
}
Cause: You already have a job processing (1 at a time limit).
Fix: Wait for current job to complete, or use the returned job_id.
Best Practices
- Check status codes — 2xx = success, 4xx = client error, 5xx = server error
- Handle rate limits — Implement exponential backoff
- Log errors — Include error details for debugging