Generate music
generate_musicCosts a flat price per track, charged only after confirm_cents matches the quote: starts one AI music track.
Args: prompt: 1-3000 chars (genre, mood, instruments). duration_s: 5-240 seconds. confirm_cents: the price the user agreed to (from tool_cost_estimate); 0 with quote_only. idempotency_key: unique per purchase; a retry with the same key never buys twice. Idempotency is keyed on (this token, this tool, idempotency_key), not on the arguments: reusing an idempotency_key with different arguments returns the first result. quote_only: true returns the price and buys nothing.
Returns: {ok, job_id, kind:'music', poll_after_s, cents}: poll with wait_for_job; the track lands in your Library A job that fails is refunded to the balance, but it still counts toward this token's daily limit until midnight UTC.
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>",
"duration_s": "<duration_s>",
"confirm_cents": "<confirm_cents>"
},
"name": "generate_music"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | ||
| duration_s | Yes | ||
| quote_only | No | true: return the price and buy nothing. | |
| confirm_cents | Yes | The price in cents the user agreed to, from tool_cost_estimate or a quote_only call. Pass 0 with quote_only. | |
| idempotency_key | No | Any unique string per purchase; a retry with the same key never buys twice. |