Skip to main content
POST
Generate audio
Music, songs, sound effects and ambience. See the Audio guide for runnable examples, timed sections and loops.

Authorizations

Authorization
string
header
required

API key authentication. Pass your API key as a Bearer token.

Body

application/json
model
string
required

Audio generation model id. List them with GET /v3/audio/models: ?type=music for songs and scores, ?type=sound for sound effects and ambience, ?capability=audio_sections or ?capability=audio_loop for models that take those fields. For example elevenlabs/music_v2_5 (music) or elevenlabs/eleven_text_to_sound_v2 (sound effects).

async
boolean

Run generation on the background worker and return a job to poll (202) instead of waiting inline (200). Use for full-length tracks and slow models.

duration_seconds
number

Requested length in seconds (up to 600). Omit it to let the model choose. Limits differ by model, and some models have no length setting; a value a model cannot honor answers 400 naming its limit.

format
string

Output audio format: mp3, wav, opus or pcm. Omit it to get the model's native format. A format the model cannot produce answers 400 naming the ones it can.

instrumental
boolean

Music only: generate without vocals.

loop
boolean

Generate audio that repeats seamlessly, for ambience and hums. Needs a model with the audio_loop capability (GET /v3/audio/models?capability=audio_loop); other models answer 400.

parameters
object

Provider-specific fields, forwarded verbatim and never gated: the provider validates them. Use it for settings specific to one model, in that provider's own field names.

prompt
string

What to generate. For music: genre, mood, instruments, lyrics. For a sound effect: the sound itself, for example "a single hammer strike on an iron anvil". Required unless sections are set.

sections
object[]

A timed plan for music that must fit a picture: each section's duration_ms plus its own prompt and styles, in order. The sections set the total length, so duration_seconds is not sent with them. Needs a model with the audio_sections capability (GET /v3/audio/models?capability=audio_sections); other models answer 400.

seed
integer

Seed for more repeatable output. Models without seed support answer 400.

store
boolean

Persist the generated audio to /v3/files and return a reusable file_id. Defaults to false; set true to store.

Response

Successful response

audio
object
required
created
integer
required
id
string
required
model
string
required
usage
object
required
lyrics
string
Last modified on October 1, 2026