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

# Get MIDI Generation Details

> Retrieve detailed information about a MIDI generation task including complete note data for all detected instruments.

### Usage Guide

* Use this endpoint to check the status of a MIDI generation task
* Access complete MIDI note data once processing is complete
* Retrieve detailed instrument and note information
* Track processing progress and any errors that may have occurred

### Query Parameters

| Parameter | Type   | Required | Description                                           |
| :-------- | :----- | :------- | :---------------------------------------------------- |
| `taskId`  | string | Yes      | The task ID returned from the MIDI generation request |

### Developer Notes

* The `midiData` field contains the complete MIDI data as a structured object with instruments and notes
* MIDI data includes all detected instruments with pitch, timing, and velocity for each note
* MIDI generation records are retained for 14 days
* **Important**: When using [vocal separation](/suno-api/separate-vocals-from-music) with `type: split_stem`, the `midiData` may be empty.


## OpenAPI

````yaml suno-api/suno-api.json GET /api/v1/midi/record-info
openapi: 3.0.0
info:
  title: intro
  description: API documentation for audio generation services
  version: 1.0.0
  contact:
    name: Technical Support
    email: support@sunoapi.org
servers:
  - url: https://api.sunoapi.org
    description: API Server
security:
  - BearerAuth: []
tags:
  - name: Music Generation
    description: Endpoints for creating and managing music generation tasks
  - name: Lyrics Generation
    description: Endpoints for lyrics generation and management
  - name: WAV Conversion
    description: Endpoints for converting music to WAV format
  - name: Vocal Removal
    description: Endpoints for vocal removal from music tracks
  - name: Music Video Generation
    description: Endpoints for generating MP4 videos from music tracks
  - name: Account Management
    description: Endpoints for account and credits management
paths:
  /api/v1/midi/record-info:
    get:
      summary: Get MIDI Generation Details
      description: >-
        Retrieve detailed information about a MIDI generation task including
        complete note data for all detected instruments.


        ### Usage Guide

        - Use this endpoint to check the status of a MIDI generation task

        - Access complete MIDI note data once processing is complete

        - Retrieve detailed instrument and note information

        - Track processing progress and any errors that may have occurred


        ### Status Descriptions

        - `successFlag: 0`: Pending - Task is waiting to be executed

        - `successFlag: 1`: Success - MIDI generation completed successfully

        - `successFlag: 2`: Failed - Failed to create task

        - `successFlag: 3`: Failed - MIDI generation failed

        - Check errorCode and errorMessage fields for failure details


        ### Developer Notes

        - The midiData field contains the complete MIDI data as a structured
        object with instruments and notes

        - MIDI data includes all detected instruments with pitch, timing, and
        velocity for each note

        - MIDI generation records are retained for 14 days

        - **Important**: When using vocal separation with `type: split_stem`,
        the midiData may be empty
      operationId: get-midi-details
      parameters:
        - name: taskId
          in: query
          required: true
          schema:
            type: string
          description: The task ID returned from the MIDI generation request
          example: 5c79****be8e
      responses:
        '200':
          description: MIDI generation task details retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: Response status code
                    example: 200
                  msg:
                    type: string
                    description: Response message
                    example: success
                  data:
                    type: object
                    description: MIDI generation task details
                    properties:
                      taskId:
                        type: string
                        description: MIDI generation task ID
                      recordTaskId:
                        type: integer
                        description: Internal record task ID
                      audioId:
                        type: string
                        description: Audio ID from the vocal separation task
                      callbackUrl:
                        type: string
                        description: Callback URL provided when creating the task
                      completeTime:
                        type: integer
                        description: Task completion timestamp (milliseconds)
                      midiData:
                        type: object
                        description: >-
                          Complete MIDI data containing detected instruments and
                          notes
                        properties:
                          state:
                            type: string
                            description: Processing state
                            example: complete
                          instruments:
                            type: array
                            description: >-
                              Array of detected instruments with their MIDI
                              notes
                            items:
                              type: object
                              properties:
                                name:
                                  type: string
                                  description: Instrument name
                                notes:
                                  type: array
                                  description: Array of MIDI notes for this instrument
                                  items:
                                    type: object
                                    properties:
                                      pitch:
                                        type: integer
                                        description: MIDI note number (0-127)
                                      start:
                                        type: number
                                        description: Note start time in seconds
                                      end:
                                        type: number
                                        description: Note end time in seconds
                                      velocity:
                                        type: number
                                        description: Note velocity/intensity (0-1)
                      successFlag:
                        type: integer
                        description: >-
                          Task status flag: 0 = Pending, 1 = Success, 2 = Failed
                          to create task, 3 = MIDI generation failed
                      createTime:
                        type: integer
                        description: Task creation timestamp (milliseconds)
                      errorCode:
                        type: string
                        nullable: true
                        description: Error code if task failed
                      errorMessage:
                        type: string
                        nullable: true
                        description: Error message if task failed
              example:
                code: 200
                msg: success
                data:
                  taskId: 5c79****be8e
                  recordTaskId: -1
                  audioId: e231****-****-****-****-****8cadc7dc
                  callbackUrl: https://example.callback
                  completeTime: 1760335255000
                  midiData:
                    state: complete
                    instruments:
                      - name: Drums
                        notes:
                          - pitch: 73
                            start: 0.036458333333333336
                            end: 0.18229166666666666
                            velocity: 1
                          - pitch: 61
                            start: 0.046875
                            end: 0.19270833333333334
                            velocity: 1
                      - name: Electric Bass (finger)
                        notes:
                          - pitch: 44
                            start: 7.6875
                            end: 7.911458333333333
                            velocity: 1
                  successFlag: 1
                  createTime: 1760335251000
                  errorCode: null
                  errorMessage: null
        '500':
          $ref: '#/components/responses/Error'
components:
  responses:
    Error:
      description: Server error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        # 🔑 API Authentication


        All endpoints require authentication using Bearer Token.


        ## Get API Key


        1. Visit the [API Key Management Page](https://sunoapi.org/api-key) to
        obtain your API Key


        ## Usage


        Add to request headers:


        ```

        Authorization: Bearer YOUR_API_KEY

        ```


        > **⚠️ Note:**

        > - Keep your API Key secure and do not share it with others

        > - If you suspect your API Key has been compromised, reset it
        immediately from the management page

````