Agent402 / tools / tts-lite

Text-to-speech (lite)

$0.005 per call · USDC via x402 · POST /api/tts-lite

Convert text to speech with Kokoro-82M, ten times cheaper than /api/tts. Returns base64-encoded mp3 or pcm. The same request shape and the same ten OpenAI voice names as /api/tts, mapped to Kokoro's own voices; the voice is synthetic-sounding where the OpenAI tiers are not, which is the whole trade. Use this for high-volume narration, notifications and agent speech where the cost per call matters more than the timbre; use /api/tts or /api/tts-hd when it does not. No API key needed; pay per call via x402. Text capped at 2000 chars.

TRY IN PLAYGROUND →

Input

FieldTypeDescription
text *stringText to convert to speech (max 2000 chars)
voicestringVoice: alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer (default: alloy) - mapped to the nearest Kokoro voice, which is named back in the response
formatstringAudio format: mp3 or pcm (default: mp3). The other formats are on /api/tts

Example output

{
  "model": "hexgrad/kokoro-82m",
  "provider": "openrouter",
  "voice": "af_alloy",
  "format": "mp3",
  "audio": "<base64-encoded audio>",
  "chars": 20
}

Try it - see the 402 challenge (free)

curl -i -X POST https://agent402.tools/api/tts-lite \
  -H "Content-Type: application/json" \
  -d '{"text":"Hello from Agent402!","voice":"alloy","format":"mp3"}'

The response is HTTP 402 Payment Required with exact payment requirements. Any x402 v2 client pays automatically and retries:

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
import { metaTitle, metaDescription } from "./seo-meta.js";

const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/tts-lite", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "text": "Hello from Agent402!",
    "voice": "alloy",
    "format": "mp3"
  }),
});
Wallet-only. This tool reaches the network/browser/storage, so it is paid in USDC via x402 (no proof-of-work tier).

Related tools

LLM inference

$0.010 · POST /api/llm

LLM inference proxy - send an OpenAI-format chat/completions request and get a response from GPT-4o-mini. Supports visio…

try in playground →

LLM inference (Pro)

$0.100 · POST /api/llm-pro

LLM inference proxy (Pro tier) - GPT-4o or GPT-4.1. Supports vision (up to 2 image URLs) and structured output (response…

try in playground →

LLM inference (Premium)

$0.500 · POST /api/llm-premium

LLM inference proxy (Premium tier) - o3 or o3-mini reasoning models. Supports vision (up to 2 image URLs) and structured…

try in playground →