{"uid":"cap_BJeA9_1859wm13-hMjmyB","slug":"dub-translate-and-speak-13591b0b","name":"Dub: Translate and Speak","description":"Translate a text into a target language and speak the translation, in one paid call. The translation runs on the /v1/chat/completions gateway tier and the speech on /api/tts (tier \"standard\", $0.140) or /api/tts-hd (tier \"hd\", $0.260); the price is the sum of the two.","url":"https://agent402.tools/api/dub?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"json":{"type":"boolean"},"text":{"type":"string"},"tier":{"type":"string"},"voice":{"type":"string"},"format":{"type":"string"},"sourceLanguage":{"type":"string"},"targetLanguage":{"type":"string"}}},"responseSchema":{"type":"json","example":{"tier":"standard","audio":"<base64-encoded audio>","chars":58,"model":"elevenlabs/eleven-v4-turbo","voice":"sarah","format":"mp3","translation":"Hola desde Agent402. Cada herramienta se paga por llamada.","targetLanguage":"es","translationModel":"openai/gpt-4o-mini","detectedSourceLanguage":"en"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.14","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","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.14/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.14","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.14","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_zTTxoFzsB_HxUjHGbQ6g4","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.14","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Translates text from one language to another and synthesizes the translation as spoken audio in a single API call.","exampleAgentPrompt":"Translate 'Hello from Agent402. Each tool is paid per call.' into Spanish and speak it using the standard tier with Sarah's voice in MP3 format.","exampleUseCases":[{"title":"Multilingual customer support audio","prompt":"Take this support message — 'Your order has been shipped and will arrive in 3 business days.' — translate it into French and generate an MP3 audio file of the translation using the standard tier and the default voice."},{"title":"Language learning pronunciation guide","prompt":"Translate 'Good morning, how are you today?' into Japanese and speak it out loud using the HD tier so I can hear a high-quality pronunciation."},{"title":"Dubbed product announcement clip","prompt":"I need to dub our English tagline 'Discover the future of mobility' into German — please translate it and give me the spoken audio in MP3 using the standard voice Sarah."}],"resultDescription":"Returns a JSON object containing the translated text, a base64-encoded audio file of the spoken translation, the detected source language, target language, character count, audio format, TTS model used (e.g. elevenlabs/eleven-v4-turbo), voice name, and TTS tier (standard or hd).","failureModes":["Unsupported target language code returns an error or garbled output","Invalid voice name causes TTS to fail or fall back to a default","Missing text field returns a validation error","Unsupported audio format may be rejected","Network timeout during TTS synthesis for very long texts","Payment failure (HTTP 402) if USDC balance is insufficient"],"whenToPreferThis":"Choose this endpoint when you need both translation and text-to-speech in a single atomic call, avoiding the overhead of chaining two separate APIs. It is ideal for dubbing messages, producing multilingual audio snippets, or building voice-enabled multilingual workflows where latency and simplicity matter. Prefer the HD tier ($0.260) when audio quality is critical, or standard ($0.140) for cost-sensitive bulk use.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T07:43:36.140Z","isFirstParty":false,"canonicalSlug":"dub-translate-and-speak-13591b0b"}