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.
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"
| Field | Description |
|---|---|
text | Required. The text to speak, up to the model's character limit. |
model | Optional. One of the models below. Without a cloned voice, chatterbox runs on kokoro. |
custom_voice_id | Optional. The id of one of your cloned voices that is ready. |
voice_id | ಆಯ್ಕೆ. ಚೇಫ್ / backs / / eings /. ಆದರೆ, ಈ ರೀತಿಯ ರಚನೆಯನ್ನು ನಾವು ಅಲಕ್ಷಿಸಬಾರದು. ಮಾದರಿಯ ಪೂರ್ವನಿಯೋಜಿತ ಧ್ವನಿ ಬಳಸಲು ಎರಡೆ ವೀಕ್ಷಣೆ ಕ್ಷೇತ್ರಗಳನ್ನು ಬಿಟ್ಟುಹೋಗು. |
language | Optional. Language code, en by default. |
speed | Optional. Speaking speed, 1.0 by default. |
format | Optional. Audio format, mp3 by default. |
| Model | Maximum characters per request |
|---|---|
kokoro | 500 |
chatterbox | 5000 |
bark | 1000 |
tortoise | 10000 |
chatterbox-turbo | 5000 |
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.
400 | A required field is missing or a value is invalid, for example text longer than the model allows. |
401 | The key is missing, wrong, revoked or expired. |
402 | Not enough credits for this text. The response includes credits_required and credits_available. |
403 | The account has no paid plan or credit pack (code api_paid_plan_required), the key lacks permission, or the clone limit is reached. |
404 | The voice or generation does not exist, is not yours, or the audio is not ready yet. |
429 | Rate limit reached. Wait the number of seconds in retry_after. |
503 | The generation service is busy. Try again in a minute. No credits are taken. |