Swagger Petstore - OpenAPI 3.0
POST/audio/translations

Translate audio to English

Translates audio into English text. Send the request as multipart/form-data with the audio file in the file field. Supply file and model at minimum — prompt and response_format are optional. Returns a translation object with the English text.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

5 body fields

Translation request. file and model are required; all other fields are optional.

filestringrequired
The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. The request must include enough format metadata for the file to be identified. We recommend an extension-bearing filename and an appropriate content type.
modelstringrequired
ID of the model to use. Only `whisper-1` (which is powered by our open source Whisper V2 model) is currently available.
promptstringoptional
An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text#prompting) should be in English.
response_formatstringoptional
The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.
Allowed:jsontextsrtverbose_jsonvttDefault:json
temperaturenumberoptional
The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
Default:0

2 status codes
200Returns a translation object containing the English text and metadata such as language, duration, and segments depending on the response format.
textstringrequired
429Returned when the request rate limit is exceeded.
errorobjectrequired

Error handling

file is required and must be an audio file in one of the supported formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. model is required and must be whisper-1. temperature must be between 0 and 1. response_format must be one of: json, text, srt, verbose_json, or vtt. A 429 is returned when the request rate limit is exceeded.