Learn how to properly handle errors, implement retry logic, and troubleshoot common issues when using the VoiceDub API.Documentation Index
Fetch the complete documentation index at: https://api-docs-beta-7agmae.voicedub.ai/llms.txt
Use this file to discover all available pages before exploring further.
Error Response Format
All API errors return a consistent JSON structure: Error Response:HTTP Status Codes
400 Bad Request
Invalid request parameters or malformed data. 400 Examples:- Invalid UUID format for voice or dub IDs
- Missing required parameters
- Invalid parameter values (e.g., pitch shift outside -24 to +24 range)
- Passing a
voiceIdfor a voice that does not exist or is not accessible
401 Unauthorized
Authentication failed or API key issues. 401 Examples:- Missing
Authorizationheader - Incorrect API key format (should be
Api-Key YOUR_KEY) - Deleted or expired API key
403 Forbidden
Valid request but insufficient permissions or credits. 403 Examples:- Insufficient API credits for operation
404 Not Found
Resource doesn’t exist or you don’t have access. 404 Examples:- Invalid resource ID
429 Rate Limited
Too many requests in a short time period. 429 Example:500 Internal Server Error
Server-side error occurred. 500 Example:- Temporary server issues
- Unexpected system errors
Retry Logic
Implement exponential backoff for transient errors:Status Polling Best Practices
When polling for job completion, follow these guidelines:Polling Intervals
Common Error Scenarios
Scenario 1: Insufficient Credits
Detection
Detection
Resolution
Resolution
- Check current credit balance with
GET /v1/me - Purchase more credits or enable auto top-up
- Retry the request once credits are available
Prevention
Prevention
- Monitor credit balance regularly
- Set up auto top-up with appropriate thresholds
- Check
requiredCreditsafter preprocessing before generation - Implement credit balance checks in your application
Scenario 2: Processing Failures
Detection
Detection
Resolution
Resolution
- Check audio file format and quality
- Try a different audio file or format
- Ensure file is not corrupted
- Verify file size is under 50MB
- Check if audio contains detectable vocals
Prevention
Prevention
- Use high-quality source audio (192kbps+ MP3 or lossless)
- Test with shorter clips first
- Validate file format before upload
- Use supported formats: MP3, WAV, M4A, FLAC, OGG
Scenario 3: Rate Limiting
Detection
Detection
Resolution
Resolution
- Implement exponential backoff
- Wait before retrying (start with 1 second)
- Reduce request frequency
Prevention
Prevention
- Implement request queuing in your application
- Don’t poll faster than once every 3 seconds
- Cache responses when appropriate
Error Handling Checklist
✅ Implement proper HTTP status code handling
✅ Parse error responses for specific error codes
✅ Implement exponential backoff for retries
✅ Set appropriate timeouts for long-running operations
✅ Don’t retry 4xx errors (except 429)
✅ Log errors for debugging and monitoring
✅ Provide meaningful error messages to users
✅ Monitor credit balance and handle insufficient credits gracefully
Debugging Tips
Enable Request Logging
Log all API requests and responses for debugging:Common Debugging Steps
- Verify API key format: Should be
Api-Key YOUR_API_KEY - Check request payload: Ensure JSON is valid and complete
- Validate UUIDs: Voice and dub IDs must be valid UUID format
- Test with cURL: Isolate issues by testing with cURL first
- Check network connectivity: Ensure you can reach
api.voicedub.ai
Getting Help
When contacting support, include:- Dub/Voice ID
- Complete error response with code and message
- Steps to reproduce the issue
- Audio file details (format, size, duration)
- Timestamp when the error occurred
Need help debugging an issue? Join our Discord community or email help@voicedub.ai with the details above.