Skip to main content
Transcription and translation upload audio files and return text, not synthesized speech. OpenAI-compatible translation means audio-to-English, not translation into an arbitrary target language. For another language, transcribe first and send the text to a translation-capable chat model. A transcription model may not support the translation endpoint.

Upload a recording

Set API_BASE_URL (including /v1), API_KEY, and API_MODEL using the Python SDK guide. Set API_AUDIO_PATH to a local recording. Save as transcribe.py and run python transcribe.py transcribe. After selecting a translation-capable model, run python transcribe.py translate. Running this uploads the recording. The example accepts nonempty files up to 20 MiB, a client example limit rather than a universal model limit. Keep the correct filename extension and confirm codec support. The SDK manages the multipart boundary; file contains bytes, not a local-path string or remote URL.

Response formats and long recordings

This example uses response_format: json and reads text. Silence may produce an empty string; let the application decide whether to accept it. text, srt, and vtt produce text responses, not JSON objects with a text field. For timestamps, confirm support for verbose_json and timestamp_granularities[]. Timestamps and speaker diarization are not universal capabilities. language hints at the transcription input language; it does not select the translation target. prompt provides context. Split long recordings to fit service limits, preserve time offsets, and handle overlapping text. Reverse proxies, gateways, and channels can impose smaller upload limits than the model. This page uses non-SSE responses for recorded files. Streaming transcription, speaker events, and realtime audio protocols require separate channel verification; do not parse them as Chat Completions events. Reference: OpenAI file transcription and translation. 简体中文 Related guide: Audio conversation input