Use case

AI music video generator API:
a song in, a music video out

Send a song and a short brief. Get back one mp4 cut on the beat, with the same singer in every scene and your original track as the soundtrack.

Prepaid, no subscriptionREST or MCPOne key for models, data and agents
song.mp3 · 3:24cut on the beat"into the night"scene 1"neon in the rain"scene 2"never look back"scene 3"to the sea"scene 4music-video.mp4

A music video used to mean a shoot, an editor and a budget. Now an AI music video generator does it in one API call: POST /v1/videos/music takes your song and a short brief (the story, the look, the singer) and returns one mp4 the length of the song. Scenes are cut on the beat, the same singer appears in every scene and lip-syncs the lyrics, and the soundtrack is your original track, untouched. Build it into a music app, a label's release workflow or a creator tool, or make one in the playground without writing code.

Hand it to your AI agent

Copy this prompt into Claude Code, Cursor, Codex or any coding agent. It tells the agent where the docs are and how to use your API key.

Make a music video from a song with the Lovely Router music video API: it cuts the song on the beat into scenes, casts one singer, renders every scene with the song driving the picture and joins them into one mp4 over the original track.

- Docs (read first): https://lovelyrouter.com/docs/models/music-videos.md and https://lovelyrouter.com/docs/api/music-videos.md
- Start: POST https://lovelyrouter.com/v1/videos/music (multipart) with `song` (MP3/WAV/FLAC/OGG/M4A, up to 60 MB), `model` (`ltx-music-video`, or `minimax-h3-music-video` for the steadiest likeness), `size` (`16:9`, `9:16` or `1:1`), an optional brief (`story`, `style`, `character`, `locations`, `lyrics`) and `consent=true` (accepts the model's terms; read the licence linked in the docs first and tell me if my use might not be allowed).
- It answers 202 at once. Poll GET https://lovelyrouter.com/v1/videos/music/<id>?wait=120 until `status` is `completed`, `failed` or `cancelled`, then download GET https://lovelyrouter.com/v1/videos/music/<id>/content (kept 7 days).
- Billed per second of the song (at least 15 s), plus the director's chat calls and the character pictures. Once started it can't be stopped: send `auto_render: false` to stop at `ready`, show me the character sheets and scene prompts, and only call POST .../render after I approve. Use `start`/`end` (seconds) to make it for part of the song.
- For a recurring artist, save them once with POST https://lovelyrouter.com/v1/characters (docs: https://lovelyrouter.com/docs/api/characters.md) and pass `character_id`.
- Auth: read my API key from the LOVELY_API_KEY environment variable and send it as `Authorization: Bearer $LOVELY_API_KEY`. Never print or commit the key. If it is not set, ask me to create one at https://lovelyrouter.com/app/keys.
- Billing is prepaid: every call is charged to my balance, so test with a small request before running anything large.
- Every docs page is plain Markdown; the full index is https://lovelyrouter.com/llms.txt.

My task: <the song file, what the video should show (story, style, singer) and the aspect ratio>
01

How it works

010203
  1. Send the song and a brief

    Upload an MP3, WAV, FLAC, OGG or M4A file (up to 60 MB) and, if you like, a story, a style, a character and lyrics. Every field is optional: with no brief, the director invents a story and a singer from the lyrics.

  2. Cut on the beat, cast once

    The song is split into scenes that end on its beats, about 5 seconds each, and the lyrics are transcribed scene by scene. A chat model, the director, defines the singer once and an image model draws a turnaround sheet (front, side, back) for each outfit, so every scene shows the same person.

  3. Directed and rendered scene by scene

    The director writes a shot for each scene from your brief and its lyrics, with the camera move and the light. Each scene is rendered with its part of the song driving the picture: the singer's lips follow the words, and movement follows the music.

  4. One mp4 over your track

    The scenes are joined in order over the original song. You can watch each clip as soon as it renders, and download the finished video for 7 days.

02

Make one with a single request

cURL
curl https://lovelyrouter.com/v1/videos/music \
  -H "Authorization: Bearer $LOVELY_API_KEY" \
  -F model=ltx-music-video \
  -F song=@song.mp3 \
  -F story="A night drive through a neon city; she leaves the old town behind and reaches the sea at dawn" \
  -F style="Cinematic 35 mm film, teal and orange, light rain, shallow depth of field" \
  -F character="A woman in her twenties with short black hair, a red leather jacket and silver hoop earrings" \
  -F size=16:9 \
  -F consent=true

The request answers 202 at once with the music video object. Poll GET /v1/videos/music/{id}?wait=120 for its status, progress and scenes, then download GET /v1/videos/music/{id}/content when it is completed. The music videos guide has the same flow in Python and Node.js.

03

The tools for the job

Music video API

POST /v1/videos/music runs the whole pipeline: beat analysis, casting, character sheets, directing, rendering and the final cut. Choose 16:9, 9:16 or 1:1. Reference: music videos API.

Saved characters

Save an artist once with POST /v1/characters (a name, a description and a turnaround sheet) and pass character_id on every video, so the same face carries across a whole album. Saving is free. See characters.

Song slicing

Send start and end in seconds to make the video for the chorus or the first minute only. You pay for the slice, not the song. The playground has a slicer with a preview.

Review before rendering

With auto_render: false the job stops once every scene has its prompt and first frame. Rewrite any scene with PATCH, then POST …/render. A plan you discard costs nothing for the video.

Character sheets and first frames

Drawn with the image generation API on your key, from a picture of your singer (character_image) or from the brief. Pick the image model with image_model.

Any chat model as director

director_model takes any chat model your key can use; a fast, inexpensive one is plenty.

04

Two models

ModelPrice per second of songBest for
ltx-music-video$0.06Fast renders, about 20–25 s per scene: a 3-minute song in roughly 12–15 minutes. Up to 1472×832.
minimax-h3-music-video$0.13 ($0.2 with first_frames)The singer filmed straight from their character sheet for the steadiest likeness, about 45 s per scene. Up to 1344×768.

Both take songs from 5 seconds to 6 minutes, bill at least 15 seconds, and render at 24 fps. Every request sets consent: true to accept the model's terms: the LTX terms or the MiniMax H3 terms, which don't allow use in the EU, the UK, South Korea or the US.

05

Recipes

A video for every release

Save the artist with POST /v1/characters, then call the API with character_id and a one-line story per single. Every video stars the same face.

Vertical clips for short-video apps

Send size=9:16 with a start and end around the hook, and get a 15–60 second vertical video for Reels, Shorts or TikTok.

Approve before you spend

Set auto_render: false, show your user the character sheets and first frames, let them rewrite scenes, then start the render.

A music app that feels quick

Show each scene's clip (scenes[n].url) as it renders, so users watch the video take shape instead of waiting for all of it.

Lyric-perfect performances

Pass the lyrics as written and the language (such as en, zh or ja); the director quotes the right words in each performance shot.

06

What you pay

You pay per second of the song: $0.06 with ltx-music-video, so a 3½-minute song costs $12.6; $0.13 with minimax-h3-music-video. The director's calls and the character pictures (typically one per look plus one per scene) are billed separately at those models' own prices. When the song's length is known, its price is held from your prepaid balance, and the video settles as one charge in your logs. If a video fails on our side, nothing is charged for it. Prices for every model are on pricing.

07

Rights and responsible use

Use songs you own or have the rights to, and people you have permission to depict. Videos must follow the model's terms and the Acceptable Use Policy. Finished videos are kept for 7 days, then deleted; download what you want to keep.

08

Frequently asked questions

?
Do I need to provide music?+

Yes. The video is built around your song: its beats set the cuts, its lyrics drive the singing and the finished mp4 uses it as the soundtrack. Send a whole song up to 6 minutes, or a slice of a longer one.

Will the singer look the same in every scene?+

Yes, by default. The singer is cast once and drawn as a turnaround sheet for each outfit, and every scene starts from that sheet. Send a photo as character_image, or a saved character's character_id, to choose the face yourself.

How long does a music video take?+

Analysis takes under a minute and the character sheets a few minutes. Scenes then render one after another: a 3-minute song takes about 12–15 minutes with ltx-music-video and 25–30 minutes with minimax-h3-music-video. Add about a minute and a half when no GPU is warm.

Can I edit the scenes before rendering?+

Yes. Send auto_render: false and the job stops at ready with every scene's prompt and first frame. Rewrite scenes with PATCH, then start the render with POST /v1/videos/music/{id}/render. A plan you discard is free.

Which aspect ratios can I make?+

16:9 for YouTube, 9:16 for vertical short-video apps and 1:1 for feeds. All render at 24 frames per second.

Can an AI agent make music videos for me?+

Yes. Copy the prompt on this page into Claude Code, Cursor or Codex: it points the agent at the Markdown docs, and the agent calls the API with your key.

For still images, see the image generation API; for every endpoint and field, the music videos API reference.

One prepaid key for models, data and agents

No subscription. Top up, use what you need, see every charge in your logs.