API ReferenceReference
Response format
Every response uses the same envelope, so you can branch on one field.
Every response uses the same envelope, so you can branch on one field. Success and failure never share a shape.
Success
2xx
{ "success": true, "message": "...", "data": { ... }, "credits": { ... } }credits is included on requests that can cost characters (text to speech and cloning).
Lists
List endpoints return an array in data plus a pagination object:
List response
{
"success": true,
"data": [ ... ],
"pagination": { "page": 1, "limit": 50, "total": 1108, "total_pages": 23, "has_more": true }
}Keep increasing page until has_more is false.
Failure
4xx / 5xx
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Some fields are invalid. Check the fields object for details.",
"fields": { "audio": "Unsupported audio format. Please upload a WAV or MP3 file." }
}
}- Always branch on
success. error.codeis a stable, machine-readable string you can switch on.error.messageis human-readable and safe to show your users.- Some errors add extra fields, like
fieldsorretryAfterSeconds.
