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

# Suno Replace Section API 文档

> 使用 Suno 段落替换接口对歌曲中的指定片段进行重写或替换，适合副歌重做、桥段调整和局部优化。

<Callout type="info">
  提示：替换的歌词 要跟原来的歌词有重复的地方，最好相应的时间能对应上

  infill\_lyrics：表示你要填充或替换进去的“最新歌词片段”。
  prompt：表示上下文，需要把“新歌词”前后的原歌词拼接起来。

  例子：原歌词是 \[Verse 1]AA \[Chorus]BB \[Verse 2] CC \[Chorus]DD \[Outro]EE，如果你想把 CC 替换为 OO

  infill\_lyrics 就传 OO（要替换的新歌词）。
  prompt 就传 BB \[Verse 2]OO\[Chorus]DD （在新歌词 OO 前后，保留一部分原歌词，拼成上下文）。

  这样就能根据 prompt 的上下文和 infill\_lyrics 的新歌词片段，生成最佳的结果。
</Callout>


## OpenAPI

````yaml openapi/cn/suno.json POST /suno/v1/replace-section
openapi: 3.1.0
info:
  title: TTAPI API DOCS
  version: 1.0.0
  description: Suno 音乐生成相关接口
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /suno/v1/replace-section:
    post:
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  properties:
                    music_id:
                      type: string
                      description: 音频ID
                    infill_start_s:
                      type: number
                      description: 开始替换时间，单位：秒
                    infill_end_s:
                      type: number
                      description: 结束替换时间，单位：秒
                    prompt:
                      type: string
                      description: 上下文歌词
                    infill_lyrics:
                      type: string
                      description: 新歌词
                  required:
                    - music_id
                    - mv
                    - infill_start_s
                    - infill_end_s
                - $ref: '#/components/schemas/Mv_Params'
                - $ref: '#/components/schemas/Title_Params'
                - $ref: '#/components/schemas/Tags_Params'
                - $ref: '#/components/schemas/Negative_tags_Params'
                - $ref: '#/components/schemas/IsStorageParams'
                - $ref: '#/components/schemas/HookUrlParams'
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    Mv_Params:
      type: object
      properties:
        mv:
          type: string
          default: chirp-v5
          enum:
            - chirp-v5-5
            - chirp-v5
            - chirp-v4-5+
            - chirp-v4-5
            - chirp-v4-5-all
            - chirp-v4
            - chirp-v3-5
            - chirp-v3-0
          description: 使用模型
    Title_Params:
      type: object
      properties:
        title:
          type: string
          description: |-
            音乐标题

            自定义模式下(custom=true)使用，最多80字符。
    Tags_Params:
      type: object
      properties:
        tags:
          type: string
          description: |-
            音乐风格

            自定义模式下(custom=true)使用，最多1000字符
          example: rock, blues, hip-hop, r&b
    Negative_tags_Params:
      type: object
      properties:
        negative_tags:
          type: string
          description: |-
            不想要生成的音乐风格

            自定义模式下(custom=true)使用。
    IsStorageParams:
      type: object
      properties:
        isStorage:
          type: boolean
          default: true
          description: |-
            是否转存

            - **true**：音频将进行转存，返回TTAPI CDN地址
            - **false**：返回官方源地址
    HookUrlParams:
      type: object
      properties:
        hookUrl:
          type: string
          description: 回调通知地址
  responses:
    SuccessResponse:
      description: 请求成功
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: SUCCESS
              message:
                type: string
                example: success
              data:
                type: object
                example:
                  jobId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
            required:
              - status
              - message
              - data
    400Response:
      description: 参数错误
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
              data:
                type: object
            required:
              - status
              - message
    401Response:
      description: 授权失败
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: Wrong TT-API-KEY or email is not activated.
            required:
              - status
              - message
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        请前往 <a href='https://dashboard.ttapi.io' target='_blank'>TTAPI 控制台</a>
        获取 API 密钥。

````