# Table of Contents - [Audio | OpenAI API Reference](#audio-openai-api-reference) - [Audio | OpenAI API Reference](#audio-openai-api-reference) - [Audio | OpenAI API Reference](#audio-openai-api-reference) --- # Audio | OpenAI API Reference [](https://platform.openai.com/docs/overview) Log in[Sign up](https://platform.openai.com/signup) Audio --------- Learn how to turn audio into text or text into audio. Related guide: [Speech to text](https://platform.openai.com/docs/guides/speech-to-text) Create speech ----------------- post https://api.openai.com/v1/audio/speech Generates audio from the input text. #### Request body [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createspeech-input) input string Required The text to generate audio for. The maximum length is 4096 characters. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createspeech-model) model string Required One of the available [TTS models](https://platform.openai.com/docs/models#tts) : `tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createspeech-voice) voice string or object Required 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](https://platform.openai.com/docs/guides/text-to-speech#voice-options) . Hide possible types [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createspeech-voice-string) string [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createspeech-voice-object) object Custom voice reference. Hide properties [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createspeech-voice-object-id) id string Required The custom voice ID, e.g. `voice_1234`. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createspeech-instructions) instructions string Optional Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createspeech-response_format) response\_format string Optional Defaults to mp3 The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createspeech-speed) speed number Optional Defaults to 1 The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createspeech-stream_format) stream\_format string Optional Defaults to audio The format to stream the audio in. Supported formats are `sse` and `audio`. `sse` is not supported for `tts-1` or `tts-1-hd`. #### Returns The audio file content or a [stream of audio events](https://platform.openai.com/docs/api-reference/audio/speech-audio-delta-event) . DefaultSSE Stream Format Example request curl 1 2 3 4 5 6 7 8 9 curl https://api.openai.com/v1/audio/speech \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4o-mini-tts", "input": "The quick brown fox jumped over the lazy dog.", "voice": "alloy" }' \ --output speech.mp3 1 2 3 4 5 6 7 8 9 10 from pathlib import Path import openai speech_file_path = Path(__file__).parent / "speech.mp3" with openai.audio.speech.with_streaming_response.create( model="gpt-4o-mini-tts", voice="alloy", input="The quick brown fox jumped over the lazy dog." ) as response: response.stream_to_file(speech_file_path) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 import fs from "fs"; import path from "path"; import OpenAI from "openai"; const openai = new OpenAI(); const speechFile = path.resolve("./speech.mp3"); async function main() { const mp3 = await openai.audio.speech.create({ model: "gpt-4o-mini-tts", voice: "alloy", input: "Today is a wonderful day to build something people love!", }); console.log(speechFile); const buffer = Buffer.from(await mp3.arrayBuffer()); await fs.promises.writeFile(speechFile, buffer); } main(); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 using System; using System.IO; using OpenAI.Audio; AudioClient client = new( model: "gpt-4o-mini-tts", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY") ); BinaryData speech = client.GenerateSpeech( text: "The quick brown fox jumped over the lazy dog.", voice: GeneratedSpeechVoice.Alloy ); using FileStream stream = File.OpenWrite("speech.mp3"); speech.ToStream().CopyTo(stream); Create voice ---------------- post https://api.openai.com/v1/audio/voices Create a custom voice you can use for audio output (for example, in Text-to-Speech and the Realtime API). This requires an audio sample and a previously uploaded consent recording. See the [custom voices guide](https://platform.openai.com/docs/guides/text-to-speech#custom-voices) for requirements and best practices. Custom voices are limited to eligible customers. #### Request body [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createvoice-audio_sample) audio\_sample file Required The sample audio recording file. Maximum size is 10 MiB. Supported MIME types: `audio/mpeg`, `audio/wav`, `audio/x-wav`, `audio/ogg`, `audio/aac`, `audio/flac`, `audio/webm`, `audio/mp4`. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createvoice-consent) consent string Required The consent recording ID (for example, `cons_1234`). [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createvoice-name) name string Required The name of the new voice. #### Returns The created voice. Example request curl 1 2 3 4 5 6 curl https://api.openai.com/v1/audio/voices \ -X POST \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -F "name=My new voice" \ -F "consent=cons_1234" \ -F "audio_sample=@$HOME/audio_sample.wav;type=audio/x-wav" Create voice consent ------------------------ post https://api.openai.com/v1/audio/voice\_consents Upload a consent recording that authorizes creation of a custom voice. See the [custom voices guide](https://platform.openai.com/docs/guides/text-to-speech#custom-voices) for requirements and best practices. Custom voices are limited to eligible customers. #### Request body [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createvoiceconsent-language) language string Required The BCP 47 language tag for the consent phrase (for example, `en-US`). [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createvoiceconsent-name) name string Required The label to use for this consent recording. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createvoiceconsent-recording) recording file Required The consent audio recording file. Maximum size is 10 MiB. Supported MIME types: `audio/mpeg`, `audio/wav`, `audio/x-wav`, `audio/ogg`, `audio/aac`, `audio/flac`, `audio/webm`, `audio/mp4`. #### Returns The created voice consent recording metadata. Example request curl 1 2 3 4 5 6 curl https://api.openai.com/v1/audio/voice_consents \ -X POST \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -F "name=John Doe" \ -F "language=en-US" \ -F "recording=@$HOME/consent_recording.wav;type=audio/x-wav" List voice consents ----------------------- get https://api.openai.com/v1/audio/voice\_consents List consent recordings available to your organization for creating custom voices. See the [custom voices guide](https://platform.openai.com/docs/guides/text-to-speech#custom-voices) . Custom voices are limited to eligible customers. #### Query parameters [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_listvoiceconsents-after) after string Optional 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. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_listvoiceconsents-limit) limit integer Optional Defaults to 20 A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. #### Returns A paginated list of voice consent recordings. Example request curl 1 2 curl https://api.openai.com/v1/audio/voice_consents?limit=20 \ -H "Authorization: Bearer $OPENAI_API_KEY" Retrieve voice consent -------------------------- get https://api.openai.com/v1/audio/voice\_consents/{consent\_id} Retrieve consent recording metadata used for creating custom voices. See the [custom voices guide](https://platform.openai.com/docs/guides/text-to-speech#custom-voices) . Custom voices are limited to eligible customers. #### Path parameters [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_getvoiceconsent-consent_id) consent\_id string Required The ID of the consent recording to retrieve. #### Returns The voice consent recording metadata. Example request curl 1 2 curl https://api.openai.com/v1/audio/voice_consents/cons_1234 \ -H "Authorization: Bearer $OPENAI_API_KEY" Update voice consent ------------------------ post https://api.openai.com/v1/audio/voice\_consents/{consent\_id} Update consent recording metadata used for creating custom voices. This endpoint updates metadata only and does not replace the underlying audio. See the [custom voices guide](https://platform.openai.com/docs/guides/text-to-speech#custom-voices) . Custom voices are limited to eligible customers. #### Path parameters [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_updatevoiceconsent-consent_id) consent\_id string Required The ID of the consent recording to update. #### Request body [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_updatevoiceconsent-name) name string Required The updated label for this consent recording. #### Returns The updated voice consent recording metadata. Example request curl 1 2 3 4 5 6 7 curl https://api.openai.com/v1/audio/voice_consents/cons_1234 \ -X POST \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "John Doe" }' Delete voice consent ------------------------ delete https://api.openai.com/v1/audio/voice\_consents/{consent\_id} Delete a consent recording that was uploaded for creating custom voices. See the [custom voices guide](https://platform.openai.com/docs/guides/text-to-speech#custom-voices) . Custom voices are limited to eligible customers. #### Path parameters [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_deletevoiceconsent-consent_id) consent\_id string Required The ID of the consent recording to delete. #### Returns A deletion confirmation. Example request curl 1 2 3 curl https://api.openai.com/v1/audio/voice_consents/cons_1234 \ -X DELETE \ -H "Authorization: Bearer $OPENAI_API_KEY" Create transcription ------------------------ post https://api.openai.com/v1/audio/transcriptions Transcribes audio into the input language. #### Request body [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranscription-file) file file Required The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranscription-model) model string Required ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source Whisper V2 model), and `gpt-4o-transcribe-diarize`. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranscription-chunking_strategy) chunking\_strategy "auto" or object Optional Controls how the audio is cut into chunks. When set to `"auto"`, the server first normalizes loudness and then uses voice activity detection (VAD) to choose boundaries. `server_vad` object can be provided to tweak VAD detection parameters manually. If unset, the audio is transcribed as a single block. Required when using `gpt-4o-transcribe-diarize` for inputs longer than 30 seconds. Hide possible types [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranscription-chunking_strategy-string) string Automatically set chunking parameters based on the audio. Must be set to `"auto"`. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranscription-chunking_strategy-object) object Hide properties [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranscription-chunking_strategy-object-type) type string Required Must be set to `server_vad` to enable manual chunking using server side VAD. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranscription-chunking_strategy-object-prefix_padding_ms) prefix\_padding\_ms integer Optional Defaults to 300 Amount of audio to include before the VAD detected speech (in milliseconds). [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranscription-chunking_strategy-object-silence_duration_ms) silence\_duration\_ms integer Optional Defaults to 200 Duration of silence to detect speech stop (in milliseconds). With shorter values the model will respond more quickly, but may jump in on short pauses from the user. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranscription-chunking_strategy-object-threshold) threshold number Optional Defaults to 0.5 Sensitivity threshold (0.0 to 1.0) for voice activity detection. A higher threshold will require louder audio to activate the model, and thus might perform better in noisy environments. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranscription-include) include array Optional Additional information to include in the transcription response. `logprobs` will return the log probabilities of the tokens in the response to understand the model's confidence in the transcription. `logprobs` only works with response\_format set to `json` and only with the models `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using `gpt-4o-transcribe-diarize`. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranscription-known_speaker_names) known\_speaker\_names array Optional Optional list of speaker names that correspond to the audio samples provided in `known_speaker_references[]`. Each entry should be a short identifier (for example `customer` or `agent`). Up to 4 speakers are supported. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranscription-known_speaker_references) known\_speaker\_references array Optional Optional list of audio samples (as [data URLs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs) ) that contain known speaker references matching `known_speaker_names[]`. Each sample must be between 2 and 10 seconds, and can use any of the same input audio formats supported by `file`. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranscription-language) language string Optional The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format will improve accuracy and latency. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranscription-prompt) prompt string Optional An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) should match the audio language. This field is not supported when using `gpt-4o-transcribe-diarize`. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranscription-response_format) response\_format string Optional Defaults to json 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. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranscription-stream) stream boolean Optional Defaults to false If set to true, the model response data will be streamed to the client as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) . See the [Streaming section of the Speech-to-Text guide](https://platform.openai.com/docs/guides/speech-to-text?lang=curl#streaming-transcriptions) for more information. Note: Streaming is not supported for the `whisper-1` model and will be ignored. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranscription-temperature) temperature number Optional Defaults to 0 The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranscription-timestamp_granularities) timestamp\_granularities array Optional Defaults to segment The timestamp granularities to populate for this transcription. `response_format` must be set `verbose_json` to use timestamp granularities. Either or both of these options are supported: `word`, or `segment`. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency. This option is not available for `gpt-4o-transcribe-diarize`. #### Returns The [transcription object](https://platform.openai.com/docs/api-reference/audio/json-object) , a [diarized transcription object](https://platform.openai.com/docs/api-reference/audio/diarized-json-object) , a [verbose transcription object](https://platform.openai.com/docs/api-reference/audio/verbose-json-object) , or a [stream of transcript events](https://platform.openai.com/docs/api-reference/audio/transcript-text-delta-event) . DefaultDiarizationStreamingLogprobsWord timestampsSegment timestamps Example request curl 1 2 3 4 5 curl https://api.openai.com/v1/audio/transcriptions \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: multipart/form-data" \ -F file="@/path/to/file/audio.mp3" \ -F model="gpt-4o-transcribe" 1 2 3 4 5 6 7 8 from openai import OpenAI client = OpenAI() audio_file = open("speech.mp3", "rb") transcript = client.audio.transcriptions.create( model="gpt-4o-transcribe", file=audio_file ) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 import fs from "fs"; import OpenAI from "openai"; const openai = new OpenAI(); async function main() { const transcription = await openai.audio.transcriptions.create({ file: fs.createReadStream("audio.mp3"), model: "gpt-4o-transcribe", }); console.log(transcription.text); } main(); 1 2 3 4 5 6 7 8 9 10 11 12 13 using System; using OpenAI.Audio; string audioFilePath = "audio.mp3"; AudioClient client = new( model: "gpt-4o-transcribe", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY") ); AudioTranscription transcription = client.TranscribeAudio(audioFilePath); Console.WriteLine($"{transcription.Text}"); Response 1 2 3 4 5 6 7 8 9 10 11 12 13 { "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.", "usage": { "type": "tokens", "input_tokens": 14, "input_token_details": { "text_tokens": 0, "audio_tokens": 14 }, "output_tokens": 45, "total_tokens": 59 } } Create translation ---------------------- post https://api.openai.com/v1/audio/translations Translates audio into English. #### Request body [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranslation-file) file file Required The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranslation-model) model string or "whisper-1" Required ID of the model to use. Only `whisper-1` (which is powered by our open source Whisper V2 model) is currently available. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranslation-prompt) prompt string Optional An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) should be in English. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranslation-response_format) response\_format string Optional Defaults to json The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio_createtranslation-temperature) temperature number Optional Defaults to 0 The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit. #### Returns The translated text. Example request curl 1 2 3 4 5 curl https://api.openai.com/v1/audio/translations \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: multipart/form-data" \ -F file="@/path/to/file/german.m4a" \ -F model="whisper-1" 1 2 3 4 5 6 7 8 from openai import OpenAI client = OpenAI() audio_file = open("speech.mp3", "rb") transcript = client.audio.translations.create( model="whisper-1", file=audio_file ) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 import fs from "fs"; import OpenAI from "openai"; const openai = new OpenAI(); async function main() { const translation = await openai.audio.translations.create({ file: fs.createReadStream("speech.mp3"), model: "whisper-1", }); console.log(translation.text); } main(); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 using System; using OpenAI.Audio; string audioFilePath = "audio.mp3"; AudioClient client = new( model: "whisper-1", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY") ); AudioTranscription transcription = client.TranscribeAudio(audioFilePath); Console.WriteLine($"{transcription.Text}"); Response 1 2 3 { "text": "Hello, my name is Wolfgang and I come from Germany. Where are you heading today?" } The voice object -------------------- A custom voice that can be used for audio output. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_object-created_at) created\_at integer The Unix timestamp (in seconds) for when the voice was created. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_object-id) id string The voice identifier, which can be referenced in API endpoints. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_object-name) name string The name of the voice. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_object-object) object string The object type, which is always `audio.voice`. OBJECT The voice object 1 2 3 4 5 6 { "object": "audio.voice", "id": "voice_123abc", "name": "My new voice", "created_at": 1734220800 } The voice consent object ---------------------------- A consent recording used to authorize creation of a custom voice. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_consent_object-created_at) created\_at integer The Unix timestamp (in seconds) for when the consent recording was created. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_consent_object-id) id string The consent recording identifier. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_consent_object-language) language string The BCP 47 language tag for the consent phrase (for example, `en-US`). [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_consent_object-name) name string The label provided when the consent recording was uploaded. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_consent_object-object) object string The object type, which is always `audio.voice_consent`. OBJECT The voice consent object 1 2 3 4 5 6 7 { "object": "audio.voice_consent", "id": "cons_1234", "name": "John Doe", "language": "en-US", "created_at": 1734220800 } The voice consent list object --------------------------------- [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_consent_list-data) data array Hide properties [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_consent_list-data-created_at) created\_at integer The Unix timestamp (in seconds) for when the consent recording was created. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_consent_list-data-id) id string The consent recording identifier. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_consent_list-data-language) language string The BCP 47 language tag for the consent phrase (for example, `en-US`). [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_consent_list-data-name) name string The label provided when the consent recording was uploaded. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_consent_list-data-object) object string The object type, which is always `audio.voice_consent`. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_consent_list-first_id) first\_id string [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_consent_list-has_more) has\_more boolean [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_consent_list-last_id) last\_id string [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_consent_list-object) object string OBJECT The voice consent list object 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { "object": "list", "data": [\ {\ "object": "audio.voice_consent",\ "id": "cons_1234",\ "name": "John Doe",\ "language": "en-US",\ "created_at": 1734220800\ }\ ], "first_id": "cons_1234", "last_id": "cons_1234", "has_more": false } The voice consent deletion object ------------------------------------- [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_consent_deleted-deleted) deleted boolean [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_consent_deleted-id) id string The consent recording identifier. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-voice_consent_deleted-object) object string OBJECT The voice consent deletion object 1 2 3 4 5 { "object": "audio.voice_consent", "id": "cons_1234", "deleted": true } The transcription object (JSON) ----------------------------------- Represents a transcription response returned by model, based on the provided input. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-json_object-logprobs) logprobs array 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. Hide properties [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-json_object-logprobs-bytes) bytes array The bytes of the token. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-json_object-logprobs-logprob) logprob number The log probability of the token. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-json_object-logprobs-token) token string The token in the transcription. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-json_object-text) text string The transcribed text. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-json_object-usage) usage object Token usage statistics for the request. Hide possible types [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-json_object-usage-token_usage) Token Usage object Usage statistics for models billed by token usage. Hide properties [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-json_object-usage-token_usage-input_tokens) input\_tokens integer Number of input tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-json_object-usage-token_usage-output_tokens) output\_tokens integer Number of output tokens generated. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-json_object-usage-token_usage-total_tokens) total\_tokens integer Total number of tokens used (input + output). [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-json_object-usage-token_usage-type) type string The type of the usage object. Always `tokens` for this variant. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-json_object-usage-token_usage-input_token_details) input\_token\_details object Details about the input tokens billed for this request. Hide properties [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-json_object-usage-token_usage-input_token_details-audio_tokens) audio\_tokens integer Number of audio tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-json_object-usage-token_usage-input_token_details-text_tokens) text\_tokens integer Number of text tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-json_object-usage-duration_usage) Duration Usage object Usage statistics for models billed by audio input duration. Hide properties [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-json_object-usage-duration_usage-seconds) seconds number Duration of the input audio in seconds. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-json_object-usage-duration_usage-type) type string The type of the usage object. Always `duration` for this variant. OBJECT The transcription object (JSON) 1 2 3 4 5 6 7 8 9 10 11 12 13 { "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.", "usage": { "type": "tokens", "input_tokens": 14, "input_token_details": { "text_tokens": 10, "audio_tokens": 4 }, "output_tokens": 101, "total_tokens": 115 } } The transcription object (Diarized JSON) -------------------------------------------- Represents a diarized transcription response returned by the model, including the combined transcript and speaker-segment annotations. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-duration) duration number Duration of the input audio in seconds. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-segments) segments array Segments of the transcript annotated with timestamps and speaker labels. Hide properties [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-segments-end) end number End timestamp of the segment in seconds. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-segments-id) id string Unique identifier for the segment. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-segments-speaker) speaker string 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`, ...). [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-segments-start) start number Start timestamp of the segment in seconds. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-segments-text) text string Transcript text for this segment. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-segments-type) type string The type of the segment. Always `transcript.text.segment`. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-task) task string The type of task that was run. Always `transcribe`. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-text) text string The concatenated transcript text for the entire audio input. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-usage) usage object Token or duration usage statistics for the request. Hide possible types [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-usage-token_usage) Token Usage object Usage statistics for models billed by token usage. Hide properties [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-usage-token_usage-input_tokens) input\_tokens integer Number of input tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-usage-token_usage-output_tokens) output\_tokens integer Number of output tokens generated. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-usage-token_usage-total_tokens) total\_tokens integer Total number of tokens used (input + output). [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-usage-token_usage-type) type string The type of the usage object. Always `tokens` for this variant. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-usage-token_usage-input_token_details) input\_token\_details object Details about the input tokens billed for this request. Hide properties [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-usage-token_usage-input_token_details-audio_tokens) audio\_tokens integer Number of audio tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-usage-token_usage-input_token_details-text_tokens) text\_tokens integer Number of text tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-usage-duration_usage) Duration Usage object Usage statistics for models billed by audio input duration. Hide properties [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-usage-duration_usage-seconds) seconds number Duration of the input audio in seconds. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-diarized_json_object-usage-duration_usage-type) type string The type of the usage object. Always `duration` for this variant. OBJECT The transcription object (Diarized JSON) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 { "task": "transcribe", "duration": 42.7, "text": "Agent: Thanks for calling OpenAI support.\nCustomer: Hi, I need help with diarization.", "segments": [\ {\ "type": "transcript.text.segment",\ "id": "seg_001",\ "start": 0.0,\ "end": 5.2,\ "text": "Thanks for calling OpenAI support.",\ "speaker": "agent"\ },\ {\ "type": "transcript.text.segment",\ "id": "seg_002",\ "start": 5.2,\ "end": 12.8,\ "text": "Hi, I need help with diarization.",\ "speaker": "A"\ }\ ], "usage": { "type": "duration", "seconds": 43 } } The transcription object (Verbose JSON) ------------------------------------------- Represents a verbose json transcription response returned by model, based on the provided input. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-verbose_json_object-duration) duration number The duration of the input audio. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-verbose_json_object-language) language string The language of the input audio. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-verbose_json_object-segments) segments array Segments of the transcribed text and their corresponding details. Hide properties [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-verbose_json_object-segments-avg_logprob) avg\_logprob number Average logprob of the segment. If the value is lower than -1, consider the logprobs failed. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-verbose_json_object-segments-compression_ratio) compression\_ratio number Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-verbose_json_object-segments-end) end number End time of the segment in seconds. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-verbose_json_object-segments-id) id integer Unique identifier of the segment. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-verbose_json_object-segments-no_speech_prob) no\_speech\_prob number 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. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-verbose_json_object-segments-seek) seek integer Seek offset of the segment. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-verbose_json_object-segments-start) start number Start time of the segment in seconds. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-verbose_json_object-segments-temperature) temperature number Temperature parameter used for generating the segment. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-verbose_json_object-segments-text) text string Text content of the segment. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-verbose_json_object-segments-tokens) tokens array Array of token IDs for the text content. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-verbose_json_object-text) text string The transcribed text. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-verbose_json_object-usage) usage object Usage statistics for models billed by audio input duration. Hide properties [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-verbose_json_object-usage-seconds) seconds number Duration of the input audio in seconds. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-verbose_json_object-usage-type) type string The type of the usage object. Always `duration` for this variant. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-verbose_json_object-words) words array Extracted words and their corresponding timestamps. Hide properties [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-verbose_json_object-words-end) end number End time of the word in seconds. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-verbose_json_object-words-start) start number Start time of the word in seconds. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-verbose_json_object-words-word) word string The text content of the word. OBJECT The transcription object (Verbose JSON) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 { "task": "transcribe", "language": "english", "duration": 8.470000267028809, "text": "The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.", "segments": [\ {\ "id": 0,\ "seek": 0,\ "start": 0.0,\ "end": 3.319999933242798,\ "text": " The beach was a popular spot on a hot summer day.",\ "tokens": [\ 50364, 440, 7534, 390, 257, 3743, 4008, 322, 257, 2368, 4266, 786, 13, 50530\ ],\ "temperature": 0.0,\ "avg_logprob": -0.2860786020755768,\ "compression_ratio": 1.2363636493682861,\ "no_speech_prob": 0.00985979475080967\ },\ ...\ ], "usage": { "type": "duration", "seconds": 9 } } Stream Event (speech.audio.delta) ------------------------------------- Emitted for each chunk of audio data generated during speech synthesis. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-speech_audio_delta_event-audio) audio string A chunk of Base64-encoded audio data. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-speech_audio_delta_event-type) type string The type of the event. Always `speech.audio.delta`. OBJECT Stream Event (speech.audio.delta) 1 2 3 4 { "type": "speech.audio.delta", "audio": "base64-encoded-audio-data" } Stream Event (speech.audio.done) ------------------------------------ Emitted when the speech synthesis is complete and all audio has been streamed. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-speech_audio_done_event-type) type string The type of the event. Always `speech.audio.done`. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-speech_audio_done_event-usage) usage object Token usage statistics for the request. Hide properties [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-speech_audio_done_event-usage-input_tokens) input\_tokens integer Number of input tokens in the prompt. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-speech_audio_done_event-usage-output_tokens) output\_tokens integer Number of output tokens generated. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-speech_audio_done_event-usage-total_tokens) total\_tokens integer Total number of tokens used (input + output). OBJECT Stream Event (speech.audio.done) 1 2 3 4 5 6 7 8 { "type": "speech.audio.done", "usage": { "input_tokens": 14, "output_tokens": 101, "total_tokens": 115 } } Stream Event (transcript.text.delta) ---------------------------------------- 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](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `Stream` parameter set to `true`. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_delta_event-delta) delta string The text delta that was additionally transcribed. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_delta_event-logprobs) logprobs array The log probabilities of the delta. Only included if you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `include[]` parameter set to `logprobs`. Hide properties [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_delta_event-logprobs-bytes) bytes array The bytes that were used to generate the log probability. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_delta_event-logprobs-logprob) logprob number The log probability of the token. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_delta_event-logprobs-token) token string The token that was used to generate the log probability. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_delta_event-segment_id) segment\_id string Identifier of the diarized segment that this delta belongs to. Only present when using `gpt-4o-transcribe-diarize`. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_delta_event-type) type string The type of the event. Always `transcript.text.delta`. OBJECT Stream Event (transcript.text.delta) 1 2 3 4 { "type": "transcript.text.delta", "delta": " wonderful" } Stream Event (transcript.text.segment) ------------------------------------------ Emitted when a diarized transcription returns a completed segment with speaker information. Only emitted when you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with `stream` set to `true` and `response_format` set to `diarized_json`. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_segment_event-end) end number End timestamp of the segment in seconds. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_segment_event-id) id string Unique identifier for the segment. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_segment_event-speaker) speaker string Speaker label for this segment. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_segment_event-start) start number Start timestamp of the segment in seconds. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_segment_event-text) text string Transcript text for this segment. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_segment_event-type) type string The type of the event. Always `transcript.text.segment`. OBJECT Stream Event (transcript.text.segment) 1 2 3 4 5 6 7 8 { "type": "transcript.text.segment", "id": "seg_002", "start": 5.2, "end": 12.8, "text": "Hi, I need help with diarization.", "speaker": "A" } Stream Event (transcript.text.done) --------------------------------------- Emitted when the transcription is complete. Contains the complete transcription text. Only emitted when you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `Stream` parameter set to `true`. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_done_event-logprobs) logprobs array The log probabilities of the individual tokens in the transcription. Only included if you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `include[]` parameter set to `logprobs`. Hide properties [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_done_event-logprobs-bytes) bytes array The bytes that were used to generate the log probability. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_done_event-logprobs-logprob) logprob number The log probability of the token. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_done_event-logprobs-token) token string The token that was used to generate the log probability. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_done_event-text) text string The text that was transcribed. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_done_event-type) type string The type of the event. Always `transcript.text.done`. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_done_event-usage) usage object Usage statistics for models billed by token usage. Hide properties [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_done_event-usage-input_tokens) input\_tokens integer Number of input tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_done_event-usage-output_tokens) output\_tokens integer Number of output tokens generated. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_done_event-usage-total_tokens) total\_tokens integer Total number of tokens used (input + output). [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_done_event-usage-type) type string The type of the usage object. Always `tokens` for this variant. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_done_event-usage-input_token_details) input\_token\_details object Details about the input tokens billed for this request. Hide properties [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_done_event-usage-input_token_details-audio_tokens) audio\_tokens integer Number of audio tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/json-object#audio-transcript_text_done_event-usage-input_token_details-text_tokens) text\_tokens integer Number of text tokens billed for this request. OBJECT Stream Event (transcript.text.done) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 { "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.", "usage": { "type": "tokens", "input_tokens": 14, "input_token_details": { "text_tokens": 10, "audio_tokens": 4 }, "output_tokens": 31, "total_tokens": 45 } } --- # Audio | OpenAI API Reference [](https://platform.openai.com/docs/overview) Log in[Sign up](https://platform.openai.com/signup) Audio --------- Learn how to turn audio into text or text into audio. Related guide: [Speech to text](https://platform.openai.com/docs/guides/speech-to-text) Create speech ----------------- post https://api.openai.com/v1/audio/speech Generates audio from the input text. #### Request body [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createspeech-input) input string Required The text to generate audio for. The maximum length is 4096 characters. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createspeech-model) model string Required One of the available [TTS models](https://platform.openai.com/docs/models#tts) : `tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createspeech-voice) voice string or object Required 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](https://platform.openai.com/docs/guides/text-to-speech#voice-options) . Hide possible types [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createspeech-voice-string) string [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createspeech-voice-object) object Custom voice reference. Hide properties [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createspeech-voice-object-id) id string Required The custom voice ID, e.g. `voice_1234`. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createspeech-instructions) instructions string Optional Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createspeech-response_format) response\_format string Optional Defaults to mp3 The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createspeech-speed) speed number Optional Defaults to 1 The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createspeech-stream_format) stream\_format string Optional Defaults to audio The format to stream the audio in. Supported formats are `sse` and `audio`. `sse` is not supported for `tts-1` or `tts-1-hd`. #### Returns The audio file content or a [stream of audio events](https://platform.openai.com/docs/api-reference/audio/speech-audio-delta-event) . DefaultSSE Stream Format Example request curl 1 2 3 4 5 6 7 8 9 curl https://api.openai.com/v1/audio/speech \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4o-mini-tts", "input": "The quick brown fox jumped over the lazy dog.", "voice": "alloy" }' \ --output speech.mp3 1 2 3 4 5 6 7 8 9 10 from pathlib import Path import openai speech_file_path = Path(__file__).parent / "speech.mp3" with openai.audio.speech.with_streaming_response.create( model="gpt-4o-mini-tts", voice="alloy", input="The quick brown fox jumped over the lazy dog." ) as response: response.stream_to_file(speech_file_path) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 import fs from "fs"; import path from "path"; import OpenAI from "openai"; const openai = new OpenAI(); const speechFile = path.resolve("./speech.mp3"); async function main() { const mp3 = await openai.audio.speech.create({ model: "gpt-4o-mini-tts", voice: "alloy", input: "Today is a wonderful day to build something people love!", }); console.log(speechFile); const buffer = Buffer.from(await mp3.arrayBuffer()); await fs.promises.writeFile(speechFile, buffer); } main(); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 using System; using System.IO; using OpenAI.Audio; AudioClient client = new( model: "gpt-4o-mini-tts", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY") ); BinaryData speech = client.GenerateSpeech( text: "The quick brown fox jumped over the lazy dog.", voice: GeneratedSpeechVoice.Alloy ); using FileStream stream = File.OpenWrite("speech.mp3"); speech.ToStream().CopyTo(stream); Create voice ---------------- post https://api.openai.com/v1/audio/voices Create a custom voice you can use for audio output (for example, in Text-to-Speech and the Realtime API). This requires an audio sample and a previously uploaded consent recording. See the [custom voices guide](https://platform.openai.com/docs/guides/text-to-speech#custom-voices) for requirements and best practices. Custom voices are limited to eligible customers. #### Request body [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createvoice-audio_sample) audio\_sample file Required The sample audio recording file. Maximum size is 10 MiB. Supported MIME types: `audio/mpeg`, `audio/wav`, `audio/x-wav`, `audio/ogg`, `audio/aac`, `audio/flac`, `audio/webm`, `audio/mp4`. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createvoice-consent) consent string Required The consent recording ID (for example, `cons_1234`). [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createvoice-name) name string Required The name of the new voice. #### Returns The created voice. Example request curl 1 2 3 4 5 6 curl https://api.openai.com/v1/audio/voices \ -X POST \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -F "name=My new voice" \ -F "consent=cons_1234" \ -F "audio_sample=@$HOME/audio_sample.wav;type=audio/x-wav" Create voice consent ------------------------ post https://api.openai.com/v1/audio/voice\_consents Upload a consent recording that authorizes creation of a custom voice. See the [custom voices guide](https://platform.openai.com/docs/guides/text-to-speech#custom-voices) for requirements and best practices. Custom voices are limited to eligible customers. #### Request body [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createvoiceconsent-language) language string Required The BCP 47 language tag for the consent phrase (for example, `en-US`). [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createvoiceconsent-name) name string Required The label to use for this consent recording. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createvoiceconsent-recording) recording file Required The consent audio recording file. Maximum size is 10 MiB. Supported MIME types: `audio/mpeg`, `audio/wav`, `audio/x-wav`, `audio/ogg`, `audio/aac`, `audio/flac`, `audio/webm`, `audio/mp4`. #### Returns The created voice consent recording metadata. Example request curl 1 2 3 4 5 6 curl https://api.openai.com/v1/audio/voice_consents \ -X POST \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -F "name=John Doe" \ -F "language=en-US" \ -F "recording=@$HOME/consent_recording.wav;type=audio/x-wav" List voice consents ----------------------- get https://api.openai.com/v1/audio/voice\_consents List consent recordings available to your organization for creating custom voices. See the [custom voices guide](https://platform.openai.com/docs/guides/text-to-speech#custom-voices) . Custom voices are limited to eligible customers. #### Query parameters [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_listvoiceconsents-after) after string Optional 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. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_listvoiceconsents-limit) limit integer Optional Defaults to 20 A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. #### Returns A paginated list of voice consent recordings. Example request curl 1 2 curl https://api.openai.com/v1/audio/voice_consents?limit=20 \ -H "Authorization: Bearer $OPENAI_API_KEY" Retrieve voice consent -------------------------- get https://api.openai.com/v1/audio/voice\_consents/{consent\_id} Retrieve consent recording metadata used for creating custom voices. See the [custom voices guide](https://platform.openai.com/docs/guides/text-to-speech#custom-voices) . Custom voices are limited to eligible customers. #### Path parameters [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_getvoiceconsent-consent_id) consent\_id string Required The ID of the consent recording to retrieve. #### Returns The voice consent recording metadata. Example request curl 1 2 curl https://api.openai.com/v1/audio/voice_consents/cons_1234 \ -H "Authorization: Bearer $OPENAI_API_KEY" Update voice consent ------------------------ post https://api.openai.com/v1/audio/voice\_consents/{consent\_id} Update consent recording metadata used for creating custom voices. This endpoint updates metadata only and does not replace the underlying audio. See the [custom voices guide](https://platform.openai.com/docs/guides/text-to-speech#custom-voices) . Custom voices are limited to eligible customers. #### Path parameters [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_updatevoiceconsent-consent_id) consent\_id string Required The ID of the consent recording to update. #### Request body [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_updatevoiceconsent-name) name string Required The updated label for this consent recording. #### Returns The updated voice consent recording metadata. Example request curl 1 2 3 4 5 6 7 curl https://api.openai.com/v1/audio/voice_consents/cons_1234 \ -X POST \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "John Doe" }' Delete voice consent ------------------------ delete https://api.openai.com/v1/audio/voice\_consents/{consent\_id} Delete a consent recording that was uploaded for creating custom voices. See the [custom voices guide](https://platform.openai.com/docs/guides/text-to-speech#custom-voices) . Custom voices are limited to eligible customers. #### Path parameters [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_deletevoiceconsent-consent_id) consent\_id string Required The ID of the consent recording to delete. #### Returns A deletion confirmation. Example request curl 1 2 3 curl https://api.openai.com/v1/audio/voice_consents/cons_1234 \ -X DELETE \ -H "Authorization: Bearer $OPENAI_API_KEY" Create transcription ------------------------ post https://api.openai.com/v1/audio/transcriptions Transcribes audio into the input language. #### Request body [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranscription-file) file file Required The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranscription-model) model string Required ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source Whisper V2 model), and `gpt-4o-transcribe-diarize`. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranscription-chunking_strategy) chunking\_strategy "auto" or object Optional Controls how the audio is cut into chunks. When set to `"auto"`, the server first normalizes loudness and then uses voice activity detection (VAD) to choose boundaries. `server_vad` object can be provided to tweak VAD detection parameters manually. If unset, the audio is transcribed as a single block. Required when using `gpt-4o-transcribe-diarize` for inputs longer than 30 seconds. Hide possible types [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranscription-chunking_strategy-string) string Automatically set chunking parameters based on the audio. Must be set to `"auto"`. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranscription-chunking_strategy-object) object Hide properties [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranscription-chunking_strategy-object-type) type string Required Must be set to `server_vad` to enable manual chunking using server side VAD. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranscription-chunking_strategy-object-prefix_padding_ms) prefix\_padding\_ms integer Optional Defaults to 300 Amount of audio to include before the VAD detected speech (in milliseconds). [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranscription-chunking_strategy-object-silence_duration_ms) silence\_duration\_ms integer Optional Defaults to 200 Duration of silence to detect speech stop (in milliseconds). With shorter values the model will respond more quickly, but may jump in on short pauses from the user. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranscription-chunking_strategy-object-threshold) threshold number Optional Defaults to 0.5 Sensitivity threshold (0.0 to 1.0) for voice activity detection. A higher threshold will require louder audio to activate the model, and thus might perform better in noisy environments. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranscription-include) include array Optional Additional information to include in the transcription response. `logprobs` will return the log probabilities of the tokens in the response to understand the model's confidence in the transcription. `logprobs` only works with response\_format set to `json` and only with the models `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using `gpt-4o-transcribe-diarize`. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranscription-known_speaker_names) known\_speaker\_names array Optional Optional list of speaker names that correspond to the audio samples provided in `known_speaker_references[]`. Each entry should be a short identifier (for example `customer` or `agent`). Up to 4 speakers are supported. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranscription-known_speaker_references) known\_speaker\_references array Optional Optional list of audio samples (as [data URLs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs) ) that contain known speaker references matching `known_speaker_names[]`. Each sample must be between 2 and 10 seconds, and can use any of the same input audio formats supported by `file`. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranscription-language) language string Optional The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format will improve accuracy and latency. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranscription-prompt) prompt string Optional An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) should match the audio language. This field is not supported when using `gpt-4o-transcribe-diarize`. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranscription-response_format) response\_format string Optional Defaults to json 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. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranscription-stream) stream boolean Optional Defaults to false If set to true, the model response data will be streamed to the client as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) . See the [Streaming section of the Speech-to-Text guide](https://platform.openai.com/docs/guides/speech-to-text?lang=curl#streaming-transcriptions) for more information. Note: Streaming is not supported for the `whisper-1` model and will be ignored. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranscription-temperature) temperature number Optional Defaults to 0 The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranscription-timestamp_granularities) timestamp\_granularities array Optional Defaults to segment The timestamp granularities to populate for this transcription. `response_format` must be set `verbose_json` to use timestamp granularities. Either or both of these options are supported: `word`, or `segment`. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency. This option is not available for `gpt-4o-transcribe-diarize`. #### Returns The [transcription object](https://platform.openai.com/docs/api-reference/audio/json-object) , a [diarized transcription object](https://platform.openai.com/docs/api-reference/audio/diarized-json-object) , a [verbose transcription object](https://platform.openai.com/docs/api-reference/audio/verbose-json-object) , or a [stream of transcript events](https://platform.openai.com/docs/api-reference/audio/transcript-text-delta-event) . DefaultDiarizationStreamingLogprobsWord timestampsSegment timestamps Example request curl 1 2 3 4 5 curl https://api.openai.com/v1/audio/transcriptions \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: multipart/form-data" \ -F file="@/path/to/file/audio.mp3" \ -F model="gpt-4o-transcribe" 1 2 3 4 5 6 7 8 from openai import OpenAI client = OpenAI() audio_file = open("speech.mp3", "rb") transcript = client.audio.transcriptions.create( model="gpt-4o-transcribe", file=audio_file ) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 import fs from "fs"; import OpenAI from "openai"; const openai = new OpenAI(); async function main() { const transcription = await openai.audio.transcriptions.create({ file: fs.createReadStream("audio.mp3"), model: "gpt-4o-transcribe", }); console.log(transcription.text); } main(); 1 2 3 4 5 6 7 8 9 10 11 12 13 using System; using OpenAI.Audio; string audioFilePath = "audio.mp3"; AudioClient client = new( model: "gpt-4o-transcribe", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY") ); AudioTranscription transcription = client.TranscribeAudio(audioFilePath); Console.WriteLine($"{transcription.Text}"); Response 1 2 3 4 5 6 7 8 9 10 11 12 13 { "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.", "usage": { "type": "tokens", "input_tokens": 14, "input_token_details": { "text_tokens": 0, "audio_tokens": 14 }, "output_tokens": 45, "total_tokens": 59 } } Create translation ---------------------- post https://api.openai.com/v1/audio/translations Translates audio into English. #### Request body [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranslation-file) file file Required The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranslation-model) model string or "whisper-1" Required ID of the model to use. Only `whisper-1` (which is powered by our open source Whisper V2 model) is currently available. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranslation-prompt) prompt string Optional An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) should be in English. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranslation-response_format) response\_format string Optional Defaults to json The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio_createtranslation-temperature) temperature number Optional Defaults to 0 The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit. #### Returns The translated text. Example request curl 1 2 3 4 5 curl https://api.openai.com/v1/audio/translations \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: multipart/form-data" \ -F file="@/path/to/file/german.m4a" \ -F model="whisper-1" 1 2 3 4 5 6 7 8 from openai import OpenAI client = OpenAI() audio_file = open("speech.mp3", "rb") transcript = client.audio.translations.create( model="whisper-1", file=audio_file ) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 import fs from "fs"; import OpenAI from "openai"; const openai = new OpenAI(); async function main() { const translation = await openai.audio.translations.create({ file: fs.createReadStream("speech.mp3"), model: "whisper-1", }); console.log(translation.text); } main(); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 using System; using OpenAI.Audio; string audioFilePath = "audio.mp3"; AudioClient client = new( model: "whisper-1", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY") ); AudioTranscription transcription = client.TranscribeAudio(audioFilePath); Console.WriteLine($"{transcription.Text}"); Response 1 2 3 { "text": "Hello, my name is Wolfgang and I come from Germany. Where are you heading today?" } The voice object -------------------- A custom voice that can be used for audio output. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_object-created_at) created\_at integer The Unix timestamp (in seconds) for when the voice was created. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_object-id) id string The voice identifier, which can be referenced in API endpoints. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_object-name) name string The name of the voice. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_object-object) object string The object type, which is always `audio.voice`. OBJECT The voice object 1 2 3 4 5 6 { "object": "audio.voice", "id": "voice_123abc", "name": "My new voice", "created_at": 1734220800 } The voice consent object ---------------------------- A consent recording used to authorize creation of a custom voice. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_consent_object-created_at) created\_at integer The Unix timestamp (in seconds) for when the consent recording was created. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_consent_object-id) id string The consent recording identifier. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_consent_object-language) language string The BCP 47 language tag for the consent phrase (for example, `en-US`). [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_consent_object-name) name string The label provided when the consent recording was uploaded. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_consent_object-object) object string The object type, which is always `audio.voice_consent`. OBJECT The voice consent object 1 2 3 4 5 6 7 { "object": "audio.voice_consent", "id": "cons_1234", "name": "John Doe", "language": "en-US", "created_at": 1734220800 } The voice consent list object --------------------------------- [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_consent_list-data) data array Hide properties [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_consent_list-data-created_at) created\_at integer The Unix timestamp (in seconds) for when the consent recording was created. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_consent_list-data-id) id string The consent recording identifier. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_consent_list-data-language) language string The BCP 47 language tag for the consent phrase (for example, `en-US`). [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_consent_list-data-name) name string The label provided when the consent recording was uploaded. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_consent_list-data-object) object string The object type, which is always `audio.voice_consent`. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_consent_list-first_id) first\_id string [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_consent_list-has_more) has\_more boolean [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_consent_list-last_id) last\_id string [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_consent_list-object) object string OBJECT The voice consent list object 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { "object": "list", "data": [\ {\ "object": "audio.voice_consent",\ "id": "cons_1234",\ "name": "John Doe",\ "language": "en-US",\ "created_at": 1734220800\ }\ ], "first_id": "cons_1234", "last_id": "cons_1234", "has_more": false } The voice consent deletion object ------------------------------------- [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_consent_deleted-deleted) deleted boolean [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_consent_deleted-id) id string The consent recording identifier. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-voice_consent_deleted-object) object string OBJECT The voice consent deletion object 1 2 3 4 5 { "object": "audio.voice_consent", "id": "cons_1234", "deleted": true } The transcription object (JSON) ----------------------------------- Represents a transcription response returned by model, based on the provided input. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-json_object-logprobs) logprobs array 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. Hide properties [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-json_object-logprobs-bytes) bytes array The bytes of the token. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-json_object-logprobs-logprob) logprob number The log probability of the token. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-json_object-logprobs-token) token string The token in the transcription. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-json_object-text) text string The transcribed text. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-json_object-usage) usage object Token usage statistics for the request. Hide possible types [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-json_object-usage-token_usage) Token Usage object Usage statistics for models billed by token usage. Hide properties [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-json_object-usage-token_usage-input_tokens) input\_tokens integer Number of input tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-json_object-usage-token_usage-output_tokens) output\_tokens integer Number of output tokens generated. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-json_object-usage-token_usage-total_tokens) total\_tokens integer Total number of tokens used (input + output). [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-json_object-usage-token_usage-type) type string The type of the usage object. Always `tokens` for this variant. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-json_object-usage-token_usage-input_token_details) input\_token\_details object Details about the input tokens billed for this request. Hide properties [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-json_object-usage-token_usage-input_token_details-audio_tokens) audio\_tokens integer Number of audio tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-json_object-usage-token_usage-input_token_details-text_tokens) text\_tokens integer Number of text tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-json_object-usage-duration_usage) Duration Usage object Usage statistics for models billed by audio input duration. Hide properties [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-json_object-usage-duration_usage-seconds) seconds number Duration of the input audio in seconds. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-json_object-usage-duration_usage-type) type string The type of the usage object. Always `duration` for this variant. OBJECT The transcription object (JSON) 1 2 3 4 5 6 7 8 9 10 11 12 13 { "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.", "usage": { "type": "tokens", "input_tokens": 14, "input_token_details": { "text_tokens": 10, "audio_tokens": 4 }, "output_tokens": 101, "total_tokens": 115 } } The transcription object (Diarized JSON) -------------------------------------------- Represents a diarized transcription response returned by the model, including the combined transcript and speaker-segment annotations. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-duration) duration number Duration of the input audio in seconds. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-segments) segments array Segments of the transcript annotated with timestamps and speaker labels. Hide properties [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-segments-end) end number End timestamp of the segment in seconds. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-segments-id) id string Unique identifier for the segment. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-segments-speaker) speaker string 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`, ...). [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-segments-start) start number Start timestamp of the segment in seconds. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-segments-text) text string Transcript text for this segment. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-segments-type) type string The type of the segment. Always `transcript.text.segment`. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-task) task string The type of task that was run. Always `transcribe`. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-text) text string The concatenated transcript text for the entire audio input. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-usage) usage object Token or duration usage statistics for the request. Hide possible types [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-usage-token_usage) Token Usage object Usage statistics for models billed by token usage. Hide properties [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-usage-token_usage-input_tokens) input\_tokens integer Number of input tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-usage-token_usage-output_tokens) output\_tokens integer Number of output tokens generated. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-usage-token_usage-total_tokens) total\_tokens integer Total number of tokens used (input + output). [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-usage-token_usage-type) type string The type of the usage object. Always `tokens` for this variant. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-usage-token_usage-input_token_details) input\_token\_details object Details about the input tokens billed for this request. Hide properties [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-usage-token_usage-input_token_details-audio_tokens) audio\_tokens integer Number of audio tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-usage-token_usage-input_token_details-text_tokens) text\_tokens integer Number of text tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-usage-duration_usage) Duration Usage object Usage statistics for models billed by audio input duration. Hide properties [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-usage-duration_usage-seconds) seconds number Duration of the input audio in seconds. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-diarized_json_object-usage-duration_usage-type) type string The type of the usage object. Always `duration` for this variant. OBJECT The transcription object (Diarized JSON) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 { "task": "transcribe", "duration": 42.7, "text": "Agent: Thanks for calling OpenAI support.\nCustomer: Hi, I need help with diarization.", "segments": [\ {\ "type": "transcript.text.segment",\ "id": "seg_001",\ "start": 0.0,\ "end": 5.2,\ "text": "Thanks for calling OpenAI support.",\ "speaker": "agent"\ },\ {\ "type": "transcript.text.segment",\ "id": "seg_002",\ "start": 5.2,\ "end": 12.8,\ "text": "Hi, I need help with diarization.",\ "speaker": "A"\ }\ ], "usage": { "type": "duration", "seconds": 43 } } The transcription object (Verbose JSON) ------------------------------------------- Represents a verbose json transcription response returned by model, based on the provided input. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-verbose_json_object-duration) duration number The duration of the input audio. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-verbose_json_object-language) language string The language of the input audio. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-verbose_json_object-segments) segments array Segments of the transcribed text and their corresponding details. Hide properties [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-verbose_json_object-segments-avg_logprob) avg\_logprob number Average logprob of the segment. If the value is lower than -1, consider the logprobs failed. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-verbose_json_object-segments-compression_ratio) compression\_ratio number Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-verbose_json_object-segments-end) end number End time of the segment in seconds. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-verbose_json_object-segments-id) id integer Unique identifier of the segment. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-verbose_json_object-segments-no_speech_prob) no\_speech\_prob number 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. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-verbose_json_object-segments-seek) seek integer Seek offset of the segment. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-verbose_json_object-segments-start) start number Start time of the segment in seconds. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-verbose_json_object-segments-temperature) temperature number Temperature parameter used for generating the segment. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-verbose_json_object-segments-text) text string Text content of the segment. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-verbose_json_object-segments-tokens) tokens array Array of token IDs for the text content. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-verbose_json_object-text) text string The transcribed text. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-verbose_json_object-usage) usage object Usage statistics for models billed by audio input duration. Hide properties [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-verbose_json_object-usage-seconds) seconds number Duration of the input audio in seconds. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-verbose_json_object-usage-type) type string The type of the usage object. Always `duration` for this variant. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-verbose_json_object-words) words array Extracted words and their corresponding timestamps. Hide properties [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-verbose_json_object-words-end) end number End time of the word in seconds. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-verbose_json_object-words-start) start number Start time of the word in seconds. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-verbose_json_object-words-word) word string The text content of the word. OBJECT The transcription object (Verbose JSON) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 { "task": "transcribe", "language": "english", "duration": 8.470000267028809, "text": "The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.", "segments": [\ {\ "id": 0,\ "seek": 0,\ "start": 0.0,\ "end": 3.319999933242798,\ "text": " The beach was a popular spot on a hot summer day.",\ "tokens": [\ 50364, 440, 7534, 390, 257, 3743, 4008, 322, 257, 2368, 4266, 786, 13, 50530\ ],\ "temperature": 0.0,\ "avg_logprob": -0.2860786020755768,\ "compression_ratio": 1.2363636493682861,\ "no_speech_prob": 0.00985979475080967\ },\ ...\ ], "usage": { "type": "duration", "seconds": 9 } } Stream Event (speech.audio.delta) ------------------------------------- Emitted for each chunk of audio data generated during speech synthesis. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-speech_audio_delta_event-audio) audio string A chunk of Base64-encoded audio data. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-speech_audio_delta_event-type) type string The type of the event. Always `speech.audio.delta`. OBJECT Stream Event (speech.audio.delta) 1 2 3 4 { "type": "speech.audio.delta", "audio": "base64-encoded-audio-data" } Stream Event (speech.audio.done) ------------------------------------ Emitted when the speech synthesis is complete and all audio has been streamed. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-speech_audio_done_event-type) type string The type of the event. Always `speech.audio.done`. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-speech_audio_done_event-usage) usage object Token usage statistics for the request. Hide properties [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-speech_audio_done_event-usage-input_tokens) input\_tokens integer Number of input tokens in the prompt. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-speech_audio_done_event-usage-output_tokens) output\_tokens integer Number of output tokens generated. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-speech_audio_done_event-usage-total_tokens) total\_tokens integer Total number of tokens used (input + output). OBJECT Stream Event (speech.audio.done) 1 2 3 4 5 6 7 8 { "type": "speech.audio.done", "usage": { "input_tokens": 14, "output_tokens": 101, "total_tokens": 115 } } Stream Event (transcript.text.delta) ---------------------------------------- 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](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `Stream` parameter set to `true`. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_delta_event-delta) delta string The text delta that was additionally transcribed. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_delta_event-logprobs) logprobs array The log probabilities of the delta. Only included if you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `include[]` parameter set to `logprobs`. Hide properties [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_delta_event-logprobs-bytes) bytes array The bytes that were used to generate the log probability. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_delta_event-logprobs-logprob) logprob number The log probability of the token. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_delta_event-logprobs-token) token string The token that was used to generate the log probability. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_delta_event-segment_id) segment\_id string Identifier of the diarized segment that this delta belongs to. Only present when using `gpt-4o-transcribe-diarize`. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_delta_event-type) type string The type of the event. Always `transcript.text.delta`. OBJECT Stream Event (transcript.text.delta) 1 2 3 4 { "type": "transcript.text.delta", "delta": " wonderful" } Stream Event (transcript.text.segment) ------------------------------------------ Emitted when a diarized transcription returns a completed segment with speaker information. Only emitted when you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with `stream` set to `true` and `response_format` set to `diarized_json`. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_segment_event-end) end number End timestamp of the segment in seconds. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_segment_event-id) id string Unique identifier for the segment. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_segment_event-speaker) speaker string Speaker label for this segment. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_segment_event-start) start number Start timestamp of the segment in seconds. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_segment_event-text) text string Transcript text for this segment. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_segment_event-type) type string The type of the event. Always `transcript.text.segment`. OBJECT Stream Event (transcript.text.segment) 1 2 3 4 5 6 7 8 { "type": "transcript.text.segment", "id": "seg_002", "start": 5.2, "end": 12.8, "text": "Hi, I need help with diarization.", "speaker": "A" } Stream Event (transcript.text.done) --------------------------------------- Emitted when the transcription is complete. Contains the complete transcription text. Only emitted when you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `Stream` parameter set to `true`. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_done_event-logprobs) logprobs array The log probabilities of the individual tokens in the transcription. Only included if you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `include[]` parameter set to `logprobs`. Hide properties [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_done_event-logprobs-bytes) bytes array The bytes that were used to generate the log probability. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_done_event-logprobs-logprob) logprob number The log probability of the token. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_done_event-logprobs-token) token string The token that was used to generate the log probability. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_done_event-text) text string The text that was transcribed. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_done_event-type) type string The type of the event. Always `transcript.text.done`. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_done_event-usage) usage object Usage statistics for models billed by token usage. Hide properties [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_done_event-usage-input_tokens) input\_tokens integer Number of input tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_done_event-usage-output_tokens) output\_tokens integer Number of output tokens generated. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_done_event-usage-total_tokens) total\_tokens integer Total number of tokens used (input + output). [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_done_event-usage-type) type string The type of the usage object. Always `tokens` for this variant. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_done_event-usage-input_token_details) input\_token\_details object Details about the input tokens billed for this request. Hide properties [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_done_event-usage-input_token_details-audio_tokens) audio\_tokens integer Number of audio tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/diarized-json-object#audio-transcript_text_done_event-usage-input_token_details-text_tokens) text\_tokens integer Number of text tokens billed for this request. OBJECT Stream Event (transcript.text.done) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 { "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.", "usage": { "type": "tokens", "input_tokens": 14, "input_token_details": { "text_tokens": 10, "audio_tokens": 4 }, "output_tokens": 31, "total_tokens": 45 } } --- # Audio | OpenAI API Reference [](https://platform.openai.com/docs/overview) Log in[Sign up](https://platform.openai.com/signup) Audio --------- Learn how to turn audio into text or text into audio. Related guide: [Speech to text](https://platform.openai.com/docs/guides/speech-to-text) Create speech ----------------- post https://api.openai.com/v1/audio/speech Generates audio from the input text. #### Request body [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createspeech-input) input string Required The text to generate audio for. The maximum length is 4096 characters. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createspeech-model) model string Required One of the available [TTS models](https://platform.openai.com/docs/models#tts) : `tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createspeech-voice) voice string or object Required 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](https://platform.openai.com/docs/guides/text-to-speech#voice-options) . Hide possible types [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createspeech-voice-string) string [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createspeech-voice-object) object Custom voice reference. Hide properties [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createspeech-voice-object-id) id string Required The custom voice ID, e.g. `voice_1234`. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createspeech-instructions) instructions string Optional Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createspeech-response_format) response\_format string Optional Defaults to mp3 The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createspeech-speed) speed number Optional Defaults to 1 The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createspeech-stream_format) stream\_format string Optional Defaults to audio The format to stream the audio in. Supported formats are `sse` and `audio`. `sse` is not supported for `tts-1` or `tts-1-hd`. #### Returns The audio file content or a [stream of audio events](https://platform.openai.com/docs/api-reference/audio/speech-audio-delta-event) . DefaultSSE Stream Format Example request curl 1 2 3 4 5 6 7 8 9 curl https://api.openai.com/v1/audio/speech \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4o-mini-tts", "input": "The quick brown fox jumped over the lazy dog.", "voice": "alloy" }' \ --output speech.mp3 1 2 3 4 5 6 7 8 9 10 from pathlib import Path import openai speech_file_path = Path(__file__).parent / "speech.mp3" with openai.audio.speech.with_streaming_response.create( model="gpt-4o-mini-tts", voice="alloy", input="The quick brown fox jumped over the lazy dog." ) as response: response.stream_to_file(speech_file_path) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 import fs from "fs"; import path from "path"; import OpenAI from "openai"; const openai = new OpenAI(); const speechFile = path.resolve("./speech.mp3"); async function main() { const mp3 = await openai.audio.speech.create({ model: "gpt-4o-mini-tts", voice: "alloy", input: "Today is a wonderful day to build something people love!", }); console.log(speechFile); const buffer = Buffer.from(await mp3.arrayBuffer()); await fs.promises.writeFile(speechFile, buffer); } main(); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 using System; using System.IO; using OpenAI.Audio; AudioClient client = new( model: "gpt-4o-mini-tts", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY") ); BinaryData speech = client.GenerateSpeech( text: "The quick brown fox jumped over the lazy dog.", voice: GeneratedSpeechVoice.Alloy ); using FileStream stream = File.OpenWrite("speech.mp3"); speech.ToStream().CopyTo(stream); Create voice ---------------- post https://api.openai.com/v1/audio/voices Create a custom voice you can use for audio output (for example, in Text-to-Speech and the Realtime API). This requires an audio sample and a previously uploaded consent recording. See the [custom voices guide](https://platform.openai.com/docs/guides/text-to-speech#custom-voices) for requirements and best practices. Custom voices are limited to eligible customers. #### Request body [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createvoice-audio_sample) audio\_sample file Required The sample audio recording file. Maximum size is 10 MiB. Supported MIME types: `audio/mpeg`, `audio/wav`, `audio/x-wav`, `audio/ogg`, `audio/aac`, `audio/flac`, `audio/webm`, `audio/mp4`. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createvoice-consent) consent string Required The consent recording ID (for example, `cons_1234`). [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createvoice-name) name string Required The name of the new voice. #### Returns The created voice. Example request curl 1 2 3 4 5 6 curl https://api.openai.com/v1/audio/voices \ -X POST \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -F "name=My new voice" \ -F "consent=cons_1234" \ -F "audio_sample=@$HOME/audio_sample.wav;type=audio/x-wav" Create voice consent ------------------------ post https://api.openai.com/v1/audio/voice\_consents Upload a consent recording that authorizes creation of a custom voice. See the [custom voices guide](https://platform.openai.com/docs/guides/text-to-speech#custom-voices) for requirements and best practices. Custom voices are limited to eligible customers. #### Request body [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createvoiceconsent-language) language string Required The BCP 47 language tag for the consent phrase (for example, `en-US`). [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createvoiceconsent-name) name string Required The label to use for this consent recording. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createvoiceconsent-recording) recording file Required The consent audio recording file. Maximum size is 10 MiB. Supported MIME types: `audio/mpeg`, `audio/wav`, `audio/x-wav`, `audio/ogg`, `audio/aac`, `audio/flac`, `audio/webm`, `audio/mp4`. #### Returns The created voice consent recording metadata. Example request curl 1 2 3 4 5 6 curl https://api.openai.com/v1/audio/voice_consents \ -X POST \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -F "name=John Doe" \ -F "language=en-US" \ -F "recording=@$HOME/consent_recording.wav;type=audio/x-wav" List voice consents ----------------------- get https://api.openai.com/v1/audio/voice\_consents List consent recordings available to your organization for creating custom voices. See the [custom voices guide](https://platform.openai.com/docs/guides/text-to-speech#custom-voices) . Custom voices are limited to eligible customers. #### Query parameters [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_listvoiceconsents-after) after string Optional 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. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_listvoiceconsents-limit) limit integer Optional Defaults to 20 A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. #### Returns A paginated list of voice consent recordings. Example request curl 1 2 curl https://api.openai.com/v1/audio/voice_consents?limit=20 \ -H "Authorization: Bearer $OPENAI_API_KEY" Retrieve voice consent -------------------------- get https://api.openai.com/v1/audio/voice\_consents/{consent\_id} Retrieve consent recording metadata used for creating custom voices. See the [custom voices guide](https://platform.openai.com/docs/guides/text-to-speech#custom-voices) . Custom voices are limited to eligible customers. #### Path parameters [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_getvoiceconsent-consent_id) consent\_id string Required The ID of the consent recording to retrieve. #### Returns The voice consent recording metadata. Example request curl 1 2 curl https://api.openai.com/v1/audio/voice_consents/cons_1234 \ -H "Authorization: Bearer $OPENAI_API_KEY" Update voice consent ------------------------ post https://api.openai.com/v1/audio/voice\_consents/{consent\_id} Update consent recording metadata used for creating custom voices. This endpoint updates metadata only and does not replace the underlying audio. See the [custom voices guide](https://platform.openai.com/docs/guides/text-to-speech#custom-voices) . Custom voices are limited to eligible customers. #### Path parameters [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_updatevoiceconsent-consent_id) consent\_id string Required The ID of the consent recording to update. #### Request body [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_updatevoiceconsent-name) name string Required The updated label for this consent recording. #### Returns The updated voice consent recording metadata. Example request curl 1 2 3 4 5 6 7 curl https://api.openai.com/v1/audio/voice_consents/cons_1234 \ -X POST \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "John Doe" }' Delete voice consent ------------------------ delete https://api.openai.com/v1/audio/voice\_consents/{consent\_id} Delete a consent recording that was uploaded for creating custom voices. See the [custom voices guide](https://platform.openai.com/docs/guides/text-to-speech#custom-voices) . Custom voices are limited to eligible customers. #### Path parameters [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_deletevoiceconsent-consent_id) consent\_id string Required The ID of the consent recording to delete. #### Returns A deletion confirmation. Example request curl 1 2 3 curl https://api.openai.com/v1/audio/voice_consents/cons_1234 \ -X DELETE \ -H "Authorization: Bearer $OPENAI_API_KEY" Create transcription ------------------------ post https://api.openai.com/v1/audio/transcriptions Transcribes audio into the input language. #### Request body [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranscription-file) file file Required The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranscription-model) model string Required ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source Whisper V2 model), and `gpt-4o-transcribe-diarize`. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranscription-chunking_strategy) chunking\_strategy "auto" or object Optional Controls how the audio is cut into chunks. When set to `"auto"`, the server first normalizes loudness and then uses voice activity detection (VAD) to choose boundaries. `server_vad` object can be provided to tweak VAD detection parameters manually. If unset, the audio is transcribed as a single block. Required when using `gpt-4o-transcribe-diarize` for inputs longer than 30 seconds. Hide possible types [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranscription-chunking_strategy-string) string Automatically set chunking parameters based on the audio. Must be set to `"auto"`. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranscription-chunking_strategy-object) object Hide properties [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranscription-chunking_strategy-object-type) type string Required Must be set to `server_vad` to enable manual chunking using server side VAD. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranscription-chunking_strategy-object-prefix_padding_ms) prefix\_padding\_ms integer Optional Defaults to 300 Amount of audio to include before the VAD detected speech (in milliseconds). [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranscription-chunking_strategy-object-silence_duration_ms) silence\_duration\_ms integer Optional Defaults to 200 Duration of silence to detect speech stop (in milliseconds). With shorter values the model will respond more quickly, but may jump in on short pauses from the user. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranscription-chunking_strategy-object-threshold) threshold number Optional Defaults to 0.5 Sensitivity threshold (0.0 to 1.0) for voice activity detection. A higher threshold will require louder audio to activate the model, and thus might perform better in noisy environments. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranscription-include) include array Optional Additional information to include in the transcription response. `logprobs` will return the log probabilities of the tokens in the response to understand the model's confidence in the transcription. `logprobs` only works with response\_format set to `json` and only with the models `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using `gpt-4o-transcribe-diarize`. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranscription-known_speaker_names) known\_speaker\_names array Optional Optional list of speaker names that correspond to the audio samples provided in `known_speaker_references[]`. Each entry should be a short identifier (for example `customer` or `agent`). Up to 4 speakers are supported. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranscription-known_speaker_references) known\_speaker\_references array Optional Optional list of audio samples (as [data URLs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs) ) that contain known speaker references matching `known_speaker_names[]`. Each sample must be between 2 and 10 seconds, and can use any of the same input audio formats supported by `file`. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranscription-language) language string Optional The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format will improve accuracy and latency. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranscription-prompt) prompt string Optional An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) should match the audio language. This field is not supported when using `gpt-4o-transcribe-diarize`. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranscription-response_format) response\_format string Optional Defaults to json 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. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranscription-stream) stream boolean Optional Defaults to false If set to true, the model response data will be streamed to the client as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) . See the [Streaming section of the Speech-to-Text guide](https://platform.openai.com/docs/guides/speech-to-text?lang=curl#streaming-transcriptions) for more information. Note: Streaming is not supported for the `whisper-1` model and will be ignored. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranscription-temperature) temperature number Optional Defaults to 0 The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranscription-timestamp_granularities) timestamp\_granularities array Optional Defaults to segment The timestamp granularities to populate for this transcription. `response_format` must be set `verbose_json` to use timestamp granularities. Either or both of these options are supported: `word`, or `segment`. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency. This option is not available for `gpt-4o-transcribe-diarize`. #### Returns The [transcription object](https://platform.openai.com/docs/api-reference/audio/json-object) , a [diarized transcription object](https://platform.openai.com/docs/api-reference/audio/diarized-json-object) , a [verbose transcription object](https://platform.openai.com/docs/api-reference/audio/verbose-json-object) , or a [stream of transcript events](https://platform.openai.com/docs/api-reference/audio/transcript-text-delta-event) . DefaultDiarizationStreamingLogprobsWord timestampsSegment timestamps Example request curl 1 2 3 4 5 curl https://api.openai.com/v1/audio/transcriptions \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: multipart/form-data" \ -F file="@/path/to/file/audio.mp3" \ -F model="gpt-4o-transcribe" 1 2 3 4 5 6 7 8 from openai import OpenAI client = OpenAI() audio_file = open("speech.mp3", "rb") transcript = client.audio.transcriptions.create( model="gpt-4o-transcribe", file=audio_file ) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 import fs from "fs"; import OpenAI from "openai"; const openai = new OpenAI(); async function main() { const transcription = await openai.audio.transcriptions.create({ file: fs.createReadStream("audio.mp3"), model: "gpt-4o-transcribe", }); console.log(transcription.text); } main(); 1 2 3 4 5 6 7 8 9 10 11 12 13 using System; using OpenAI.Audio; string audioFilePath = "audio.mp3"; AudioClient client = new( model: "gpt-4o-transcribe", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY") ); AudioTranscription transcription = client.TranscribeAudio(audioFilePath); Console.WriteLine($"{transcription.Text}"); Response 1 2 3 4 5 6 7 8 9 10 11 12 13 { "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.", "usage": { "type": "tokens", "input_tokens": 14, "input_token_details": { "text_tokens": 0, "audio_tokens": 14 }, "output_tokens": 45, "total_tokens": 59 } } Create translation ---------------------- post https://api.openai.com/v1/audio/translations Translates audio into English. #### Request body [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranslation-file) file file Required The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranslation-model) model string or "whisper-1" Required ID of the model to use. Only `whisper-1` (which is powered by our open source Whisper V2 model) is currently available. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranslation-prompt) prompt string Optional An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) should be in English. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranslation-response_format) response\_format string Optional Defaults to json The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio_createtranslation-temperature) temperature number Optional Defaults to 0 The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit. #### Returns The translated text. Example request curl 1 2 3 4 5 curl https://api.openai.com/v1/audio/translations \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: multipart/form-data" \ -F file="@/path/to/file/german.m4a" \ -F model="whisper-1" 1 2 3 4 5 6 7 8 from openai import OpenAI client = OpenAI() audio_file = open("speech.mp3", "rb") transcript = client.audio.translations.create( model="whisper-1", file=audio_file ) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 import fs from "fs"; import OpenAI from "openai"; const openai = new OpenAI(); async function main() { const translation = await openai.audio.translations.create({ file: fs.createReadStream("speech.mp3"), model: "whisper-1", }); console.log(translation.text); } main(); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 using System; using OpenAI.Audio; string audioFilePath = "audio.mp3"; AudioClient client = new( model: "whisper-1", apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY") ); AudioTranscription transcription = client.TranscribeAudio(audioFilePath); Console.WriteLine($"{transcription.Text}"); Response 1 2 3 { "text": "Hello, my name is Wolfgang and I come from Germany. Where are you heading today?" } The voice object -------------------- A custom voice that can be used for audio output. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_object-created_at) created\_at integer The Unix timestamp (in seconds) for when the voice was created. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_object-id) id string The voice identifier, which can be referenced in API endpoints. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_object-name) name string The name of the voice. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_object-object) object string The object type, which is always `audio.voice`. OBJECT The voice object 1 2 3 4 5 6 { "object": "audio.voice", "id": "voice_123abc", "name": "My new voice", "created_at": 1734220800 } The voice consent object ---------------------------- A consent recording used to authorize creation of a custom voice. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_consent_object-created_at) created\_at integer The Unix timestamp (in seconds) for when the consent recording was created. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_consent_object-id) id string The consent recording identifier. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_consent_object-language) language string The BCP 47 language tag for the consent phrase (for example, `en-US`). [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_consent_object-name) name string The label provided when the consent recording was uploaded. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_consent_object-object) object string The object type, which is always `audio.voice_consent`. OBJECT The voice consent object 1 2 3 4 5 6 7 { "object": "audio.voice_consent", "id": "cons_1234", "name": "John Doe", "language": "en-US", "created_at": 1734220800 } The voice consent list object --------------------------------- [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_consent_list-data) data array Hide properties [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_consent_list-data-created_at) created\_at integer The Unix timestamp (in seconds) for when the consent recording was created. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_consent_list-data-id) id string The consent recording identifier. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_consent_list-data-language) language string The BCP 47 language tag for the consent phrase (for example, `en-US`). [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_consent_list-data-name) name string The label provided when the consent recording was uploaded. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_consent_list-data-object) object string The object type, which is always `audio.voice_consent`. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_consent_list-first_id) first\_id string [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_consent_list-has_more) has\_more boolean [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_consent_list-last_id) last\_id string [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_consent_list-object) object string OBJECT The voice consent list object 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { "object": "list", "data": [\ {\ "object": "audio.voice_consent",\ "id": "cons_1234",\ "name": "John Doe",\ "language": "en-US",\ "created_at": 1734220800\ }\ ], "first_id": "cons_1234", "last_id": "cons_1234", "has_more": false } The voice consent deletion object ------------------------------------- [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_consent_deleted-deleted) deleted boolean [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_consent_deleted-id) id string The consent recording identifier. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-voice_consent_deleted-object) object string OBJECT The voice consent deletion object 1 2 3 4 5 { "object": "audio.voice_consent", "id": "cons_1234", "deleted": true } The transcription object (JSON) ----------------------------------- Represents a transcription response returned by model, based on the provided input. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-json_object-logprobs) logprobs array 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. Hide properties [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-json_object-logprobs-bytes) bytes array The bytes of the token. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-json_object-logprobs-logprob) logprob number The log probability of the token. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-json_object-logprobs-token) token string The token in the transcription. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-json_object-text) text string The transcribed text. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-json_object-usage) usage object Token usage statistics for the request. Hide possible types [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-json_object-usage-token_usage) Token Usage object Usage statistics for models billed by token usage. Hide properties [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-json_object-usage-token_usage-input_tokens) input\_tokens integer Number of input tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-json_object-usage-token_usage-output_tokens) output\_tokens integer Number of output tokens generated. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-json_object-usage-token_usage-total_tokens) total\_tokens integer Total number of tokens used (input + output). [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-json_object-usage-token_usage-type) type string The type of the usage object. Always `tokens` for this variant. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-json_object-usage-token_usage-input_token_details) input\_token\_details object Details about the input tokens billed for this request. Hide properties [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-json_object-usage-token_usage-input_token_details-audio_tokens) audio\_tokens integer Number of audio tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-json_object-usage-token_usage-input_token_details-text_tokens) text\_tokens integer Number of text tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-json_object-usage-duration_usage) Duration Usage object Usage statistics for models billed by audio input duration. Hide properties [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-json_object-usage-duration_usage-seconds) seconds number Duration of the input audio in seconds. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-json_object-usage-duration_usage-type) type string The type of the usage object. Always `duration` for this variant. OBJECT The transcription object (JSON) 1 2 3 4 5 6 7 8 9 10 11 12 13 { "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.", "usage": { "type": "tokens", "input_tokens": 14, "input_token_details": { "text_tokens": 10, "audio_tokens": 4 }, "output_tokens": 101, "total_tokens": 115 } } The transcription object (Diarized JSON) -------------------------------------------- Represents a diarized transcription response returned by the model, including the combined transcript and speaker-segment annotations. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-duration) duration number Duration of the input audio in seconds. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-segments) segments array Segments of the transcript annotated with timestamps and speaker labels. Hide properties [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-segments-end) end number End timestamp of the segment in seconds. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-segments-id) id string Unique identifier for the segment. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-segments-speaker) speaker string 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`, ...). [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-segments-start) start number Start timestamp of the segment in seconds. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-segments-text) text string Transcript text for this segment. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-segments-type) type string The type of the segment. Always `transcript.text.segment`. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-task) task string The type of task that was run. Always `transcribe`. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-text) text string The concatenated transcript text for the entire audio input. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-usage) usage object Token or duration usage statistics for the request. Hide possible types [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-usage-token_usage) Token Usage object Usage statistics for models billed by token usage. Hide properties [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-usage-token_usage-input_tokens) input\_tokens integer Number of input tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-usage-token_usage-output_tokens) output\_tokens integer Number of output tokens generated. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-usage-token_usage-total_tokens) total\_tokens integer Total number of tokens used (input + output). [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-usage-token_usage-type) type string The type of the usage object. Always `tokens` for this variant. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-usage-token_usage-input_token_details) input\_token\_details object Details about the input tokens billed for this request. Hide properties [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-usage-token_usage-input_token_details-audio_tokens) audio\_tokens integer Number of audio tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-usage-token_usage-input_token_details-text_tokens) text\_tokens integer Number of text tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-usage-duration_usage) Duration Usage object Usage statistics for models billed by audio input duration. Hide properties [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-usage-duration_usage-seconds) seconds number Duration of the input audio in seconds. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-diarized_json_object-usage-duration_usage-type) type string The type of the usage object. Always `duration` for this variant. OBJECT The transcription object (Diarized JSON) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 { "task": "transcribe", "duration": 42.7, "text": "Agent: Thanks for calling OpenAI support.\nCustomer: Hi, I need help with diarization.", "segments": [\ {\ "type": "transcript.text.segment",\ "id": "seg_001",\ "start": 0.0,\ "end": 5.2,\ "text": "Thanks for calling OpenAI support.",\ "speaker": "agent"\ },\ {\ "type": "transcript.text.segment",\ "id": "seg_002",\ "start": 5.2,\ "end": 12.8,\ "text": "Hi, I need help with diarization.",\ "speaker": "A"\ }\ ], "usage": { "type": "duration", "seconds": 43 } } The transcription object (Verbose JSON) ------------------------------------------- Represents a verbose json transcription response returned by model, based on the provided input. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-verbose_json_object-duration) duration number The duration of the input audio. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-verbose_json_object-language) language string The language of the input audio. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-verbose_json_object-segments) segments array Segments of the transcribed text and their corresponding details. Hide properties [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-verbose_json_object-segments-avg_logprob) avg\_logprob number Average logprob of the segment. If the value is lower than -1, consider the logprobs failed. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-verbose_json_object-segments-compression_ratio) compression\_ratio number Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-verbose_json_object-segments-end) end number End time of the segment in seconds. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-verbose_json_object-segments-id) id integer Unique identifier of the segment. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-verbose_json_object-segments-no_speech_prob) no\_speech\_prob number 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. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-verbose_json_object-segments-seek) seek integer Seek offset of the segment. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-verbose_json_object-segments-start) start number Start time of the segment in seconds. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-verbose_json_object-segments-temperature) temperature number Temperature parameter used for generating the segment. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-verbose_json_object-segments-text) text string Text content of the segment. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-verbose_json_object-segments-tokens) tokens array Array of token IDs for the text content. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-verbose_json_object-text) text string The transcribed text. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-verbose_json_object-usage) usage object Usage statistics for models billed by audio input duration. Hide properties [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-verbose_json_object-usage-seconds) seconds number Duration of the input audio in seconds. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-verbose_json_object-usage-type) type string The type of the usage object. Always `duration` for this variant. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-verbose_json_object-words) words array Extracted words and their corresponding timestamps. Hide properties [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-verbose_json_object-words-end) end number End time of the word in seconds. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-verbose_json_object-words-start) start number Start time of the word in seconds. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-verbose_json_object-words-word) word string The text content of the word. OBJECT The transcription object (Verbose JSON) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 { "task": "transcribe", "language": "english", "duration": 8.470000267028809, "text": "The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.", "segments": [\ {\ "id": 0,\ "seek": 0,\ "start": 0.0,\ "end": 3.319999933242798,\ "text": " The beach was a popular spot on a hot summer day.",\ "tokens": [\ 50364, 440, 7534, 390, 257, 3743, 4008, 322, 257, 2368, 4266, 786, 13, 50530\ ],\ "temperature": 0.0,\ "avg_logprob": -0.2860786020755768,\ "compression_ratio": 1.2363636493682861,\ "no_speech_prob": 0.00985979475080967\ },\ ...\ ], "usage": { "type": "duration", "seconds": 9 } } Stream Event (speech.audio.delta) ------------------------------------- Emitted for each chunk of audio data generated during speech synthesis. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-speech_audio_delta_event-audio) audio string A chunk of Base64-encoded audio data. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-speech_audio_delta_event-type) type string The type of the event. Always `speech.audio.delta`. OBJECT Stream Event (speech.audio.delta) 1 2 3 4 { "type": "speech.audio.delta", "audio": "base64-encoded-audio-data" } Stream Event (speech.audio.done) ------------------------------------ Emitted when the speech synthesis is complete and all audio has been streamed. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-speech_audio_done_event-type) type string The type of the event. Always `speech.audio.done`. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-speech_audio_done_event-usage) usage object Token usage statistics for the request. Hide properties [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-speech_audio_done_event-usage-input_tokens) input\_tokens integer Number of input tokens in the prompt. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-speech_audio_done_event-usage-output_tokens) output\_tokens integer Number of output tokens generated. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-speech_audio_done_event-usage-total_tokens) total\_tokens integer Total number of tokens used (input + output). OBJECT Stream Event (speech.audio.done) 1 2 3 4 5 6 7 8 { "type": "speech.audio.done", "usage": { "input_tokens": 14, "output_tokens": 101, "total_tokens": 115 } } Stream Event (transcript.text.delta) ---------------------------------------- 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](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `Stream` parameter set to `true`. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_delta_event-delta) delta string The text delta that was additionally transcribed. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_delta_event-logprobs) logprobs array The log probabilities of the delta. Only included if you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `include[]` parameter set to `logprobs`. Hide properties [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_delta_event-logprobs-bytes) bytes array The bytes that were used to generate the log probability. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_delta_event-logprobs-logprob) logprob number The log probability of the token. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_delta_event-logprobs-token) token string The token that was used to generate the log probability. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_delta_event-segment_id) segment\_id string Identifier of the diarized segment that this delta belongs to. Only present when using `gpt-4o-transcribe-diarize`. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_delta_event-type) type string The type of the event. Always `transcript.text.delta`. OBJECT Stream Event (transcript.text.delta) 1 2 3 4 { "type": "transcript.text.delta", "delta": " wonderful" } Stream Event (transcript.text.segment) ------------------------------------------ Emitted when a diarized transcription returns a completed segment with speaker information. Only emitted when you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with `stream` set to `true` and `response_format` set to `diarized_json`. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_segment_event-end) end number End timestamp of the segment in seconds. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_segment_event-id) id string Unique identifier for the segment. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_segment_event-speaker) speaker string Speaker label for this segment. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_segment_event-start) start number Start timestamp of the segment in seconds. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_segment_event-text) text string Transcript text for this segment. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_segment_event-type) type string The type of the event. Always `transcript.text.segment`. OBJECT Stream Event (transcript.text.segment) 1 2 3 4 5 6 7 8 { "type": "transcript.text.segment", "id": "seg_002", "start": 5.2, "end": 12.8, "text": "Hi, I need help with diarization.", "speaker": "A" } Stream Event (transcript.text.done) --------------------------------------- Emitted when the transcription is complete. Contains the complete transcription text. Only emitted when you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `Stream` parameter set to `true`. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_done_event-logprobs) logprobs array The log probabilities of the individual tokens in the transcription. Only included if you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `include[]` parameter set to `logprobs`. Hide properties [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_done_event-logprobs-bytes) bytes array The bytes that were used to generate the log probability. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_done_event-logprobs-logprob) logprob number The log probability of the token. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_done_event-logprobs-token) token string The token that was used to generate the log probability. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_done_event-text) text string The text that was transcribed. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_done_event-type) type string The type of the event. Always `transcript.text.done`. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_done_event-usage) usage object Usage statistics for models billed by token usage. Hide properties [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_done_event-usage-input_tokens) input\_tokens integer Number of input tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_done_event-usage-output_tokens) output\_tokens integer Number of output tokens generated. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_done_event-usage-total_tokens) total\_tokens integer Total number of tokens used (input + output). [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_done_event-usage-type) type string The type of the usage object. Always `tokens` for this variant. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_done_event-usage-input_token_details) input\_token\_details object Details about the input tokens billed for this request. Hide properties [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_done_event-usage-input_token_details-audio_tokens) audio\_tokens integer Number of audio tokens billed for this request. [](https://platform.openai.com/docs/api-reference/audio/verbose-json-object#audio-transcript_text_done_event-usage-input_token_details-text_tokens) text\_tokens integer Number of text tokens billed for this request. OBJECT Stream Event (transcript.text.done) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 { "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.", "usage": { "type": "tokens", "input_tokens": 14, "input_token_details": { "text_tokens": 10, "audio_tokens": 4 }, "output_tokens": 31, "total_tokens": 45 } } ---