Suno 音乐视频生成
curl --request POST \
--url https://api.crun.ai/api/v1/client/job/CreateTask \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"model": "suno/music-video",
"callback_url": "https://your-domain.com/api/callback",
"input": {
"task_id": "task_12345678",
"suno_id": "suno_abc123",
"author": "Ava",
"brand": "Acme Records"
}
}
'import requests
url = "https://api.crun.ai/api/v1/client/job/CreateTask"
payload = {
"model": "suno/music-video",
"callback_url": "https://your-domain.com/api/callback",
"input": {
"task_id": "task_12345678",
"suno_id": "suno_abc123",
"author": "Ava",
"brand": "Acme Records"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'suno/music-video',
callback_url: 'https://your-domain.com/api/callback',
input: {
task_id: 'task_12345678',
suno_id: 'suno_abc123',
author: 'Ava',
brand: 'Acme Records'
}
})
};
fetch('https://api.crun.ai/api/v1/client/job/CreateTask', 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://api.crun.ai/api/v1/client/job/CreateTask",
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([
'model' => 'suno/music-video',
'callback_url' => 'https://your-domain.com/api/callback',
'input' => [
'task_id' => 'task_12345678',
'suno_id' => 'suno_abc123',
'author' => 'Ava',
'brand' => 'Acme Records'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://api.crun.ai/api/v1/client/job/CreateTask"
payload := strings.NewReader("{\n \"model\": \"suno/music-video\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"task_id\": \"task_12345678\",\n \"suno_id\": \"suno_abc123\",\n \"author\": \"Ava\",\n \"brand\": \"Acme Records\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api.crun.ai/api/v1/client/job/CreateTask")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"suno/music-video\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"task_id\": \"task_12345678\",\n \"suno_id\": \"suno_abc123\",\n \"author\": \"Ava\",\n \"brand\": \"Acme Records\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crun.ai/api/v1/client/job/CreateTask")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"suno/music-video\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"task_id\": \"task_12345678\",\n \"suno_id\": \"suno_abc123\",\n \"author\": \"Ava\",\n \"brand\": \"Acme Records\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "success",
"data": {
"task_id": "task_12345678"
}
}{
"code": 422,
"message": "Missing Params or Type Error",
"errors": [
"specific error field message"
]
}API参考
Suno API:生成音乐视频
基于现有的 Suno 音乐作品生成包含封面图与滚动歌词的音乐视频。
POST
/
api
/
v1
/
client
/
job
/
CreateTask
Suno 音乐视频生成
curl --request POST \
--url https://api.crun.ai/api/v1/client/job/CreateTask \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"model": "suno/music-video",
"callback_url": "https://your-domain.com/api/callback",
"input": {
"task_id": "task_12345678",
"suno_id": "suno_abc123",
"author": "Ava",
"brand": "Acme Records"
}
}
'import requests
url = "https://api.crun.ai/api/v1/client/job/CreateTask"
payload = {
"model": "suno/music-video",
"callback_url": "https://your-domain.com/api/callback",
"input": {
"task_id": "task_12345678",
"suno_id": "suno_abc123",
"author": "Ava",
"brand": "Acme Records"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'suno/music-video',
callback_url: 'https://your-domain.com/api/callback',
input: {
task_id: 'task_12345678',
suno_id: 'suno_abc123',
author: 'Ava',
brand: 'Acme Records'
}
})
};
fetch('https://api.crun.ai/api/v1/client/job/CreateTask', 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://api.crun.ai/api/v1/client/job/CreateTask",
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([
'model' => 'suno/music-video',
'callback_url' => 'https://your-domain.com/api/callback',
'input' => [
'task_id' => 'task_12345678',
'suno_id' => 'suno_abc123',
'author' => 'Ava',
'brand' => 'Acme Records'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://api.crun.ai/api/v1/client/job/CreateTask"
payload := strings.NewReader("{\n \"model\": \"suno/music-video\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"task_id\": \"task_12345678\",\n \"suno_id\": \"suno_abc123\",\n \"author\": \"Ava\",\n \"brand\": \"Acme Records\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api.crun.ai/api/v1/client/job/CreateTask")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"suno/music-video\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"task_id\": \"task_12345678\",\n \"suno_id\": \"suno_abc123\",\n \"author\": \"Ava\",\n \"brand\": \"Acme Records\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crun.ai/api/v1/client/job/CreateTask")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"suno/music-video\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"task_id\": \"task_12345678\",\n \"suno_id\": \"suno_abc123\",\n \"author\": \"Ava\",\n \"brand\": \"Acme Records\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "success",
"data": {
"task_id": "task_12345678"
}
}{
"code": 422,
"message": "Missing Params or Type Error",
"errors": [
"specific error field message"
]
}重要说明
- 需要提供之前生成的 Suno 音乐任务中的
task_id和suno_id
生成音乐视频
基于现有的 Suno 音乐结果创建音乐视频。{
"model": "suno/music-video",
"callback_url": "",
"input": {
"task_id": "task_12345678",
"suno_id": "suno_abc123"
}
}
{
"model": "suno/music-video",
"callback_url": "",
"input": {
"task_id": "task_12345678",
"suno_id": "suno_abc123",
"author": "Ava",
"brand": "Acme Records"
}
}
相关资源
现有的 Suno 音乐作品可来源于以下任意接口。生成音乐
通过文本提示词创建多种风格的歌曲。
扩展音乐
无缝延续并扩展现有音乐作品。
上传音频扩展
上传音频以扩展并优化音乐作品。
音乐翻唱
使用新的风格或声音重新演绎歌曲。
获取任务结果
提交任务后,可以使用统一查询接口检查任务进度并获取生成结果:获取 Suno 任务信息
了解如何查询 Suno 任务状态并获取生成结果
授权
所有 API 均需通过 API Key 进行身份认证。
获取 API Key:
- 访问 API Key 管理页面 获取你的 API Key
使用方式: 在请求头中添加:
x-api-key: YOUR_API_KEY
注意:
- 请妥善保管 API Key,不要泄露给他人
- 如果怀疑 API Key 已泄露,请立即在管理页面重置
请求体
application/json
使用的模型名称。
- 必须为
suno/music-video
可用选项:
suno/music-video 基于已生成的 Suno 音乐任务生成音乐视频的输入参数。
规则:
task_id必填,必须来自已完成的音乐生成任务suno_id必填,对应音乐条目 ID
Show child attributes
Show child attributes
可选回调地址,用于接收任务完成通知。
- 任务完成后系统会 POST 结果到该地址
- 回调结构与任务查询接口一致
- 接口需返回 HTTP 200 表示接收成功
示例:
"https://your-domain.com/api/callback"
响应
请求成功
响应状态码
- 200:成功 - 请求已成功处理
- 401:未授权 - 认证信息缺失或无效
- 402:余额不足 - 账户积分不足
- 404:未找到 - 请求资源不存在
- 422:参数错误 - 请求参数校验失败
- 429:请求过于频繁 - 超出频率限制
- 455:服务不可用 - 系统维护中
- 500:服务器错误 - 处理请求时发生异常
- 501:生成失败 - 内容生成任务失败
- 505:功能禁用 - 当前功能不可用
可用选项:
200, 401, 402, 404, 422, 429, 455, 500, 501, 505 响应消息,失败时为错误说明
示例:
"success"
Show child attributes
Show child attributes
此页面对您有帮助吗?
⌘I
