curl --request POST \
--url https://api.example.com/v1/audio/translations \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"response_format": "<string>",
"temperature": 123
}
'{
"text": "<string>",
"language": "<string>",
"duration": 123,
"segments": [
{
"id": 123,
"text": "<string>",
"start": 123,
"end": 123,
"tokens": [
{}
],
"temperature": 123,
"avg_logprob": 123,
"compression_ratio": 123,
"no_speech_prob": 123
}
]
}curl --request POST \
--url https://api.example.com/v1/audio/translations \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"response_format": "<string>",
"temperature": 123
}
'{
"text": "<string>",
"language": "<string>",
"duration": 123,
"segments": [
{
"id": 123,
"text": "<string>",
"start": 123,
"end": 123,
"tokens": [
{}
],
"temperature": 123,
"avg_logprob": 123,
"compression_ratio": 123,
"no_speech_prob": 123
}
]
}client.audio.translations.create(params)
openai/whisper-1).json - JSON response with text onlytext - Plain textsrt - SubRip subtitle formatverbose_json - JSON with timestamps, segments, and metadatavtt - WebVTT subtitle formatjson0english) (verbose_json only).Show Segment Object
import fs from "fs";
const translation = await client.audio.translations.create({
file: fs.createReadStream("german-audio.mp3"),
model: "openai/whisper-1",
});
console.log(translation.text);