Audio translation
Translate speech in any supported language into English text.
/v1/audio/translations
Transcribes an audio file and translates it into English in one step. The endpoint follows the OpenAI Audio API (audio.translations) and accepts multipart/form-data, so the official OpenAI SDKs work unchanged with base_url set to https://rutoken.ai/v1. The usual model is whisper-1.
To keep the original language, use Speech to text.
Authentication
Send your key in the Authorization: Bearer sk-xxxx header.
Request body
Content type: multipart/form-data. All form fields are forwarded to the upstream model.
| Parameter | Type | Required | Description |
|---|---|---|---|
file |
file | Yes | Audio file: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav or webm. OpenAI limits uploads to 25 MB. |
model |
string | Yes | Model ID, e.g. whisper-1. If omitted, the request is routed as whisper-1. |
prompt |
string | No | Optional English text to guide the style of the translation. |
response_format |
string | No | json (default), text, srt, verbose_json or vtt. |
temperature |
number | No | Sampling temperature from 0 to 1. Default 0. |
Request example
curl https://rutoken.ai/v1/audio/translations \
-H "Authorization: Bearer $API_KEY" \
-F file="@interview-de.mp3" \
-F model="whisper-1"
from openai import OpenAI
client = OpenAI(base_url="https://rutoken.ai/v1", api_key="sk-xxxx")
with open("interview-de.mp3", "rb") as audio:
resp = client.audio.translations.create(model="whisper-1", file=audio)
print(resp.text)
import fs from "node:fs";
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://rutoken.ai/v1", apiKey: "sk-xxxx" });
const resp = await client.audio.translations.create({
model: "whisper-1",
file: fs.createReadStream("interview-de.mp3"),
});
console.log(resp.text);
Response
{
"text": "Thank you for having me. Today I want to talk about renewable energy."
}
| Field | Type | Description |
|---|---|---|
text |
string | English translation of the audio. |
With response_format set to text, srt or vtt, the body is plain text instead of JSON.
See also: Speech to text, Errors.