Video
How to Make an AI Music Video with Bitcoin Lightning
Three calls: write a song, make a reference frame, then animate it to that song. About 1,850 sats. No account, no subscription, no credits.
Reference clips, not a whole track
reference_audio takes short clips —2 to 15 seconds each — that you cite in the prompt as "Audio 1". It cannot travel alone: at least one reference_image must come with it. So a music video is one shot per slice of your track, not one call for the whole song. We measured this the hard way — passing a 217-second track uncited produced audio that correlated 0.33 with the source, i.e. not the source.
The three calls
generate-music500 sats→ audioUrlA full song with vocals from a text prompt. Returns a URL you can hand straight to the next call.
generate-image100 sats→ imageUrlOne reference frame. This is what keeps the character and style consistent if you make several shots.
generate-video1,250 sats→ videoUrlPrompt + a <=15s reference_audio slice + reference_image, with the clip cited as "Audio 1". 5-15 seconds, 768p or 2K.
Total for a 5-second 768p shot: 1,850 sats. At 2K the video leg is 2,000 sats instead of 1,250. Video is priced per second — 768p 250 / 2K 400 sats/sec — so a longer shot scales linearly.
Worked example
Each call returns a 402 with a Lightning invoice, you pay it, and you repeat the call with the preimage. Any L402 client does this for you — this is the shape, not the ceremony.
# 1 — the song
curl -X POST https://sats4ai.com/api/l402/generate-music \
-H 'Content-Type: application/json' \
-d '{"prompt":"dream pop, 120 BPM, warm analog synths, female vocal",
"lyrics_optimizer": true}'
# -> { "audioUrl": "https://sats4ai.com/api/uploads/track.mp3?token=..." }
# 2 — the reference frame
curl -X POST https://sats4ai.com/api/l402/generate-image \
-H 'Content-Type: application/json' \
-d '{"prompt":"a singer on a neon rooftop at night, 35mm, shallow depth of field"}'
# -> { "imageUrl": "https://sats4ai.com/api/uploads/frame.png?token=..." }
# 3 — the video, performed to the track
curl -X POST https://sats4ai.com/api/l402/generate-video \
-H 'Content-Type: application/json' \
-d '{
"prompt": "she sings to camera to Audio 1, city lights bokeh behind her, slow push in",
"duration": 5,
"resolution": "768p",
"reference_audio": "https://sats4ai.com/api/uploads/slice-0-8s.mp3?token=...",
"reference_image": "https://sats4ai.com/api/uploads/frame.png?token=..."
}'
# -> 202 { requestId, poll_url } then poll until { videoUrl }The URLs our endpoints return are already public-with-token and valid for six hours, which is far longer than a render takes — so you can pass them straight through without hosting anything yourself.
Write at 120 BPM
This is the detail that separates a demo from something you would actually cut together. At 120 BPM one bar is exactly 2.000 seconds. Durations are whole seconds, so every generation lands on a bar line and shots butt together without drift. A 5-second shot is 2.5 bars; an 8-second shot is 4 bars. Pick the tempo first and the edit does itself.
One generation is capped at 15 seconds
That is the model's ceiling, not ours. For a whole song you slice the track, run one generation per slice passing that slice as reference_audio, reuse the same reference_image so the character holds, then concatenate the clips and lay the full master over the top with ffmpeg. Four 8-second shots gives you 32 seconds. We deliberately do not do that stitching for you — it is one ffmpeg command, and keeping it on your side means you keep the cut.
For agents
All three are MCP tools — generate_music, generate_image, generate_video — and the chain is just passing one tool's output URL into the next tool's reference_audio. No orchestration framework, no account, no API key. Each call is paid on its own with Lightning, so an agent can abandon after step one and owe nothing further.
What you get
- Reference clips (2-15s) and stills steer the shot, cited in the prompt
- 768p or 2K, 5-15 seconds, 768p 250 / 2K 400 sats/sec
- Reference stills keep one character across several shots
- Reference inputs are free — they change the output, never the price
- No signup, no card, no credits — pay per call with Bitcoin
Prices on this page are read from the same constants the invoice is minted from.