Speech-to-Text
Transcribe audio to text. Drop-in replacement for POST /v1/audio/transcriptions. Model availability, supported formats, and billing depend on the selected model.
POST/v1/audio/transcriptions
Content type
multipart/form-data. The audio file is sent as a form field named file.
Form fields
| Name | Type | Required | Description |
|---|---|---|---|
model | string | Required | Standard model alias. Must declare transcription capability. See supported models below. |
file | file | Required | Audio file to transcribe. Supported formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm. Max 25 MB. |
language | string | ISO-639-1 language code (e.g. en, zh, fr). Auto-detected when omitted. Providing the language improves accuracy and latency. | |
prompt | string | Optional context text to guide the model. Useful for proper nouns or domain-specific terminology. | |
response_format | string | Output format: json (default), text, srt, verbose_json, vtt. | |
temperature | number | Sampling temperature between 0 and 1. Higher values increase variation. Default 0. |
Response
For response_format=json (default), returns a JSON object with a text field containing the transcript and a duration field (seconds, used for billing). Status 200 on success.
Quick start
Python
from openai import OpenAI
client = OpenAI(
base_url="https://api.therouter.ai/v1",
api_key="YOUR_API_KEY",
)
with open("audio.mp3", "rb") as f:
transcript = client.audio.transcriptions.create(
model="openai/whisper-1",
file=f,
)
print(transcript.text)
The formerly listed
alibaba/sensevoice-small model is not in the current catalog. Do not rely on it as an automatic fallback; check the current model catalog and your routing configuration.Supported models
| Name | Type | Required | Description |
|---|---|---|---|
openai/whisper-1 | transcription | Whisper transcription; see the model page for current availability and price. | |
openai/gpt-4o-transcribe | transcription | GPT-4o transcription; supported formats and features vary by model. | |
openai/gpt-4o-mini-transcribe | transcription | GPT-4o mini transcription; consult the current model catalog. |
Review the current model pricing and billing unit in the model catalog. Do not assume a missing duration field means a request is free.