curl --fail-with-body -X POST "$RAWCHUNKS_API/api/generation/generate" \
-H "Authorization: Bearer $SESSION_TOKEN" \
-H "x-session-user-address: $USER_ADDRESS" \
-H "x-network-id: $NETWORK" \
-H "Content-Type: application/json" \
--data "$(jq -nc --arg user "$USER_ADDRESS" '{
"creatorAddress": $user,
"prompt": "Instrumental acid house with a dry kick, rolling bass and a restrained synth lead",
"instrumental": true,
"audioDuration": 60,
"bpm": 124,
"modelVariant": "turbo",
"title": "Night circuit",
"licenses": 20,
"license_price": 5,
"stream_price": 0.01
}')"
{
"songId": "sng-example",
"taskId": "task-example",
"status": "pending"
}
Generation
Generate music
Submit a new music generation.
POST
/
api
/
generation
/
generate
curl --fail-with-body -X POST "$RAWCHUNKS_API/api/generation/generate" \
-H "Authorization: Bearer $SESSION_TOKEN" \
-H "x-session-user-address: $USER_ADDRESS" \
-H "x-network-id: $NETWORK" \
-H "Content-Type: application/json" \
--data "$(jq -nc --arg user "$USER_ADDRESS" '{
"creatorAddress": $user,
"prompt": "Instrumental acid house with a dry kick, rolling bass and a restrained synth lead",
"instrumental": true,
"audioDuration": 60,
"bpm": 124,
"modelVariant": "turbo",
"title": "Night circuit",
"licenses": 20,
"license_price": 5,
"stream_price": 0.01
}')"
{
"songId": "sng-example",
"taskId": "task-example",
"status": "pending"
}
Fast (
Budget headers use six-decimal USDC atomic units. See session payments.
turbo) costs $0.05. Studio Master (sft) costs $0.10. creatorAddress can be omitted when the selected account comes from the session, but explicit addresses must match your intended creator. New songs start private.
Generate and retrieve audio.
Headers and parameters
string
required
Bearer $SESSION_TOKEN. Use the complete token from your active Rawchunks session.string
Session owner address. Supplies
creatorAddress when omitted from the JSON body.string
Session network in CAIP-2 form, for example eip155:8453.
JSON body
string
Wallet address for the selected account. Use the same address as the session owner. Minimum length:
10.string
required
Musical description. At least three characters after trimming. Minimum length:
3.string
default:"turbo"
Fast or Studio Master. Values:
turbo, sft.string
Omit or leave blank for an Untitled title.
string
Artwork URL.
string
Existing album ID.
string
Plain text with optional section tags. Omit for automatic lyrics/settings; specify instrumental for no vocals.
boolean
When true, the request uses [Instrumental] lyrics.
string
Language ID from GET /api/options.
number
Tempo in beats per minute. Range:
30 to 300.string
Key ID from GET /api/options.
number
Requested duration in seconds. Range:
5 to 300.integer
Optional seed. Omit for a random seed; this is not a guarantee of byte-identical audio. Range:
0 to 9007199254740991.string
Opaque ID returned by the API. Minimum length:
1.string
Required with voiceId. Trained mode needs a ready saved voice for the selected model. Values:
reference, trained.string
Direct reference audio URL. Mutually exclusive with voiceId.
number
Voice conditioning strength. Default 0.7 for saved voices, 0.65 for direct references. Range:
0 to 1.string[]
integer
default:0
Listed allocation. Omitted value is 0. Minimum:
0.number
default:0.02
Listed USDC per minute. Separate from the service fee. Minimum:
0.number
default:25
Listed USDC per license. Separate from the service fee. Minimum:
0.Response (202)
Accepted; follow the returned task.string
required
string
required
string
required
Values:
pending, processing, ready.string
integer
string
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. |
500 | Request failed. |
curl --fail-with-body -X POST "$RAWCHUNKS_API/api/generation/generate" \
-H "Authorization: Bearer $SESSION_TOKEN" \
-H "x-session-user-address: $USER_ADDRESS" \
-H "x-network-id: $NETWORK" \
-H "Content-Type: application/json" \
--data "$(jq -nc --arg user "$USER_ADDRESS" '{
"creatorAddress": $user,
"prompt": "Instrumental acid house with a dry kick, rolling bass and a restrained synth lead",
"instrumental": true,
"audioDuration": 60,
"bpm": 124,
"modelVariant": "turbo",
"title": "Night circuit",
"licenses": 20,
"license_price": 5,
"stream_price": 0.01
}')"
{
"songId": "sng-example",
"taskId": "task-example",
"status": "pending"
}
⌘I