创建音乐视频
curl --request POST \
--url https://apibox.erweima.ai/api/v1/mp4/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"taskId": "taskId_774b9aa0422f",
"audioId": "e231****-****-****-****-****8cadc7dc",
"callBackUrl": "https://api.example.com/callback",
"author": "Suno Artist",
"domainName": "music.example.com"
}
'import requests
url = "https://apibox.erweima.ai/api/v1/mp4/generate"
payload = {
"taskId": "taskId_774b9aa0422f",
"audioId": "e231****-****-****-****-****8cadc7dc",
"callBackUrl": "https://api.example.com/callback",
"author": "Suno Artist",
"domainName": "music.example.com"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
taskId: 'taskId_774b9aa0422f',
audioId: 'e231****-****-****-****-****8cadc7dc',
callBackUrl: 'https://api.example.com/callback',
author: 'Suno Artist',
domainName: 'music.example.com'
})
};
fetch('https://apibox.erweima.ai/api/v1/mp4/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apibox.erweima.ai/api/v1/mp4/generate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'taskId' => 'taskId_774b9aa0422f',
'audioId' => 'e231****-****-****-****-****8cadc7dc',
'callBackUrl' => 'https://api.example.com/callback',
'author' => 'Suno Artist',
'domainName' => 'music.example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apibox.erweima.ai/api/v1/mp4/generate"
payload := strings.NewReader("{\n \"taskId\": \"taskId_774b9aa0422f\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"callBackUrl\": \"https://api.example.com/callback\",\n \"author\": \"Suno Artist\",\n \"domainName\": \"music.example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apibox.erweima.ai/api/v1/mp4/generate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"taskId\": \"taskId_774b9aa0422f\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"callBackUrl\": \"https://api.example.com/callback\",\n \"author\": \"Suno Artist\",\n \"domainName\": \"music.example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apibox.erweima.ai/api/v1/mp4/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"taskId\": \"taskId_774b9aa0422f\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"callBackUrl\": \"https://api.example.com/callback\",\n \"author\": \"Suno Artist\",\n \"domainName\": \"music.example.com\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"taskId": "taskId_774b9aa0422f"
}
}Music Video Generation
创建音乐视频
为音乐曲目生成带有可视化效果的MP4视频。
POST
/
api
/
v1
/
mp4
/
generate
创建音乐视频
curl --request POST \
--url https://apibox.erweima.ai/api/v1/mp4/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"taskId": "taskId_774b9aa0422f",
"audioId": "e231****-****-****-****-****8cadc7dc",
"callBackUrl": "https://api.example.com/callback",
"author": "Suno Artist",
"domainName": "music.example.com"
}
'import requests
url = "https://apibox.erweima.ai/api/v1/mp4/generate"
payload = {
"taskId": "taskId_774b9aa0422f",
"audioId": "e231****-****-****-****-****8cadc7dc",
"callBackUrl": "https://api.example.com/callback",
"author": "Suno Artist",
"domainName": "music.example.com"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
taskId: 'taskId_774b9aa0422f',
audioId: 'e231****-****-****-****-****8cadc7dc',
callBackUrl: 'https://api.example.com/callback',
author: 'Suno Artist',
domainName: 'music.example.com'
})
};
fetch('https://apibox.erweima.ai/api/v1/mp4/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apibox.erweima.ai/api/v1/mp4/generate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'taskId' => 'taskId_774b9aa0422f',
'audioId' => 'e231****-****-****-****-****8cadc7dc',
'callBackUrl' => 'https://api.example.com/callback',
'author' => 'Suno Artist',
'domainName' => 'music.example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apibox.erweima.ai/api/v1/mp4/generate"
payload := strings.NewReader("{\n \"taskId\": \"taskId_774b9aa0422f\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"callBackUrl\": \"https://api.example.com/callback\",\n \"author\": \"Suno Artist\",\n \"domainName\": \"music.example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apibox.erweima.ai/api/v1/mp4/generate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"taskId\": \"taskId_774b9aa0422f\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"callBackUrl\": \"https://api.example.com/callback\",\n \"author\": \"Suno Artist\",\n \"domainName\": \"music.example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apibox.erweima.ai/api/v1/mp4/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"taskId\": \"taskId_774b9aa0422f\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"callBackUrl\": \"https://api.example.com/callback\",\n \"author\": \"Suno Artist\",\n \"domainName\": \"music.example.com\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"taskId": "taskId_774b9aa0422f"
}
}用法指南
- 此接口为您的音乐曲目创建MP4视频格式的可视化表示。
- 需要同时提供
taskId和audioId来识别具体曲目。 - 可选的
author和domainName参数可用于添加品牌信息。
开发者说明
- 生成的视频文件将保留15天。
- 视频包含与音乐同步的视觉效果。
- 此功能非常适合社交媒体分享、音乐推广或创建视觉内容。
- 视频保持与原始音轨相同的音频质量。
授权
🔑 API 认证说明
所有接口都需要通过 Bearer Token 方式进行认证。
获取 API Key
- 访问 API Key 管理页面 获取您的 API Key
使用方式
在请求头中添加:
Authorization: Bearer YOUR_API_KEY
⚠️ 注意:
- 请妥善保管您的 API Key,不要泄露给他人
- 如果怀疑 API Key 泄露,请立即在管理页面重置
请求体
application/json
音乐生成任务的任务ID。
- 必填。用于标识包含待转换为视频的音频的任务。
- 需要同时提供
taskId和audioId以识别确切的音轨。
示例:
"taskId_774b9aa0422f"
要转换为视频的具体音轨ID。
- 必填。用于标识任务中要转换的具体音轨。
- 需要同时提供
taskId和audioId以识别确切的音轨。
示例:
"e231****-****-****-****-****8cadc7dc"
显示在视频上的艺术家或创作者名称。
- 可选。
- 将在视频中显著展示,通常在开头。
- 最长50个字符。
Maximum string length:
50示例:
"Suno Artist"
作为水印显示的网站或品牌。
- 可选。
- 将作为微妙的水印出现在视频底部。
- 最长50个字符。
Maximum string length:
50示例:
"music.example.com"
回调
响应
请求成功
状态码
- ✅ 200 - 请求成功
- ⚠️ 400 - 无效参数
- ⚠️ 401 - 未授权访问
- ⚠️ 404 - 无效的请求方法或路径
- ⚠️ 405 - 超出速率限制
- ⚠️ 409 - 冲突 - Mp4 记录已存在
- ⚠️ 413 - 主题或提示词过长
- ⚠️ 429 - 积分不足
- ⚠️ 430 - 您的调用频率过高,请稍后重试
- ⚠️ 455 - 系统维护中
- ❌ 500 - 服务器错误
可用选项:
200, 400, 401, 404, 405, 409, 413, 429, 430, 455, 500 当 code != 200 时,展示错误信息
示例:
"success"
Show child attributes
Show child attributes
