POST
/v1/tools/generate_musicpricedGenerate music
Composes music, for a video or anything else, from a description of its mood, instruments and pace, up to an hour, as an MP3: instrumental unless singing is asked for, or a song sung with given lyrics. Past three minutes, its three minutes play on, crossfaded each time they begin again.
Takes prompt (text), lyrics (text). Returns music (the music, an MP3).
$0.08 per 30 seconds of music, at least $0.10, at most $0.30, up to 3600 seconds.
Fields
| Field | Type | Default | What it is |
|---|---|---|---|
prompt | string | Required | The music in a sentence or a few, such as its mood, instruments, pace and who sings; any language. Instrumental unless you ask for singing or give lyrics. |
lyrics | string | | Words to sing, in any language, its parts marked like [Verse] and [Chorus] if you like; sung as written. Without them it is instrumental, unless the prompt asks for singing, when lyrics are written for it. |
seconds | number | 30 | How long it runs, in seconds, up to an hour; past three minutes, its three minutes play on, crossfaded each time they begin again. It ends in a fade. |
Call it
Request
curl -X POST https://app.scrub.app/v1/tools/generate_music \
-H "Authorization: Bearer $SCRUB_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt":"…"}'Answer
{
"ok": true,
"result": {
"job_id": "job_…",
"status": "running",
"price_usd": "$…"
}
}It starts at once and answers running. Ask job_status with the job_id for its result. quote gives its price first, free.
Every call can also answer an error: what comes back. Try it with your key from Account.