Oneclick 音乐 MV API 文档
一句话总结: 零门槛的“音乐视觉化”神器,一键将音频变爆款 MV。
| 项目 | 说明 |
|---|---|
| 支持分辨率 | 720p、1080p |
| 720p 计费 | 15 credits/s,时长向上取整 |
| 1080p 计费 | 720p 的 1.5 倍 |
| 并发占用 | 每次调用占用 10 |
/openapi/v2/media/upload 上传音频,获取音频 ID。/openapi/v2/audio/verification,完成音频审核。/openapi/v2/video/music_mv_agent/generate 生成音乐 MV。video_id,通过 /openapi/v2/video/result/{video_id} 查询视频结果及视频 URL。音频校验和音乐 MV 生成接口均使用以下 Header。
| 字段 | 类型 | 必填 | 说明或取值 |
|---|---|---|---|
API-KEY | string | 是 | Pixverse API Key,客户注册后获得的唯一 Key |
Ai-trace-id | string | 是 | 每个链路任务新建的 ID |
Content-Type | string | 是 | application/json |
| 项目 | 说明 |
|---|---|
| 支持环境 | 国内 ✅、海外 ✅ |
| 业务能力 | 对上传的音频进行审核,同步返回审核结果 |
| 请求方式 | POST |
| 请求路径 | /openapi/v2/audio/verification |
| 字段 | 类型 | 必填 | 说明 | 校验规则 |
|---|---|---|---|---|
audio_media_id | uint64 | 是 | 上传接口返回的音频 ID;原始示例为 "music_id": 1111 | 必须是当前账号上传的音频 |
curl --location --request POST 'https://app-api.pixverse.ai/openapi/v2/audio/verification' \
--header 'API-KEY: sk-xxxxxxxxxxx' \
--header 'Ai-trace-id: xxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"audio_media_id": 405833376854443
}'
{
"ErrCode": 0,
"ErrMsg": "Success",
"Resp": {}
}
| 含义 | ErrCode | ErrMsg |
|---|---|---|
| 音频 ID 为空 | 400017 | Required field audio_media_id are missing or empty. |
| 音频 ID 不存在 | 400013 | Invalid field type or value. Please verify your input data. |
| 音频非本账号创建 | 500047 | audio_media_id: The provided media is invalid — the type may be incorrect, or the resource is no longer available. |
| 传入 ID 格式错误 | 500047 | audio_media_id: The provided media is invalid — the type may be incorrect, or the resource is no longer available. |
| 音频内容违规(英文) | 500063 | The text you entered contains sensitive information. Please re-enter. |
| 音频内容违规(中文) | 500063 | 输入的内容不符合平台规范,请重新输入 |
错误响应示例:
{
"ErrCode": 400017,
"ErrMsg": "Required field audio_media_id are missing or empty."
}
| 项目 | 说明 |
|---|---|
| 支持环境 | 国内 ✅、海外 ✅ |
| 业务能力 | 生成音乐 MV |
| 请求方式 | POST |
| 请求路径 | /openapi/v2/video/music_mv_agent/generate |
| 并发占用 | 10 |
| 字段 | 类型 | 必填 | 说明与校验规则 |
|---|---|---|---|
mv_agent_type | string | 是 | 使用 vibe_mv_v3_custom |
audio_media_id | uint64 | 是 | 音频上传后返回的 ID;原始示例为 "media_id": 1111。须先通过音频校验。参数说明要求文件不超过 100 MB,时长为 10 秒至 6 分钟;大小限制与错误示例存在差异,见第 2 节 |
image_references | array | 否 | 角色图片,当前仅支持单图。支持 JPG、PNG、WebP,尺寸不超过 10000 × 10000 像素,文件大小不超过 20 MB |
style_img_references | array | 否 | 仅在 mv_style=Custom 时传入风格图片,当前仅支持单图,格式、尺寸和大小限制同角色图片。未传时使用角色图片作为风格参考;自定义风格下两种图片引用不能同时为空 |
music_style | string | 否 | 音乐风格,见下方枚举,不区分大小写;为空时由算法处理 |
mv_style | string | 否 | MV 画面风格,见下方枚举,不区分大小写;为空时由算法处理 |
aspect_ratio | string | 否 | 16:9、9:16、1:1、4:3、3:4,默认 16:9 |
quality | string | 否 | 720p、1080p,默认 720p |
lyric_text | string | 否 | 歌词内容,建议保留标点或换行 |
caption_switch | boolean | 否 | 字幕开关,默认 false |
lip_sync_switch | boolean | 否 | 对口型开关,true 开启,false 关闭,默认 false。纯音乐开启对口型会生成失败并返回错误 |
lyric_timestamp | JSON object | 否 | 1. |
| 歌词时间戳里面的0秒表示的是audio起始时间 |
时间戳单调递增(每一个新start时间不能早于上一个end时间,当前不支持叠字情况)
时间戳需小于等于audio时长(会校验歌词时间戳长度不得超过音频时长)
words数量限制5000,拼接后长度小于5000
跟lyric_text同时传入时,优先用lyric_timestamp
{
"words": [
{
"start": 0.0,
"end": 0.32,
"word": "Who"
},
{
"start": 0.32,
"end": 0.64,
"word": "be"
}
]
} |
音乐风格 music_style:
Pop / Rock / Hip Hop / R&B / Jazz / Reggae / Country / Folk /
Electronic / Classical / Soul / Funk / Metal / Ambient / Others
MV 画面风格 mv_style:
Custom / Cinematic / Lo-fi / Dreamscape / Woolen Felt / Candy /
Golden Age / Voxel / Retro Game / Claymation / Woodland Tale /
Impressionism / Decadence / Futuristic / Chromatic Clash / Holiday
其中,Custom 为自定义风格,其余为 15 种内置风格。
角色图片:
{
"image_references": [
{
"img_id": 164913710,
"ref_name": "角色图片"
}
]
}
风格图片:
{
"style_img_references": [
{
"img_id": 164913711,
"ref_name": "风格图片"
}
]
}
当 mv_style=Custom 时:
style_img_references,则使用 image_references 作为风格参考。image_references 与 style_img_references 不能同时为空。{
"lyric_timestamp": {
"words": [
{
"start": 0.0,
"end": 0.32,
"word": "Who"
},
{
"start": 0.32,
"end": 0.64,
"word": "be"
}
]
}
}
校验规则:
0 表示音频起始时间。start 不能早于上一个 end,当前不支持叠字。words 数量不超过 5000,拼接后的文本长度小于 5000。lyric_text 同时传入时,优先使用 lyric_timestamp。以下示例保留主要参数,歌词为节选;JSON 中已移除注释,以便直接使用。
curl --location --request POST 'https://app-api.pixverse.ai/openapi/v2/video/music_mv_agent/generate' \
--header 'API-KEY: sk-xxxxxxxxxxx' \
--header 'Ai-trace-id: xxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"mv_agent_type": "vibe_mv_v3_custom",
"audio_media_id": 404796051111573,
"image_references": [
{
"img_id": 164913710,
"ref_name": "角色图片"
}
],
"style_img_references": [
{
"img_id": 164913711,
"ref_name": "风格图片"
}
],
"music_style": "Jazz",
"mv_style": "Custom",
"aspect_ratio": "16:9",
"quality": "720p",
"lyric_text": "The city breathes in velvet hush\nStreetlights bleed soft molten gold\nMy footsteps hum a quiet rush\nWhere winter air turns warm and old",
"caption_switch": true,
"lip_sync_switch": true
}'
接口成功返回 video_id 后,通过 /openapi/v2/video/result/{video_id} 获取视频结果及视频 URL。
{
"ErrCode": 0,
"ErrMsg": "Success",
"Resp": {
"video_id": 311156303940608,
"credits": 1000
}
}
下表完整保留原始错误码与错误消息。除另行标注外,响应示例包含 ErrCode 与 ErrMsg 两个字段。
| 含义 | ErrCode | ErrMsg |
|---|---|---|
| 音频未审核,需先调用音频校验接口 | 701020 | The audio content has not been verified. Please call the audio verification interface first. |
| 音频审核未通过 | 500063 | The text you entered contains sensitive information. Please re-enter. |
mv_agent_type 不在指定枚举内 | 400017 | Invalid value for mv_agent_type |
| 视频比例错误 | 400017 | Invalid value for aspect_ratio. |
| 视频清晰度错误 | 400017 | Invalid value for quality. |
| 音频文件大小超限 | 400017 | Audio file size exceeds the 15MB limit. |
| 音频时长超过 360 秒 | 400017 | The audio duration exceeds the 360-second limit.(响应另含 "Resp": null) |
| 音频时长无效 | 400017 | Invalid value for duration. |
mv_style 不在指定枚举内 | 400017 | Invalid value for mv_style. |
music_style 不在指定枚举内 | 400017 | Invalid value for music_style. |
| 音频 ID 为空 | 400017 | Required field audio_media_id are missing or empty. |
| 音频非本账号资源 | 500047 | audio_media_id: The provided media is invalid — the type may be incorrect, or the resource is no longer available. |
| 音频 ID 不存在 | 500047 | audio_media_id: The provided media is invalid — the type may be incorrect, or the resource is no longer available. |
| 图片超过一张 | 400017 | Invalid value for img_references. |
| 图片 ID 为空 | 400017 | Invalid value for img_id. |
| 图片非本账号资源 | 701009 | Invalid query. You can only query your own generated or uploaded content. |
| 图片 ID 不存在 | 400032 | invalid img id |
| 自定义风格下,角色图片和风格图片同时为空 | 400017 | image_references and style_img_references cannot both be empty when mv_agent_type is vibe_mv_v3_custom and mv_style is custom. |
| 纯音乐开启对口型 | 400017 | No lyrics were detected in the audio. Lip sync MV requires vocals with recognizable lyrics. |
| 通用提示词超过 5000 字符 | 400017 | music_style / mv_prompt must be within 5000 characters |
| 歌词审核拦截 | 500063 | The text you entered contains sensitive information. Please re-enter. |
| 音频审核拦截 | 500063 | The content you entered contains sensitive information. Please re-enter. |
| 免费用户因并发限制不可用 | 500044 | Reached the limit for concurrent generations. |
音频未审核:
{
"ErrCode": 701020,
"ErrMsg": "The audio content has not been verified. Please call the audio verification interface first."
}
音频时长超限:
{
"ErrCode": 400017,
"ErrMsg": "The audio duration exceeds the 360-second limit.",
"Resp": null
}
自定义风格缺少图片:
{
"ErrCode": 400017,
"ErrMsg": "image_references and style_img_references cannot both be empty when mv_agent_type is vibe_mv_v3_custom and mv_style is custom."
}
纯音乐开启对口型:
{
"ErrCode": 400017,
"ErrMsg": "No lyrics were detected in the audio. Lip sync MV requires vocals with recognizable lyrics."
}
curl --location 'https://app-api.pixverseai.cn/openapi/v2/video/music_mv_agent/generate' \
--header 'API-KEY: your-api-key' \
--header 'Ai-trace-id: your-ai-trace-id' \
--header 'Content-Type: application/json' \
--data '{
// MV 三期自定义链路标识
"mv_agent_type": "vibe_mv_v3_custom",
// 上传的音频 ID,需先通过音频校验
"audio_media_id": 0,
// 角色图片(可选,当前仅支持单图)
"image_references": [
{
"img_id": 0,
"ref_name": "角色图片"
}
],
// 风格图片(仅 mv_style=Custom 时传入,当前仅支持单图)
"style_img_references": [
{
"img_id": 0,
"ref_name": "风格图片"
}
],
// 音乐风格;为空时由算法处理
// Pop/Rock/Hip Hop/R&B/Jazz/Reggae/Country/Folk/Electronic/Classical/Soul/Funk/Metal/Ambient/Others
"music_style": "Jazz",
// MV 风格;为空时由算法处理
// Custom/Cinematic/Lo-fi/Dreamscape/Woolen Felt/Candy/Golden Age/Voxel/Retro Game/Claymation/Woodland Tale/Impressionism/Decadence/Futuristic/Chromatic Clash/Holiday
"mv_style": "Custom",
// 尺寸:16:9/9:16/1:1/4:3/3:4
"aspect_ratio": "16:9",
// 分辨率:720p/1080p
"quality": "720p",
// 歌词文本(建议保留标点或换行)
"lyric_text": "The city breathes in velvet hush\nStreetlights bleed soft molten gold\nMy footsteps hum a quiet rush\nWhere winter air turns warm and old\n\nYour shadow leans against the rain\nA cigarette of silver light\nEach step I take dissolves the pain\nOf hours lost inside the night\n\nMeet me at midnight in blue\nWhere the saxophone cries for you\nHold me like the night won’t end\nLike broken hearts can start again\nMeet me where the neon glows\nWhere nobody knows what nobody knows\nUnderneath this silver moon\nLove sounds sweeter out of tune\n\nDon’t say goodbye too soon\nLet the record spin in June\nWe’re just two fading silhouettes\nDancing out of tune\nMeet me at midnight in blue\nWhere the saxophone cries for you\nHold me like the night won’t end\nLike broken hearts can start again\n\nTime slows down in smoky air\nA single note hangs in the stair\nNo need for words no need to prove\nJust this calm this shared remove\n\nMeet me at midnight in blue\nWhere the saxophone cries for you\nHold me like the night won’t end\nLike broken hearts can start again\nMeet me where the neon glows\nWhere nobody knows what nobody knows\nUnderneath this silver moon\nLove sounds sweeter out of tune",
// 字幕开关;不传时默认 false
"caption_switch": true,
// 对口型开关;不传时默认 false
"lip_sync_switch": true
}'{
"ErrCode": 0,
"ErrMsg": "Success",
"Resp": {
"video_id": 123456789,
"credits": 0
}
}