> ## Documentation Index
> Fetch the complete documentation index at: https://docs.senseaudio.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 歌曲生成

## 说明

请求生成歌曲，获得异步任务ID。获得异步任务ID后可使用[查询歌曲任务 API](/api-reference/endpoint/music/song-pending)轮询歌曲生成状态。

## 歌曲格式

当参数 `custom_mode` 为 `false` 时，歌词需要按照指定格式输入。歌词由多个歌曲段组成，每个段以结构标签开头。模型通过这些标签引导歌曲结构和歌词发展。

| 标签              | 段落类型      | 是否需要歌词 | 时长参考      | 说明             |
| :-------------- | :-------- | :----- | :-------- | :------------- |
| \[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 | ✅ 需要歌词 | 无固定时长     | 连接主歌与副歌，增强情绪转换 |


## OpenAPI

````yaml api-reference/endpoint/music/music.openapi.json POST /v1/music/song/create
openapi: 3.1.0
info:
  title: SenseAudio - Music
  version: 1.0.0
servers:
  - url: https://api.senseaudio.cn
    description: 生产环境
security:
  - bearerAuth: []
paths:
  /v1/music/song/create:
    post:
      summary: 创建音乐
      operationId: musicCreateMusicSong
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - lyrics
              properties:
                custom_mode:
                  description: 是否自定义模式，即是否传入提示词而不是歌词
                  type: boolean
                instrumental:
                  description: 是否纯音乐，纯音乐仍然需要传入歌词或提示词
                  type: boolean
                lyrics:
                  required: true
                  description: 歌词或提示词，传入歌词时需要按照上文中的格式输入，提示词则无限制，不能超过 2000 码位
                  type: string
                model:
                  required: true
                  description: 模型，目前只能使用senseaudio-music-1.0-260319
                  type: string
                  enum:
                    - senseaudio-music-1.0-260319
                negative_tags:
                  description: 负面标签，排除的风格元素
                  type: string
                style:
                  description: 歌曲风格
                  type: string
                style_weight:
                  description: 风格权重 0-1
                  type: number
                title:
                  description: 歌曲标题
                  type: string
                vocal_gender:
                  description: 歌曲中人声的性别，f代表女性，m代表男性
                  type: string
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  task_id:
                    description: 任务ID
                    type: string
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API_KEY
      description: 格式：`Bearer <API_KEY>`

````