Skip to content

Speech generation endpoint handler.

POST
/v1/audio/speech
curl --request POST \
--url https://example.com/v1/audio/speech \
--header 'Content-Type: application/json' \
--data '{ "input": "[S1] Dia is an open weights text to dialogue model. [S2] You get full control over scripts and voices. [S1] Wow. Amazing. (laughs) [S2] Try it now on Git hub or Hugging Face.", "instructions": "example", "model": "nari-labs/Dia-1.6B", "response_format": "mp3", "speed": 1, "stream_format": "example", "voice": "example" }'
Media typeapplication/json

Speech generation request

object
input
required

The text content to convert to speech.

string
Example
[S1] Dia is an open weights text to dialogue model. [S2] You get full control over scripts and voices. [S1] Wow. Amazing. (laughs) [S2] Try it now on Git hub or Hugging Face.
instructions

Additional directions for how to speak the input.

string | null
model

The TTS model to use for audio generation.

string
Example
nari-labs/Dia-1.6B
response_format

The desired audio format for the generated speech.

string
Allowed values: mp3 opus aac flac wav pcm
speed

Playback speed between 0.25 and 4.0, default 1.0.

number | null format: double
stream_format

Raw audio (audio, default) or server-sent audio events (sse).

string | null
voice

This model’s voice, currently only default.

string | null

Encoded audio or speech events

string format: binary

Invalid speech parameters or unsupported model capability