Error Response Format
All error responses from the Babou API follow a consistent JSON structure:A human-readable description of what went wrong
A machine-readable error code for programmatic handling
Optional additional guidance on resolving the error
HTTP Status Codes
The Babou API uses standard HTTP status codes:| Status Code | Meaning |
|---|---|
200 | Success - Request completed successfully |
400 | Bad Request - Invalid parameters or request format |
401 | Unauthorized - Invalid or missing API key |
404 | Not Found - Resource doesn’t exist or you don’t have access |
409 | Conflict - Resource state conflict (e.g., already processing) |
413 | Payload Too Large - File exceeds size limits |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error - Something went wrong on our end |
Common Error Codes
Authentication Errors
UNAUTHORIZED
UNAUTHORIZED
INVALID_API_KEY_FORMAT
INVALID_API_KEY_FORMAT
HTTP Status: Solution:
401Cause: API key doesn’t match the expected format (sk-bab-*)Example:- Ensure your API key starts with
sk-bab- - Check for typos or truncation
- Don’t add extra characters or whitespace
API_KEY_EXPIRED
API_KEY_EXPIRED
HTTP Status: Solution:
401Cause: The API key has passed its expiration dateExample:- Generate a new API key from your dashboard
- Update your application with the new key
- Set up key rotation to prevent future expirations
Validation Errors
VALIDATION_ERROR
VALIDATION_ERROR
HTTP Status: Common Validation Rules:
400Cause: Request parameters don’t meet validation requirementsExample:- Project name: 1-30 characters
- Project description: max 1000 characters
- Chapter name: 1-30 characters
- Chapter duration: positive integer
- Prompt content: 1-5000 characters
- Check the
hintfield for specific guidance - Review the API documentation for parameter requirements
- Validate input on the client side before sending
Resource Errors
NOT_FOUND
NOT_FOUND
HTTP Status: Solution:
404Cause: The requested resource doesn’t exist or you don’t have accessExample:- Verify the ID is correct
- Check that the resource belongs to your account
- Ensure the resource hasn’t been deleted
- Use List endpoints to find valid IDs
CONFLICT
CONFLICT
HTTP Status: Solution:
409Cause: Resource state conflict - operation can’t proceed due to current stateCommon Scenarios:- Another prompt is already being processed for a chapter
- Export is already in progress for a project
- Wait for the current operation to complete
- Check operation status before retrying
- Use
force: trueparameter if applicable (use cautiously)
File Upload Errors
FILE_TOO_LARGE
FILE_TOO_LARGE
HTTP Status: Solution:
413Cause: Uploaded file exceeds the 100MB size limitExample:- Compress the file before uploading
- Split large videos into smaller segments
- Check file size before upload:
UPLOAD_FAILED
UPLOAD_FAILED
HTTP Status: Solution:
500Cause: Failed to upload file to cloud storageExample:- Retry the upload
- Check your network connection
- Verify the file isn’t corrupted
- Contact support if the issue persists
Rate Limiting
RATE_LIMIT_EXCEEDED
RATE_LIMIT_EXCEEDED
HTTP Status: Solution:
429Cause: Too many requests in a short time periodExample:- Implement exponential backoff
- Space out your requests
- Cache responses when possible
- Contact support for higher rate limits
Server Errors
INTERNAL_ERROR
INTERNAL_ERROR
HTTP Status: Solution:
500Cause: An unexpected error occurred on the serverExample:- Retry the request after a short delay
- Check the status page for known issues
- Contact support if the problem persists
- Include the request ID if available for faster debugging