create.new_song writes and performs a complete song, with vocals singing the lyrics you give it. You describe the sound either in words (a prompt) or by pointing at a track whose style to follow (a reference). Use it for jingles, personalised songs, demo tracks and anything else that needs a sung vocal.
For music without vocals, use create.new_instrumental.
The request
Send
prompt or reference, not both.
Every field, with its exact rules: submit and poll in the API Reference.
Example
This makes two versions of a song from a prompt, both normalised for streaming, and saves them. It uses the reference client; savesoundpiece.py or soundpiece.mjs next to it first.
The result
run returns the finished song object, with one entry in outputs per variation:
Choosing parameters
-
Lyrics. Put each section marker (
[Intro],[Verse],[Chorus],[Bridge],[Outro],[Instrumental]) on its own line, and each sung line on its own line under it. -
Prompt or reference? A prompt is quickest: mix genre, mood, tempo and instruments, separated by commas, e.g.
"rock song, energetic, male vocal". A reference is better when you have a track whose feel you want to match. To use one, send it in place ofprompt: -
n_variations. Each variation is a different take on the same request. Ask for two or three when you want to pick the best; each one costs the same as a single song. -
Loudness. Off unless you include the block. Add
{"preset": "streaming"}(orpodcast,broadcast, or atarget_lufs) when the songs go straight to a platform. See the loudness normalisation guide.
Errors
When you submit (the request is refused, nothing is charged):
While processing (the operation finishes as
failed, with an error.code):
Reference limits for this endpoint: WAV, MP3 or FLAC, from 1 second to 5 minutes long, and at most 50 MB.
See Errors for the response shapes, and for the errors every endpoint can return (
401, 403, 429).
Cost
3 credits per variation, son_variations: 2 costs 6. Normalisation costs nothing extra. Resending a request with the same idempotency key is not charged again.