Troubleshooting

Common errors, causes, and solutions when using the ShunyaLabs transcription APIs.

File Size Error (413)

terminal
HTTP 413: Request Entity Too Large
File 'meeting.wav' is 12.45 MB. Maximum allowed size is 10 MB.
  • Split audio into smaller segments
  • Reduce bitrate or sample rate
  • Compress using FFmpeg:
terminal
ffmpeg -i input.wav -ar 16000 -ac 1 -b:a 64k output.wav

Authentication Error (401)

terminal
HTTP 401: Unauthorized
  • Verify API key is correct
  • Ensure API key is sent in headers
  • Remove extra spaces or line breaks

Bad Request (400)

terminal
HTTP 400: Bad Request
CauseSolution
Unsupported file formatUse WAV, MP3, M4A or supported formats
Invalid parameter valueVerify language_code, chunk_size
Corrupted audio fileTest with a different file
Missing required fieldsEnsure file parameter is included

Method Not Allowed (405)

terminal
HTTP 405: Method Not Allowed
  • Use POST instead of GET
  • Correct: requests.post(...)
  • Incorrect: requests.get(...)

Audio Processing Failed (500)

terminal
HTTP 500: Audio splitting by VAD failed
  • Ensure audio contains speech
  • Avoid silence-only recordings
  • Reduce background noise
  • Verify audio file integrity

Connection Timeout

  • Check internet connection
  • Verify API endpoint accessibility
  • Increase request timeout for large files
python
response = requests.post(
    url,
    headers=headers,
    files=files,
    data=data,
    timeout=300
)

SSL Certificate Errors

python
# Not recommended for production
response = requests.post(
    url,
    headers=headers,
    files=files,
    data=data,
    verify=False
)

HTTP Status Codes

CodeMeaningAction
200SuccessTranscription completed
400Bad RequestCheck parameters
401UnauthorizedVerify API key
405Method Not AllowedUse POST
413File Too LargeReduce file size
500Server ErrorRetry or contact support

Debugging Tips

python
import logging
logging.basicConfig(level=logging.DEBUG)

try:
    result = transcribe_file("audio.wav", api_key)
except Exception as e:
    logging.error(f"Transcription failed: {e}")
python
def check_audio_file(path):
    import os
    size_mb = os.path.getsize(path) / (1024 * 1024)
    print(f"File size: {size_mb:.2f} MB")
    return size_mb <= 10