AyaSpeech Logo

Error Handling

The API uses standard HTTP status codes. Error responses include a JSON body with adetail field.

Error Response Format

{
  "detail": "Human-readable error message"
}

Status Codes

CodeMeaningWhat to do
200SuccessRequest completed successfully
400Bad RequestCheck request body format and required fields
401UnauthorizedCheck your API token is valid and included in headers
403ForbiddenToken revoked or email not verified
413Payload Too LargeAudio file or text exceeds size limits for your tier
429Too Many RequestsRate limit or quota exceeded. Wait or upgrade tier
500Internal Server ErrorRetry after a brief pause. Contact support if persistent
503Service UnavailableModel is loading or at capacity. Retry with exponential backoff

Retry Strategy

429 responses: Wait until the next day (daily cap) or next month (monthly volume) resets.

500/503 responses: Retry with exponential backoff (1s, 2s, 4s). Max 3 retries.

400/401/403 responses: Do not retry. Fix the request.