Onchain Router · Audio Speech

by Onchain Router

POSTBase

$0.002

per call · USD Coin on Base

Text-to-speech generation · 24-hour encrypted capability URL · 0% service fee launch promotion

Endpoint

POST https://onchainrouter.dev/v1/audio/speech

4

Calls / 30d

1

Unique payers / 30d

Sep 6

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://onchainrouter.dev/v1/audio/speech", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "input": "Your text to speak.",
    "model": "elevenlabs/flash-v2.5",
    "response_format": "mp3",
    "speed": 1,
    "voice": "darian"
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://onchainrouter.dev/v1/audio/speech" \
  -H "Content-Type: application/json" \
  -d '{"input":"Your text to speak.","model":"elevenlabs/flash-v2.5","response_format":"mp3","speed":1,"voice":"darian"}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "data": [
    {
      "url": "https://onchainrouter.dev/v1/media/audio/example?access=capability"
    }
  ],
  "id": "spch_example",
  "model": "elevenlabs/flash-v2.5",
  "usage": {
    "input_characters": 19
  }
}

Payment details

Pay to0xa7660dea6aadcc87cbb5e79ccd262d391e61de5d
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase
Schemesexact

Is this your API?

Pin it to the top of Media & Generation and the homepage with a featured placement.

Get featured →

More from Onchain Router & similar services