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

استرداد نتيجة موسيقية أُنشئت عبر `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` عند اكتمال التوليد.
* مرّر معرّف Phaseo `id` الذي أعاده `POST /music/generate`، وليس `nativeResponseId`.
* يتولى هذا المسار داخليًا معالجة واجهات الحالة والاسترداد الخاصة بالمزوّد.


## OpenAPI

````yaml ar/openapi/v1/openapi.localized.yaml GET /music/generate/{music_id}
openapi: 3.0.3
info:
  title: Phaseo Gateway API
  description: >-
    واجهة API للبوابة تتيح الوصول إلى نماذج ذكاء اصطناعي متنوعة عبر نقاط نهاية
    متوافقة مع OpenAI.
  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: >-
        يجلب نتيجة موسيقية موحدة باستخدام معرّف طلب Phaseo الذي يعيده POST
        /music/generate. تتم معالجة واجهات حالة المزوّد الخاصة داخليًا.
      operationId: getMusicGeneration
      parameters:
        - name: music_id
          in: path
          required: true
          description: معرّف طلب Phaseo الثابت الذي يعيده POST /music/generate.
          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 يُستخدم مع 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: معرّف المزوّد upstream لأغراض الربط والدعم.
        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.