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

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.

max_retries
integer
default:2

Retries on the same endpoint when the provider rejects the call before doing any work (HTTP 429 or a gateway 502/503/504 with no result, or a connection that never reached it). Only the successful attempt is billed. Default 2 / max 3; 0 turns retries off.

Required range: 0 <= x <= 3
parameters
object

Provider-specific fields forwarded verbatim, except fields owned by normalized inputs and shared-account song selectors. Use scoped sections for song references; the provider validates other settings.

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.

store_song
boolean

Store a reusable song for inpainting, separately from store (which saves a file). Requires audio_song_storage and nonzero project retention.

Response

Successful response

audio
object
required
created
integer
required
id
string
required
model
string
required
usage
object
required
lyrics
string
plan
object
song
object
store_song_skipped
string
words_timestamps
object[]
Last modified on November 16, 2026