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

# 上传并续写音乐：查询任务

> 按 `taskId` 查询任务状态和结果。`data.state` 为 `success` 时从 `data.response`（与 `data.resultJson` 相同）读取结果，为 `fail` 时 `data.failCode` / `data.failMsg` 为失败原因。建议每 10 秒左右查询一次。



## OpenAPI

````yaml /openapi/zh/suno-upload-extend.json get /api/v1/jobs/recordInfo
openapi: 3.1.0
info:
  description: 上传一段自己的音频，保持原有风格从指定时间点继续往下写，生成更长、衔接自然的完整歌曲；每次生成两首。
  title: Suno 上传并续写音乐
  version: v1
servers:
  - url: https://api.dreamto.ai
security:
  - bearerAuth: []
tags:
  - name: Suno 上传并续写音乐
paths:
  /api/v1/jobs/recordInfo:
    get:
      tags:
        - Suno 上传并续写音乐
      summary: 查询任务
      description: >-
        按 `taskId` 查询任务状态和结果。`data.state` 为 `success` 时从 `data.response`（与
        `data.resultJson` 相同）读取结果，为 `fail` 时 `data.failCode` / `data.failMsg`
        为失败原因。建议每 10 秒左右查询一次。
      operationId: sunoRecordInfo
      parameters:
        - description: 任务 ID，即创建任务返回的 `data.taskId`。
          example: 7d3f0a9c41e85b2f6a1c9e04b8d27f53
          explode: false
          in: query
          name: taskId
          required: true
          schema:
            examples:
              - 7d3f0a9c41e85b2f6a1c9e04b8d27f53
            type: string
      responses:
        '200':
          content:
            application/json:
              examples:
                排队中:
                  description: 任务已创建，等待生成。
                  summary: 排队中
                  value:
                    code: 200
                    msg: success
                    data:
                      taskId: 7d3f0a9c41e85b2f6a1c9e04b8d27f53
                      model: ai-music-api/upload-and-extend-audio
                      state: waiting
                      param: >-
                        {"input":"{\"upload_url\":\"https://your-domain.com/audio/morning-coffee.mp3\",\"instrumental\":false,\"lyrics\":\"[Verse]\\n杯中热气缓缓升起\\n[Chorus]\\n早安咖啡，唤醒我\",\"style\":\"轻快原声民谣流行\",\"title\":\"早安咖啡（续）\",\"continue_at\":20,\"model\":\"V6\"}","model":"ai-music-api/upload-and-extend-audio"}
                      resultJson: null
                      failCode: null
                      failMsg: null
                      costTime: null
                      completeTime: null
                      createTime: 1795014897000
                      updateTime: 1795014907000
                生成中:
                  description: 生成中，请稍后再查。
                  summary: 生成中
                  value:
                    code: 200
                    msg: success
                    data:
                      taskId: 7d3f0a9c41e85b2f6a1c9e04b8d27f53
                      model: ai-music-api/upload-and-extend-audio
                      state: generating
                      param: >-
                        {"input":"{\"upload_url\":\"https://your-domain.com/audio/morning-coffee.mp3\",\"instrumental\":false,\"lyrics\":\"[Verse]\\n杯中热气缓缓升起\\n[Chorus]\\n早安咖啡，唤醒我\",\"style\":\"轻快原声民谣流行\",\"title\":\"早安咖啡（续）\",\"continue_at\":20,\"model\":\"V6\"}","model":"ai-music-api/upload-and-extend-audio"}
                      resultJson: null
                      failCode: null
                      failMsg: null
                      costTime: null
                      completeTime: null
                      createTime: 1795014897000
                      updateTime: 1795014907000
                生成成功:
                  description: '`response`（与 `resultJson` 相同）为结果，链接均为 DreamTo 下载地址。'
                  summary: 生成成功
                  value:
                    code: 200
                    msg: success
                    data:
                      taskId: 7d3f0a9c41e85b2f6a1c9e04b8d27f53
                      model: ai-music-api/upload-and-extend-audio
                      state: success
                      param: >-
                        {"input":"{\"upload_url\":\"https://your-domain.com/audio/morning-coffee.mp3\",\"instrumental\":false,\"lyrics\":\"[Verse]\\n杯中热气缓缓升起\\n[Chorus]\\n早安咖啡，唤醒我\",\"style\":\"轻快原声民谣流行\",\"title\":\"早安咖啡（续）\",\"continue_at\":20,\"model\":\"V6\"}","model":"ai-music-api/upload-and-extend-audio"}
                      resultJson: >-
                        {"code":200,"data":[{"audio_url":"https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/c335fac2fdf1e6f2f06da/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t","createTime":1795015717013,"duration":43.96,"id":"d6f3f7e1-081d-4a5f-a172-e2e14769fb45","image_url":"https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/ab3eeee00828fa2896f71/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t","model_name":"chirp-hawk","prompt":"[Verse
                        1]\nKettle starts its little song\nFirst light slips
                        across the floor\nCoffee warms my hands away\nAnd I'm
                        ready for the day\n\n[Chorus]\nGood morning coffee, here
                        we go\nOne sweet sip and the whole world slows\nA little
                        warmth, a little cheer\nThe best part of the morning's
                        here\nGood morning coffee, cheers to
                        today\n\n[Verse]\nSteam curls up from the morning
                        cup\n[Chorus]\nGood morning, coffee, wake me
                        up","stream_audio_url":"https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/c50f26b11a40c60660834/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t","tags":"Cheerful
                        acoustic folk-pop","title":"Good Morning, Coffee
                        Extended"},{"audio_url":"https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/92e5b58537e5a481efea4/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t","createTime":1795015717013,"duration":40.84,"id":"48c10886-0ed2-43ba-82e8-352fbd73c56d","image_url":"https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/6b34b825bee4b7bd58c8e/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t","model_name":"chirp-hawk","prompt":"[Verse
                        1]\nKettle starts its little song\nFirst light slips
                        across the floor\nCoffee warms my hands away\nAnd I'm
                        ready for the day\n\n[Chorus]\nGood morning coffee, here
                        we go\nOne sweet sip and the whole world slows\nA little
                        warmth, a little cheer\nThe best part of the morning's
                        here\nGood morning coffee, cheers to
                        today\n\n[Verse]\nSteam curls up from the morning
                        cup\n[Chorus]\nGood morning, coffee, wake me
                        up","stream_audio_url":"https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/174701a887e884f0d3e24/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t","tags":"Cheerful
                        acoustic folk-pop","title":"Good Morning, Coffee
                        Extended"}],"msg":"success","task_id":"7d3f0a9c41e85b2f6a1c9e04b8d27f53"}
                      failCode: null
                      failMsg: null
                      costTime: 66
                      completeTime: 1795015717013
                      createTime: 1795014897000
                      updateTime: 1795014939000
                      response:
                        code: 200
                        data:
                          - audio_url: >-
                              https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/c335fac2fdf1e6f2f06da/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t
                            createTime: 1795015717013
                            duration: 43.96
                            id: d6f3f7e1-081d-4a5f-a172-e2e14769fb45
                            image_url: >-
                              https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/ab3eeee00828fa2896f71/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t
                            model_name: chirp-hawk
                            prompt: |-
                              [Verse 1]
                              Kettle starts its little song
                              First light slips across the floor
                              Coffee warms my hands away
                              And I'm ready for the day

                              [Chorus]
                              Good morning coffee, here we go
                              One sweet sip and the whole world slows
                              A little warmth, a little cheer
                              The best part of the morning's here
                              Good morning coffee, cheers to today

                              [Verse]
                              Steam curls up from the morning cup
                              [Chorus]
                              Good morning, coffee, wake me up
                            stream_audio_url: >-
                              https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/c50f26b11a40c60660834/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t
                            tags: Cheerful acoustic folk-pop
                            title: Good Morning, Coffee Extended
                          - audio_url: >-
                              https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/92e5b58537e5a481efea4/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t
                            createTime: 1795015717013
                            duration: 40.84
                            id: 48c10886-0ed2-43ba-82e8-352fbd73c56d
                            image_url: >-
                              https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/6b34b825bee4b7bd58c8e/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t
                            model_name: chirp-hawk
                            prompt: |-
                              [Verse 1]
                              Kettle starts its little song
                              First light slips across the floor
                              Coffee warms my hands away
                              And I'm ready for the day

                              [Chorus]
                              Good morning coffee, here we go
                              One sweet sip and the whole world slows
                              A little warmth, a little cheer
                              The best part of the morning's here
                              Good morning coffee, cheers to today

                              [Verse]
                              Steam curls up from the morning cup
                              [Chorus]
                              Good morning, coffee, wake me up
                            stream_audio_url: >-
                              https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/174701a887e884f0d3e24/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t
                            tags: Cheerful acoustic folk-pop
                            title: Good Morning, Coffee Extended
                        msg: success
                        task_id: 7d3f0a9c41e85b2f6a1c9e04b8d27f53
                生成失败:
                  description: '`failCode` / `failMsg` 为失败原因，不扣费。'
                  summary: 生成失败
                  value:
                    code: 200
                    msg: success
                    data:
                      taskId: 7d3f0a9c41e85b2f6a1c9e04b8d27f53
                      model: ai-music-api/upload-and-extend-audio
                      state: fail
                      param: >-
                        {"input":"{\"upload_url\":\"https://your-domain.com/audio/morning-coffee.mp3\",\"instrumental\":false,\"lyrics\":\"[Verse]\\n杯中热气缓缓升起\\n[Chorus]\\n早安咖啡，唤醒我\",\"style\":\"轻快原声民谣流行\",\"title\":\"早安咖啡（续）\",\"continue_at\":20,\"model\":\"V6\"}","model":"ai-music-api/upload-and-extend-audio"}
                      resultJson: ''
                      failCode: '400'
                      failMsg: Audio generation failed.
                      costTime: 0
                      completeTime: 1795014939000
                      createTime: 1795014897000
                      updateTime: 1795014939000
                任务不存在（422）:
                  description: 任务 ID 不存在、不属于当前账号或已过期。
                  summary: 任务不存在（422）
                  value:
                    code: 422
                    msg: recordInfo is null
                    data: null
              schema:
                $ref: '#/components/schemas/SunoRecordInfoResponse'
          description: >-
            HTTP 状态码始终为 200。`code` 为 `200` 时 `data` 为任务信息（任务本身是否成功看
            `data.state`）；其他 `code` 为错误，`data` 为 `null`。
          headers:
            X-Request-Id:
              description: 本次请求的 ID，排查问题时请提供。
              schema:
                type: string
components:
  schemas:
    SunoRecordInfoResponse:
      additionalProperties: false
      description: 查询任务的响应。HTTP 状态码始终为 200。
      properties:
        code:
          description: |-
            结果代码：
            - `200`：查询成功（任务本身是否成功看 `data.state`）
            - `401`：API Key 缺失或无效
            - `405`：请求方法错误
            - `422`：`taskId` 缺失、不存在、属于其他账号或已过期（`msg` 为 `recordInfo is null`）
            - `429`：请求过于频繁
            - `500`：服务器错误，可稍后重试
          format: int64
          type: integer
        msg:
          description: 结果说明：成功时为 `success`，错误时为英文原因。
          type: string
        data:
          $ref: '#/components/schemas/SunoTaskRecord'
          description: 任务信息；错误时为 `null`。
      required:
        - code
        - msg
        - data
      type: object
    SunoTaskRecord:
      additionalProperties: false
      description: 任务信息。
      properties:
        taskId:
          description: 任务 ID。
          type: string
        model:
          description: 创建任务时的接口名称。
          type: string
        state:
          description: |-
            任务状态；`success` 和 `fail` 为终态。

            **可选值：**
            - `waiting`：已创建，等待开始
            - `queuing`：排队中
            - `generating`：生成中
            - `success`：成功（终态），结果在 `response`
            - `fail`：失败（终态），原因在 `failCode` / `failMsg`，不扣费
          enum:
            - waiting
            - queuing
            - generating
            - success
            - fail
          type: string
        param:
          description: >-
            创建任务时的请求，JSON 字符串，包含 `model`、`callBackUrl`（如有）和 `input`；其中 `input`
            也是 JSON 字符串，需要再解析一次。
          type: string
        resultJson:
          description: 结果的 JSON 字符串，内容与 `response` 相同；任务结束前为 `null`，失败时为空串。
          type:
            - string
            - 'null'
        failCode:
          description: 失败代码（数字字符串，如 `"500"`）；未失败时为 `null`。
          type:
            - string
            - 'null'
        failMsg:
          description: 失败原因（英文）；未失败时为 `null`。
          type:
            - string
            - 'null'
        costTime:
          description: 生成耗时（秒）；任务结束前为 `null`。
          format: int64
          type:
            - integer
            - 'null'
        completeTime:
          description: 完成时间，Unix 毫秒时间戳；任务结束前为 `null`。
          format: int64
          type:
            - integer
            - 'null'
        createTime:
          description: 创建时间，Unix 毫秒时间戳。
          format: int64
          type: integer
        updateTime:
          description: 最后更新时间，Unix 毫秒时间戳。
          format: int64
          type: integer
        response:
          $ref: '#/components/schemas/SunoTaskResultListSunoGenerateTrack'
          description: 解析后的结果，仅任务成功时返回；其中的文件链接均为 DreamTo 下载地址。
      required:
        - taskId
        - model
        - state
        - param
        - resultJson
        - failCode
        - failMsg
        - costTime
        - completeTime
        - createTime
        - updateTime
      type: object
    SunoTaskResultListSunoGenerateTrack:
      additionalProperties: false
      description: 任务结果。
      properties:
        code:
          description: 结果代码，成功时为 `200`。
          format: int64
          type: integer
        msg:
          description: 结果说明，成功时为 `success`。
          type: string
        task_id:
          description: 任务 ID（与 `taskId` 相同）。
          type: string
        data:
          description: 续写后的歌曲，通常为 2 首。
          items:
            $ref: '#/components/schemas/SunoGenerateTrack'
          type: array
      required:
        - code
        - msg
        - task_id
        - data
      type: object
    SunoGenerateTrack:
      additionalProperties: false
      description: 一首续写后的歌曲。
      properties:
        id:
          description: 歌曲 ID，用作续写、翻唱、分轨、音乐视频等接口的 `audio_id`。
          type: string
        audio_url:
          description: 歌曲音频（MP3）的下载地址。
          type: string
        stream_audio_url:
          description: 流式播放地址，生成过程中即可播放。
          type: string
        image_url:
          description: 封面图片的下载地址。
          type: string
        prompt:
          description: 完整歌词（包含原曲与续写部分；纯音乐时可能为空）。
          type: string
        model_name:
          description: 实际使用的模型名称。
          type: string
        title:
          description: 歌名。
          type: string
        tags:
          description: 风格标签。
          type: string
        createTime:
          description: 创建时间，Unix 毫秒时间戳。
          format: int64
          type: integer
        duration:
          description: 时长（秒）。
          format: double
          type: number
        source_audio_url:
          description: 原始音频地址（如有）。
          type: string
        source_image_url:
          description: 原始封面地址（如有）。
          type: string
        source_stream_audio_url:
          description: 原始流式播放地址（如有）。
          type: string
      required:
        - id
        - audio_url
        - stream_audio_url
        - image_url
        - prompt
        - model_name
        - title
        - tags
        - createTime
        - duration
      type: object
  securitySchemes:
    bearerAuth:
      description: 'DreamTo 控制台创建的 API Key，格式 `Authorization: Bearer <API Key>`。'
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.