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

# 获取音乐生成详情

> 获取音乐生成任务的详细信息，包括状态、参数和结果。

### 状态说明

* PENDING: 任务正在等待处理
* TEXT\_SUCCESS: 歌词/文本生成已成功完成
* FIRST\_SUCCESS: 第一首曲目生成已成功完成
* SUCCESS: 所有曲目已成功生成
* CREATE\_TASK\_FAILED: 创建生成任务失败
* GENERATE\_AUDIO\_FAILED: 生成音乐曲目失败
* CALLBACK\_EXCEPTION: 回调过程中发生错误
* SENSITIVE\_WORD\_ERROR: 内容包含禁用词

### 开发者注意事项

* 对于纯音乐曲目（instrumental=true），响应中不会包含歌词数据
* 可以使用此接口检查任务状态，而不必等待回调


## OpenAPI

````yaml cn/suno-api/suno-api-cn.json GET /api/v1/generate/record-info
openapi: 3.0.0
info:
  title: intro
  description: 这是生成音频的API接口文档
  version: 1.0.0
  contact:
    name: 技术支持
    email: support@sunoapi.org
servers:
  - url: https://api.sunoapi.org
    description: API 服务器
security:
  - BearerAuth: []
tags:
  - name: Music Generation
    description: 用于创建和管理音乐生成任务的接口
  - name: Lyrics Generation
    description: 用于歌词生成和管理的接口
  - name: WAV Conversion
    description: 用于将音乐转换为WAV格式的接口
  - name: Vocal Removal
    description: 用于从音乐轨道中移除人声的接口
  - name: Music Video Generation
    description: 用于生成MP4视频的接口
  - name: Account Management
    description: 用于账户和积分管理的接口
paths:
  /api/v1/generate/record-info:
    get:
      summary: 获取音乐生成详情
      operationId: get-music-generation-details
      parameters:
        - in: query
          name: taskId
          description: 从'生成音乐'或'延长音乐'接口返回的任务ID。用于标识要查询的特定生成任务。
          required: true
          example: 5c79****be8e
          schema:
            type: string
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          taskId:
                            type: string
                            description: 任务ID
                          parentMusicId:
                            type: string
                            description: 父音乐ID（仅扩展音乐时有值）
                          param:
                            type: string
                            description: 生成任务的参数信息
                          response:
                            type: object
                            properties:
                              taskId:
                                type: string
                                description: 任务ID
                              sunoData:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    id:
                                      type: string
                                      description: 音频唯一标识（audioId）
                                    audioUrl:
                                      type: string
                                      description: 音频文件URL
                                    streamAudioUrl:
                                      type: string
                                      description: 流式音频URL
                                    imageUrl:
                                      type: string
                                      description: 封面图片URL
                                    prompt:
                                      type: string
                                      description: 生成提示词/歌词
                                    modelName:
                                      type: string
                                      description: 使用的模型名称
                                    title:
                                      type: string
                                      description: 音乐标题
                                    tags:
                                      type: string
                                      description: 音乐标签
                                    createTime:
                                      type: string
                                      description: 创建时间
                                      format: date-time
                                    duration:
                                      type: number
                                      description: 音频时长（秒）
                          status:
                            type: string
                            description: 任务状态
                            enum:
                              - PENDING
                              - TEXT_SUCCESS
                              - FIRST_SUCCESS
                              - SUCCESS
                              - CREATE_TASK_FAILED
                              - GENERATE_AUDIO_FAILED
                              - CALLBACK_EXCEPTION
                              - SENSITIVE_WORD_ERROR
                          type:
                            type: string
                            enum:
                              - chirp-v3-5
                              - chirp-v4
                            description: 任务类型
                          operationType:
                            type: string
                            enum:
                              - generate
                              - extend
                              - upload_cover
                              - upload_extend
                            description: |-
                              操作类型

                              - `generate`: 生成音乐 - 使用AI模型创建新的音乐作品
                              - `extend`: 延长音乐 - 延长或修改现有的音乐作品
                              - `upload_cover`: 上传并翻唱音乐 - 基于上传的音频文件创建新的音乐作品
                              - `upload_extend`: 上传并扩展音乐 - 基于上传的音频文件延长或修改音乐作品
                          errorCode:
                            type: number
                            description: 错误码，仅当任务失败时有值
                          errorMessage:
                            type: string
                            description: 错误信息，仅当任务失败时有值
              example:
                code: 200
                msg: success
                data:
                  taskId: 5c79****be8e
                  parentMusicId: ''
                  param: >-
                    {"prompt":"A calm piano
                    track","style":"Classical","title":"Peaceful
                    Piano","customMode":true,"instrumental":true,"model":"V4_5ALL"}
                  response:
                    taskId: 5c79****be8e
                    sunoData:
                      - id: 8551****662c
                        audioUrl: https://example.cn/****.mp3
                        streamAudioUrl: https://example.cn/****
                        imageUrl: https://example.cn/****.jpeg
                        prompt: '[Verse] 夜晚城市 灯火辉煌'
                        modelName: chirp-v3-5
                        title: 钢铁侠
                        tags: electrifying, rock
                        createTime: '2025-01-01 00:00:00'
                        duration: 198.44
                  status: SUCCESS
                  type: GENERATE
                  errorCode: null
                  errorMessage: null
        '500':
          $ref: '#/components/responses/Error'
components:
  schemas:
    ApiResponse:
      type: object
      properties:
        code:
          type: integer
          description: |-
            # 状态码说明

            - ✅ 200 - 请求成功
            - ⚠️ 400 - 参数错误
            - ⚠️ 401 - 没有访问权限
            - ⚠️ 404 - 请求方式或者路径错误
            - ⚠️ 405 - 调用超过限制
            - ⚠️ 413 - 主题或者prompt过长
            - ⚠️ 429 - 积分不足
            - ⚠️ 430 - 您的调用频率过高，请稍后再试。
            - ⚠️ 455 - 网站维护
            - ❌ 500 - 服务器异常
          example: 200
          enum:
            - 200
            - 400
            - 401
            - 404
            - 405
            - 413
            - 429
            - 430
            - 455
            - 500
        msg:
          type: string
          description: 当 code != 200 时，展示错误信息
          example: success
  responses:
    Error:
      description: 服务器异常
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: |-
        # 🔑 API 认证说明

        所有接口都需要通过 Bearer Token 方式进行认证。

        ## 获取 API Key

        1. 访问 [API Key 管理页面](https://sunoapi.org/api-key) 获取您的 API Key

        ## 使用方式

        在请求头中添加：

        ```
        Authorization: Bearer YOUR_API_KEY
        ```

        > **⚠️ 注意：**
        > - 请妥善保管您的 API Key，不要泄露给他人
        > - 如果怀疑 API Key 泄露，请立即在管理页面重置

````