Speech to text
OpenAI-compatible
Speech to text
POST /v1/audio/transcriptions — Whisper / GPT-4o transcribe
POST
Speech to text
Transcribe an audio file into text.
Request
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
file | file | ✅ | Audio file; supports mp3 / mp4 / mpeg / mpga / m4a / wav / webm, max 25MB |
model | string | ✅ | whisper-1 / gpt-4o-transcribe / gpt-4o-mini-transcribe |
language | string | ISO-639-1 language code, e.g. zh / en / ja; leave empty to auto-detect | |
prompt | string | A guiding hint for domain / proper nouns / spelling | |
response_format | string | json (default) / text / srt / verbose_json / vtt | |
temperature | number | 0-1 | |
timestamp_granularities[] | array | word / segment; requires verbose_json |
Response
response_format: "json":
response_format: "verbose_json":
srt / vtt return subtitle text (save directly as .srt / .vtt).
Python
Long-audio strategy
- Whisper has a 25MB single-file limit; split long audio in advance (5-10 minutes per segment recommended).
- Use
promptto pass the tail text of the previous segment to keep context coherent. - A tool like
ffmpeg -i input.mp3 -f segment -segment_time 600 part_%03d.mp3can split quickly.