Errors
When a request fails to generate audio, the API returns a JSON error response containing error_code, error_message, succeed, and data. The error_code is an application-level error code, not an HTTP status code. The language of error_message follows the Accept-Language header: English by default and Chinese when Chinese is requested. Error responses do not include a trace_id.
{
"error_code": 10003,
"error_message": "Unauthorized",
"succeed": false,
"data": null
}
| HTTP Status | Business error_code | Meaning | What to Do |
|---|---|---|---|
400 | 10001 | Invalid request content or unsupported option | Check the request and try again |
400 | 10013 | Text exceeds the 500 weighted-character limit | Shorten the text; each Chinese character counts as 2 and each other Unicode character counts as 1 |
400 | 10023 | No synthesizable content | Please provide valid text or a supported event tag |
401 | 10003 | Missing or invalid API key | Check the API key |
402 | 20003 | Insufficient account balance | Add funds and try again |
403 | 10004 | Text to Speech is unavailable for the current project | Check the project’s enabled capabilities |
429 | 10005 or 10014 | The request limit has been reached | Wait briefly and try again |
500 | 10000 | An unexpected service error occurred | Try again; contact support if the problem continues |
503 | 20002 | The service is temporarily unavailable | Try again later |
504 | 10006 | The service timed out before audio was returned | Try again later |
Voice Cloning errors
Voice-management endpoints return HTTP 200 on success. Failures use a non-2xx HTTP status and the standard JSON envelope. Check the HTTP status together with succeed and error_code.
| HTTP Status | Business error_code | Meaning | What to Do |
|---|---|---|---|
409 | 10017 | The custom-voice quota has been reached | Delete an unused custom voice and try again |
409 | 10018 | voice_id already exists or is reserved | Use another voice_id |
409 | 10019 | The generated or requested voice ID conflicts with an existing voice | Retry or use another voice_id |
413 | 20010 | File exceeds the size limit for this API | File upload: up to 50 MiB; voice cloning reference audio: up to 20 MiB |
400 | 20012 | Reference audio format is invalid or cannot be processed, including corrupt media or a missing audio stream | Upload a supported, readable reference audio file |
400 | 20015 | Reference audio exceeds 60 seconds | Upload a reference recording between 3 and 60 seconds |
400 | 20016 | Reference audio is shorter than 3 seconds or does not contain enough usable speech | Upload clear, continuous speech rather than silence or noise |
400 | 20017 | Pauses in the reference speech are too long | Upload a recording with more continuous speech |
If streaming generation stops unexpectedly, provide the HTTP status, API endpoint, and approximate time with time zone when contacting support.