# x402-gateway Text-to-Speech (MeloTTS)

> x402-gateway Text-to-Speech (MeloTTS) is a paid API for AI agents from x402-gateway.blackwoodstate8.workers.dev, paid per call via x402, $0.023/call, status unknown (last checked 2026-10-22).

Converts short text (up to 1000 characters) into WAV audio using MeloTTS on Workers AI, returning base64-encoded audio in one of six languages, billed at $0.023 USDC per call.

## Facts

- Endpoint: POST https://x402-gateway.blackwoodstate8.workers.dev/v1/text-to-speech?utm_source=zero.xyz
- Price: $0.023/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-22
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-gateway-text-to-speech-melotts-b5f6d8b3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ovMeC7rzjJbLqqHlQz2ox

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 x402-gateway-text-to-speech-melotts-b5f6d8b3 -d '<json body>'
```

Example prompt: Read this aloud in French and give me the WAV audio: 'Bienvenue dans notre boutique, nous sommes ravis de vous accueillir.'

## When to prefer this

Choose this endpoint when you need a quick, low-cost, multilingual text-to-speech conversion for short texts (under 1000 characters) without needing voice cloning, SSML markup, a specific speaker voice, or audio longer than roughly two minutes. It is well-suited for on-demand narration in six languages billed per call with no subscription required.

## Known failure modes

- Text exceeds 1000-character limit — request rejected with validation error
- Unsupported language code provided — returns error indicating valid options (en, es, fr, zh, ja, ko)
- Empty or missing 'text' field — schema validation failure
- Payment not provided or insufficient USDC balance — x402 payment required error
- Timeout or Workers AI backend unavailability — 5xx error after ~8 seconds
- Text contains only whitespace — likely rejected by minLength:1 constraint

## How this service works

Use when you need text to speech, tts, a voice audio file or spoken narration of a short text. Do not use for voice cloning, a chosen voice, SSML or audio longer than about two minutes. Returns JSON with text to speech (TTS): your text read aloud as WAV voice audio (base64, 44.1 kHz mono) by MeloTTS on Workers AI, in English, Spanish, French, Chinese, Japanese or Korean for 0.023 USDC per call. Typical response time 8000 ms (p95). Category: Media.

## Output

A JSON object containing the base64-encoded WAV audio (44.1 kHz mono), the MIME type (audio/wav), byte count, character count, language code, and model name used. May also include a 'next' field suggesting a follow-up paid call in the same service family.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "text"
     ],
     "properties": {
      "lang": {
       "enum": [
        "en",
        "es",
        "fr",
        "zh",
        "ja",
        "ko"
       ],
       "type": "string",
       "description": "Speech language: en (default), es, fr, zh, ja or ko"
      },
      "text": {
       "type": "string",
       "maxLength": 1000,
       "minLength": 1,
       "description": "Text to read aloud, e.g. Welcome to our store (up to 1000 characters)"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "mimeType",
      "audioBase64",
      "bytes",
      "lang",
      "chars",
      "model"
     ],
     "properties": {
      "lang": {
       "type": "string"
      },
      "next": {
       "type": "object",
       "required": [
        "service",
        "tool",
        "method",
        "url",
        "useWhen",
        "sample"
       ],
       "properties": {
        "url": {
         "type": "string",
         "description": "Paid route of the next call"
        },
        "tool": {
         "type": "string",
         "description": "MCP tool name of the same call"
        },
        "method": {
         "enum": [
          "GET",
          "POST"
         ],
         "type": "string"
        },
        "sample": {
         "type": "string",
         "description": "Free fixed sample of the whole family"
        },
        "service": {
         "type": "string",
         "description": "Service id of the suggested next paid call"
        },
        "useWhen": {
         "type": "string",
         "description": "When the next call is the right one"
        }
       },
       "description": "Suggested next paid call in the same family (call it in a loop when the task continues)"
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "lang": "en",
  "bytes": 348518,
  "chars": 63,
  "model": "@cf/myshell-ai/melotts",
  "mimeType": "audio/wav",
  "audioBase64": "UklGRl5RBQBXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YTpRBQAAAAAA...(464692 characters)"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-gateway-text-to-speech-melotts-b5f6d8b3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-gateway.blackwoodstate8.workers.dev](https://www.zero.xyz/host/x402-gateway.blackwoodstate8.workers.dev/llms.txt)
