TokenLab

Audio & Realtime

Create Translation

Translates audio into English text

POST
/v1/audio/translations

Overview

Translates audio in any supported language into English text. Unlike transcription, this endpoint always outputs English text regardless of the input language.

This endpoint translates audio into English. Do not send language; it is not supported for audio translation and can return unsupported_parameter. For text translation, use POST /v1/translations; recommended_for=translation refers to that text API.

Request Body

Translation returns when processing finishes. For longer audio, allow an HTTP client timeout of at least 120s.

filefilerequired

The audio file to translate. Supported formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm. Maximum file size is 25 MB.

modelstringdefault: whisper-1

Audio translation model ID, such as whisper-1. Confirm that its current model details support POST /v1/audio/translations.

promptstring

An optional text to guide the model's style or continue a previous segment. Should be in English.

response_formatstringdefault: json

Output format. Whisper supports json, text, srt, verbose_json, and vtt; other models may support a different subset. Check the selected model's details.

temperaturenumber

Sampling temperature from 0 to 1, only for models that support this parameter.

Response

The fields below describe JSON transcript or translation responses. text, srt, and vtt return raw text or subtitles rather than a JSON object. Additional fields depend on the model and output format.

textstring

The translated text in English.

For verbose_json format, the response also includes:

languagestring

Language label reported in the response, when provided.

durationnumber

The duration of the input audio in seconds.

segmentsarray

Segments of the translated text with timestamps.

Request

curl -X POST "https://api.tokenlab.sh/v1/audio/translations" \
  -H "Authorization: Bearer sk-your-api-key" \
  -F "file=@german_audio.mp3" \
  -F "model=whisper-1"

Response

{
  "text": "Hello, my name is Wolfgang and I come from Germany. Where are you from?"
}

Translation vs Transcription

FeatureTranslationTranscription
Output languageAlways EnglishSame as input
Use caseConvert foreign audio to EnglishPreserve original language
Language parameterNot applicableOptional hint

Authorization

BearerAuth
AuthorizationBearer <token>

API Key authentication. Create or manage API keys in Dashboard > API > API Keys.

In: header

Headers

X-TokenLab-Delivery-Policy?string

Per-request Delivery policy. Overrides the API key and Workspace defaults. Auto tries TokenLab Verified first and may switch once to Official only before output, request acceptance, or persistent resource creation.

Value in

  • "auto"
  • "verified"
  • "official"

Request Body

multipart/form-data

Response

application/json

application/json

application/json

application/json

application/json

application/json