Skip to main content
POST
cURL
Both endpoints take the OpenAI-compatible speech and transcription request bodies and return the matching responses. Speech and music models appear in the main catalog with audio in architecture.output_modalities.

Text to speech

POST /v1/audio/speech takes the standard speech body and returns audio bytes. Speech models are openai/gpt-audio-mini (fast) and openai/gpt-audio (higher quality); voices are alloy, ash, ballad, coral, echo, sage, shimmer and verse. The response is audio/wav (24 kHz mono); pass response_format: "pcm16" for the raw samples. instructions sets the delivery; by default the model reads the text verbatim.
In a web app, serve the bytes from your own route and point an <audio> element at it; the Content-Type header names the format. A model id that does not produce audio returns 400 with the list of ids that do.

Music

The same endpoint composes music: send model: "google/lyria-3-clip-preview" (or google/lyria-3-pro-preview) with input set to the mood or style you want, for example "upbeat lo-fi for a launch video". Music models answer with an MP3 (audio/mpeg); voice is ignored. The header x-predev-audio-format carries the format on every speech response.

Transcription

POST /v1/audio/transcriptions is multipart/form-data with a file part and a model field.
Set TRANSCRIBE_MODEL to a speech-to-text model such as openai/whisper-large-v3. Transcription models are not listed by GET /v1/models. Speech, music, and transcription calls return the usual x-predev-* headers and are charged from the model’s metered usage.

Authorizations

Authorization
string
header
required

The workspace API key (pdk_…) from Integrations → Built-in in the pre.dev dashboard.

Headers

x-predev-project-id
string

Attribute this call to one of the workspace's projects. An id the workspace does not own is ignored.

Body

application/json
model
string
required

A catalog model whose architecture.output_modalities includes audio: speech models (openai/gpt-audio-mini, openai/gpt-audio) or music models (google/lyria-3-clip-preview, google/lyria-3-pro-preview).

Example:

"openai/gpt-audio-mini"

input
string
required

The text to speak, or for a music model, the style or mood to compose.

Minimum string length: 1
voice
string
default:alloy

Speech voice, such as alloy, ash, ballad, coral, echo, sage, shimmer or verse. Music models ignore it.

instructions
string

How to deliver the text. By default the text is read verbatim. Music models ignore it.

response_format
string
default:wav

wav (24 kHz mono) or pcm16 (raw samples; pcm also works). Other values return WAV. Music models return their own container (MP3).

Response

The audio: audio/wav for speech, audio/mpeg for music, or application/octet-stream with raw PCM16 samples (24 kHz mono) when response_format is pcm16.

The response is of type file.