Audio

Creates a voice from a text prompt or from a consent recording and an audio sample.

For prompt-based creation, send type: "prompt" with a name and prompt as JSON or multipart form data. For creation from an audio sample, send type: "audio_sample" with a name, audio_sample, and consent recording ID as multipart form data. The type defaults to audio_sample when omitted.

Returns the saved voice's metadata. Voices created from text prompts are supported only in Live, not in Realtime or the speech endpoint. The response does not include preview audio.

post/audio/voices

Request

  • Base URL
    https://api.openai.com/v1
  • URL
    https://api.openai.com/v1/audio/voices
  • Auth
    HTTP bearer

Request body

type'prompt' required

Set to prompt to create a voice from a text description.

namestring required

The name of the new voice.

promptstring required

A description of the desired voice. Must not contain only whitespace.

script_hintstring

Optional text for the voice to speak during creation. If omitted, a script is generated from the prompt. Must not be blank after trimming whitespace; scripts that are too short are rejected.

Response

OK

object'audio.voice' required

The object type, which is always audio.voice.

idstring required

The voice identifier, which can be referenced in API endpoints.

type'audio_sample' | 'prompt' required

How the voice was created.

promptstring

The original text prompt used to create the voice. Present for prompt-generated voices with a stored prompt; omitted for audio-sample voices and older voices without a stored prompt.

namestring required

The name of the voice.

created_atinteger required

The Unix timestamp (in seconds) for when the voice was created.

Changes

    • warning

      added the new prompt enum value to the response property for the response status

    • info

      added prompt mapping keys to the request discriminator

    • info

      added the media type application/json to the request body

    • info

      added to the request body oneOf list

    • info

      added the optional property to the response with the status

    • breaking

      the response's property type changed from no type to string for status

    • warning

      added the new audio_sample enum value to the response property for the response status

    • info

      removed subschema #1 subschema #2 from the response property anyOf list for the response status