Skip to main content
POST /v1/audio/translations
Translates audio into English text. This endpoint takes audio in any supported language and outputs the transcription in English.

Request Body

This endpoint accepts multipart/form-data.
file
file
required
The audio file to translate. Supported formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm. Maximum file size is 25MB.
model
string
required
The model to use for translation (e.g., whisper-1).
prompt
string
Optional text to guide the model’s style. Should be in English.
response_format
string
default:"json"
The output format. Options: json, text, srt, verbose_json, vtt.
temperature
number
default:"0"
Sampling temperature between 0 and 1.

Response

text
string
The translated English text.

Examples

Basic Translation

from openai import OpenAI

client = OpenAI(
    api_key="sk-voidai-your_key_here",
    base_url="https://api.voidai.app/v1"
)

# Translate French audio to English
with open("french_audio.mp3", "rb") as audio_file:
    translation = client.audio.translations.create(
        model="whisper-1",
        file=audio_file
    )

print(translation.text)

With Prompt Guidance

with open("japanese_meeting.mp3", "rb") as audio_file:
    translation = client.audio.translations.create(
        model="whisper-1",
        file=audio_file,
        prompt="This is a business meeting discussion about quarterly sales."
    )

SRT Subtitles in English

with open("german_video.mp3", "rb") as audio_file:
    translation = client.audio.translations.create(
        model="whisper-1",
        file=audio_file,
        response_format="srt"
    )

# Save English subtitles
with open("english_subtitles.srt", "w") as f:
    f.write(translation)

Response Example

{
  "text": "Hello, welcome to our presentation. Today we will discuss the new features of our product."
}

Supported Languages

The translation endpoint accepts audio in any of the following languages and translates to English:
LanguageCodeLanguageCode
AfrikaansafKoreanko
ArabicarLatvianlv
ChinesezhLithuanianlt
CzechcsMalayms
DanishdaNorwegianno
DutchnlPolishpl
FinnishfiPortuguesept
FrenchfrRomanianro
GermandeRussianru
GreekelSpanishes
HebrewheSwedishsv
HindihiThaith
HungarianhuTurkishtr
IndonesianidUkrainianuk
ItalianitVietnamesevi
Japaneseja
Unlike transcription, translation always outputs English text regardless of the input language.