Generate speech from your own code. Send text and a voice ID, get a job ID back, then poll for the result or receive a webhook. Audio comes back as MP3, with SRT subtitles when you ask for them.
API keys work on the paid tier: buy a credit pack, then open the API page in your dashboard to see your key.
POST your text and voice_id to /v2/text-to-speech/async with the xi-api-key header. The response returns a job_id.
Poll GET /v2/text-to-speech/async/{job_id}, or pass receive_url and we call your webhook when the job is done or failed.
The finished job links to the MP3 audio and, with with_transcript, an SRT subtitle file.
Jobs run in the background. A webhook gets up to 5 attempts over about 51 minutes until your server answers with a 2xx.
Up to 1,000,000 characters per request; long text is split and processed in parts for you.
Ask for a transcript to get an SRT file, or send SRT text in and only the spoken words are billed.
Generate a conversation between several voices in one request.
Re-voice an existing recording in a different voice.
Dub audio or video into another language.
curl -X POST "https://api.ai84.pro/v2/text-to-speech/async" \
-H "xi-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Hello from AI84.pro.", "voice_id": "YOUR_VOICE_ID", "with_transcript": true}'const API_URL = 'https://api.ai84.pro'
const headers = { 'xi-api-key': process.env.AI84_API_KEY, 'Content-Type': 'application/json' }
// 1. Create the job: the response carries its job_id right away
const res = await fetch(API_URL + '/v2/text-to-speech/async', {
method: 'POST',
headers,
body: JSON.stringify({ text: 'Hello from AI84.pro.', voice_id: 'YOUR_VOICE_ID', with_transcript: true }),
})
const { job_id } = await res.json()
// 2. Poll until it is done, or pass receive_url to get a webhook instead
let job
do {
await new Promise((resolve) => setTimeout(resolve, 3000))
job = (await (await fetch(API_URL + '/v2/text-to-speech/async/' + job_id, { headers })).json()).job
} while (job.status === 'queued' || job.status === 'processing')
console.log(job.status, job.audioUrl, job.transcriptUrl)Yes. API keys work while your account is on the paid tier, which means it holds unexpired paid credits. Otherwise job requests are refused with 403 PAID_USER_REQUIRED.
Send your API key in the xi-api-key header. A Bearer token from the login endpoint is accepted too.
Yes. Creating jobs is limited to 60 requests per minute per IP address; above that you get 429 with a Retry-After header.
In credits, from the same balance as the web app. The cost depends on the length of the text and the model, is deducted when the job is created and is returned as credit_cost; an estimate endpoint gives the cost in advance.
After you sign in, the API page of your dashboard lists every endpoint with its parameters, errors and cURL examples, and can copy the whole reference for an AI coding agent.
Every generation uses credits based on the length of your text and the voice model you choose, and the app shows the cost before you generate. Credits come in packs; each pack has a validity period, a set number of days or permanent, shown before you pay. See the pricing page.
On the Buy Credits page you can pay by bank transfer with a VietQR code, or with cryptocurrency such as USDT. The methods open to you are shown at checkout.
Sign in, pick a credit pack and make your first API call.
Get started