Skip to main content
Learn how to properly handle errors, implement retry logic, and troubleshoot common issues when using the VoiceDub API.

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:
Common causes:
  • 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 voiceId for a voice that does not exist or is not accessible

401 Unauthorized

Authentication failed or API key issues. 401 Examples:
Common causes:
  • Missing Authorization header
  • 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:
Common causes:
  • Insufficient API credits for operation

404 Not Found

Resource doesn’t exist or you don’t have access. 404 Examples:
Common causes:
  • 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:
When this happens:
  • 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

Never poll faster than once every 3 seconds to avoid rate limiting.

Common Error Scenarios

Scenario 1: Insufficient Credits

  1. Check current credit balance with GET /v1/me
  2. Purchase more credits or enable auto top-up
  3. Retry the request once credits are available
  • Monitor credit balance regularly
  • Set up auto top-up with appropriate thresholds
  • Check requiredCredits after preprocessing before generation
  • Implement credit balance checks in your application

Scenario 2: Processing Failures

  1. Check audio file format and quality
  2. Try a different audio file or format
  3. Ensure file is not corrupted
  4. Verify file size is under 50MB
  5. Check if audio contains detectable vocals
  • 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

  1. Implement exponential backoff
  2. Wait before retrying (start with 1 second)
  3. Reduce request frequency
  • 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

  1. Verify API key format: Should be Api-Key YOUR_API_KEY
  2. Check request payload: Ensure JSON is valid and complete
  3. Validate UUIDs: Voice and dub IDs must be valid UUID format
  4. Test with cURL: Isolate issues by testing with cURL first
  5. 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.