Skip to content
github-actions[bot] edited this page Aug 18, 2026 · 4 revisions

Text-to-Speech

Payment wires: every paid endpoint accepts x402 and MPP (Machine Payments Protocol) on the same 402 - see Paying with x402 and Paying with MPP. Agent402 is the applied layer of Agentic Finance: agents that pay and get paid on their own.

Acceptable use. Hosted-instance traffic is governed by the Terms of Service — including a generative-content acceptable-use policy — and by the upstream model providers' usage policies. Wallets used for prohibited content are blocked before settlement. Outputs are generated by third-party models from your inputs; you are responsible for how you use them.

Two tiers of text-to-speech, paywalled via x402. Send text, get back base64-encoded audio. 10 voices, 6 output formats. The operator's OPENAI_API_KEY handles upstream auth.

Tiers

Endpoint Price Model Quality Text cap
POST /api/tts $0.05 tts-1 Standard (fast) 2,000 chars
POST /api/tts-hd $0.10 tts-1-hd HD (higher fidelity) 2,000 chars

Both tiers are wallet-only — every call burns real upstream TTS credit. See Security Model.

Voices

alloy (default), ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer

Output formats

mp3 (default), opus, aac, flac, wav, pcm

Request / Response

// Request
{ "text": "Hello from Agent402!", "voice": "alloy", "format": "mp3" }

// Response
{ "model": "tts-1", "provider": "openai", "voice": "alloy", "format": "mp3",
  "audio": "<base64-encoded audio>", "chars": 20 }

Only text is required. voice defaults to alloy, format defaults to mp3.

See also

Clone this wiki locally