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.
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.
Price: 0.023 USDC per call (x402, eip155:8453). Typical response time: 8000 ms (p95).
POST https://x402-gateway.blackwoodstate8.workers.dev/v1/text-to-speech. A request without payment gets 402 Payment Required with the
PAYMENT-REQUIRED header; any x402 client signs an EIP-3009 authorization and retries with
PAYMENT-SIGNATURE (or X-PAYMENT). Invalid input is answered with 400 and not charged.
curl -i -X POST https://x402-gateway.blackwoodstate8.workers.dev/v1/text-to-speech -H 'content-type: application/json' -d '{"text":"Hello from Blackwood State. This audio was generated on demand.","lang":"en"}'
| Pay to | 0xe46a85E0cb068A80Dd2E4553046ddCFe3FAc9650 |
|---|---|
| Asset | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 (USDC) |
| Amount | 23000 atomic units (0.023 USDC) |
| Authorization window | 60 s |
Streamable HTTP at https://x402-gateway.blackwoodstate8.workers.dev/mcp, tool blackwood_speech_synthesize. Payment goes in
_meta["x402/payment"]; without it the tool returns the payment requirements.
| Field | Type | Meaning |
|---|---|---|
text | string | Text to read aloud, e.g. Welcome to our store (up to 1000 characters) |
lang (optional) | string | Speech language: en (default), es, fr, zh, ja or ko |
Example:
{
"text": "Hello from Blackwood State. This audio was generated on demand.",
"lang": "en"
}
Real example:
{
"mimeType": "audio/wav",
"audioBase64": "UklGRl5RBQBXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YTpRBQAAAAAA...(464692 characters)",
"bytes": 348518,
"lang": "en",
"chars": 63,
"model": "@cf/myshell-ai/melotts"
}
{
"type": "object",
"properties": {
"mimeType": {
"type": "string",
"enum": [
"audio/wav",
"audio/mpeg"
]
},
"audioBase64": {
"type": "string"
},
"bytes": {
"type": "number"
},
"lang": {
"type": "string"
},
"chars": {
"type": "number"
},
"model": {
"type": "string"
},
"next": {
"type": "object",
"properties": {
"service": {
"type": "string",
"description": "Service id of the suggested next paid call"
},
"tool": {
"type": "string",
"description": "MCP tool name of the same call"
},
"method": {
"type": "string",
"enum": [
"GET",
"POST"
]
},
"url": {
"type": "string",
"description": "Paid route of the next call"
},
"useWhen": {
"type": "string",
"description": "When the next call is the right one"
},
"sample": {
"type": "string",
"description": "Free fixed sample of the whole family"
}
},
"required": [
"service",
"tool",
"method",
"url",
"useWhen",
"sample"
],
"additionalProperties": false,
"description": "Suggested next paid call in the same family (call it in a loop when the task continues)"
}
},
"required": [
"mimeType",
"audioBase64",
"bytes",
"lang",
"chars",
"model"
],
"additionalProperties": false
}Free schema and example: GET https://x402-gateway.blackwoodstate8.workers.dev/v1/text-to-speech.
OpenAPI 3.1 · llms.txt · All services