Text to speech errors
The speech endpoints answer errors in the OpenAI shape, with the field at fault in param:
{ "error": { "message": "\"input\" is 5120 characters; the limit is 4096. Split it into several requests.", "type": "invalid_request_error", "param": "input", "code": "input_too_long" }}Read code in your code: it is stable. message is for people and may change.
POST /v1/audio/speech
Section titled “POST /v1/audio/speech”| Status | code |
What to do |
|---|---|---|
| 400 | invalid_json, model_not_found |
Send JSON with "model": "aderra-voice-1" |
| 400 | invalid_input, input_too_long |
Send 1 to 4,096 billable characters. For more, see Limits and quotas |
| 400 | input_too_long_for_format |
aac, opus and flac take about 900 characters: shorten the text, or use mp3, wav or pcm |
| 400 | invalid_voice |
Use a voice from GET /v1/audio/voices. The message says where to find them |
| 400 | unsupported_format |
Use mp3, wav, pcm, aac, opus or flac |
| 400 | invalid_speed |
Send a speed from 0.7 to 1.3 |
| 400 | unsupported_language |
Use a supported language code, or leave language out |
| 401 | unauthorized |
Check the key |
| 402 | insufficient_credits, api_wallet_empty |
Add funds |
| 402 | key_spend_cap_reached |
Raise or remove the key’s cap |
| 403 | api_key_required |
Use an API key from the Developers page, not a terminal key |
| 403 | account_suspended |
Contact us |
| 413 | request_too_large |
Keep the request body under 1 MB |
| 429 | rate_limited, too_many_concurrent_requests |
Wait for Retry-After |
| 429 | provider_busy |
The voice service is busy. Not charged. Retry shortly, with backoff |
| 502 | provider_failed |
Not charged. Try again |
An unknown voice, for example:
{ "error": { "message": "Unknown voice \"Bob\". List the 200 voices with GET /v1/audio/voices, or see https://aderra.ai/docs/api/voices/.", "type": "invalid_request_error", "param": "voice", "code": "invalid_voice" }}Once the audio has started, the status is already 200: a failure then shows as a stream that ends early, not as an error body. See Streaming.
GET /v1/audio/voices and GET /v1/audio/models
Section titled “GET /v1/audio/voices and GET /v1/audio/models”| Status | code |
What to do |
|---|---|---|
| 401 | unauthorized |
Send an Aderra key, API or terminal, as Authorization: Bearer or x-api-key |
{ "error": { "message": "Send an Aderra API key as a Bearer token.", "type": "authentication_error", "param": null, "code": "unauthorized" }}Filters never cause an error: a value that no voice has returns an empty data list.
Retrying
Section titled “Retrying”Retry 429 and 502, after Retry-After when it is sent, with exponential backoff otherwise. Don’t retry 400, 401, 402 or 403 unchanged: they will be refused again. A refused or failed request is not charged. See Rate limits and, for every endpoint’s errors, Errors.