Skip to main content

Error Response Format

All error responses from the Babou API follow a consistent JSON structure:
string
A human-readable description of what went wrong
string
A machine-readable error code for programmatic handling
string
Optional additional guidance on resolving the error

HTTP Status Codes

The Babou API uses standard HTTP status codes:

Common Error Codes

Authentication Errors

HTTP Status: 401Cause: Invalid or missing API keyExample:
Solution:
  • Verify your API key is correct
  • Ensure you’re including the Authorization header
  • Check that your API key hasn’t expired
  • Get a new API key from the dashboard
HTTP Status: 401Cause: API key doesn’t match the expected format (sk-bab-*)Example:
Solution:
  • Ensure your API key starts with sk-bab-
  • Check for typos or truncation
  • Don’t add extra characters or whitespace
HTTP Status: 401Cause: The API key has passed its expiration dateExample:
Solution:
  • 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

HTTP Status: 400Cause: Request parameters don’t meet validation requirementsExample:
Common Validation Rules:
  • Project name: 1-30 characters
  • Project description: max 1000 characters
  • Chapter name: 1-30 characters
  • Chapter duration: positive integer
  • Prompt content: 1-5000 characters
Solution:
  • Check the hint field for specific guidance
  • Review the API documentation for parameter requirements
  • Validate input on the client side before sending

Resource Errors

HTTP Status: 404Cause: The requested resource doesn’t exist or you don’t have accessExample:
Solution:
  • 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
HTTP Status: 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
Example:
Solution:
  • Wait for the current operation to complete
  • Check operation status before retrying
  • Use force: true parameter if applicable (use cautiously)

File Upload Errors

HTTP Status: 413Cause: Uploaded file exceeds the 100MB size limitExample:
Solution:
  • Compress the file before uploading
  • Split large videos into smaller segments
  • Check file size before upload:
HTTP Status: 500Cause: Failed to upload file to cloud storageExample:
Solution:
  • Retry the upload
  • Check your network connection
  • Verify the file isn’t corrupted
  • Contact support if the issue persists

Rate Limiting

HTTP Status: 429Cause: Too many requests in a short time periodExample:
Solution:
  • Implement exponential backoff
  • Space out your requests
  • Cache responses when possible
  • Contact support for higher rate limits
Retry Strategy:

Server Errors

HTTP Status: 500Cause: An unexpected error occurred on the serverExample:
Solution:
  • 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

Error Handling Best Practices

1. Always Check Response Status

2. Implement Retry Logic

3. Handle Specific Error Codes

4. Log Errors for Debugging

Need Help?

If you’re experiencing errors that aren’t covered here:

Check API Status

View system status and known issues

Contact Support

Get help from our support team