POST
/generate生成音乐回调API
使用具有回调支持的 AI 生成音乐。
POST
https://udioapi.pro/api/generatetips
此端点将生成结果发送到您的回调 URL。
回调 URL 必须公开并接受 POST 请求。
requestHeaders
| name | required | description |
|---|---|---|
Authorization | yes | 用于身份验证的承载令牌 |
Content-Type | yes | application/json |
requestBody
请求体支持灵感模式或自定义模式,以及回调URL
灵感模式
从文本描述生成
| paramName | paramType | required | description | example |
|---|---|---|---|---|
gpt_description_prompt | string | yes | 文字描述提示 | A upbeat pop song about summer vacation with catchy melody |
自定义模式
使用自定义歌词、风格、标题生成
| paramName | paramType | required | description | example |
|---|---|---|---|---|
prompt | string | yes | 自定义歌词或提示 | Verse 1: Walking down the street, feeling so free... |
style | string | no | 音乐风格 | pop, upbeat, electronic, 120 bpm |
title | string | no | 歌名 | Summer Dreams |
tags | string | no | 负面标签 | sad, slow |
commonParams
| paramName | paramType | required | description | example |
|---|---|---|---|---|
callback_url | string | yes | 用于接收生成回调的公共 URL | https://your-domain.com/api/callback |
model | string | no | 人工智能模型 | chirp-v5-5 |
make_instrumental | boolean | no | 生成器乐 | false |
gender | string | no | 声音性别偏好 | female |
style_weight | number | no | 风格坚持强度 | 0.65 |
weirdness_constraint | number | no | 创意偏差控制 | 0.65 |
audio_weight | number | no | 音频功能平衡 | 0.65 |
responses
json
{
"code": 200,
"message": "success",
"workId": "gen2abc123def456bksv",
"data": {
"task_id": "gen2abc123def456bksv"
}
}codeExamples
curl
curl -X POST "https://udioapi.pro/api/generate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"callback_url": "https://your-domain.com/api/callback",
"model": "chirp-v4-5",
"gpt_description_prompt": "A upbeat pop song about summer vacation with catchy melody",
"make_instrumental": false,
"gender": "female",
"style_weight": 0.65,
"weirdness_constraint": 0.65,
"audio_weight": 0.65
}'