Developer Documentation
Integrate ECHO's powerful translation engines into your applications. Our API offers speech-to-speech, text-to-speech, speech-to-text, and comprehensive document translation endpoints.
Authentication
Authenticate your requests by including your Client ID and Client Secret in the HTTP headers. You can manage your credentials in the API Keys Dashboard.
X-Client-Id: your_client_id_here X-Client-Secret: your_client_secret_here
Note: API requests are metered in USD and deduct from your universal wallet balance. Keep your balance topped up to ensure uninterrupted service!
Core Endpoints
Translate Text (Text to Text)
POST/api/v1/translation/text/Translates text instantaneously from a source language to a target language.
{
"text": "Hello, how are you?",
"source_language": "en",
"target_language": "es"
}{
"success": true,
"original_text": "Hello, how are you?",
"translated_text": "Hola, ¿cómo estás?",
"source_language": "en",
"target_language": "es",
"cost_incurred": 0.0015
}Payload Descriptions
textRequiredThe raw text string you want to translate.
source_languageOptionalISO code (e.g., 'en'). If omitted, the API will attempt to auto-detect the language.
target_languageRequiredISO code of the language you want to translate the text into.
Translate Speech (Speech to Speech)
POST/api/v1/translation/speech/sts/Accepts base64 encoded audio and returns translated synthesized audio using Voice Cloning.
{
"audio_base64": "UklGRiQAAABXQVZFZm10IBAAAA...",
"source_language": "auto",
"target_language": "fr"
}{
"success": true,
"audio_url": "https://cdn.letecho.com/...",
"transcript": "Hello world",
"translation": "Bonjour le monde",
"cost_incurred": 0.08
}Payload Descriptions
audio_base64RequiredThe base64 encoded audio string representing the source audio file.
source_languageOptionalISO code. If 'auto' or omitted, the API will auto-detect the spoken language.
target_languageRequiredISO code of the language you want to translate the speech into.
Transcribe Speech (Speech to Text)
POST/api/v1/translation/speech/stt/Accepts an audio file and returns the translated text transcription.
audio_file: <File.mp3> source_language: "es" target_language: "en"
{
"success": true,
"original_text": "Buenos días",
"translated_text": "Good morning",
"cost_incurred": 0.03
}Payload Descriptions
audio_fileRequiredThe raw audio file uploaded via Multipart/form-data.
source_languageOptionalISO code. If omitted, the API will attempt to auto-detect the spoken language.
target_languageRequiredISO code of the language you want to transcribe the speech into.
Synthesize Speech (Text to Speech)
POST/api/v1/translation/speech/tts/Accepts text payload and synthesizes high-quality audio in the target language.
{
"text": "The weather is nice today.",
"target_language": "de",
"voice_id": "echo_neutral_01"
}{
"success": true,
"audio_url": "https://cdn.letecho.com/...",
"duration_seconds": 3.4,
"cost_incurred": 0.005
}Payload Descriptions
textRequiredThe text you want to synthesize into speech.
target_languageRequiredISO code of the language to synthesize.
voice_idOptionalSpecific voice model identifier (e.g., 'echo_neutral_01').
Common Error Responses
{
"success": false,
"error": "Missing required field: target_language"
}{
"success": false,
"error": "Insufficient wallet balance. Please recharge to continue using the API."
}Document Processing (Async)
Asynchronous Translation
For large documents (PDF, DOCX, DOC, CSV, XLSX, XLS) or lengthy media files, processing cannot happen instantly. These requests are handled asynchronously. You submit the document, receive a job ID immediately, and ECHO fires a Webhook to your server when the translation is complete.
Translate Document
POST/api/v1/translation/document/document: <File.pdf> source_language: "auto" target_language: "fr" webhook_url: "https://your-domain.com/webhook"
{
"success": true,
"job_id": "doc_8f73b2a9c1",
"status": "processing",
"message": "Document accepted. Webhook will be fired upon completion."
}Payload Descriptions
documentRequiredThe file to be translated. Accepted formats:
.pdf.docx.doc.csv.xlsx.xls. Uploaded viamultipart/form-data.target_languageRequiredISO 639-1 code of the target language.
webhook_urlRequiredURL to receive the translated payload when processing is completed asynchronously.
source_languageOptionalOriginal language ISO code. Defaults to "auto" for auto-detection.
Supported File Types
Only the formats listed below are accepted. Requests with any other file type will be rejected with a 400 error.
Documents
Document Translation APIText-based and scanned PDFs
Word (DOCX)
Microsoft Word 2007+
Word (DOC)
Microsoft Word legacy
CSV
Comma-separated values — text cells only
Excel (XLSX)
Excel 2007+ workbook
Excel (XLS)
Excel legacy workbook
Audio
Speech APIsWAV
Lossless — best quality
MP3
Most common compressed format
MP4
Audio stream extracted from video
WebM
Browser-recorded audio
Opus
Low-latency compressed audio
OGG
Open container format
CSV & Excel note: Only cells containing natural-language text are translated. Numeric values, dates, and formulas are preserved as-is.
Webhooks & Security
Long-running document tasks notify your server upon completion via Webhooks. ECHO signs webhook events so you can verify they originated securely from us.
1. Signature Verification
We include an X-Echo-Signature header with every webhook payload. The signature is an HMAC SHA-256 hash of the raw request body using your Client Secret as the key. Always verify this signature to prevent replay attacks and spoofing.
Node.js
import crypto from 'crypto';
const verifyWebhook = (reqBody, signature, secret) => {
const hash = crypto.createHmac('sha256', secret)
.update(reqBody)
.digest('hex');
return hash === signature;
};Python
import hmac
import hashlib
def verify_webhook(req_body: bytes, signature: str, secret: str) -> bool:
expected = hmac.new(
secret.encode('utf-8'),
req_body,
hashlib.sha256
).hexdigest()
return hmac.compare_digest(expected, signature)2. Webhook Event Payload
When the document processing completes, ECHO sends a POST request to your specified `webhook_url` containing the final file location. Your endpoint must respond with a `200 OK`.
{
"event_type": "document.translation.completed",
"job_id": "doc_8f73b2a9c1",
"data": {
"status": "success",
"document_type": "t2t",
"source_language": "en",
"target_language": "fr",
"original_file_name": "report.pdf",
"translated_file_url": "https://cdn.letecho.com/docs/translated_report.pdf",
"cost_incurred": 0.45
},
"created_at": "2026-06-14T21:15:00Z"
}Payload Structure
event_typeIdentifies the type of webhook. E.g., document.translation.completed, audio.translation.completed, or *.failed.
data.document_typeThe type of translation performed. Options: t2t, s2s, t2s, s2t.
data.translated_file_urlThe secure URL to download the translated document or audio. Expires in 24 hours.