> ## 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-lyrics.json get /api/v1/jobs/recordInfo
openapi: 3.1.0
info:
  description: 根据一句主题描述创作歌词，每次返回 2 ~ 3 组带歌名和段落标记的歌词供挑选。
  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/generate-lyrics
                      state: waiting
                      param: >-
                        {"input":"{\"prompt\":\"一首怀旧的歌，关于童年回忆和在小镇长大的时光\"}","model":"ai-music-api/generate-lyrics"}
                      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/generate-lyrics
                      state: generating
                      param: >-
                        {"input":"{\"prompt\":\"一首怀旧的歌，关于童年回忆和在小镇长大的时光\"}","model":"ai-music-api/generate-lyrics"}
                      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/generate-lyrics
                      state: success
                      param: >-
                        {"input":"{\"prompt\":\"一首怀旧的歌，关于童年回忆和在小镇长大的时光\"}","model":"ai-music-api/generate-lyrics"}
                      resultJson: >-
                        {"resultObject":{"code":200,"lyricsData":[{"error_message":"","status":"complete","tags":["Indie-folk
                        ballad with a gentle swung 6/8 pulse, brushed acoustic
                        guitar and soft upright bass; verse stays sparse with
                        close-mic lead vocal and fingerpicked harmonics,
                        pre-chorus opens into a breathy harmony lift, chorus
                        brings a warm cello line and doubled hook vocals. Little
                        rain-stick swells and reversed guitar breaths between
                        lines, final chorus blooms with handclaps and room
                        reverb. Intimate, dusty, and widescreen at
                        once."],"text":"[Verse 1]\nPaws on the sill\nEyes on the
                        glass\nThe whole yard turns silver\nAs the clouds roll
                        past\n\n[Verse 2]\nA drip on the pane\nA tap on the
                        tin\nYou tilt your small head\nLike you know where I've
                        been\n\n[Pre-Chorus]\nTail flick, slow and low\nYou
                        never need a name\nYou watch the water write\nIts secret
                        in the frame\n\n[Chorus]\nRain, rain, stay\nCat by the
                        window\nRain, rain, play\nSoft on the rooftop\n(soft on
                        the rooftop)\nYou and the storm\nShare the same
                        hush\nRain, rain, stay\nCat by the window\n\n[Verse
                        3]\nYou never chase thunder\nYou never run out\nJust sit
                        with the gray\nLike it's something to
                        trust\n\n[Pre-Chorus]\nTail flick, slow and low\nYou
                        never need a name\nYou watch the water write\nIts secret
                        in the frame\n\n[Chorus]\nRain, rain, stay\nCat by the
                        window\nRain, rain, play\nSoft on the rooftop\n(soft on
                        the rooftop)\nYou and the storm\nShare the same
                        hush\nRain, rain, stay\nCat by the
                        window\n\n[Bridge]\nWhen the last drop fades\nYou'll
                        blink once and yawn\nBut for one more minute\nThe whole
                        world holds on\n\n[Final Chorus]\nRain, rain, stay\nCat
                        by the window\nRain, rain, play\nSoft on the
                        rooftop\n(soft on the rooftop)\nYou and the storm\nShare
                        the same hush\nRain, rain, stay\nCat by the
                        window","title":"Tin Roof
                        Cat"},{"error_message":"","status":"complete","tags":["Indie-folk
                        waltz with brushed acoustic guitar, soft upright bass,
                        and a slow 6/8 sway; verse stays sparse with close-mic
                        vocal and room tone, pre-chorus adds cello lift and hand
                        taps, chorus opens with gentle harmony stacks and a
                        hummed answer. Rainstick swells, porch-screen creaks,
                        and a final instrumental shimmer. Warm, intimate, dusty
                        mix."],"text":"[Verse 1]\nOn the windowsill you
                        sit\nTail curled like a question\nEvery drop on the tin
                        roof\nMakes a tiny resurrection\n\nYour whiskers catch
                        the grey\nAs the whole yard turns to silver\nYou blink
                        at the puddles\nLike they owe you something
                        clearer\n\n[Pre-Chorus]\nAnd you don't move\nYou just
                        hold that view\nLike the world is
                        new\n\n[Chorus]\nLittle cat, little cat\nWatching the
                        rain fall down\nLittle cat, little cat\nSafe in your
                        cardboard crown\nYou don't rush, you don't run\nYou let
                        the cold come through\nLittle cat, little cat\nThe sky
                        belongs to you\n\n[Verse 2]\nA moth taps at the porch
                        light\nThen drifts off in the mist\nYou follow every
                        ripple\nWith that slow, sure little twist\n\nMy shoes
                        are by the door\nBut I'm staying here with you\nCountin'
                        every silver thread\nAs it stitches up the
                        blue\n\n[Pre-Chorus]\nAnd you don't move\nYou just hold
                        that view\nLike the world is new\n\n[Chorus]\nLittle
                        cat, little cat\nWatching the rain fall down\nLittle
                        cat, little cat\nSafe in your cardboard crown\nYou don't
                        rush, you don't run\nYou let the cold come
                        through\nLittle cat, little cat\nThe sky belongs to
                        you\n\n[Bridge]\nWhen the storm leans heavy\nYou just
                        soften more\nA small kind of prayer\nOn the kitchen
                        floor\n\n[Final Chorus]\nLittle cat, little
                        cat\nWatching the rain fall down\nLittle cat, little
                        cat\nSafe in your cardboard crown\nYou don't rush, you
                        don't run\nYou let the cold come through\nLittle cat,
                        little cat\nThe sky belongs to you","title":"Tin Roof
                        Cat"}],"message":"success","taskId":"7d3f0a9c41e85b2f6a1c9e04b8d27f53"}}
                      failCode: null
                      failMsg: null
                      costTime: 5
                      completeTime: 1795014902888
                      createTime: 1795014897000
                      updateTime: 1795014939000
                      response:
                        resultObject:
                          code: 200
                          lyricsData:
                            - error_message: ''
                              status: complete
                              tags:
                                - >-
                                  Indie-folk ballad with a gentle swung 6/8
                                  pulse, brushed acoustic guitar and soft
                                  upright bass; verse stays sparse with
                                  close-mic lead vocal and fingerpicked
                                  harmonics, pre-chorus opens into a breathy
                                  harmony lift, chorus brings a warm cello line
                                  and doubled hook vocals. Little rain-stick
                                  swells and reversed guitar breaths between
                                  lines, final chorus blooms with handclaps and
                                  room reverb. Intimate, dusty, and widescreen
                                  at once.
                              text: |-
                                [Verse 1]
                                Paws on the sill
                                Eyes on the glass
                                The whole yard turns silver
                                As the clouds roll past

                                [Verse 2]
                                A drip on the pane
                                A tap on the tin
                                You tilt your small head
                                Like you know where I've been

                                [Pre-Chorus]
                                Tail flick, slow and low
                                You never need a name
                                You watch the water write
                                Its secret in the frame

                                [Chorus]
                                Rain, rain, stay
                                Cat by the window
                                Rain, rain, play
                                Soft on the rooftop
                                (soft on the rooftop)
                                You and the storm
                                Share the same hush
                                Rain, rain, stay
                                Cat by the window

                                [Verse 3]
                                You never chase thunder
                                You never run out
                                Just sit with the gray
                                Like it's something to trust

                                [Pre-Chorus]
                                Tail flick, slow and low
                                You never need a name
                                You watch the water write
                                Its secret in the frame

                                [Chorus]
                                Rain, rain, stay
                                Cat by the window
                                Rain, rain, play
                                Soft on the rooftop
                                (soft on the rooftop)
                                You and the storm
                                Share the same hush
                                Rain, rain, stay
                                Cat by the window

                                [Bridge]
                                When the last drop fades
                                You'll blink once and yawn
                                But for one more minute
                                The whole world holds on

                                [Final Chorus]
                                Rain, rain, stay
                                Cat by the window
                                Rain, rain, play
                                Soft on the rooftop
                                (soft on the rooftop)
                                You and the storm
                                Share the same hush
                                Rain, rain, stay
                                Cat by the window
                              title: Tin Roof Cat
                            - error_message: ''
                              status: complete
                              tags:
                                - >-
                                  Indie-folk waltz with brushed acoustic guitar,
                                  soft upright bass, and a slow 6/8 sway; verse
                                  stays sparse with close-mic vocal and room
                                  tone, pre-chorus adds cello lift and hand
                                  taps, chorus opens with gentle harmony stacks
                                  and a hummed answer. Rainstick swells,
                                  porch-screen creaks, and a final instrumental
                                  shimmer. Warm, intimate, dusty mix.
                              text: |-
                                [Verse 1]
                                On the windowsill you sit
                                Tail curled like a question
                                Every drop on the tin roof
                                Makes a tiny resurrection

                                Your whiskers catch the grey
                                As the whole yard turns to silver
                                You blink at the puddles
                                Like they owe you something clearer

                                [Pre-Chorus]
                                And you don't move
                                You just hold that view
                                Like the world is new

                                [Chorus]
                                Little cat, little cat
                                Watching the rain fall down
                                Little cat, little cat
                                Safe in your cardboard crown
                                You don't rush, you don't run
                                You let the cold come through
                                Little cat, little cat
                                The sky belongs to you

                                [Verse 2]
                                A moth taps at the porch light
                                Then drifts off in the mist
                                You follow every ripple
                                With that slow, sure little twist

                                My shoes are by the door
                                But I'm staying here with you
                                Countin' every silver thread
                                As it stitches up the blue

                                [Pre-Chorus]
                                And you don't move
                                You just hold that view
                                Like the world is new

                                [Chorus]
                                Little cat, little cat
                                Watching the rain fall down
                                Little cat, little cat
                                Safe in your cardboard crown
                                You don't rush, you don't run
                                You let the cold come through
                                Little cat, little cat
                                The sky belongs to you

                                [Bridge]
                                When the storm leans heavy
                                You just soften more
                                A small kind of prayer
                                On the kitchen floor

                                [Final Chorus]
                                Little cat, little cat
                                Watching the rain fall down
                                Little cat, little cat
                                Safe in your cardboard crown
                                You don't rush, you don't run
                                You let the cold come through
                                Little cat, little cat
                                The sky belongs to you
                              title: Tin Roof Cat
                          message: success
                          taskId: 7d3f0a9c41e85b2f6a1c9e04b8d27f53
                生成失败:
                  description: '`failCode` / `failMsg` 为失败原因，不扣费。'
                  summary: 生成失败
                  value:
                    code: 200
                    msg: success
                    data:
                      taskId: 7d3f0a9c41e85b2f6a1c9e04b8d27f53
                      model: ai-music-api/generate-lyrics
                      state: fail
                      param: >-
                        {"input":"{\"prompt\":\"一首怀旧的歌，关于童年回忆和在小镇长大的时光\"}","model":"ai-music-api/generate-lyrics"}
                      resultJson: ''
                      failCode: '400'
                      failMsg: Song Description flagged for moderation
                      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/SunoLyricsResult'
          description: 解析后的结果，仅任务成功时返回；其中的文件链接均为 DreamTo 下载地址。
      required:
        - taskId
        - model
        - state
        - param
        - resultJson
        - failCode
        - failMsg
        - costTime
        - completeTime
        - createTime
        - updateTime
      type: object
    SunoLyricsResult:
      additionalProperties: false
      description: 歌词生成结果。
      properties:
        resultObject:
          $ref: '#/components/schemas/SunoLyricsResultObject'
          description: 生成结果。
      required:
        - resultObject
      type: object
    SunoLyricsResultObject:
      additionalProperties: false
      description: 生成结果。
      properties:
        lyricsData:
          description: 生成的歌词，通常为 2 ~ 3 组。
          items:
            $ref: '#/components/schemas/SunoLyricsItem'
          type: array
        code:
          description: 状态码，`200` 表示生成成功。
          format: int64
          type: integer
        message:
          description: 状态信息，成功时为 `success`。
          type: string
        taskId:
          description: 任务 ID（创建任务返回的 `data.taskId`）。
          type: string
      required:
        - lyricsData
        - code
        - message
        - taskId
      type: object
    SunoLyricsItem:
      additionalProperties: false
      description: 一组生成的歌词。
      properties:
        text:
          description: 歌词全文，用 `[Verse]`、`[Chorus]` 等标记段落。
          type: string
        title:
          description: 歌名。
          type: string
        status:
          description: |-
            这组歌词的生成状态。

            **可选值：**
            - `complete`：生成成功。
            - `failed`：生成失败，原因见 `error_message`。
          enum:
            - complete
            - failed
          type: string
        error_message:
          description: 错误信息，`status` 为 `failed` 时有效，成功时为空字符串。
          type: string
        tags:
          description: 建议的音乐风格描述，可作为生成音乐接口的 `style` 参考。
          items:
            type: string
          type: array
      required:
        - text
        - title
        - status
        - error_message
      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.