File-level translation for offline transcription.
Translation is available now on the batch-jobs plane. Declare the target languages once when you submit the job; the set is frozen for the whole job.
Request
Send target_languages (array, max 8) or translate_to (single-language shorthand):
curl -X POST https://audio.lansonai.com/v1/audio/transcriptions/jobs \
-H "Authorization: Bearer sk-..." \
-H "Content-Type: application/json" \
-d '{
"audio_url": "https://cdn.example.com/audio.wav",
"language": "zh",
"target_languages": ["en", "ja"]
}'| Parameter | Description |
|---|---|
language | Source language of the audio (optional; auto-detected when omitted) |
target_languages | Target languages (BCP-47, max 8). Each language is billed separately. |
translate_to | Single-language shorthand for target_languages: [translate_to]. Ignored when target_languages is present. |
Omit both fields to get transcription only, without translation.
Output
Each target language produces one track with per-segment timestamps:
{
"result": {
"segments": [
{ "id": 0, "start_time": 0.0, "end_time": 3.2, "duration": 3.2, "text": "今天天气很好" }
],
"translations": [
{
"language": "en",
"text": "The weather is nice today.",
"segments": [
{
"id": 0,
"start_time": 0.0,
"end_time": 3.2,
"duration": 3.2,
"text": "The weather is nice today.",
"source_text": "今天天气很好"
}
],
"failed_batches": 0
}
],
"metadata": {
"translation": {
"target_languages": ["en"],
"model": "deepseek/deepseek-v4.1-flash-1017",
"failed_batches": 0,
"usage": {
"calls": 1,
"prompt_tokens": 120,
"completion_tokens": 24,
"total_tokens": 144
}
}
}
}
}translations[].segments corresponds 1:1 to the source sentence units (same id and timestamps). A failed batch is retried once; if it still fails, its lines are omitted from the track and failed_batches is incremented. One language failing never blocks another.
Billing
Translation is billed per target language × processed audio duration at the recorded translation add-on rate. See API pricing. Token usage is reported in result.metadata.translation.usage for observability; it is not a separate line item.
Related
- Transcribe Audio — submit a job
- Batch Jobs API — full request/response contract
- Live Translation — translation concepts
- Realtime Translation — real-time translation