> ## 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.

# Replace music section: Get task

> Returns the state and result of a task by `taskId`. When `data.state` is `success`, read the result from `data.response` (the same as `data.resultJson`); when it is `fail`, `data.failCode` / `data.failMsg` give the reason. Poll about every 10 seconds.



## OpenAPI

````yaml /openapi/en/suno-replace-section.json get /api/v1/jobs/recordInfo
openapi: 3.1.0
info:
  description: >-
    Regenerate a chosen time range (at least 10 seconds) of a song so that it
    blends with the parts around it; works on a generated song or an uploaded
    audio file.
  title: Suno Replace music section
  version: v1
servers:
  - url: https://api.dreamto.ai
security:
  - bearerAuth: []
tags:
  - name: Suno Replace music section
paths:
  /api/v1/jobs/recordInfo:
    get:
      tags:
        - Suno Replace music section
      summary: Get task
      description: >-
        Returns the state and result of a task by `taskId`. When `data.state` is
        `success`, read the result from `data.response` (the same as
        `data.resultJson`); when it is `fail`, `data.failCode` / `data.failMsg`
        give the reason. Poll about every 10 seconds.
      operationId: sunoRecordInfo
      parameters:
        - description: 'Task ID: `data.taskId` returned by createTask.'
          example: 7d3f0a9c41e85b2f6a1c9e04b8d27f53
          explode: false
          in: query
          name: taskId
          required: true
          schema:
            examples:
              - 7d3f0a9c41e85b2f6a1c9e04b8d27f53
            type: string
      responses:
        '200':
          content:
            application/json:
              examples:
                Waiting:
                  description: The task is created and waiting.
                  summary: Waiting
                  value:
                    code: 200
                    msg: success
                    data:
                      taskId: 7d3f0a9c41e85b2f6a1c9e04b8d27f53
                      model: ai-music-api/replace-section
                      state: waiting
                      param: >-
                        {"input":"{\"task_id\":\"c2a81e5f09d34b7e8f61a2d4c9b03e75\",\"audio_id\":\"f924248f-e765-48fd-9ea9-c64290225e4e\",\"prompt\":\"Good
                        morning, sunshine, here we go\\nOne bright step and the
                        whole world glows\",\"lyrics\":\"[Chorus]\\nGood
                        morning, sunshine, here we go\\nOne bright step and the
                        whole world glows\",\"tags\":\"cheerful acoustic
                        folk-pop\",\"title\":\"Good Morning,
                        Sunshine\",\"infill_start_s\":10,\"infill_end_s\":20.5,\"full_lyrics\":\"[Verse]\\nKettle
                        starts its little song\\nFirst light slips across the
                        floor\\n[Chorus]\\nGood morning, sunshine, here we
                        go\\nOne bright step and the whole world
                        glows\\n[Outro]\\nGood morning, cheers to
                        today!\"}","model":"ai-music-api/replace-section"}
                      resultJson: null
                      failCode: null
                      failMsg: null
                      costTime: null
                      completeTime: null
                      createTime: 1795014897000
                      updateTime: 1795014907000
                Generating:
                  description: Generating; query again later.
                  summary: Generating
                  value:
                    code: 200
                    msg: success
                    data:
                      taskId: 7d3f0a9c41e85b2f6a1c9e04b8d27f53
                      model: ai-music-api/replace-section
                      state: generating
                      param: >-
                        {"input":"{\"task_id\":\"c2a81e5f09d34b7e8f61a2d4c9b03e75\",\"audio_id\":\"f924248f-e765-48fd-9ea9-c64290225e4e\",\"prompt\":\"Good
                        morning, sunshine, here we go\\nOne bright step and the
                        whole world glows\",\"lyrics\":\"[Chorus]\\nGood
                        morning, sunshine, here we go\\nOne bright step and the
                        whole world glows\",\"tags\":\"cheerful acoustic
                        folk-pop\",\"title\":\"Good Morning,
                        Sunshine\",\"infill_start_s\":10,\"infill_end_s\":20.5,\"full_lyrics\":\"[Verse]\\nKettle
                        starts its little song\\nFirst light slips across the
                        floor\\n[Chorus]\\nGood morning, sunshine, here we
                        go\\nOne bright step and the whole world
                        glows\\n[Outro]\\nGood morning, cheers to
                        today!\"}","model":"ai-music-api/replace-section"}
                      resultJson: null
                      failCode: null
                      failMsg: null
                      costTime: null
                      completeTime: null
                      createTime: 1795014897000
                      updateTime: 1795014907000
                Succeeded:
                  description: >-
                    `response` (the same as `resultJson`) is the result; every
                    link is a DreamTo download link.
                  summary: Succeeded
                  value:
                    code: 200
                    msg: success
                    data:
                      taskId: 7d3f0a9c41e85b2f6a1c9e04b8d27f53
                      model: ai-music-api/replace-section
                      state: success
                      param: >-
                        {"input":"{\"task_id\":\"c2a81e5f09d34b7e8f61a2d4c9b03e75\",\"audio_id\":\"f924248f-e765-48fd-9ea9-c64290225e4e\",\"prompt\":\"Good
                        morning, sunshine, here we go\\nOne bright step and the
                        whole world glows\",\"lyrics\":\"[Chorus]\\nGood
                        morning, sunshine, here we go\\nOne bright step and the
                        whole world glows\",\"tags\":\"cheerful acoustic
                        folk-pop\",\"title\":\"Good Morning,
                        Sunshine\",\"infill_start_s\":10,\"infill_end_s\":20.5,\"full_lyrics\":\"[Verse]\\nKettle
                        starts its little song\\nFirst light slips across the
                        floor\\n[Chorus]\\nGood morning, sunshine, here we
                        go\\nOne bright step and the whole world
                        glows\\n[Outro]\\nGood morning, cheers to
                        today!\"}","model":"ai-music-api/replace-section"}
                      resultJson: >-
                        {"code":200,"data":[{"audio_url":"https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/c43e125bbbdcafc1d387f/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t","createTime":1795015940224,"duration":41.12,"id":"1150f859-c087-408b-9866-b07863e75ce7","image_url":"https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/4ba7f3ce592ddbce92b41/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t","model_name":"chirp-hawk","prompt":"[Verse]\nKettle
                        starts its little song\nFirst light slips across the
                        floor\nCoffee warms my hands awake\nAnd I'm ready for
                        the day\n\n[Chorus]\nGood morning, sunshine, here we
                        go\nOne bright step and the whole world glows\nA little
                        warmth, a little cheer\nThe best part of the morning's
                        here\n\n[Outro]\nGood morning, coffee, cheers to
                        today!","stream_audio_url":"https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/2f034639e8ad0540457c3/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t","tags":"folk-pop,
                        acoustic","title":"Good Morning,
                        Sunshine"},{"audio_url":"https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/cecb105a41a06b6f8ce3e/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t","createTime":1795015940224,"duration":41.12,"id":"7190052a-d671-4f70-a949-b26c4873c561","image_url":"https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/e2de1e355b9b2956604d3/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t","model_name":"chirp-hawk","prompt":"[Verse]\nKettle
                        starts its little song\nFirst light slips across the
                        floor\nCoffee warms my hands awake\nAnd I'm ready for
                        the day\n\n[Chorus]\nGood morning, sunshine, here we
                        go\nOne bright step and the whole world glows\nA little
                        warmth, a little cheer\nThe best part of the morning's
                        here\n\n[Outro]\nGood morning, coffee, cheers to
                        today!","stream_audio_url":"https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/2457e4995b7820a787e56/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t","tags":"folk-pop,
                        acoustic","title":"Good Morning,
                        Sunshine"}],"msg":"success","task_id":"7d3f0a9c41e85b2f6a1c9e04b8d27f53"}
                      failCode: null
                      failMsg: null
                      costTime: 50
                      completeTime: 1795015940224
                      createTime: 1795014897000
                      updateTime: 1795014939000
                      response:
                        code: 200
                        data:
                          - audio_url: >-
                              https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/c43e125bbbdcafc1d387f/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t
                            createTime: 1795015940224
                            duration: 41.12
                            id: 1150f859-c087-408b-9866-b07863e75ce7
                            image_url: >-
                              https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/4ba7f3ce592ddbce92b41/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t
                            model_name: chirp-hawk
                            prompt: |-
                              [Verse]
                              Kettle starts its little song
                              First light slips across the floor
                              Coffee warms my hands awake
                              And I'm ready for the day

                              [Chorus]
                              Good morning, sunshine, here we go
                              One bright step and the whole world glows
                              A little warmth, a little cheer
                              The best part of the morning's here

                              [Outro]
                              Good morning, coffee, cheers to today!
                            stream_audio_url: >-
                              https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/2f034639e8ad0540457c3/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t
                            tags: folk-pop, acoustic
                            title: Good Morning, Sunshine
                          - audio_url: >-
                              https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/cecb105a41a06b6f8ce3e/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t
                            createTime: 1795015940224
                            duration: 41.12
                            id: 7190052a-d671-4f70-a949-b26c4873c561
                            image_url: >-
                              https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/e2de1e355b9b2956604d3/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t
                            model_name: chirp-hawk
                            prompt: |-
                              [Verse]
                              Kettle starts its little song
                              First light slips across the floor
                              Coffee warms my hands awake
                              And I'm ready for the day

                              [Chorus]
                              Good morning, sunshine, here we go
                              One bright step and the whole world glows
                              A little warmth, a little cheer
                              The best part of the morning's here

                              [Outro]
                              Good morning, coffee, cheers to today!
                            stream_audio_url: >-
                              https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/2457e4995b7820a787e56/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t
                            tags: folk-pop, acoustic
                            title: Good Morning, Sunshine
                        msg: success
                        task_id: 7d3f0a9c41e85b2f6a1c9e04b8d27f53
                Unknown task (422):
                  description: >-
                    The task ID does not exist, belongs to another account or
                    has expired.
                  summary: Unknown task (422)
                  value:
                    code: 422
                    msg: recordInfo is null
                    data: null
                Failed:
                  description: '`failCode` / `failMsg` give the reason; not charged.'
                  summary: Failed
                  value:
                    code: 200
                    msg: success
                    data:
                      taskId: 7d3f0a9c41e85b2f6a1c9e04b8d27f53
                      model: ai-music-api/replace-section
                      state: fail
                      param: >-
                        {"input":"{\"task_id\":\"c2a81e5f09d34b7e8f61a2d4c9b03e75\",\"audio_id\":\"f924248f-e765-48fd-9ea9-c64290225e4e\",\"prompt\":\"Good
                        morning, sunshine, here we go\\nOne bright step and the
                        whole world glows\",\"lyrics\":\"[Chorus]\\nGood
                        morning, sunshine, here we go\\nOne bright step and the
                        whole world glows\",\"tags\":\"cheerful acoustic
                        folk-pop\",\"title\":\"Good Morning,
                        Sunshine\",\"infill_start_s\":10,\"infill_end_s\":20.5,\"full_lyrics\":\"[Verse]\\nKettle
                        starts its little song\\nFirst light slips across the
                        floor\\n[Chorus]\\nGood morning, sunshine, here we
                        go\\nOne bright step and the whole world
                        glows\\n[Outro]\\nGood morning, cheers to
                        today!\"}","model":"ai-music-api/replace-section"}
                      resultJson: ''
                      failCode: '400'
                      failMsg: Audio generation failed
                      costTime: 0
                      completeTime: 1795014939000
                      createTime: 1795014897000
                      updateTime: 1795014939000
              schema:
                $ref: '#/components/schemas/SunoRecordInfoResponse'
          description: >-
            Always HTTP 200. With `code` `200`, `data` is the task (whether the
            task succeeded is `data.state`); any other `code` is an error with
            `data` `null`.
          headers:
            X-Request-Id:
              description: ID of this request; include it when reporting issues.
              schema:
                type: string
components:
  schemas:
    SunoRecordInfoResponse:
      additionalProperties: false
      description: Response of recordInfo; always HTTP 200.
      properties:
        code:
          description: >-
            Result code:

            - `200`: found (whether the task succeeded is `data.state`)

            - `401`: missing or invalid API Key

            - `405`: wrong HTTP method

            - `422`: `taskId` is missing, unknown, belongs to another account or
            has expired (`msg` is `recordInfo is null`)

            - `429`: too many requests

            - `500`: server error; retry later
          format: int64
          type: integer
        msg:
          description: 'Message: `success`, or the English reason of an error.'
          type: string
        data:
          $ref: '#/components/schemas/SunoTaskRecord'
          description: The task; `null` on error.
      required:
        - code
        - msg
        - data
      type: object
    SunoTaskRecord:
      additionalProperties: false
      description: A task.
      properties:
        taskId:
          description: Task ID.
          type: string
        model:
          description: Endpoint name of the task.
          type: string
        state:
          description: >-
            Task state; `success` and `fail` are final.


            **Allowed values:**

            - `waiting`: Created and waiting to start

            - `queuing`: Queued

            - `generating`: Generating

            - `success`: Succeeded (final); the result is in `response`

            - `fail`: Failed (final); the reason is in `failCode` / `failMsg`;
            not charged
          enum:
            - waiting
            - queuing
            - generating
            - success
            - fail
          type: string
        param:
          description: >-
            The create request as a JSON string with `model`, `callBackUrl` (if
            any) and `input`; `input` is itself a JSON string and needs a second
            parse.
          type: string
        resultJson:
          description: >-
            The result as a JSON string, the same as `response`; `null` until
            the task finishes and an empty string when it failed.
          type:
            - string
            - 'null'
        failCode:
          description: >-
            Failure code (a numeric string such as `"500"`); `null` unless the
            task failed.
          type:
            - string
            - 'null'
        failMsg:
          description: Failure reason (English); `null` unless the task failed.
          type:
            - string
            - 'null'
        costTime:
          description: Generation time in seconds; `null` until the task finishes.
          format: int64
          type:
            - integer
            - 'null'
        completeTime:
          description: >-
            Completion time as Unix milliseconds; `null` until the task
            finishes.
          format: int64
          type:
            - integer
            - 'null'
        createTime:
          description: Creation time as Unix milliseconds.
          format: int64
          type: integer
        updateTime:
          description: Last update time as Unix milliseconds.
          format: int64
          type: integer
        response:
          $ref: '#/components/schemas/SunoTaskResultListSunoReplaceSectionTrack'
          description: >-
            The parsed result, only when the task succeeded; every file link in
            it is a DreamTo download link.
      required:
        - taskId
        - model
        - state
        - param
        - resultJson
        - failCode
        - failMsg
        - costTime
        - completeTime
        - createTime
        - updateTime
      type: object
    SunoTaskResultListSunoReplaceSectionTrack:
      additionalProperties: false
      description: Task result.
      properties:
        code:
          description: Result code, `200` on success.
          format: int64
          type: integer
        msg:
          description: Message, `success` on success.
          type: string
        task_id:
          description: Task ID (the same as `taskId`).
          type: string
        data:
          description: The complete songs with the section replaced, usually two.
          items:
            $ref: '#/components/schemas/SunoReplaceSectionTrack'
          type: array
      required:
        - code
        - msg
        - task_id
        - data
      type: object
    SunoReplaceSectionTrack:
      additionalProperties: false
      description: One complete song with the section replaced.
      properties:
        id:
          description: >-
            ID of the new song, usable as the `audio_id` of extension, cover,
            stem separation and other endpoints.
          type: string
        audio_url:
          description: Download link of the song audio (MP3).
          type: string
        stream_audio_url:
          description: Streaming link.
          type: string
        image_url:
          description: Download link of the cover image.
          type: string
        prompt:
          description: Lyrics of the whole song.
          type: string
        model_name:
          description: Name of the model that made the song.
          type: string
        title:
          description: Song title.
          type: string
        tags:
          description: Style tags.
          type: string
        createTime:
          description: Creation time as Unix milliseconds.
          format: int64
          type: integer
        duration:
          description: Duration in seconds.
          format: double
          type: number
        source_audio_url:
          description: Original audio link (when present).
          type: string
        source_image_url:
          description: Original cover image link (when present).
          type: string
        source_stream_audio_url:
          description: Original streaming link (when present).
          type: string
      required:
        - id
        - audio_url
        - stream_audio_url
        - image_url
        - prompt
        - model_name
        - title
        - tags
        - createTime
        - duration
      type: object
  securitySchemes:
    bearerAuth:
      description: >-
        API Key created in the DreamTo console, sent as `Authorization: Bearer
        <API Key>`.
      scheme: bearer
      type: http

````

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