使用场景

AI 音乐视频生成 API:
输入一首歌,输出一支 MV

发送一首歌和一段简短的创意说明,即可拿到一个踩点剪辑的 mp4:每个场景都是同一位歌手,配乐就是你的原曲。

预付费,无订阅REST 或 MCP一个密钥搞定模型、数据和智能体
song.mp3 · 3:24踩点剪辑"into the night"scene 1"neon in the rain"scene 2"never look back"scene 3"to the sea"scene 4music-video.mp4

过去拍一支 MV 意味着拍摄、剪辑和预算。现在,歌曲转音乐视频只需一次 API 调用:POST /v1/videos/music 接收你的歌曲和一段简短的创意说明(故事、画面风格、歌手),返回一个与歌曲等长的 mp4。场景按节拍切分,每个场景都是同一位歌手并对口型演唱歌词,配乐就是你的原曲,一点不改。你可以把它接入音乐应用、唱片公司的发行流程或创作者工具,也可以不写代码,直接把 Playground 当作 AI MV 生成器来用。

交给你的 AI 智能体

把这段提示词复制到 Claude Code、Cursor、Codex 或任何编程智能体中。它会告诉智能体文档在哪里,以及如何使用你的 API 密钥。

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

工作原理

010203
  1. 发送歌曲和创意说明

    上传 MP3、WAV、FLAC、OGG 或 M4A 文件(最大 60 MB),可选附上 story、style、character 和 lyrics。所有字段都是可选的:不写说明时,导演会根据歌词自己构思故事和歌手。

  2. 踩点切分,一次定角

    歌曲按节拍切成场景,每段约 5 秒,并逐场景转写歌词。一个聊天模型担任导演,先把歌手定义一次,再由图像模型为每套服装画一张三视图设定图(正面、侧面、背面),让每个场景都是同一个人。

  3. 逐场景导演与渲染

    导演根据你的说明和该场景的歌词为每个场景写一个镜头,包括运镜和光线。每个场景渲染时由对应的那段歌曲驱动画面:歌手的口型跟着歌词,动作跟着音乐。

  4. 一个 mp4,配你的原曲

    场景按顺序拼接在原曲之上。每段片段一渲染完就能观看,成片可在 7 天内下载。

02

一次请求生成一支 MV

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

请求会立即返回 202 和音乐视频对象。轮询 GET /v1/videos/music/{id}?wait=120 查看 status、progress 和各个场景,状态变为 completed 后用 GET /v1/videos/music/{id}/content 下载。音乐视频指南里有 Python 和 Node.js 的同样流程。

03

用到的工具

音乐视频 API。

POST /v1/videos/music 跑完整条流程:节拍分析、定角、角色设定图、导演、渲染和最终剪辑。画幅可选 16:9、9:16 或 1:1。参考:音乐视频 API。

保存的角色。

用 POST /v1/characters 把一位艺人保存一次(名字、描述和三视图设定图),之后每支视频都传 character_id,整张专辑都是同一张脸。保存免费。见 角色。

歌曲截取。

传入以秒为单位的 start 和 end,只为副歌或前一分钟生成视频,按截取的长度计费,而不是整首歌。Playground 里有带预览的截取工具。

渲染前审阅。

设置 auto_render: false 后,任务会在每个场景都有提示词和首帧时停下。用 PATCH 改写任意场景,再 POST …/render。放弃的方案不收视频费用。

角色设定图和首帧。

用你账户上的图像生成 API 绘制,可以基于歌手的照片(character_image),也可以基于文字说明。用 image_model 选择图像模型。

任意聊天模型都能当导演。

director_model 接受你的密钥可用的任何聊天模型;快速、便宜的模型就足够了。

04

两个模型

模型每秒歌曲价格适合
ltx-music-video$0.06渲染快,每个场景约 20–25 秒:3 分钟的歌大约 12–15 分钟完成。最高 1472×832。
minimax-h3-music-video$0.13(开启 first_frames 为 $0.2)直接根据角色设定图拍摄歌手,形象最稳定,每个场景约 45 秒。最高 1344×768。

两个模型都支持 5 秒到 6 分钟的歌曲,最少按 15 秒计费,24 fps 渲染。每个请求都要设置 consent: true 以接受模型条款:LTX 条款或 MiniMax H3 条款,后者不允许在欧盟、英国、韩国或美国使用。

05

实用配方

每次发行都配一支 MV。

用 POST /v1/characters 保存艺人,之后每首单曲用 character_id 加一句故事调用 API,每支视频的主角都是同一张脸。

短视频平台的竖屏片段。

传 size=9:16,并用 start 和 end 截取副歌高潮,得到 15–60 秒的竖屏视频,适合抖音、Reels 或 Shorts。

先审批再花钱。

设置 auto_render: false,把角色设定图和首帧给用户看,让他们改写场景,再开始渲染。

响应迅速的音乐应用。

渲染过程中逐个展示场景片段(scenes[n].url)。

歌词精准的演唱。

传入原文 lyrics 和 language(如 en、zh 或 ja),导演在每个演唱镜头里都会引用正确的歌词。

06

费用说明

按歌曲的秒数付费:ltx-music-video 每秒 $0.06,一首 3 分半的歌约 $12.6;minimax-h3-music-video 每秒 $0.13。导演的调用和角色图片(通常每套服装一张、每个场景一张)按各自模型的价格另行计费。歌曲长度确定后,会从你的预付余额中冻结相应金额,视频完成后在日志中作为一笔费用结算。如果视频因我们这边的原因失败,不收取视频费用。所有模型的价格见价格页。

07

版权与负责任使用

请使用你拥有或获得授权的歌曲,以及你有权呈现的人物。视频必须遵守模型条款和可接受使用政策。成片保留 7 天后删除,请下载需要保留的内容。

08

常见问题

?
需要我提供音乐吗?+

需要。视频围绕你的歌曲生成:节拍决定剪辑点,歌词驱动演唱,成片的配乐就是这首歌。可以发送最长 6 分钟的整首歌,也可以截取更长歌曲的一段。

每个场景里的歌手会是同一个人吗?+

默认会。歌手只定角一次,并为每套服装画一张三视图设定图,每个场景都从这张设定图开始。发送一张照片作为 character_image,或传入保存角色的 character_id,就能自己指定长相。

生成一支 MV 需要多久?+

分析不到一分钟,角色设定图需要几分钟。之后场景依次渲染:3 分钟的歌用 ltx-music-video 约 12–15 分钟,用 minimax-h3-music-video 约 25–30 分钟。没有已预热的 GPU 时再加约一分半钟。

渲染前可以修改场景吗?+

可以。传入 auto_render: false,任务会停在 ready,带有每个场景的提示词和首帧。用 PATCH 改写场景,再用 POST /v1/videos/music/{id}/render 开始渲染。放弃的方案免费。

支持哪些画幅?+

16:9 适合 YouTube,9:16 适合竖屏短视频平台,1:1 适合信息流。全部以每秒 24 帧渲染。

AI 智能体能帮我做 MV 吗?+

能。把本页的提示词复制到 Claude Code、Cursor 或 Codex:它会告诉智能体去读 Markdown 文档,智能体再用你的密钥调用 API。

静态图片请看图像生成 API;每个接口和字段见音乐视频 API 参考。

一个预付费密钥,搞定模型、数据和智能体

无需订阅。充值后按需使用,每笔费用都能在日志中查看。