Skip to main content
POST
/
audio
/
speech
Generate Speech
curl --request POST \
  --url https://{controlPlaneURL}/api/llm/audio/speech \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "input": "<string>",
  "model": "<string>",
  "voice": "<string>",
  "instructions": "<string>",
  "response_format": "<string>",
  "speed": 123,
  "stream_format": "<string>"
}
'
"<string>"

Documentation Index

Fetch the complete documentation index at: https://www.truefoundry.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-tfy-metadata
string

Optional metadata for the request

Body

application/json

Text to convert to speech and speech generation options

input
string
required

The text to generate audio for. The maximum length is 4096 characters.

model
string
required

One of the available TTS models: tts-1, tts-1-hd or gpt-4o-mini-tts.

voice

The voice to use for single-speaker TTS. Can be a string (OpenAI format: alloy, ash, ballad, coral, echo, fable, onyx, nova, sage, shimmer, verse) or an object with name and languageCode (Vertex AI format).

instructions
string | null

Control the voice of your generated audio with additional instructions. Does not work with tts-1 or tts-1-hd.

response_format
string | null

The format to audio in. Supported formats are mp3, opus, aac, flac, wav, and pcm. Default: mp3.

speed
number | null

The speed of the generated audio. Select a value from 0.25 to 4.0. Default: 1.0.

stream_format
string | null

The format to stream the audio in. Supported formats are sse and audio. sse is not supported for tts-1 or tts-1-hd. Default: audio.

Response

Audio generated successfully

The audio file content