Error Handling
The Spitch API returns standard HTTP status codes and structured error responses to help you debug and handle issues gracefully.Common Status Codes
200
- Success400
- Bad request (invalid parameters)401
- Unauthorized (invalid or missing API key)402
- Payment required (insufficient credits)404
- Not found422
- Validation error (malformed request)429
- Rate limit exceeded500
- Internal server error
Error Response Format
Best Practices
Python
Common Issues
Authentication Problems
Issue:401 Unauthorized
errors
Solutions:
- Verify your API key is correct
- Check that the API key is properly set in environment variables
- Ensure you’re using the latest version of the SDK
- Make sure your API key hasn’t expired
Python
Rate Limiting
Issue:429 Rate Limit Exceeded
errors
Solutions:
- Implement exponential backoff
- Add delays between requests
- Monitor your usage in the dashboard
- Consider upgrading your plan for higher limits
Python
File Upload Issues
Issue: Problems uploading files for translation Solutions:- Check file size limits (25MB max)
- Verify file format is supported
- Ensure proper file permissions
- Check your storage quota
Audio Format Issues
Issue: Audio transcription or generation failures Solutions:- Use supported formats:
mp3
,wav
,m4a
,ogg
- Check audio quality and sample rates
- Ensure audio files aren’t corrupted
- Try converting to a different supported format
Language and Voice Compatibility
Issue: Voice not working with selected language Solutions:- Check the voices documentation for language compatibility
- Verify the language code is correct (
en
,yo
,ha
,ig
,am
) - Make sure you’re using a voice that supports your chosen language
Getting Help
If you’re still experiencing issues:- Check the API Reference for detailed parameter information
- Join our Discord community for support
- Contact our support team at dev@spitch.app
- Check the status page for service updates
- Your SDK version
- The full error message
- A minimal code example that reproduces the issue
- Your API request/response (with API keys redacted)