Error Response Format
All API errors follow a consistent JSON response format:string
required
Short error message describing what went wrong
string
Human-readable explanation with additional context (optional)
object
HTTP Status Codes
400 Bad Request
The request was malformed or contained invalid parameters. Common causes:- Invalid JSON in request body
- Missing required fields (
url,variantCount, etc.) - Invalid URL format (not a valid HTTP/HTTPS URL)
- Invalid
variantCount(must be 1-3) urlsnot an array of 1-3 valid URLs
401 Unauthorized
Authentication failed. Your API key is missing, invalid, or malformed. Common causes:- Missing
Authorizationheader - Invalid API key format (must start with
nvl_) - API key has been revoked
- API key does not exist
402 Payment Required
You have exceeded your plan’s quota or attempted to use a feature not available on your plan. Common causes:- Generated more videos than your plan allows this billing period
- Trial period has ended
- Plan does not include API access
The
usage object is included when the error is quota-related, showing your current usage and plan limit.403 Forbidden
Your API key lacks the required permission to perform this action. Common causes:- API key does not have
generatepermission (for POST /api/v1/generate) - API key does not have
projects:readpermission (for GET endpoints) - Attempting to access another user’s resources
404 Not Found
The requested resource does not exist. Common causes:- Job ID does not exist
- Project ID does not exist
- Typo in the endpoint URL
422 Unprocessable Entity
The request was well-formed, but the server cannot process it due to semantic errors. Common causes:- URL is not a product page (detected as homepage, category page, blog post, etc.)
- URL is a valid product page but cannot be processed (unsupported e-commerce platform)
429 Too Many Requests
You have exceeded the rate limit of 60 requests per minute.number
Number of seconds to wait before retrying (optional)
Retry-After header with the same value.
See the Rate Limits page for detailed guidance on handling rate limits.
500 Internal Server Error
An unexpected error occurred on the server. Common causes:- Temporary service outage
- Database connection issue
- Unexpected data format from upstream service
Error Handling Best Practices
1. Implement Comprehensive Error Handling
Always check both the HTTP status code and the error response body:2. Retry Strategy
Retry 5xx errors and 429 errors with exponential backoff. Do not retry 4xx errors (except 429).3. Log Errors for Debugging
Always log the full error response for debugging:4. Handle Special Error Types
Quota Exceeded (402)
When you receive a 402 error, show the user their current usage and guide them to upgrade:Not a Product (422)
When you receivenot_a_product, help the user understand what went wrong:
Contact Support
If you encounter persistent errors or need help debugging:- Review the API documentation for correct endpoint usage
- Contact support at support@nouvel.ai

