logo
平台介绍
快速接入
密钥管理
模型列表
计费规则
音色列表
文本转语音
音色克隆
文生音色
语音识别
多模态理解模型
音乐生成
音乐生成介绍
POST
创建歌词生成任务
POST
创建歌曲生成任务
GET
查询歌曲生成状态
图片生成
视频生成
语音Agent
自定义Agent
常见问题
工作台
立即登录

音乐歌曲生成请求

请求生成歌曲。

接口概览

  • 接口地址: https://api.senseaudio.cn/v1/music/song/create
  • 请求方式: POST
  • Content-Type: application/json
  • 鉴权方式: Bearer Token

请求配置

请求头 (Request Headers)

参数名必填说明示例
Authorization是鉴权 Token。格式:Bearer SENSEAUDIO_API_KEYBearer sk-123456…
Content-Type是内容类型。固定为 application/jsonapplication/json

请求参数 (Request Body)

必填参数

参数名类型必填描述
modelstring是模型,目前只能使用senseaudio-music-1.0-260319
custom_modebool否是否传入提示词而不是歌词
instrumentalbool否是否为纯音乐,纯音乐仍然需要传入歌词或提示词
lyricsstring是歌词或提示词,传入歌词时需要按照下文中的格式输入,提示词则无限制,不能超过 2000 码位
negative_tagsstring否负面标签,排除的风格元素
stylestring否歌曲风格
style_weightfloat否风格权重 0-1
titlestring否歌曲标题
vocal_genderstring否歌曲中人声的性别,f代表女性,m代表男性

歌词格式

歌词由多个歌曲段组成,每个段以结构标签开头。模型通过这些标签引导歌曲结构和歌词发展。

标签段落类型是否需要歌词时长参考说明
[intro-short]前奏 Intro❌ 无歌词~0–10 秒短前奏,纯伴奏引入
[intro-medium]前奏 Intro❌ 无歌词~10–20 秒中长前奏版本
[inst-short]纯伴奏段❌ 无歌词~0–10 秒中间的器乐演奏段
[inst-medium]纯伴奏段❌ 无歌词~10–20 秒较长的器乐段
[outro-short]尾奏 Outro❌ 无歌词~0–10 秒短尾部收束
[outro-medium]尾奏 Outro❌ 无歌词~10–20 秒中长尾部收束
[verse]主歌 Verse✅ 需要歌词无固定时长承担叙事内容,应有完整句子
[chorus]副歌 Chorus✅ 需要歌词无固定时长歌曲主题部分,应朗朗上口
[bridge]过渡 Bridge✅ 需要歌词无固定时长连接主歌与副歌,增强情绪转换

响应结构

参数名类型描述
task_idstring任务 ID

响应示例

json
复制
{ "task_id": "50f979f5-2b9e-4254-8653-c277644a31fa" }

代码示例

CURL

bash
复制
curl -X POST "https://api.senseaudio.cn/v1/music/song/create" \ -H "Authorization: Bearer $SENSEAUDIO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "lyrics": "[intro-medium] ; [verse] Wake up from the shadows! ; Rise up with your fire! ; Break the chains that hold you down! ; [chorus] Roar like a lion! ; Conquer the storm! ; We are the unstoppable force! ; [bridge] Nothing can stop us now! ; [outro-short] ; [inst-short]", "model": "senseaudio-music-1.0-260319", "title": "战歌", "vocal_gender": "m" }'

Python

python
复制
import requests API_URL = "https://api.senseaudio.cn/v1/music/song/create" HEADERS = { "Authorization": "Bearer SENSEAUDIO_API_KEY", "Content-Type": "application/json" } def create(data): resp = requests.post(API_URL, headers=HEADERS, json=data) if resp.status_code == 200: return resp.json() return None result = create({ "lyrics": "[intro-medium] ; [verse] Wake up from the shadows! ; Rise up with your fire! ; Break the chains that hold you down! ; [chorus] Roar like a lion! ; Conquer the storm! ; We are the unstoppable force! ; [bridge] Nothing can stop us now! ; [outro-short] ; [inst-short]", "model": "senseaudio-music-1.0-260319", "title": "战歌", "vocal_gender": "m" })

JavaScript

javascript
复制
const axios = require('axios'); const API_URL = 'https://api.senseaudio.cn/v1/music/song/create'; const HEADERS = { 'Authorization': 'Bearer SENSEAUDIO_API_KEY', 'Content-Type': 'application/json' }; async function create(data) { try { const res = await axios.post(API_URL, data, { headers: HEADERS }); return res.data; } catch (err) { console.error('请求失败:', err.message); return null; } } create({ "lyrics": "[intro-medium] ; [verse] Wake up from the shadows! ; Rise up with your fire! ; Break the chains that hold you down! ; [chorus] Roar like a lion! ; Conquer the storm! ; We are the unstoppable force! ; [bridge] Nothing can stop us now! ; [outro-short] ; [inst-short]", "model": "senseaudio-music-1.0-260319", "title": "战歌", "vocal_gender": "m" }).then(result => { console.log(result); });