error code and a human-readable message.
Error Format
Errors
unauthorized (401)
The API key is missing, malformed, invalid, or revoked.
Authorization: Bearer sk_996_... (or ?api_key= for WebSockets).
invalid_json / missing_transcript (400)
The request body is malformed or missing required fields.
Common causes:
- Invalid JSON body
- Missing
transcript,voice,model_id, oroutput_format
Invalid output_format (400)
The output_format uses an unsupported container, encoding, or sample_rate. Validation is strict — there’s no silent fallback. The message names the offending field.
Common causes:
- Removed formats:
container: "mp3",encoding: "pcm_f32le" - Unsupported
sample_rate(only8000,16000,22050are allowed) container: "wav"on a streaming endpoint (/tts/sse,/tts/websocketareraw-only)
payment_required (402)
The organization’s credit balance can’t cover the request.
rate_limited / concurrent_limit (429)
You’ve exceeded your org’s per-minute request rate or concurrency cap (shared across all your API keys). See Rate Limits.
Fix: Honor the Retry-After header and retry. For concurrent_limit, retry the rejected turn on a fresh context_id — only that context was rejected, not the whole connection.