# Onchain Router Text-to-Speech

> Onchain Router Text-to-Speech is a paid API for AI agents from onchainrouter.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Converts text input to spoken audio using ElevenLabs Flash v2.5, returning a 24-hour encrypted capability URL to an MP3 file

## Facts

- Endpoint: POST https://onchainrouter.dev/v1/audio/speech
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/onchain-router-text-to-speech-2eb60194
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_z7pZtFgC506PLQSMHvGT6

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability onchain-router-text-to-speech-2eb60194 -d '<json body>'
```

Example prompt: Can you read out this product description using the 'darian' voice at normal speed and give me the MP3: 'Introducing the world's most comfortable running shoe — engineered for speed and built for endurance.'

## When to prefer this

Choose this endpoint when you need fast, high-quality speech synthesis via ElevenLabs Flash v2.5 with a selection of 20 named voices, and want to pay per call in USDC via x402 with no subscription. Prefer this over alternatives when operating in an onchain or crypto-native payment context, or when a 24-hour hosted MP3 URL is sufficient for your use case.

## Known failure modes

- Input text exceeds 2000 character limit — request rejected with validation error
- Invalid voice alias not in the allowed enum — returns schema validation error
- Speed value outside 0.7–1.2 range or not a multiple of 0.001 — rejected
- Insufficient USDC balance for x402 payment — payment authorization fails
- Capability URL expires after 24 hours — audio is no longer accessible
- Model field set to unsupported value — returns enum validation error

## How this service works

Give agents provider-neutral access to text, image, and speech models with USDC payments on Base, local spending controls, ambiguity-safe recovery, and verified receipts. Stable public npm clients and MIT agent integrations are available now.

## Output

A JSON object containing a speech ID, the model used, character usage count, and a time-limited (24-hour) encrypted capability URL pointing to the generated MP3 audio file hosted on onchainrouter.dev.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "input": {
   "type": "string",
   "maxLength": 2000,
   "minLength": 1
  },
  "model": {
   "enum": [
    "elevenlabs/flash-v2.5"
   ],
   "type": "string"
  },
  "speed": {
   "type": "number",
   "maximum": 1.2,
   "minimum": 0.7,
   "multipleOf": 0.001
  },
  "voice": {
   "enum": [
    "darian",
    "talia",
    "elara",
    "baxter",
    "eldrin",
    "kellan",
    "elowen",
    "kaelen",
    "lawrence",
    "alicia",
    "maisie",
    "warren",
    "jade",
    "eddie",
    "caleb",
    "sawyer",
    "finley",
    "florence",
    "wyatt",
    "bella"
   ],
   "type": "string",
   "description": "Optional public alias; omission uses the selected model's default voice."
  },
  "response_format": {
   "enum": [
    "mp3"
   ],
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

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

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onchain-router-text-to-speech-2eb60194/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from onchainrouter.dev](https://www.zero.xyz/host/onchainrouter.dev/llms.txt)
