Text to Speech API

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.

How it works

  1. 1

    Get an API key

    API keys work on the paid tier: buy a credit pack, then open the API page in your dashboard to see your key.

  2. 2

    Create a job

    POST your text and voice_id to /v2/text-to-speech/async with the xi-api-key header. The response returns a job_id.

  3. 3

    Get the result

    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.

  4. 4

    Download

    The finished job links to the MP3 audio and, with with_transcript, an SRT subtitle file.

What the API gives you

Async jobs and webhooks

Jobs run in the background. A webhook gets up to 5 attempts over about 51 minutes until your server answers with a 2xx.

Long text

Up to 1,000,000 characters per request; long text is split and processed in parts for you.

Subtitles

Ask for a transcript to get an SRT file, or send SRT text in and only the spoken words are billed.

More endpoints

Multi-speaker dialogue

Generate a conversation between several voices in one request.

Voice changer

Re-voice an existing recording in a different voice.

Dubbing

Dub audio or video into another language.

Example request

Create a job (cURL)

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}'

Create a job and wait for the result (Node.js 18+)

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)

Frequently asked questions

Do I need a paid account to use the API?

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.

How do I authenticate?

Send your API key in the xi-api-key header. A Bearer token from the login endpoint is accepted too.

Is there a rate limit?

Yes. Creating jobs is limited to 60 requests per minute per IP address; above that you get 429 with a Retry-After header.

How are API calls billed?

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.

Where is the full documentation?

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.

How do credits work?

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.

How can I pay?

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.

Build voice into your product

Sign in, pick a credit pack and make your first API call.

Get started