{"uid":"cap_ovMeC7rzjJbLqqHlQz2ox","slug":"x402-gateway-text-to-speech-melotts-b5f6d8b3","name":"x402-gateway Text-to-Speech (MeloTTS)","description":"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.","url":"https://x402-gateway.blackwoodstate8.workers.dev/v1/text-to-speech?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"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)","additionalProperties":false},"bytes":{"type":"number"},"chars":{"type":"number"},"model":{"type":"string"},"mimeType":{"enum":["audio/wav","audio/mpeg"],"type":"string"},"audioBase64":{"type":"string"}},"additionalProperties":false}}}}},"responseSchema":{"type":"json","example":{"lang":"en","bytes":348518,"chars":63,"model":"@cf/myshell-ai/melotts","mimeType":"audio/wav","audioBase64":"UklGRl5RBQBXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YTpRBQAAAAAA...(464692 characters)"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.023","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.023/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.023","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.023","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_EYamNyONSq1MwkI9-Hlnd","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.023","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"Read this aloud in French and give me the WAV audio: 'Bienvenue dans notre boutique, nous sommes ravis de vous accueillir.'","exampleUseCases":[{"title":"Multilingual product announcement narration","prompt":"Turn this Spanish text into a spoken audio file: 'Descubre nuestra nueva colección de primavera disponible ahora en tienda.'"},{"title":"Accessibility audio for article snippet","prompt":"Generate an English audio narration of this text so I can add it to my article: 'Climate change is accelerating at an unprecedented rate, scientists warn.'"},{"title":"Japanese language learning audio clip","prompt":"Read this Japanese sentence aloud and give me the audio file: '本日はお越しいただきありがとうございます。'"}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T18:44:38.322Z","isFirstParty":false,"canonicalSlug":"x402-gateway-text-to-speech-melotts-b5f6d8b3"}