Create a transcription
/v1/audio/transcriptionsCreate a transcription.
Compatible with OpenAI's create-transcription endpoint: upload an audio file as multipart/form-data and get its text back. The provider is the one behind your credential; Sarvam and ElevenLabs answers are returned in the same shape. The file must have an audio/* content type and be at most 25 MB (1 GB on ElevenLabs), else a 400. With stream=true the response is a text/event-stream of the provider's transcription events (OpenAI only; another provider is a 501).
Authenticate with a BYOK virtual key or with x-provider and x-api-key; a PLATFORM virtual key is a 400. The key's checks, the plan's limits and the organization's approved-provider policy (403) apply. The call is priced on the audio's duration (the audio_duration_seconds you send, else the duration the provider reports) and the cost is in the x-operation-cost-usd response header. Without x-retry-count a failed call is retried up to 3 times on 429 and 5xx; a stream is not retried.
Authorization
AuthorizationBearer <slug>.<secret>A virtual key's API key (
vk-....<secret>), asAuthorization: Bearer. What the OpenAI SDK sends from itsapi_key. Used by the inference endpoints.- or
x-virtual-keyheaderA virtual key's API key in the
x-virtual-keyheader, for clients that keepAuthorizationfor something else. - or
x-api-keyheaderDirect credentials: the provider's own API key in
x-api-key, with the provider named inx-provider(for exampleopenai). On/v1/messagesa virtual key is accepted inx-api-keytoo, which is what the Claude SDK sends.
Headers
x-providerstringWith direct credentials: the provider
x-api-keybelongs to, for exampleopenaioranthropic(case and dashes are normalised). Not used with a virtual key.x-retry-countinteger<int32>How many times to retry a failed provider call, 0 to 5. Without the header, chat completions, Claude Messages and prompt completions do not retry, and the other endpoints retry up to 3 times. Retries back off exponentially from 1 second and honour a numeric
Retry-After. The number made is in thex-retry-countresponse header.x-retry-status-codesstringComma-separated provider status codes to retry on. Default
429,500,502,503,504,529.
Request body multipart/form-data
filestring<binary>requiredthe file to upload
modelstringrequiredthe model, for example
whisper-1orgpt-4o-transcribelanguagestringthe audio's language as an ISO-639-1 code, for example
en; optionalpromptstringtext to guide the model's style or continue a previous segment; optional
response_formatstringjson(the default) orverbose_json, which adds the language, duration, segments and words (transcriptions only)temperaturestringsampling temperature from 0 to 1; optional
timestamp_granularitiesstringwordorsegment, withverbose_json: the timestamps to includeaudio_duration_secondsstringthe audio's length in seconds, used to price the call when the provider does not report it (always on a stream); optional
streamstringtrueto stream the transcription as server-sent events; default false
Responses
The transcription, or a stream of transcription events with stream=true
textstringrequiredThe transcribed text.
languagestringThe detected or given language of the audio. With
verbose_jsononly.durationnumber<float>The audio's length, in seconds. With
verbose_jsononly.segmentsobject[]The transcription split into timed segments. With
verbose_jsonand segment timestamps only.Child attributes
idinteger<int32>The segment's index, from 0.
seekinteger<int32>The seek offset of the segment, in the model's audio frames.
startnumber<float>When the segment starts, in seconds from the beginning of the audio.
endnumber<float>When the segment ends, in seconds from the beginning of the audio.
textstringThe segment's text.
tokensinteger<int32>[]The token ids of the segment's text.
temperaturenumber<float>The sampling temperature used for this segment.
avg_logprobnumber<float>The average log probability of the segment's tokens. Below -1, the segment may be unreliable.
compression_rationumber<float>The segment's compression ratio. Above 2.4, the text may be repetitive or unreliable.
no_speech_probnumber<float>The probability, 0 to 1, that the segment contains no speech.
wordsobject[]Every word with its timing. With
verbose_jsonandtimestamp_granularitiesincludingwordonly.Child attributes
wordstringThe word as transcribed.
startnumber<float>When the word starts, in seconds from the beginning of the audio.
endnumber<float>When the word ends, in seconds from the beginning of the audio.