Generate music
generate_musicGenerate music from a prompt, for 10, 20, 30 or 60 seconds: the track comes back that long. Make one original track for the whole edit unless the person gave you music or asked for an existing track, trending music or phonk. For those requests, first search_stock with kind music and import_stock a matching track. The stock library is also the fallback when a generation fails or the person asks for a library track. forceInstrumental true excludes singing. Use generate_sfx for sound effects. The music does not play its hits at seconds a prompt asks for: describe its shape (a quiet stretch, then one big drop, then the full sound) and give hero instead. It answers at once with a Job ID and the media is made in the background: start every generation you need, keep working, then call wait_for_jobs with all their Job IDs to get each Asset ID for patch_film. With its Asset ID come its beat and hits, measured from the track: the tempo, the beat times, the downbeats (bar starts), the big hits (where the music slams in), the drops, the loudness of each second, the sections (intro, build, drop, breakdown, outro), the drum hits between beats and the fills (quick runs of hits into the next bar). Cut on these measured times. With hero, it also says where the strongest drop or big hit is and the clip that lands it on that second. Uses about 0.0023 credits a second: 60 seconds use 1 credits. A credit refusal says how many credits are left: retry only with a duration that fits.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"prompt": "<prompt>",
"durationSeconds": "<durationSeconds>",
"forceInstrumental": "<forceInstrumental>",
"hero": "<hero>",
"projectId": "<projectId>"
},
"name": "generate_music"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hero | Yes | The film second of the edit's hero moment, the reveal the music must hit, or null. The answer says which offset slides the track's strongest drop or big hit onto that second. | |
| prompt | Yes | Up to 2000 characters. | |
| projectId | Yes | The project this call runs on without changing the open project. null (or leaving it out) uses the open project. wait_for_jobs takes the projectId of the calls that started the jobs. | |
| durationSeconds | Yes | ||
| forceInstrumental | Yes |