curl --fail-with-body -X POST "$RAWCHUNKS_API/api/editing/apply" \
-H "Authorization: Bearer $SESSION_TOKEN" \
-H "x-network-id: $NETWORK" \
-H "x-session-user-address: $USER_ADDRESS" \
-H "Content-Type: application/json" \
--data "$(jq -nc --arg user "$USER_ADDRESS" --arg song "$SONG_ID" '{
"songId": $song,
"userAddress": $user,
"task": "complete",
"prompt": "Acoustic guitar and restrained drums",
"modelQuality": "base",
"trackClasses": [
"guitar",
"drums"
]
}')"
{
"songId": "sng-example",
"taskId": "task-example",
"status": "pending",
"task": "repaint"
}
Editing
Apply an edit operation
Submit Rework, Layer, Accompany, Extend, Restyle or Separate.
POST
/
api
/
editing
/
apply
curl --fail-with-body -X POST "$RAWCHUNKS_API/api/editing/apply" \
-H "Authorization: Bearer $SESSION_TOKEN" \
-H "x-network-id: $NETWORK" \
-H "x-session-user-address: $USER_ADDRESS" \
-H "Content-Type: application/json" \
--data "$(jq -nc --arg user "$USER_ADDRESS" --arg song "$SONG_ID" '{
"songId": $song,
"userAddress": $user,
"task": "complete",
"prompt": "Acoustic guitar and restrained drums",
"modelQuality": "base",
"trackClasses": [
"guitar",
"drums"
]
}')"
{
"songId": "sng-example",
"taskId": "task-example",
"status": "pending",
"task": "repaint"
}
Task IDs:
Budget headers use six-decimal USDC atomic units. See session payments.
repaint = Rework, lego = Layer, complete = Accompany, extend = Extend, cover = Restyle, extract = Separate.
Rework needs positive repaintingStart/repaintingEnd. Layer needs trackName. Layer and Accompany require base. Extend needs a longer audioDuration. Restyle needs coverStrength. See editing operations.
Headers and parameters
string
required
Bearer $SESSION_TOKEN. Use the complete token from your active Rawchunks session.string
required
Selected account address. Required for owner-scoped reads and writes. It identifies the account; your product must authenticate its own users.
string
Session network in CAIP-2 form, for example eip155:8453.
JSON body
string
required
Opaque ID returned by the API. Minimum length:
1.string
Optional target stem in this song. Omit to use the master.
string
required
Wallet address for the selected account. Use the same address as the session owner. Minimum length:
10.string
Optional source override, for example the url from Upload source. Use an HTTP(S) URL.
string
Select a mode listed for this task by GET /api/options. Defaults to base. Layer and Accompany require base. Values:
turbo, sft, base.string
Alternative to modelQuality. If both are sent they must match. Values:
turbo, sft, base.integer
Optional seed. Omit for a random seed; this is not a guarantee of byte-identical audio. Range:
0 to 9007199254740991.number
Tempo in beats per minute. Range:
30 to 300.string
Key ID from GET /api/options.
string
Language ID from GET /api/options.
string
string
string
Values:
conservative, balanced, aggressive.number
Range:
0 to 1.integer
Transition control in latent frames. Minimum:
0.number
Requested transition length in seconds. Minimum:
0.string
Description of the overall song.
string
Instrument name. Required by the Layer service. Minimum length:
1.string[]
number
Minimum:
5.string[]
string
required
Values:
repaint, lego, complete, extend, cover, extract.number
Minimum:
0.number
Minimum:
0.number
Range:
0 to 1.number
Range:
0 to 1.string
default:"all"
Response (202)
Accepted; follow the returned task.string
required
string
required
string
string
required
Values:
repaint, lego, complete, extend, cover, extract.string
required
Values:
pending, processing, ready, error.object[]
Errors
Failed JSON responses contain anerror string. Check the HTTP status before reading a successful result. See job handling for interrupted or uncertain submissions.
| Status | Meaning |
|---|---|
400 | Invalid request. |
401 | Invalid or expired session token. |
402 | Payment required or insufficient session budget. |
403 | Account does not match resource. |
404 | Resource not found. |
409 | Resource conflict; reload state or open an editable version. |
500 | Request failed. |
curl --fail-with-body -X POST "$RAWCHUNKS_API/api/editing/apply" \
-H "Authorization: Bearer $SESSION_TOKEN" \
-H "x-network-id: $NETWORK" \
-H "x-session-user-address: $USER_ADDRESS" \
-H "Content-Type: application/json" \
--data "$(jq -nc --arg user "$USER_ADDRESS" --arg song "$SONG_ID" '{
"songId": $song,
"userAddress": $user,
"task": "complete",
"prompt": "Acoustic guitar and restrained drums",
"modelQuality": "base",
"trackClasses": [
"guitar",
"drums"
]
}')"
{
"songId": "sng-example",
"taskId": "task-example",
"status": "pending",
"task": "repaint"
}
⌘I