Edit parts of a track
edit_trackRe-roll or remove parts of an existing track — "swap the bass", "drop the vocals", "give me a different lead".
This is the tool for refining a track step by step. Three things govern how to use it in a chain:
Each edit makes a NEW track. The original is never modified. Pass the id returned by the previous edit into the next one; reusing the original id silently discards everything done so far and still answers success.
Each edit costs a full track off the quota. A five-step session is five tracks. Check
get_capabilitiesbefore starting a long one.Replacement is best-effort. If the underlying collection has no alternative for a part at this tempo and key, replacing it removes it instead — a success response with the instrument simply gone. Offer the result for a listen rather than asserting the change landed.
One part at a time is the right granularity: it keeps each step
reviewable and avoids spending a track on a combination the user did not
ask for. mode cannot be changed by editing — regenerate for that.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | ||
| bitrate | No | ||
| duration | No | ||
| track_id | Yes | The track to edit. In a chain of edits this is the id returned by the PREVIOUS edit, not the original — each edit makes a new track. | |
| intensity | No | ||
| delete_stems | No | ||
| wait_seconds | No | ||
| replace_stems | No | Whole sections to re-roll: DRUMS (drums, percs, hats, claps), BASS, LEADS (mids, leads, pads), VOCALS, FX (fx, riser, impact). Coarser than replace_instruments — use it when the user names a section rather than one part. | |
| delete_instruments | No | ||
| replace_instruments | No | Single parts to re-roll: DRUMS, PERCS, HATS, CLAPS, BASS, MIDS, LEADS, FX, VOCALS, PADS, RISER, IMPACT. Map what the user says onto these — a melody, lead line, riff or 'that horn/synth' is LEADS; a pad, string or chord bed is PADS; a countermelody or stab sitting under the lead is MIDS; a sweep into a drop is RISER; a hit on the drop is IMPACT. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bpm | No | ||
| key | No | ||
| url | No | Download link once done. | |
| mode | No | ||
| format | No | ||
| prompt | No | ||
| status | Yes | done, failed or pending. | |
| bitrate | No | ||
| duration | No | ||
| track_id | No | ||
| important | No | ||
| expires_at | No | After this the audio is deleted and the URL stops working. | |
| session_id | No | ||
| edited_from | No | The track this one was derived from. Edits and variations never modify the original — they mint a new track, and this is the link back. | |
| playlist_index | No | ||
| how_it_was_served | Yes |