API documentation

The REST API turns text into speech with the same models, cloned voices and credits as the website. It is included with every paid plan and credit pack.

See plans and packs

Base URL: http://voiceactorsai.com/api/v1/

Authentication

Send your key in the Authorization header as a Bearer token. Create and revoke keys on the API keys page.

Authorization: Bearer YOUR_API_KEY

Credits

One credit converts 1,000 characters of text into speech. Each request is rounded up to whole credits, with a minimum of one credit.

Text to speech

Send text and get a generation id back. Audio is made in the background: poll the status endpoint until the status is completed, then download the file.

curl -X POST http://voiceactorsai.com/api/v1/tts/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello from VoiceActorsAI.", "model": "kokoro"}'

{"success": true, "generation_id": "GENERATION_ID", "job_id": "...",
 "status": "processing", "characters": 25, "credits_used": 1, "credits_remaining": 99}

curl http://voiceactorsai.com/api/v1/generations/GENERATION_ID/ -H "Authorization: Bearer YOUR_API_KEY"
curl -OJ http://voiceactorsai.com/api/v1/generations/GENERATION_ID/download/ -H "Authorization: Bearer YOUR_API_KEY"
FieldDescription
textRequired. The text to speak, up to the model's character limit.
modelOptional. One of the models below. Without a cloned voice, chatterbox runs on kokoro.
custom_voice_idOptional. The id of one of your cloned voices that is ready.
voice_idDoorasho. Cod ka GET /voices /. Codka maktabadda mar walba ku socda qaabkeeda, sidaas darteed qaabka waa la iska indho tiriyey. ka tag labada codka goobaha in ay isticmaalaan qaabka codka default.
languageOptional. Language code, en by default.
speedOptional. Speaking speed, 1.0 by default.
formatOptional. Audio format, mp3 by default.
ModelMaximum characters per request
kokoro500
chatterbox5000
bark1000
tortoise10000
chatterbox-turbo5000

Voice cloning

Upload 6 to 60 seconds of clear speech as a multipart form to create a cloned voice. The key needs cloning permission and your plan's clone limit applies. When its status is ready, pass the voice id as custom_voice_id.

curl -X POST http://voiceactorsai.com/api/v1/clone/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "audio=@my_voice.wav" -F "name=My voice"

{"success": true, "voice_id": "VOICE_ID", "job_id": "...", "status": "processing"}

curl http://voiceactorsai.com/api/v1/clone/VOICE_ID/status/ -H "Authorization: Bearer YOUR_API_KEY"

Endpoints

POST /tts/Turn text into speech. Returns a generation id.
GET /generations/<id>/Status of a generation, with audio_url once it is completed.
GET /generations/<id>/download/Download the finished audio file.
POST /clone/Create a cloned voice from an audio clip.
GET /clone/<voice_id>/status/Status of a cloned voice: processing, ready or failed.
GET /voices/custom/Your cloned voices.
GET /voices/Voices from the voice library.
GET /models/The models and their character limits.
GET /usage/Requests and characters for this key, and your credit balance.

Rate limits

Each key allows 60 requests per minute and 10,000 requests per day.

Errors

Errors are JSON with an error field, and some also carry code, message and upgrade_url.

400A required field is missing or a value is invalid, for example text longer than the model allows.
401The key is missing, wrong, revoked or expired.
402Not enough credits for this text. The response includes credits_required and credits_available.
403The account has no paid plan or credit pack (code api_paid_plan_required), the key lacks permission, or the clone limit is reached.
404The voice or generation does not exist, is not yours, or the audio is not ready yet.
429Rate limit reached. Wait the number of seconds in retry_after.
503The generation service is busy. Try again in a minute. No credits are taken.