curl --request POST \
--url https://api.example.com/v1/audio/transcriptions \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"language": "<string>",
"prompt": "<string>",
"response_format": "<string>",
"temperature": 123
}
'{
"text": "<string>",
"language": "<string>",
"duration": 123,
"words": [
{
"word": "<string>",
"start": 123,
"end": 123
}
],
"segments": [
{
"id": 123,
"text": "<string>",
"start": 123,
"end": 123,
"tokens": [
{}
],
"temperature": 123,
"avg_logprob": 123,
"compression_ratio": 123,
"no_speech_prob": 123
}
],
"usage": {
"type": "<string>",
"seconds": 123,
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123
},
"logprobs": [
{}
]
}curl --request POST \
--url https://api.example.com/v1/audio/transcriptions \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"language": "<string>",
"prompt": "<string>",
"response_format": "<string>",
"temperature": 123
}
'{
"text": "<string>",
"language": "<string>",
"duration": 123,
"words": [
{
"word": "<string>",
"start": 123,
"end": 123
}
],
"segments": [
{
"id": 123,
"text": "<string>",
"start": 123,
"end": 123,
"tokens": [
{}
],
"temperature": 123,
"avg_logprob": 123,
"compression_ratio": 123,
"no_speech_prob": 123
}
],
"usage": {
"type": "<string>",
"seconds": 123,
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123
},
"logprobs": [
{}
]
}client.audio.transcriptions.create(params)
openai/whisper-1).en, es, fr). Supplying the input language in will improve accuracy and latency.json - JSON response with text onlytext - Plain textsrt - SubRip subtitle formatverbose_json - JSON with timestamps, segments, and metadatavtt - WebVTT subtitle formatjson0Show Segment Object
Show Usage Object
duration or tokens depending on billing model.gpt-4o-transcribe and gpt-4o-mini-transcribe if logprobs is added to the include array.import fs from "fs";
const transcription = await client.audio.transcriptions.create({
file: fs.createReadStream("audio.mp3"),
model: "openai/whisper-1",
});
console.log(transcription.text);