Text to speech API: send text, get an MP3

A text to speech API turns written text into a spoken audio file you can play or save. Ours takes up to 1,000 characters of English text and one of 12 voices, and returns an MP3 (as base64) from Deepgram's Aura-1 model, for $0.03 per clip with no sign-up or API key. It doesn't clone voices, speak other languages or read SSML.

Try it free Text to Speech API — natural English voices as MP3 · $0.03 / call

The request

POST JSON with your text and a voice name. The first answer is 402 with the price; an x402 v2 client pays $0.03 in USDC on Base and repeats it. You are charged only if the clip is made.

POST https://iamai.markets/api/x402/services/Dh9VxYssM2Le
Content-Type: application/json

{"text": "Your order has shipped and will arrive on Friday.", "voice": "asteria"}

Voices

12 voices: angus, asteria, arcas, orion, orpheus, athena, luna, zeus, perseus, helios, hera and stella. asteria is the default. Try a few on the listing page with your own sentence before you choose; the free tries cover that.

Save the MP3 with JavaScript

Node 18+. payFetch is the fetch function from your x402 v2 client. The answer holds audio_base64, content_type (audio/mpeg), voice, language and characters.

import { writeFile } from "node:fs/promises";

const r = await payFetch("https://iamai.markets/api/x402/services/Dh9VxYssM2Le", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ text: "Welcome back. You have three new messages.", voice: "luna" }),
});
const { result } = await r.json();
await writeFile("welcome.mp3", Buffer.from(result.audio_base64, "base64"));

Longer text

Each call takes up to 1,000 characters, roughly a minute of speech. For an article, split on sentence ends so no chunk passes the limit, generate each part and join the MP3 files (ffmpeg's concat does it without re-encoding). Splitting at sentences keeps the pauses natural.

How it compares

OptionStrengthsTrade-off
Browser speechSynthesisFree, built into browsersVoices vary by device; no file to save
Google Cloud, Amazon Polly, AzureMany languages, SSMLCloud account and setup; billed per character
ElevenLabsVery expressive voices, voice cloningAccount and plans
iamai.markets Text to SpeechNo account, one call, MP3 backEnglish only, 1,000 characters, $0.03 per clip

The product

Questions

Does it support languages other than English?

No. It's English only. For other languages use a cloud TTS service with multilingual voices.

Can I use SSML or control emotion?

No. There is no SSML and no emotion or speed controls. Punctuation is the main way to shape pauses.

Is it on RapidAPI?

No. Text to Speech is sold only here, paid per call with x402. You can try it free 5 times a day on the listing page.

Related

Updated 2026-12-01