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

# 获取音乐生成结果

> 使用 Phaseo 请求 ID 检索音乐生成结果。

检索通过 `POST /music/generate` 创建的音乐结果。供应商任务完成后，此端点会返回已存储的规范化结果；如果任务仍在异步处理中，则会轮询上游供应商。

## 响应结构

```json theme={null}
{
  "id": "req_01JY6MUSIC123",
  "object": "music",
  "status": "completed",
  "provider": "suno",
  "model": "V4_5PLUS",
  "nativeResponseId": "task_123",
  "output": [
    {
      "index": 0,
      "id": "clip_1",
      "audio_url": "https://...",
      "stream_audio_url": "https://...",
      "image_url": "https://...",
      "title": "Midnight Blue",
      "tags": "jazz, piano",
      "duration": 8
    }
  ],
  "usage": {
    "output_audio_count": 1,
    "output_audio_seconds": 8
  }
}
```

## 说明

* `status` 的值可以是：`queued`、`in_progress`、`completed`、`failed`。
* 生成完成后会包含 `usage`。
* 请传入 `POST /music/generate` 返回的 Phaseo `id`，而不是 `nativeResponseId`。
* 此端点会在内部处理供应商特定的状态和检索 API。


## OpenAPI

````yaml zh-Hans/openapi/v1/openapi.localized.yaml GET /music/generate/{music_id}
openapi: 3.0.3
info:
  title: Phaseo Gateway API
  description: 通过兼容 OpenAI 的端点访问各种 AI 模型的网关 API。
  version: 1.0.0
  contact:
    name: Phaseo
    url: https://phaseo.app
    email: danielbutler500@gmail.com
servers:
  - url: https://api.phaseo.app/v1
    description: 全球路由
security:
  - BearerAuth: []
tags:
  - name: Gateway
    description: Core Phaseo Gateway operations.
paths:
  /music/generate/{music_id}:
    get:
      tags:
        - Gateway
      summary: 获取音乐生成状态
      description: 使用 POST /music/generate 返回的 Phaseo 请求 ID 获取标准化音乐结果。提供商特定的状态 API 由内部处理。
      operationId: getMusicGeneration
      parameters:
        - name: music_id
          in: path
          required: true
          description: POST /music/generate 返回的稳定 Phaseo 请求 ID。
          schema:
            type: string
      responses:
        '200':
          description: 音乐生成状态响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MusicGenerateResponse'
components:
  schemas:
    MusicGenerateResponse:
      type: object
      required:
        - id
        - object
        - status
        - model
        - provider
      properties:
        id:
          type: string
          description: 稳定的 Phaseo 请求 ID，可与 GET /music/generate/{music_id} 搭配使用。
        object:
          type: string
          enum:
            - music
        status:
          type: string
          enum:
            - queued
            - in_progress
            - completed
            - failed
        model:
          type: string
        provider:
          type: string
        nativeResponseId:
          type: string
          nullable: true
          description: 用于关联和支持的上游提供商标识符。
        audio_url:
          type: string
          format: uri
        audio_base64:
          type: string
        result:
          description: 由 Phaseo 标准化的提供商结果元数据。
        output:
          type: array
          items:
            type: object
            additionalProperties: true
        usage:
          type: object
          additionalProperties: true
      additionalProperties: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer 令牌身份验证

````

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