Skip to main content
POST
Speech-to-text
We accept both multipart and JSON base64 for STT, so the OpenAI SDK works out of the box.

Multipart (OpenAI SDK default)

JSON base64 (light HTTP clients)

Response formats

json (default), text, srt, verbose_json (with segments), vtt. The response body is always JSON, whichever format you ask for: srt, vtt and text put the rendered document in the text field rather than returning it bare. The OpenAI SDK hands you the raw body for those three, so parse it as JSON and read ["text"] before writing a subtitle file. verbose_json carries segment-level timestamps in segments[]. Word-level timestamps are not supported — timestamp_granularities is dropped before the request reaches the provider, so words comes back empty. There is no /v1/audio/translations endpoint. To translate, transcribe first and pass the text to a chat completion.

Limits

  • Max 25 MB audio per request
  • Formats: MP3, MP4, M4A, WAV, WebM, OGG, FLAC

Authorizations

Authorization
string
header
required

API key in format: Bearer inf_***

Body

Either multipart/form-data with a file part — what the OpenAI SDK sends, and the reason it works here unchanged — or JSON carrying the audio as base64 in file_base64. The field names below are the JSON ones; the multipart part is named file and the rest are plain form fields of the same names.

timestamp_granularities is NOT supported: it is not read on either path, so no word-level timestamps are ever returned. verbose_json gives segment-level timestamps and that is the finest granularity available.

model
string
required

Model ID to use for STT

file_base64
string
required

Base64-encoded audio data. JSON path only — send a file part instead on multipart.

filename
string
default:audio.mp3

Original file name. The audio MIME type is derived from its extension, so a wrong extension can mis-declare the upload.

language
string

Language of the audio (ISO-639-1)

prompt
string

Optional transcription hint passed through to the provider

temperature
number

Sampling temperature (0-1)

Required range: 0 <= x <= 1
response_format
enum<string>
default:json
Available options:
json,
text,
srt,
verbose_json,
vtt

Response

Transcription result. Shape depends on response_format: JSON (json, verbose_json) or plain text (text, srt, vtt).

response_format: json (default) or verbose_json

text
string
Example:

"Hello, this is a test transcription."

language
string

Detected language (verbose_json only)

Example:

"en"

duration
number

Audio duration in seconds (verbose_json only)

Example:

12.5

segments
object[]

Time-stamped segments (verbose_json only)

credits_used
integer
Example:

3