简体中文
cURL
curl --request POST \ --url https://api.sunoapi.org/api/v1/generate \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "一段平静舒缓的钢琴曲,带有柔和的旋律", "style": "古典", "title": "宁静钢琴冥想", "customMode": true, "instrumental": true, "model": "V3_5", "negativeTags": "重金属, 强节奏鼓点", "callBackUrl": "https://api.example.com/callback" }'
{ "code": 200, "msg": "success", "data": { "taskId": "5c79****be8e" } }
使用AI模型生成带有或不带歌词的音乐。
所有接口都需要通过 Bearer Token 方式进行认证。
在请求头中添加:
Authorization: Bearer YOUR_API_KEY
⚠️ 注意: 请妥善保管您的 API Key,不要泄露给他人 如果怀疑 API Key 泄露,请立即在管理页面重置
⚠️ 注意:
请求成功
The response is of type object.
object