SPB Git

Repository Public

audio.md 64.9 KB 2,587 lines markdown

1# Audio23> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.45## Domain Types67### Audio Model89- `AudioModel = "whisper-1" or "gpt-transcribe" or "gpt-4o-transcribe" or 3 more`1011  - `"whisper-1"`1213  - `"gpt-transcribe"`1415  - `"gpt-4o-transcribe"`1617  - `"gpt-4o-mini-transcribe"`1819  - `"gpt-4o-mini-transcribe-2025-12-15"`2021  - `"gpt-4o-transcribe-diarize"`2223### Audio Response Format2425- `AudioResponseFormat = "json" or "text" or "srt" or 3 more`2627  The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, `vtt`, or `diarized_json`. For `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`, the only supported format is `json`. For `gpt-4o-transcribe-diarize`, the supported formats are `json`, `text`, and `diarized_json`, with `diarized_json` required to receive speaker annotations.2829  - `"json"`3031  - `"text"`3233  - `"srt"`3435  - `"verbose_json"`3637  - `"vtt"`3839  - `"diarized_json"`4041# Speech4243## Create speech4445**post** `/audio/speech`4647Generates audio from the input text.4849Returns the audio file content, or a stream of audio events.5051### Body Parameters5253- `input: string`5455  The text to generate audio for. The maximum length is 4096 characters.5657- `model: string or SpeechModel`5859  One of the available [TTS models](/api/docs/guides/text-to-speech): `tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`.6061  - `string`6263  - `SpeechModel = "tts-1" or "tts-1-hd" or "gpt-4o-mini-tts" or "gpt-4o-mini-tts-2025-12-15"`6465    - `"tts-1"`6667    - `"tts-1-hd"`6869    - `"gpt-4o-mini-tts"`7071    - `"gpt-4o-mini-tts-2025-12-15"`7273- `voice: string or "alloy" or "ash" or "ballad" or 7 more or object { id }`7475  The voice to use when generating the audio. Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the voices are available in the [Text to speech guide](/api/docs/guides/text-to-speech#voice-options).7677  - `string`7879  - `"alloy" or "ash" or "ballad" or 7 more`8081    - `"alloy"`8283    - `"ash"`8485    - `"ballad"`8687    - `"coral"`8889    - `"echo"`9091    - `"sage"`9293    - `"shimmer"`9495    - `"verse"`9697    - `"marin"`9899    - `"cedar"`100101  - `ID object { id }`102103    Custom voice reference.104105    - `id: string`106107      The custom voice ID, e.g. `voice_1234`.108109- `instructions: optional string`110111  Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`.112113- `response_format: optional "mp3" or "opus" or "aac" or 3 more`114115  The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`.116117  - `"mp3"`118119  - `"opus"`120121  - `"aac"`122123  - `"flac"`124125  - `"wav"`126127  - `"pcm"`128129- `speed: optional number`130131  The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default.132133- `stream_format: optional "sse" or "audio"`134135  The format to stream the audio in. Supported formats are `sse` and `audio`. `sse` is not supported for `tts-1` or `tts-1-hd`.136137  - `"sse"`138139  - `"audio"`140141### Example142143```http144curl https://api.openai.com/v1/audio/speech \145    -H 'Content-Type: application/json' \146    -H "Authorization: Bearer $OPENAI_API_KEY" \147    -d '{148          "input": "input",149          "model": "tts-1",150          "voice": "alloy"151        }'152```153154### Example155156```http157curl https://api.openai.com/v1/audio/speech \158  -H "Authorization: Bearer $OPENAI_API_KEY" \159  -H "Content-Type: application/json" \160  -d '{161    "model": "gpt-4o-mini-tts",162    "input": "The quick brown fox jumped over the lazy dog.",163    "voice": "alloy"164  }' \165  --output speech.mp3166```167168### SSE Stream Format169170```http171curl https://api.openai.com/v1/audio/speech \172  -H "Authorization: Bearer $OPENAI_API_KEY" \173  -H "Content-Type: application/json" \174  -d '{175    "model": "gpt-4o-mini-tts",176    "input": "The quick brown fox jumped over the lazy dog.",177    "voice": "alloy",178    "stream_format": "sse"179  }'180```181182## Domain Types183184### Speech Model185186- `SpeechModel = "tts-1" or "tts-1-hd" or "gpt-4o-mini-tts" or "gpt-4o-mini-tts-2025-12-15"`187188  - `"tts-1"`189190  - `"tts-1-hd"`191192  - `"gpt-4o-mini-tts"`193194  - `"gpt-4o-mini-tts-2025-12-15"`195196# Transcriptions197198## Create transcription199200**post** `/audio/transcriptions`201202Transcribes audio into the input language.203204Returns a transcription object in `json`, `diarized_json`, or `verbose_json`205format, or a stream of transcript events.206207### Returns208209- `Transcription object { text, languages, logprobs, usage }`210211  Represents a transcription response returned by model, based on the provided input.212213  - `text: string`214215    The transcribed text.216217  - `languages: optional array of TranscriptionLanguage`218219    The languages detected in the audio. Returned by `gpt-transcribe`. An empty array indicates that no language could be reliably detected.220221    - `code: string`222223      The code of a language detected in the audio.224225  - `logprobs: optional array of object { token, bytes, logprob }`226227    The log probabilities of the tokens in the transcription. Only returned with the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` if `logprobs` is added to the `include` array.228229    - `token: optional string`230231      The token in the transcription.232233    - `bytes: optional array of number`234235      The bytes of the token.236237    - `logprob: optional number`238239      The log probability of the token.240241  - `usage: optional object { input_tokens, output_tokens, total_tokens, 2 more }  or object { seconds, type }`242243    Token usage statistics for the request.244245    - `Tokens object { input_tokens, output_tokens, total_tokens, 2 more }`246247      Usage statistics for models billed by token usage.248249      - `input_tokens: number`250251        Number of input tokens billed for this request.252253      - `output_tokens: number`254255        Number of output tokens generated.256257      - `total_tokens: number`258259        Total number of tokens used (input + output).260261      - `type: "tokens"`262263        The type of the usage object. Always `tokens` for this variant.264265        - `"tokens"`266267      - `input_token_details: optional object { audio_tokens, text_tokens }`268269        Details about the input tokens billed for this request.270271        - `audio_tokens: optional number`272273          Number of audio tokens billed for this request.274275        - `text_tokens: optional number`276277          Number of text tokens billed for this request.278279    - `Duration object { seconds, type }`280281      Usage statistics for models billed by audio input duration.282283      - `seconds: number`284285        Duration of the input audio in seconds.286287      - `type: "duration"`288289        The type of the usage object. Always `duration` for this variant.290291        - `"duration"`292293- `TranscriptionDiarized object { duration, segments, task, 2 more }`294295  Represents a diarized transcription response returned by the model, including the combined transcript and speaker-segment annotations.296297  - `duration: number`298299    Duration of the input audio in seconds.300301  - `segments: array of TranscriptionDiarizedSegment`302303    Segments of the transcript annotated with timestamps and speaker labels.304305    - `id: string`306307      Unique identifier for the segment.308309    - `end: number`310311      End timestamp of the segment in seconds.312313    - `speaker: string`314315      Speaker label for this segment. When known speakers are provided, the label matches `known_speaker_names[]`. Otherwise speakers are labeled sequentially using capital letters (`A`, `B`, ...).316317    - `start: number`318319      Start timestamp of the segment in seconds.320321    - `text: string`322323      Transcript text for this segment.324325    - `type: "transcript.text.segment"`326327      The type of the segment. Always `transcript.text.segment`.328329      - `"transcript.text.segment"`330331  - `task: "transcribe"`332333    The type of task that was run. Always `transcribe`.334335    - `"transcribe"`336337  - `text: string`338339    The concatenated transcript text for the entire audio input.340341  - `usage: optional object { input_tokens, output_tokens, total_tokens, 2 more }  or object { seconds, type }`342343    Token or duration usage statistics for the request.344345    - `Tokens object { input_tokens, output_tokens, total_tokens, 2 more }`346347      Usage statistics for models billed by token usage.348349      - `input_tokens: number`350351        Number of input tokens billed for this request.352353      - `output_tokens: number`354355        Number of output tokens generated.356357      - `total_tokens: number`358359        Total number of tokens used (input + output).360361      - `type: "tokens"`362363        The type of the usage object. Always `tokens` for this variant.364365        - `"tokens"`366367      - `input_token_details: optional object { audio_tokens, text_tokens }`368369        Details about the input tokens billed for this request.370371        - `audio_tokens: optional number`372373          Number of audio tokens billed for this request.374375        - `text_tokens: optional number`376377          Number of text tokens billed for this request.378379    - `Duration object { seconds, type }`380381      Usage statistics for models billed by audio input duration.382383      - `seconds: number`384385        Duration of the input audio in seconds.386387      - `type: "duration"`388389        The type of the usage object. Always `duration` for this variant.390391        - `"duration"`392393- `TranscriptionVerbose object { duration, language, text, 3 more }`394395  Represents a verbose json transcription response returned by model, based on the provided input.396397  - `duration: number`398399    The duration of the input audio.400401  - `language: string`402403    The language of the input audio.404405  - `text: string`406407    The transcribed text.408409  - `segments: optional array of TranscriptionSegment`410411    Segments of the transcribed text and their corresponding details.412413    - `id: number`414415      Unique identifier of the segment.416417    - `avg_logprob: number`418419      Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.420421    - `compression_ratio: number`422423      Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.424425    - `end: number`426427      End time of the segment in seconds.428429    - `no_speech_prob: number`430431      Probability of no speech in the segment. If the value is higher than 1.0 and the `avg_logprob` is below -1, consider this segment silent.432433    - `seek: number`434435      Seek offset of the segment.436437    - `start: number`438439      Start time of the segment in seconds.440441    - `temperature: number`442443      Temperature parameter used for generating the segment.444445    - `text: string`446447      Text content of the segment.448449    - `tokens: array of number`450451      Array of token IDs for the text content.452453  - `usage: optional object { seconds, type }`454455    Usage statistics for models billed by audio input duration.456457    - `seconds: number`458459      Duration of the input audio in seconds.460461    - `type: "duration"`462463      The type of the usage object. Always `duration` for this variant.464465      - `"duration"`466467  - `words: optional array of TranscriptionWord`468469    Extracted words and their corresponding timestamps.470471    - `end: number`472473      End time of the word in seconds.474475    - `start: number`476477      Start time of the word in seconds.478479    - `word: string`480481      The text content of the word.482483### Example484485```http486curl https://api.openai.com/v1/audio/transcriptions \487    -H 'Content-Type: multipart/form-data' \488    -H "Authorization: Bearer $OPENAI_API_KEY" \489    -F 'file=@/path/to/file' \490    -F model=gpt-4o-transcribe491```492493#### Response494495```json496{497  "text": "text",498  "languages": [499    {500      "code": "code"501    }502  ],503  "logprobs": [504    {505      "token": "token",506      "bytes": [507        0508      ],509      "logprob": 0510    }511  ],512  "usage": {513    "input_tokens": 0,514    "output_tokens": 0,515    "total_tokens": 0,516    "type": "tokens",517    "input_token_details": {518      "audio_tokens": 0,519      "text_tokens": 0520    }521  }522}523```524525### Example526527```http528curl https://api.openai.com/v1/audio/transcriptions \529  -H "Authorization: Bearer $OPENAI_API_KEY" \530  -H "Content-Type: multipart/form-data" \531  -F file="@/path/to/file/audio.mp3" \532  -F model="gpt-4o-transcribe"533```534535#### Response536537```json538{539  "text": "Imagine the wildest idea that you've ever had, and you're curious about how it might scale to something that's a 100, a 1,000 times bigger. This is a place where you can get to do that.",540  "usage": {541    "type": "tokens",542    "input_tokens": 14,543    "input_token_details": {544      "text_tokens": 0,545      "audio_tokens": 14546    },547    "output_tokens": 45,548    "total_tokens": 59549  }550}551```552553### Diarization554555```http556curl https://api.openai.com/v1/audio/transcriptions \557  -H "Authorization: Bearer $OPENAI_API_KEY" \558  -H "Content-Type: multipart/form-data" \559  -F file="@/path/to/file/meeting.wav" \560  -F model="gpt-4o-transcribe-diarize" \561  -F response_format="diarized_json" \562  -F chunking_strategy=auto \563  -F 'known_speaker_names[]=agent' \564  -F 'known_speaker_references[]=data:audio/wav;base64,AAA...'565```566567#### Response568569```json570{571  "task": "transcribe",572  "duration": 27.4,573  "text": "Agent: Thanks for calling OpenAI support.\nA: Hi, I'm trying to enable diarization.\nAgent: Happy to walk you through the steps.",574  "segments": [575    {576      "type": "transcript.text.segment",577      "id": "seg_001",578      "start": 0.0,579      "end": 4.7,580      "text": "Thanks for calling OpenAI support.",581      "speaker": "agent"582    },583    {584      "type": "transcript.text.segment",585      "id": "seg_002",586      "start": 4.7,587      "end": 11.8,588      "text": "Hi, I'm trying to enable diarization.",589      "speaker": "A"590    },591    {592      "type": "transcript.text.segment",593      "id": "seg_003",594      "start": 12.1,595      "end": 18.5,596      "text": "Happy to walk you through the steps.",597      "speaker": "agent"598    }599  ],600  "usage": {601    "type": "duration",602    "seconds": 27603  }604}605```606607### Logprobs608609```http610curl https://api.openai.com/v1/audio/transcriptions \611  -H "Authorization: Bearer $OPENAI_API_KEY" \612  -H "Content-Type: multipart/form-data" \613  -F file="@/path/to/file/audio.mp3" \614  -F "include[]=logprobs" \615  -F model="gpt-4o-transcribe" \616  -F response_format="json"617```618619#### Response620621```json622{623  "text": "Hey, my knee is hurting and I want to see the doctor tomorrow ideally.",624  "logprobs": [625    { "token": "Hey", "logprob": -1.0415299, "bytes": [72, 101, 121] },626    { "token": ",", "logprob": -9.805982e-5, "bytes": [44] },627    { "token": " my", "logprob": -0.00229799, "bytes": [32, 109, 121] },628    {629      "token": " knee",630      "logprob": -4.7159858e-5,631      "bytes": [32, 107, 110, 101, 101]632    },633    { "token": " is", "logprob": -0.043909557, "bytes": [32, 105, 115] },634    {635      "token": " hurting",636      "logprob": -1.1041146e-5,637      "bytes": [32, 104, 117, 114, 116, 105, 110, 103]638    },639    { "token": " and", "logprob": -0.011076359, "bytes": [32, 97, 110, 100] },640    { "token": " I", "logprob": -5.3193703e-6, "bytes": [32, 73] },641    {642      "token": " want",643      "logprob": -0.0017156356,644      "bytes": [32, 119, 97, 110, 116]645    },646    { "token": " to", "logprob": -7.89631e-7, "bytes": [32, 116, 111] },647    { "token": " see", "logprob": -5.5122365e-7, "bytes": [32, 115, 101, 101] },648    { "token": " the", "logprob": -0.0040786397, "bytes": [32, 116, 104, 101] },649    {650      "token": " doctor",651      "logprob": -2.3392786e-6,652      "bytes": [32, 100, 111, 99, 116, 111, 114]653    },654    {655      "token": " tomorrow",656      "logprob": -7.89631e-7,657      "bytes": [32, 116, 111, 109, 111, 114, 114, 111, 119]658    },659    {660      "token": " ideally",661      "logprob": -0.5800861,662      "bytes": [32, 105, 100, 101, 97, 108, 108, 121]663    },664    { "token": ".", "logprob": -0.00011093382, "bytes": [46] }665  ],666  "usage": {667    "type": "tokens",668    "input_tokens": 14,669    "input_token_details": {670      "text_tokens": 0,671      "audio_tokens": 14672    },673    "output_tokens": 45,674    "total_tokens": 59675  }676}677```678679### Segment timestamps680681```http682curl https://api.openai.com/v1/audio/transcriptions \683  -H "Authorization: Bearer $OPENAI_API_KEY" \684  -H "Content-Type: multipart/form-data" \685  -F file="@/path/to/file/audio.mp3" \686  -F "timestamp_granularities[]=segment" \687  -F model="whisper-1" \688  -F response_format="verbose_json"689```690691#### Response692693```json694{695  "task": "transcribe",696  "language": "english",697  "duration": 8.470000267028809,698  "text": "The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.",699  "segments": [700    {701      "id": 0,702      "seek": 0,703      "start": 0.0,704      "end": 3.319999933242798,705      "text": " The beach was a popular spot on a hot summer day.",706      "tokens": [707        50364, 440, 7534, 390, 257, 3743, 4008, 322, 257, 2368, 4266, 786, 13, 50530708      ],709      "temperature": 0.0,710      "avg_logprob": -0.2860786020755768,711      "compression_ratio": 1.2363636493682861,712      "no_speech_prob": 0.00985979475080967713    },714    ...715  ],716  "usage": {717    "type": "duration",718    "seconds": 9719  }720}721```722723### Streaming724725```http726curl https://api.openai.com/v1/audio/transcriptions \727  -H "Authorization: Bearer $OPENAI_API_KEY" \728  -H "Content-Type: multipart/form-data" \729  -F file="@/path/to/file/audio.mp3" \730  -F model="gpt-4o-mini-transcribe" \731  -F stream=true732```733734#### Response735736```json737data: {"type":"transcript.text.delta","delta":"I","logprobs":[{"token":"I","logprob":-0.00007588794,"bytes":[73]}]}738739data: {"type":"transcript.text.delta","delta":" see","logprobs":[{"token":" see","logprob":-3.1281633e-7,"bytes":[32,115,101,101]}]}740741data: {"type":"transcript.text.delta","delta":" skies","logprobs":[{"token":" skies","logprob":-2.3392786e-6,"bytes":[32,115,107,105,101,115]}]}742743data: {"type":"transcript.text.delta","delta":" of","logprobs":[{"token":" of","logprob":-3.1281633e-7,"bytes":[32,111,102]}]}744745data: {"type":"transcript.text.delta","delta":" blue","logprobs":[{"token":" blue","logprob":-1.0280384e-6,"bytes":[32,98,108,117,101]}]}746747data: {"type":"transcript.text.delta","delta":" and","logprobs":[{"token":" and","logprob":-0.0005108566,"bytes":[32,97,110,100]}]}748749data: {"type":"transcript.text.delta","delta":" clouds","logprobs":[{"token":" clouds","logprob":-1.9361265e-7,"bytes":[32,99,108,111,117,100,115]}]}750751data: {"type":"transcript.text.delta","delta":" of","logprobs":[{"token":" of","logprob":-1.9361265e-7,"bytes":[32,111,102]}]}752753data: {"type":"transcript.text.delta","delta":" white","logprobs":[{"token":" white","logprob":-7.89631e-7,"bytes":[32,119,104,105,116,101]}]}754755data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.0014890312,"bytes":[44]}]}756757data: {"type":"transcript.text.delta","delta":" the","logprobs":[{"token":" the","logprob":-0.0110956915,"bytes":[32,116,104,101]}]}758759data: {"type":"transcript.text.delta","delta":" bright","logprobs":[{"token":" bright","logprob":0.0,"bytes":[32,98,114,105,103,104,116]}]}760761data: {"type":"transcript.text.delta","delta":" blessed","logprobs":[{"token":" blessed","logprob":-0.000045848617,"bytes":[32,98,108,101,115,115,101,100]}]}762763data: {"type":"transcript.text.delta","delta":" days","logprobs":[{"token":" days","logprob":-0.000010802739,"bytes":[32,100,97,121,115]}]}764765data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.00001700133,"bytes":[44]}]}766767data: {"type":"transcript.text.delta","delta":" the","logprobs":[{"token":" the","logprob":-0.0000118755715,"bytes":[32,116,104,101]}]}768769data: {"type":"transcript.text.delta","delta":" dark","logprobs":[{"token":" dark","logprob":-5.5122365e-7,"bytes":[32,100,97,114,107]}]}770771data: {"type":"transcript.text.delta","delta":" sacred","logprobs":[{"token":" sacred","logprob":-5.4385737e-6,"bytes":[32,115,97,99,114,101,100]}]}772773data: {"type":"transcript.text.delta","delta":" nights","logprobs":[{"token":" nights","logprob":-4.00813e-6,"bytes":[32,110,105,103,104,116,115]}]}774775data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.0036910512,"bytes":[44]}]}776777data: {"type":"transcript.text.delta","delta":" and","logprobs":[{"token":" and","logprob":-0.0031903093,"bytes":[32,97,110,100]}]}778779data: {"type":"transcript.text.delta","delta":" I","logprobs":[{"token":" I","logprob":-1.504853e-6,"bytes":[32,73]}]}780781data: {"type":"transcript.text.delta","delta":" think","logprobs":[{"token":" think","logprob":-4.3202e-7,"bytes":[32,116,104,105,110,107]}]}782783data: {"type":"transcript.text.delta","delta":" to","logprobs":[{"token":" to","logprob":-1.9361265e-7,"bytes":[32,116,111]}]}784785data: {"type":"transcript.text.delta","delta":" myself","logprobs":[{"token":" myself","logprob":-1.7432603e-6,"bytes":[32,109,121,115,101,108,102]}]}786787data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.29254505,"bytes":[44]}]}788789data: {"type":"transcript.text.delta","delta":" what","logprobs":[{"token":" what","logprob":-0.016815351,"bytes":[32,119,104,97,116]}]}790791data: {"type":"transcript.text.delta","delta":" a","logprobs":[{"token":" a","logprob":-3.1281633e-7,"bytes":[32,97]}]}792793data: {"type":"transcript.text.delta","delta":" wonderful","logprobs":[{"token":" wonderful","logprob":-2.1008714e-6,"bytes":[32,119,111,110,100,101,114,102,117,108]}]}794795data: {"type":"transcript.text.delta","delta":" world","logprobs":[{"token":" world","logprob":-8.180258e-6,"bytes":[32,119,111,114,108,100]}]}796797data: {"type":"transcript.text.delta","delta":".","logprobs":[{"token":".","logprob":-0.014231676,"bytes":[46]}]}798799data: {"type":"transcript.text.done","text":"I see skies of blue and clouds of white, the bright blessed days, the dark sacred nights, and I think to myself, what a wonderful world.","logprobs":[{"token":"I","logprob":-0.00007588794,"bytes":[73]},{"token":" see","logprob":-3.1281633e-7,"bytes":[32,115,101,101]},{"token":" skies","logprob":-2.3392786e-6,"bytes":[32,115,107,105,101,115]},{"token":" of","logprob":-3.1281633e-7,"bytes":[32,111,102]},{"token":" blue","logprob":-1.0280384e-6,"bytes":[32,98,108,117,101]},{"token":" and","logprob":-0.0005108566,"bytes":[32,97,110,100]},{"token":" clouds","logprob":-1.9361265e-7,"bytes":[32,99,108,111,117,100,115]},{"token":" of","logprob":-1.9361265e-7,"bytes":[32,111,102]},{"token":" white","logprob":-7.89631e-7,"bytes":[32,119,104,105,116,101]},{"token":",","logprob":-0.0014890312,"bytes":[44]},{"token":" the","logprob":-0.0110956915,"bytes":[32,116,104,101]},{"token":" bright","logprob":0.0,"bytes":[32,98,114,105,103,104,116]},{"token":" blessed","logprob":-0.000045848617,"bytes":[32,98,108,101,115,115,101,100]},{"token":" days","logprob":-0.000010802739,"bytes":[32,100,97,121,115]},{"token":",","logprob":-0.00001700133,"bytes":[44]},{"token":" the","logprob":-0.0000118755715,"bytes":[32,116,104,101]},{"token":" dark","logprob":-5.5122365e-7,"bytes":[32,100,97,114,107]},{"token":" sacred","logprob":-5.4385737e-6,"bytes":[32,115,97,99,114,101,100]},{"token":" nights","logprob":-4.00813e-6,"bytes":[32,110,105,103,104,116,115]},{"token":",","logprob":-0.0036910512,"bytes":[44]},{"token":" and","logprob":-0.0031903093,"bytes":[32,97,110,100]},{"token":" I","logprob":-1.504853e-6,"bytes":[32,73]},{"token":" think","logprob":-4.3202e-7,"bytes":[32,116,104,105,110,107]},{"token":" to","logprob":-1.9361265e-7,"bytes":[32,116,111]},{"token":" myself","logprob":-1.7432603e-6,"bytes":[32,109,121,115,101,108,102]},{"token":",","logprob":-0.29254505,"bytes":[44]},{"token":" what","logprob":-0.016815351,"bytes":[32,119,104,97,116]},{"token":" a","logprob":-3.1281633e-7,"bytes":[32,97]},{"token":" wonderful","logprob":-2.1008714e-6,"bytes":[32,119,111,110,100,101,114,102,117,108]},{"token":" world","logprob":-8.180258e-6,"bytes":[32,119,111,114,108,100]},{"token":".","logprob":-0.014231676,"bytes":[46]}],"usage":{"input_tokens":14,"input_token_details":{"text_tokens":0,"audio_tokens":14},"output_tokens":45,"total_tokens":59}}800```801802### Word timestamps803804```http805curl https://api.openai.com/v1/audio/transcriptions \806  -H "Authorization: Bearer $OPENAI_API_KEY" \807  -H "Content-Type: multipart/form-data" \808  -F file="@/path/to/file/audio.mp3" \809  -F "timestamp_granularities[]=word" \810  -F model="whisper-1" \811  -F response_format="verbose_json"812```813814#### Response815816```json817{818  "task": "transcribe",819  "language": "english",820  "duration": 8.470000267028809,821  "text": "The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.",822  "words": [823    {824      "word": "The",825      "start": 0.0,826      "end": 0.23999999463558197827    },828    ...829    {830      "word": "volleyball",831      "start": 7.400000095367432,832      "end": 7.900000095367432833    }834  ],835  "usage": {836    "type": "duration",837    "seconds": 9838  }839}840```841842## Domain Types843844### Transcription845846- `Transcription object { text, languages, logprobs, usage }`847848  Represents a transcription response returned by model, based on the provided input.849850  - `text: string`851852    The transcribed text.853854  - `languages: optional array of TranscriptionLanguage`855856    The languages detected in the audio. Returned by `gpt-transcribe`. An empty array indicates that no language could be reliably detected.857858    - `code: string`859860      The code of a language detected in the audio.861862  - `logprobs: optional array of object { token, bytes, logprob }`863864    The log probabilities of the tokens in the transcription. Only returned with the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` if `logprobs` is added to the `include` array.865866    - `token: optional string`867868      The token in the transcription.869870    - `bytes: optional array of number`871872      The bytes of the token.873874    - `logprob: optional number`875876      The log probability of the token.877878  - `usage: optional object { input_tokens, output_tokens, total_tokens, 2 more }  or object { seconds, type }`879880    Token usage statistics for the request.881882    - `Tokens object { input_tokens, output_tokens, total_tokens, 2 more }`883884      Usage statistics for models billed by token usage.885886      - `input_tokens: number`887888        Number of input tokens billed for this request.889890      - `output_tokens: number`891892        Number of output tokens generated.893894      - `total_tokens: number`895896        Total number of tokens used (input + output).897898      - `type: "tokens"`899900        The type of the usage object. Always `tokens` for this variant.901902        - `"tokens"`903904      - `input_token_details: optional object { audio_tokens, text_tokens }`905906        Details about the input tokens billed for this request.907908        - `audio_tokens: optional number`909910          Number of audio tokens billed for this request.911912        - `text_tokens: optional number`913914          Number of text tokens billed for this request.915916    - `Duration object { seconds, type }`917918      Usage statistics for models billed by audio input duration.919920      - `seconds: number`921922        Duration of the input audio in seconds.923924      - `type: "duration"`925926        The type of the usage object. Always `duration` for this variant.927928        - `"duration"`929930### Transcription Create Response931932- `TranscriptionCreateResponse = Transcription or TranscriptionDiarized or TranscriptionVerbose`933934  Represents a transcription response returned by model, based on the provided input.935936  - `Transcription object { text, languages, logprobs, usage }`937938    Represents a transcription response returned by model, based on the provided input.939940    - `text: string`941942      The transcribed text.943944    - `languages: optional array of TranscriptionLanguage`945946      The languages detected in the audio. Returned by `gpt-transcribe`. An empty array indicates that no language could be reliably detected.947948      - `code: string`949950        The code of a language detected in the audio.951952    - `logprobs: optional array of object { token, bytes, logprob }`953954      The log probabilities of the tokens in the transcription. Only returned with the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` if `logprobs` is added to the `include` array.955956      - `token: optional string`957958        The token in the transcription.959960      - `bytes: optional array of number`961962        The bytes of the token.963964      - `logprob: optional number`965966        The log probability of the token.967968    - `usage: optional object { input_tokens, output_tokens, total_tokens, 2 more }  or object { seconds, type }`969970      Token usage statistics for the request.971972      - `Tokens object { input_tokens, output_tokens, total_tokens, 2 more }`973974        Usage statistics for models billed by token usage.975976        - `input_tokens: number`977978          Number of input tokens billed for this request.979980        - `output_tokens: number`981982          Number of output tokens generated.983984        - `total_tokens: number`985986          Total number of tokens used (input + output).987988        - `type: "tokens"`989990          The type of the usage object. Always `tokens` for this variant.991992          - `"tokens"`993994        - `input_token_details: optional object { audio_tokens, text_tokens }`995996          Details about the input tokens billed for this request.997998          - `audio_tokens: optional number`9991000            Number of audio tokens billed for this request.10011002          - `text_tokens: optional number`10031004            Number of text tokens billed for this request.10051006      - `Duration object { seconds, type }`10071008        Usage statistics for models billed by audio input duration.10091010        - `seconds: number`10111012          Duration of the input audio in seconds.10131014        - `type: "duration"`10151016          The type of the usage object. Always `duration` for this variant.10171018          - `"duration"`10191020  - `TranscriptionDiarized object { duration, segments, task, 2 more }`10211022    Represents a diarized transcription response returned by the model, including the combined transcript and speaker-segment annotations.10231024    - `duration: number`10251026      Duration of the input audio in seconds.10271028    - `segments: array of TranscriptionDiarizedSegment`10291030      Segments of the transcript annotated with timestamps and speaker labels.10311032      - `id: string`10331034        Unique identifier for the segment.10351036      - `end: number`10371038        End timestamp of the segment in seconds.10391040      - `speaker: string`10411042        Speaker label for this segment. When known speakers are provided, the label matches `known_speaker_names[]`. Otherwise speakers are labeled sequentially using capital letters (`A`, `B`, ...).10431044      - `start: number`10451046        Start timestamp of the segment in seconds.10471048      - `text: string`10491050        Transcript text for this segment.10511052      - `type: "transcript.text.segment"`10531054        The type of the segment. Always `transcript.text.segment`.10551056        - `"transcript.text.segment"`10571058    - `task: "transcribe"`10591060      The type of task that was run. Always `transcribe`.10611062      - `"transcribe"`10631064    - `text: string`10651066      The concatenated transcript text for the entire audio input.10671068    - `usage: optional object { input_tokens, output_tokens, total_tokens, 2 more }  or object { seconds, type }`10691070      Token or duration usage statistics for the request.10711072      - `Tokens object { input_tokens, output_tokens, total_tokens, 2 more }`10731074        Usage statistics for models billed by token usage.10751076        - `input_tokens: number`10771078          Number of input tokens billed for this request.10791080        - `output_tokens: number`10811082          Number of output tokens generated.10831084        - `total_tokens: number`10851086          Total number of tokens used (input + output).10871088        - `type: "tokens"`10891090          The type of the usage object. Always `tokens` for this variant.10911092          - `"tokens"`10931094        - `input_token_details: optional object { audio_tokens, text_tokens }`10951096          Details about the input tokens billed for this request.10971098          - `audio_tokens: optional number`10991100            Number of audio tokens billed for this request.11011102          - `text_tokens: optional number`11031104            Number of text tokens billed for this request.11051106      - `Duration object { seconds, type }`11071108        Usage statistics for models billed by audio input duration.11091110        - `seconds: number`11111112          Duration of the input audio in seconds.11131114        - `type: "duration"`11151116          The type of the usage object. Always `duration` for this variant.11171118          - `"duration"`11191120  - `TranscriptionVerbose object { duration, language, text, 3 more }`11211122    Represents a verbose json transcription response returned by model, based on the provided input.11231124    - `duration: number`11251126      The duration of the input audio.11271128    - `language: string`11291130      The language of the input audio.11311132    - `text: string`11331134      The transcribed text.11351136    - `segments: optional array of TranscriptionSegment`11371138      Segments of the transcribed text and their corresponding details.11391140      - `id: number`11411142        Unique identifier of the segment.11431144      - `avg_logprob: number`11451146        Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.11471148      - `compression_ratio: number`11491150        Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.11511152      - `end: number`11531154        End time of the segment in seconds.11551156      - `no_speech_prob: number`11571158        Probability of no speech in the segment. If the value is higher than 1.0 and the `avg_logprob` is below -1, consider this segment silent.11591160      - `seek: number`11611162        Seek offset of the segment.11631164      - `start: number`11651166        Start time of the segment in seconds.11671168      - `temperature: number`11691170        Temperature parameter used for generating the segment.11711172      - `text: string`11731174        Text content of the segment.11751176      - `tokens: array of number`11771178        Array of token IDs for the text content.11791180    - `usage: optional object { seconds, type }`11811182      Usage statistics for models billed by audio input duration.11831184      - `seconds: number`11851186        Duration of the input audio in seconds.11871188      - `type: "duration"`11891190        The type of the usage object. Always `duration` for this variant.11911192        - `"duration"`11931194    - `words: optional array of TranscriptionWord`11951196      Extracted words and their corresponding timestamps.11971198      - `end: number`11991200        End time of the word in seconds.12011202      - `start: number`12031204        Start time of the word in seconds.12051206      - `word: string`12071208        The text content of the word.12091210### Transcription Diarized12111212- `TranscriptionDiarized object { duration, segments, task, 2 more }`12131214  Represents a diarized transcription response returned by the model, including the combined transcript and speaker-segment annotations.12151216  - `duration: number`12171218    Duration of the input audio in seconds.12191220  - `segments: array of TranscriptionDiarizedSegment`12211222    Segments of the transcript annotated with timestamps and speaker labels.12231224    - `id: string`12251226      Unique identifier for the segment.12271228    - `end: number`12291230      End timestamp of the segment in seconds.12311232    - `speaker: string`12331234      Speaker label for this segment. When known speakers are provided, the label matches `known_speaker_names[]`. Otherwise speakers are labeled sequentially using capital letters (`A`, `B`, ...).12351236    - `start: number`12371238      Start timestamp of the segment in seconds.12391240    - `text: string`12411242      Transcript text for this segment.12431244    - `type: "transcript.text.segment"`12451246      The type of the segment. Always `transcript.text.segment`.12471248      - `"transcript.text.segment"`12491250  - `task: "transcribe"`12511252    The type of task that was run. Always `transcribe`.12531254    - `"transcribe"`12551256  - `text: string`12571258    The concatenated transcript text for the entire audio input.12591260  - `usage: optional object { input_tokens, output_tokens, total_tokens, 2 more }  or object { seconds, type }`12611262    Token or duration usage statistics for the request.12631264    - `Tokens object { input_tokens, output_tokens, total_tokens, 2 more }`12651266      Usage statistics for models billed by token usage.12671268      - `input_tokens: number`12691270        Number of input tokens billed for this request.12711272      - `output_tokens: number`12731274        Number of output tokens generated.12751276      - `total_tokens: number`12771278        Total number of tokens used (input + output).12791280      - `type: "tokens"`12811282        The type of the usage object. Always `tokens` for this variant.12831284        - `"tokens"`12851286      - `input_token_details: optional object { audio_tokens, text_tokens }`12871288        Details about the input tokens billed for this request.12891290        - `audio_tokens: optional number`12911292          Number of audio tokens billed for this request.12931294        - `text_tokens: optional number`12951296          Number of text tokens billed for this request.12971298    - `Duration object { seconds, type }`12991300      Usage statistics for models billed by audio input duration.13011302      - `seconds: number`13031304        Duration of the input audio in seconds.13051306      - `type: "duration"`13071308        The type of the usage object. Always `duration` for this variant.13091310        - `"duration"`13111312### Transcription Diarized Segment13131314- `TranscriptionDiarizedSegment object { id, end, speaker, 3 more }`13151316  A segment of diarized transcript text with speaker metadata.13171318  - `id: string`13191320    Unique identifier for the segment.13211322  - `end: number`13231324    End timestamp of the segment in seconds.13251326  - `speaker: string`13271328    Speaker label for this segment. When known speakers are provided, the label matches `known_speaker_names[]`. Otherwise speakers are labeled sequentially using capital letters (`A`, `B`, ...).13291330  - `start: number`13311332    Start timestamp of the segment in seconds.13331334  - `text: string`13351336    Transcript text for this segment.13371338  - `type: "transcript.text.segment"`13391340    The type of the segment. Always `transcript.text.segment`.13411342    - `"transcript.text.segment"`13431344### Transcription Include13451346- `TranscriptionInclude = "logprobs"`13471348  - `"logprobs"`13491350### Transcription Language13511352- `TranscriptionLanguage object { code }`13531354  A language detected in transcribed audio.13551356  - `code: string`13571358    The code of a language detected in the audio.13591360### Transcription Segment13611362- `TranscriptionSegment object { id, avg_logprob, compression_ratio, 7 more }`13631364  - `id: number`13651366    Unique identifier of the segment.13671368  - `avg_logprob: number`13691370    Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.13711372  - `compression_ratio: number`13731374    Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.13751376  - `end: number`13771378    End time of the segment in seconds.13791380  - `no_speech_prob: number`13811382    Probability of no speech in the segment. If the value is higher than 1.0 and the `avg_logprob` is below -1, consider this segment silent.13831384  - `seek: number`13851386    Seek offset of the segment.13871388  - `start: number`13891390    Start time of the segment in seconds.13911392  - `temperature: number`13931394    Temperature parameter used for generating the segment.13951396  - `text: string`13971398    Text content of the segment.13991400  - `tokens: array of number`14011402    Array of token IDs for the text content.14031404### Transcription Stream Event14051406- `TranscriptionStreamEvent = TranscriptionTextSegmentEvent or TranscriptionTextDeltaEvent or TranscriptionTextDoneEvent`14071408  Emitted when a diarized transcription returns a completed segment with speaker information. Only emitted when you [create a transcription](/api/reference/resources/audio/subresources/transcriptions/methods/create) with `stream` set to `true` and `response_format` set to `diarized_json`.14091410  - `TranscriptionTextSegmentEvent object { id, end, speaker, 3 more }`14111412    Emitted when a diarized transcription returns a completed segment with speaker information. Only emitted when you [create a transcription](/api/reference/resources/audio/subresources/transcriptions/methods/create) with `stream` set to `true` and `response_format` set to `diarized_json`.14131414    - `id: string`14151416      Unique identifier for the segment.14171418    - `end: number`14191420      End timestamp of the segment in seconds.14211422    - `speaker: string`14231424      Speaker label for this segment.14251426    - `start: number`14271428      Start timestamp of the segment in seconds.14291430    - `text: string`14311432      Transcript text for this segment.14331434    - `type: "transcript.text.segment"`14351436      The type of the event. Always `transcript.text.segment`.14371438      - `"transcript.text.segment"`14391440  - `TranscriptionTextDeltaEvent object { delta, type, logprobs, segment_id }`14411442    Emitted when there is an additional text delta. This is also the first event emitted when the transcription starts. Only emitted when you [create a transcription](/api/reference/resources/audio/subresources/transcriptions/methods/create) with the `Stream` parameter set to `true`.14431444    - `delta: string`14451446      The text delta that was additionally transcribed.14471448    - `type: "transcript.text.delta"`14491450      The type of the event. Always `transcript.text.delta`.14511452      - `"transcript.text.delta"`14531454    - `logprobs: optional array of object { token, bytes, logprob }`14551456      The log probabilities of the delta. Only included if you [create a transcription](/api/reference/resources/audio/subresources/transcriptions/methods/create) with the `include[]` parameter set to `logprobs`.14571458      - `token: optional string`14591460        The token that was used to generate the log probability.14611462      - `bytes: optional array of number`14631464        The bytes that were used to generate the log probability.14651466      - `logprob: optional number`14671468        The log probability of the token.14691470    - `segment_id: optional string`14711472      Identifier of the diarized segment that this delta belongs to. Only present when using `gpt-4o-transcribe-diarize`.14731474  - `TranscriptionTextDoneEvent object { text, type, languages, 2 more }`14751476    Emitted when the transcription is complete. Contains the complete transcription text. Only emitted when you [create a transcription](/api/reference/resources/audio/subresources/transcriptions/methods/create) with the `Stream` parameter set to `true`.14771478    - `text: string`14791480      The text that was transcribed.14811482    - `type: "transcript.text.done"`14831484      The type of the event. Always `transcript.text.done`.14851486      - `"transcript.text.done"`14871488    - `languages: optional array of TranscriptionLanguage`14891490      The languages detected in the audio. Returned by `gpt-transcribe`. An empty array indicates that no language could be reliably detected.14911492      - `code: string`14931494        The code of a language detected in the audio.14951496    - `logprobs: optional array of object { token, bytes, logprob }`14971498      The log probabilities of the individual tokens in the transcription. Only included if you [create a transcription](/api/reference/resources/audio/subresources/transcriptions/methods/create) with the `include[]` parameter set to `logprobs`.14991500      - `token: optional string`15011502        The token that was used to generate the log probability.15031504      - `bytes: optional array of number`15051506        The bytes that were used to generate the log probability.15071508      - `logprob: optional number`15091510        The log probability of the token.15111512    - `usage: optional object { input_tokens, output_tokens, total_tokens, 2 more }`15131514      Usage statistics for models billed by token usage.15151516      - `input_tokens: number`15171518        Number of input tokens billed for this request.15191520      - `output_tokens: number`15211522        Number of output tokens generated.15231524      - `total_tokens: number`15251526        Total number of tokens used (input + output).15271528      - `type: "tokens"`15291530        The type of the usage object. Always `tokens` for this variant.15311532        - `"tokens"`15331534      - `input_token_details: optional object { audio_tokens, text_tokens }`15351536        Details about the input tokens billed for this request.15371538        - `audio_tokens: optional number`15391540          Number of audio tokens billed for this request.15411542        - `text_tokens: optional number`15431544          Number of text tokens billed for this request.15451546### Transcription Text Delta Event15471548- `TranscriptionTextDeltaEvent object { delta, type, logprobs, segment_id }`15491550  Emitted when there is an additional text delta. This is also the first event emitted when the transcription starts. Only emitted when you [create a transcription](/api/reference/resources/audio/subresources/transcriptions/methods/create) with the `Stream` parameter set to `true`.15511552  - `delta: string`15531554    The text delta that was additionally transcribed.15551556  - `type: "transcript.text.delta"`15571558    The type of the event. Always `transcript.text.delta`.15591560    - `"transcript.text.delta"`15611562  - `logprobs: optional array of object { token, bytes, logprob }`15631564    The log probabilities of the delta. Only included if you [create a transcription](/api/reference/resources/audio/subresources/transcriptions/methods/create) with the `include[]` parameter set to `logprobs`.15651566    - `token: optional string`15671568      The token that was used to generate the log probability.15691570    - `bytes: optional array of number`15711572      The bytes that were used to generate the log probability.15731574    - `logprob: optional number`15751576      The log probability of the token.15771578  - `segment_id: optional string`15791580    Identifier of the diarized segment that this delta belongs to. Only present when using `gpt-4o-transcribe-diarize`.15811582### Transcription Text Done Event15831584- `TranscriptionTextDoneEvent object { text, type, languages, 2 more }`15851586  Emitted when the transcription is complete. Contains the complete transcription text. Only emitted when you [create a transcription](/api/reference/resources/audio/subresources/transcriptions/methods/create) with the `Stream` parameter set to `true`.15871588  - `text: string`15891590    The text that was transcribed.15911592  - `type: "transcript.text.done"`15931594    The type of the event. Always `transcript.text.done`.15951596    - `"transcript.text.done"`15971598  - `languages: optional array of TranscriptionLanguage`15991600    The languages detected in the audio. Returned by `gpt-transcribe`. An empty array indicates that no language could be reliably detected.16011602    - `code: string`16031604      The code of a language detected in the audio.16051606  - `logprobs: optional array of object { token, bytes, logprob }`16071608    The log probabilities of the individual tokens in the transcription. Only included if you [create a transcription](/api/reference/resources/audio/subresources/transcriptions/methods/create) with the `include[]` parameter set to `logprobs`.16091610    - `token: optional string`16111612      The token that was used to generate the log probability.16131614    - `bytes: optional array of number`16151616      The bytes that were used to generate the log probability.16171618    - `logprob: optional number`16191620      The log probability of the token.16211622  - `usage: optional object { input_tokens, output_tokens, total_tokens, 2 more }`16231624    Usage statistics for models billed by token usage.16251626    - `input_tokens: number`16271628      Number of input tokens billed for this request.16291630    - `output_tokens: number`16311632      Number of output tokens generated.16331634    - `total_tokens: number`16351636      Total number of tokens used (input + output).16371638    - `type: "tokens"`16391640      The type of the usage object. Always `tokens` for this variant.16411642      - `"tokens"`16431644    - `input_token_details: optional object { audio_tokens, text_tokens }`16451646      Details about the input tokens billed for this request.16471648      - `audio_tokens: optional number`16491650        Number of audio tokens billed for this request.16511652      - `text_tokens: optional number`16531654        Number of text tokens billed for this request.16551656### Transcription Text Segment Event16571658- `TranscriptionTextSegmentEvent object { id, end, speaker, 3 more }`16591660  Emitted when a diarized transcription returns a completed segment with speaker information. Only emitted when you [create a transcription](/api/reference/resources/audio/subresources/transcriptions/methods/create) with `stream` set to `true` and `response_format` set to `diarized_json`.16611662  - `id: string`16631664    Unique identifier for the segment.16651666  - `end: number`16671668    End timestamp of the segment in seconds.16691670  - `speaker: string`16711672    Speaker label for this segment.16731674  - `start: number`16751676    Start timestamp of the segment in seconds.16771678  - `text: string`16791680    Transcript text for this segment.16811682  - `type: "transcript.text.segment"`16831684    The type of the event. Always `transcript.text.segment`.16851686    - `"transcript.text.segment"`16871688### Transcription Verbose16891690- `TranscriptionVerbose object { duration, language, text, 3 more }`16911692  Represents a verbose json transcription response returned by model, based on the provided input.16931694  - `duration: number`16951696    The duration of the input audio.16971698  - `language: string`16991700    The language of the input audio.17011702  - `text: string`17031704    The transcribed text.17051706  - `segments: optional array of TranscriptionSegment`17071708    Segments of the transcribed text and their corresponding details.17091710    - `id: number`17111712      Unique identifier of the segment.17131714    - `avg_logprob: number`17151716      Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.17171718    - `compression_ratio: number`17191720      Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.17211722    - `end: number`17231724      End time of the segment in seconds.17251726    - `no_speech_prob: number`17271728      Probability of no speech in the segment. If the value is higher than 1.0 and the `avg_logprob` is below -1, consider this segment silent.17291730    - `seek: number`17311732      Seek offset of the segment.17331734    - `start: number`17351736      Start time of the segment in seconds.17371738    - `temperature: number`17391740      Temperature parameter used for generating the segment.17411742    - `text: string`17431744      Text content of the segment.17451746    - `tokens: array of number`17471748      Array of token IDs for the text content.17491750  - `usage: optional object { seconds, type }`17511752    Usage statistics for models billed by audio input duration.17531754    - `seconds: number`17551756      Duration of the input audio in seconds.17571758    - `type: "duration"`17591760      The type of the usage object. Always `duration` for this variant.17611762      - `"duration"`17631764  - `words: optional array of TranscriptionWord`17651766    Extracted words and their corresponding timestamps.17671768    - `end: number`17691770      End time of the word in seconds.17711772    - `start: number`17731774      Start time of the word in seconds.17751776    - `word: string`17771778      The text content of the word.17791780### Transcription Word17811782- `TranscriptionWord object { end, start, word }`17831784  - `end: number`17851786    End time of the word in seconds.17871788  - `start: number`17891790    Start time of the word in seconds.17911792  - `word: string`17931794    The text content of the word.17951796# Translations17971798## Create translation17991800**post** `/audio/translations`18011802Translates audio into English.18031804### Returns18051806- `Translation object { text }`18071808  - `text: string`18091810- `TranslationVerbose object { duration, language, text, segments }`18111812  - `duration: number`18131814    The duration of the input audio.18151816  - `language: string`18171818    The language of the output translation (always `english`).18191820  - `text: string`18211822    The translated text.18231824  - `segments: optional array of TranscriptionSegment`18251826    Segments of the translated text and their corresponding details.18271828    - `id: number`18291830      Unique identifier of the segment.18311832    - `avg_logprob: number`18331834      Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.18351836    - `compression_ratio: number`18371838      Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.18391840    - `end: number`18411842      End time of the segment in seconds.18431844    - `no_speech_prob: number`18451846      Probability of no speech in the segment. If the value is higher than 1.0 and the `avg_logprob` is below -1, consider this segment silent.18471848    - `seek: number`18491850      Seek offset of the segment.18511852    - `start: number`18531854      Start time of the segment in seconds.18551856    - `temperature: number`18571858      Temperature parameter used for generating the segment.18591860    - `text: string`18611862      Text content of the segment.18631864    - `tokens: array of number`18651866      Array of token IDs for the text content.18671868### Example18691870```http1871curl https://api.openai.com/v1/audio/translations \1872    -H 'Content-Type: multipart/form-data' \1873    -H "Authorization: Bearer $OPENAI_API_KEY" \1874    -F 'file=@/path/to/file' \1875    -F model=whisper-11876```18771878#### Response18791880```json1881{1882  "text": "text"1883}1884```18851886### Example18871888```http1889curl https://api.openai.com/v1/audio/translations \1890  -H "Authorization: Bearer $OPENAI_API_KEY" \1891  -H "Content-Type: multipart/form-data" \1892  -F file="@/path/to/file/german.m4a" \1893  -F model="whisper-1"1894```18951896#### Response18971898```json1899{1900  "text": "Hello, my name is Wolfgang and I come from Germany. Where are you heading today?"1901}1902```19031904## Domain Types19051906### Translation19071908- `Translation object { text }`19091910  - `text: string`19111912### Translation Create Response19131914- `TranslationCreateResponse = Translation or TranslationVerbose`19151916  - `Translation object { text }`19171918    - `text: string`19191920  - `TranslationVerbose object { duration, language, text, segments }`19211922    - `duration: number`19231924      The duration of the input audio.19251926    - `language: string`19271928      The language of the output translation (always `english`).19291930    - `text: string`19311932      The translated text.19331934    - `segments: optional array of TranscriptionSegment`19351936      Segments of the translated text and their corresponding details.19371938      - `id: number`19391940        Unique identifier of the segment.19411942      - `avg_logprob: number`19431944        Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.19451946      - `compression_ratio: number`19471948        Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.19491950      - `end: number`19511952        End time of the segment in seconds.19531954      - `no_speech_prob: number`19551956        Probability of no speech in the segment. If the value is higher than 1.0 and the `avg_logprob` is below -1, consider this segment silent.19571958      - `seek: number`19591960        Seek offset of the segment.19611962      - `start: number`19631964        Start time of the segment in seconds.19651966      - `temperature: number`19671968        Temperature parameter used for generating the segment.19691970      - `text: string`19711972        Text content of the segment.19731974      - `tokens: array of number`19751976        Array of token IDs for the text content.19771978### Translation Verbose19791980- `TranslationVerbose object { duration, language, text, segments }`19811982  - `duration: number`19831984    The duration of the input audio.19851986  - `language: string`19871988    The language of the output translation (always `english`).19891990  - `text: string`19911992    The translated text.19931994  - `segments: optional array of TranscriptionSegment`19951996    Segments of the translated text and their corresponding details.19971998    - `id: number`19992000      Unique identifier of the segment.20012002    - `avg_logprob: number`20032004      Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.20052006    - `compression_ratio: number`20072008      Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.20092010    - `end: number`20112012      End time of the segment in seconds.20132014    - `no_speech_prob: number`20152016      Probability of no speech in the segment. If the value is higher than 1.0 and the `avg_logprob` is below -1, consider this segment silent.20172018    - `seek: number`20192020      Seek offset of the segment.20212022    - `start: number`20232024      Start time of the segment in seconds.20252026    - `temperature: number`20272028      Temperature parameter used for generating the segment.20292030    - `text: string`20312032      Text content of the segment.20332034    - `tokens: array of number`20352036      Array of token IDs for the text content.20372038# Voice Consents20392040## Create voice consent20412042**post** `/audio/voice_consents`20432044Upload a voice consent recording.20452046### Returns20472048- `id: string`20492050  The consent recording identifier.20512052- `created_at: number`20532054  The Unix timestamp (in seconds) for when the consent recording was created.20552056- `language: string`20572058  The BCP 47 language tag for the consent phrase (for example, `en-US`).20592060- `name: string`20612062  The label provided when the consent recording was uploaded.20632064- `object: "audio.voice_consent"`20652066  The object type, which is always `audio.voice_consent`.20672068  - `"audio.voice_consent"`20692070### Example20712072```http2073curl https://api.openai.com/v1/audio/voice_consents \2074    -H 'Content-Type: multipart/form-data' \2075    -H "Authorization: Bearer $OPENAI_API_KEY" \2076    -F language=language \2077    -F name=name \2078    -F 'recording=@/path/to/recording'2079```20802081#### Response20822083```json2084{2085  "id": "cons_1234",2086  "created_at": 0,2087  "language": "language",2088  "name": "name",2089  "object": "audio.voice_consent"2090}2091```20922093### Example20942095```http2096curl https://api.openai.com/v1/audio/voice_consents \2097  -X POST \2098  -H "Authorization: Bearer $OPENAI_API_KEY" \2099  -F "name=John Doe" \2100  -F "language=en-US" \2101  -F "recording=@$HOME/consent_recording.wav;type=audio/x-wav"2102```21032104## Delete voice consent21052106**delete** `/audio/voice_consents/{consent_id}`21072108Deletes a voice consent recording.21092110### Path Parameters21112112- `consent_id: string`21132114### Returns21152116- `id: string`21172118  The consent recording identifier.21192120- `deleted: boolean`21212122- `object: "audio.voice_consent"`21232124  - `"audio.voice_consent"`21252126### Example21272128```http2129curl https://api.openai.com/v1/audio/voice_consents/$CONSENT_ID \2130    -X DELETE \2131    -H "Authorization: Bearer $OPENAI_API_KEY"2132```21332134#### Response21352136```json2137{2138  "id": "cons_1234",2139  "deleted": true,2140  "object": "audio.voice_consent"2141}2142```21432144### Example21452146```http2147curl https://api.openai.com/v1/audio/voice_consents/cons_1234 \2148  -X DELETE \2149  -H "Authorization: Bearer $OPENAI_API_KEY"2150```21512152## List voice consents21532154**get** `/audio/voice_consents`21552156Returns a list of voice consent recordings.21572158### Query Parameters21592160- `after: optional string`21612162  A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.21632164- `limit: optional number`21652166  A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.21672168### Returns21692170- `data: array of object { id, created_at, language, 2 more }`21712172  - `id: string`21732174    The consent recording identifier.21752176  - `created_at: number`21772178    The Unix timestamp (in seconds) for when the consent recording was created.21792180  - `language: string`21812182    The BCP 47 language tag for the consent phrase (for example, `en-US`).21832184  - `name: string`21852186    The label provided when the consent recording was uploaded.21872188  - `object: "audio.voice_consent"`21892190    The object type, which is always `audio.voice_consent`.21912192    - `"audio.voice_consent"`21932194- `has_more: boolean`21952196- `object: "list"`21972198  - `"list"`21992200- `first_id: optional string or null`22012202- `last_id: optional string or null`22032204### Example22052206```http2207curl https://api.openai.com/v1/audio/voice_consents \2208    -H "Authorization: Bearer $OPENAI_API_KEY"2209```22102211#### Response22122213```json2214{2215  "data": [2216    {2217      "id": "cons_1234",2218      "created_at": 0,2219      "language": "language",2220      "name": "name",2221      "object": "audio.voice_consent"2222    }2223  ],2224  "has_more": true,2225  "object": "list",2226  "first_id": "first_id",2227  "last_id": "last_id"2228}2229```22302231### Example22322233```http2234curl https://api.openai.com/v1/audio/voice_consents?limit=20 \2235  -H "Authorization: Bearer $OPENAI_API_KEY"2236```22372238## Retrieve voice consent22392240**get** `/audio/voice_consents/{consent_id}`22412242Retrieves a voice consent recording.22432244### Path Parameters22452246- `consent_id: string`22472248### Returns22492250- `id: string`22512252  The consent recording identifier.22532254- `created_at: number`22552256  The Unix timestamp (in seconds) for when the consent recording was created.22572258- `language: string`22592260  The BCP 47 language tag for the consent phrase (for example, `en-US`).22612262- `name: string`22632264  The label provided when the consent recording was uploaded.22652266- `object: "audio.voice_consent"`22672268  The object type, which is always `audio.voice_consent`.22692270  - `"audio.voice_consent"`22712272### Example22732274```http2275curl https://api.openai.com/v1/audio/voice_consents/$CONSENT_ID \2276    -H "Authorization: Bearer $OPENAI_API_KEY"2277```22782279#### Response22802281```json2282{2283  "id": "cons_1234",2284  "created_at": 0,2285  "language": "language",2286  "name": "name",2287  "object": "audio.voice_consent"2288}2289```22902291### Example22922293```http2294curl https://api.openai.com/v1/audio/voice_consents/cons_1234 \2295  -H "Authorization: Bearer $OPENAI_API_KEY"2296```22972298## Update voice consent22992300**post** `/audio/voice_consents/{consent_id}`23012302Updates a voice consent recording (metadata only).23032304### Path Parameters23052306- `consent_id: string`23072308### Body Parameters23092310- `name: string`23112312  The updated label for this consent recording.23132314### Returns23152316- `id: string`23172318  The consent recording identifier.23192320- `created_at: number`23212322  The Unix timestamp (in seconds) for when the consent recording was created.23232324- `language: string`23252326  The BCP 47 language tag for the consent phrase (for example, `en-US`).23272328- `name: string`23292330  The label provided when the consent recording was uploaded.23312332- `object: "audio.voice_consent"`23332334  The object type, which is always `audio.voice_consent`.23352336  - `"audio.voice_consent"`23372338### Example23392340```http2341curl https://api.openai.com/v1/audio/voice_consents/$CONSENT_ID \2342    -H 'Content-Type: application/json' \2343    -H "Authorization: Bearer $OPENAI_API_KEY" \2344    -d '{2345          "name": "name"2346        }'2347```23482349#### Response23502351```json2352{2353  "id": "cons_1234",2354  "created_at": 0,2355  "language": "language",2356  "name": "name",2357  "object": "audio.voice_consent"2358}2359```23602361### Example23622363```http2364curl https://api.openai.com/v1/audio/voice_consents/cons_1234 \2365  -X POST \2366  -H "Authorization: Bearer $OPENAI_API_KEY" \2367  -H "Content-Type: application/json" \2368  -d '{2369    "name": "John Doe"2370  }'2371```23722373## Domain Types23742375### Voice Consent Create Response23762377- `VoiceConsentCreateResponse object { id, created_at, language, 2 more }`23782379  A consent recording used to authorize creation of a custom voice.23802381  - `id: string`23822383    The consent recording identifier.23842385  - `created_at: number`23862387    The Unix timestamp (in seconds) for when the consent recording was created.23882389  - `language: string`23902391    The BCP 47 language tag for the consent phrase (for example, `en-US`).23922393  - `name: string`23942395    The label provided when the consent recording was uploaded.23962397  - `object: "audio.voice_consent"`23982399    The object type, which is always `audio.voice_consent`.24002401    - `"audio.voice_consent"`24022403### Voice Consent Delete Response24042405- `VoiceConsentDeleteResponse object { id, deleted, object }`24062407  - `id: string`24082409    The consent recording identifier.24102411  - `deleted: boolean`24122413  - `object: "audio.voice_consent"`24142415    - `"audio.voice_consent"`24162417### Voice Consent List Response24182419- `VoiceConsentListResponse object { id, created_at, language, 2 more }`24202421  A consent recording used to authorize creation of a custom voice.24222423  - `id: string`24242425    The consent recording identifier.24262427  - `created_at: number`24282429    The Unix timestamp (in seconds) for when the consent recording was created.24302431  - `language: string`24322433    The BCP 47 language tag for the consent phrase (for example, `en-US`).24342435  - `name: string`24362437    The label provided when the consent recording was uploaded.24382439  - `object: "audio.voice_consent"`24402441    The object type, which is always `audio.voice_consent`.24422443    - `"audio.voice_consent"`24442445### Voice Consent Retrieve Response24462447- `VoiceConsentRetrieveResponse object { id, created_at, language, 2 more }`24482449  A consent recording used to authorize creation of a custom voice.24502451  - `id: string`24522453    The consent recording identifier.24542455  - `created_at: number`24562457    The Unix timestamp (in seconds) for when the consent recording was created.24582459  - `language: string`24602461    The BCP 47 language tag for the consent phrase (for example, `en-US`).24622463  - `name: string`24642465    The label provided when the consent recording was uploaded.24662467  - `object: "audio.voice_consent"`24682469    The object type, which is always `audio.voice_consent`.24702471    - `"audio.voice_consent"`24722473### Voice Consent Update Response24742475- `VoiceConsentUpdateResponse object { id, created_at, language, 2 more }`24762477  A consent recording used to authorize creation of a custom voice.24782479  - `id: string`24802481    The consent recording identifier.24822483  - `created_at: number`24842485    The Unix timestamp (in seconds) for when the consent recording was created.24862487  - `language: string`24882489    The BCP 47 language tag for the consent phrase (for example, `en-US`).24902491  - `name: string`24922493    The label provided when the consent recording was uploaded.24942495  - `object: "audio.voice_consent"`24962497    The object type, which is always `audio.voice_consent`.24982499    - `"audio.voice_consent"`25002501# Voices25022503## Create voice25042505**post** `/audio/voices`25062507Creates a custom voice.25082509### Returns25102511- `id: string`25122513  The voice identifier, which can be referenced in API endpoints.25142515- `created_at: number`25162517  The Unix timestamp (in seconds) for when the voice was created.25182519- `name: string`25202521  The name of the voice.25222523- `object: "audio.voice"`25242525  The object type, which is always `audio.voice`.25262527  - `"audio.voice"`25282529### Example25302531```http2532curl https://api.openai.com/v1/audio/voices \2533    -H 'Content-Type: multipart/form-data' \2534    -H "Authorization: Bearer $OPENAI_API_KEY" \2535    -F 'audio_sample=@/path/to/audio_sample' \2536    -F consent=consent \2537    -F name=name2538```25392540#### Response25412542```json2543{2544  "id": "id",2545  "created_at": 0,2546  "name": "name",2547  "object": "audio.voice"2548}2549```25502551### Example25522553```http2554curl https://api.openai.com/v1/audio/voices \2555  -X POST \2556  -H "Authorization: Bearer $OPENAI_API_KEY" \2557  -F "name=My new voice" \2558  -F "consent=cons_1234" \2559  -F "audio_sample=@$HOME/audio_sample.wav;type=audio/x-wav"2560```25612562## Domain Types25632564### Voice Create Response25652566- `VoiceCreateResponse object { id, created_at, name, object }`25672568  A custom voice that can be used for audio output.25692570  - `id: string`25712572    The voice identifier, which can be referenced in API endpoints.25732574  - `created_at: number`25752576    The Unix timestamp (in seconds) for when the voice was created.25772578  - `name: string`25792580    The name of the voice.25812582  - `object: "audio.voice"`25832584    The object type, which is always `audio.voice`.25852586    - `"audio.voice"`2587
Files main
Menu

Theme