Create transcription
Changed onTranscribes audio into text. Accepts base64-encoded audio input as JSON, an OpenAI-style multipart/form-data file upload, or a URL the provider downloads directly, and returns the transcribed text.
Request
- Base URLhttps://openrouter.ai/api/v1
- AuthHTTP bearer
Request body
Speech-to-text request input. Accepts a JSON body with input_audio containing base64-encoded audio or a URL the provider downloads.
Label each word with the speaker who said it. Speaker labels are returned on the words array (speaker, speaker_label), so response_format must be "verbose_json" (a "json" request is rejected with a 400) and word timestamps are included even when timestamp_granularities omits "word". Only supported by some providers; the request is rejected with a 400 when the selected model cannot diarize. Providers may charge extra.
Audio to transcribe: inline base64 bytes, or a URL the provider downloads directly.
Domain terms, names, or phrases to bias recognition toward. Only supported by some providers; the request is rejected with a 400 when the selected model cannot use keyterms. Providers may cap the number of terms or characters per term and may charge extra.
ISO-639-1 language code (e.g., "en", "ja"). Auto-detected if omitted.
STT model identifier
Context to guide transcription, such as domain vocabulary or a previous segment. Honored by OpenAI (except gpt-4o-transcribe-diarize), Azure OpenAI, Groq, Together, Alibaba, and AssemblyAI endpoints with prompted pricing configured. Other providers ignore it; use keyterms for supported keyword boosting. Takes precedence over provider-specific prompt options, including when empty.
Provider configuration: provider routing preferences (order, only, ignore, allow_fallbacks), data policy routing preferences (zdr, data_collection) and provider-specific passthrough options
Output format. "json" (default) returns { text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers.
A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.
Sampling temperature for transcription
Timestamp detail levels to include when response_format is "verbose_json". "segment" returns segment-level timestamps; "word" additionally returns word-level timestamps in the words array. Ignored unless response_format is "verbose_json".
Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider.
Example request
{
"input_audio": {
"data": "UklGRiQA...",
"format": "wav"
},
"language": "en",
"model": "openai/whisper-large-v3"
}Response
Transcription result
STT response containing transcribed text and optional usage statistics
Provider confidence for the whole transcript from 0 to 1, present when response_format is verbose_json and the provider scores the full transcript
Duration of the input audio in seconds, present when response_format is verbose_json
Detected entities with character offsets into text, present when the provider runs entity detection
Detected or forced language, present when response_format is verbose_json
Provider confidence in the detected language from 0 to 1, present when response_format is verbose_json and the provider scores language detection
Timestamped transcript segments, present when response_format is verbose_json
The task performed, present when response_format is verbose_json
The transcribed text
Aggregated usage statistics for the request
Timestamped words, present when the provider returns word-level timestamps
Example response
{
"text": "Hello, this is a test of OpenAI speech-to-text transcription.",
"usage": {
"cost": 0.000508,
"input_tokens": 83,
"output_tokens": 30,
"seconds": 9.2,
"total_tokens": 113
}
}Changes
- info
added the new optional request property
provider/options/celeris - info
added the new
Celerisenum value to the request propertyprovider/ignore/items/anyOf[#/components/schemas/ProviderName] - info
added the new
Celerisenum value to the request propertyprovider/only/items/anyOf[#/components/schemas/ProviderName]
1 more change in this revision
- info