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

# 查询任务

> 用提交时返回的 `task_id` 查询任务状态与结果。

| status | 含义 |
| - | - |
| `SUBMITTED` | 已提交 |
| `QUEUED` | 排队中 |
| `IN_PROGRESS` | 处理中 |
| `SUCCESS` | 已完成，产物在响应里 |
| `FAILURE` | 失败，原因见 `fail_reason` |

所有动作的查询响应外层结构相同，产物放在哪个字段，见各接口页的「任务结果」一节。


## OpenAPI

````yaml cn/openapi/suno.json GET /suno/v2/fetch/{task_id}
openapi: 3.1.0
info:
  title: Suno API
  version: 1.0.0
  description: Suno 接口
servers:
  - url: https://api.ephone.ai
security:
  - bearerAuth: []
paths:
  /suno/v2/fetch/{task_id}:
    get:
      summary: 查询任务
      description: >-
        用提交时返回的 `task_id` 查询任务状态与结果。建议每 3 到 5 秒查一次，`status` 变成 `SUCCESS` 或
        `FAILURE` 后停止。
      operationId: suno_fetch
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
          description: 提交任务时返回的任务 ID。
          example: 5adac6ee-...
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
              example:
                code: success
                data:
                  task_id: 5adac6ee-...
                  action: music
                  model: suno/music
                  status: SUCCESS
                  progress: 100%
                  submit_time: 1757800000000
                  finish_time: 1757800120000
                  musics:
                    - music_id: 89b20862-...
                      title: Rain on Tin Roof
                      tags: lo-fi piano
                      audio_url: https://...
                      image_url: https://...
                      duration: 187.56
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
              example:
                error:
                  message: Invalid Token
                  type: rix_api_error
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: error
                message: task not found
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
              example:
                error:
                  message: Too many requests, please try again later
                  type: rix_api_error
components:
  schemas:
    TaskResponse:
      type: object
      properties:
        code:
          type: string
          enum:
            - success
        message:
          type: string
        data:
          $ref: '#/components/schemas/Task'
      required:
        - code
        - data
    GatewayError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
    Task:
      type: object
      properties:
        task_id:
          type: string
          description: 任务 ID。
        action:
          type: string
          description: 动作名，例如 `music`。
        model:
          type: string
          description: 模型名，例如 `suno/music`。
        status:
          type: string
          description: 任务状态，取值见上表。
          enum:
            - SUBMITTED
            - QUEUED
            - IN_PROGRESS
            - SUCCESS
            - FAILURE
        progress:
          type: string
          description: 进度，例如 `100%`。
        fail_reason:
          type: string
          description: 失败原因，只在 `FAILURE` 时返回。
        submit_time:
          type: integer
          description: 提交时间，Unix 毫秒时间戳。
        finish_time:
          type: integer
          description: 结束时间，Unix 毫秒时间戳。
      required:
        - task_id
        - action
        - model
        - status
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: '在请求头 `Authorization: Bearer YOUR_API_KEY` 里带上 API Key。'

````

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