MusicAPI
HomeDocs
HomeDocs
  1. sonic
  • Introduction
  • Credits Usage Guide
  • Music API FAQ & Troubleshooting
  • Special Scenarios
  • Error handling
  • Webhook Integration Guide
  • Get Your Suno API Key
  • API Changelog
  • sonic
    • Sonic Instructions
    • create / extend / cover / remaster / add vocals / add instrumental
      POST
    • upload and extend music
      POST
    • upload and cover music
      POST
    • create persona
      POST
    • sample
      POST
    • mashup
      POST
    • get BPM
      POST
    • get VOX
      POST
    • get wav
      POST
    • get midi
      POST
    • get lyrics timeline
      POST
    • upsample tags
      POST
    • stems basic
      POST
    • stems full
      POST
    • replace section
      POST
    • upload music
      POST
    • create voice
      POST
    • get music
      GET
    • download (mp3 / m4a / wav)
      POST
  • riffusion(Deprecated)
    • Riffusion instructions
    • create music (with lyrics)
    • create music (with description)
    • cover music
    • extend music
    • replace music section
    • swap music sound
    • swap music vocals
    • upload
    • get music
  • producer
    • Producer instructions
    • Complete Request Examples
    • create music
    • upload
    • download
    • get music
    • Extend an existing music track
    • Replace a section of an existing music track
    • Cover an existing music track
  • studio(Unavailable)
    • Studio Instructions
    • description mode (Use case1)
    • extend mode (Use case2)
    • custom mode (Use case3)
    • instrumental mode (Use case4)
    • get music
  • lyrics generation
    • Make Lyrics
  • nuro
    • Nuro Instruction
    • Error handling
    • create vocal music
    • create instrument music
    • get music
  • get-credits
    GET
  1. sonic

get midi

POST
https://api.musicapi.ai/api/v1/sonic/midi
Get the MIDI JSON for a clip, plus a hosted URL for the .mid file.
Works on a full song's clip_id or a single instrumental track's clip_id
(after stems).

This endpoint requires polling#

Extraction runs asynchronously. A single call does not return the MIDI:
StatusMeaningWhat to do
200MIDI is ready. data.midi_url and data.instruments are populated.Done.
202Still converting. Body is {"type":"not_ready","message":"generating midi..."}Retry the same request in a few seconds.
400Terminal. Either the source audio is too old to convert, or the conversion stalled and was stopped.Do not retry this clip_id.
403Not enough credits.—
Poll with the same request body until you get a 200 or a 400. A retry
resumes the existing job; it does not start a new one.

Credits#

15 credits, charged only on a successful 200.
A 202 costs nothing, so polling is free.
Once a clip's MIDI has been extracted it is cached. Any later request for
the same clip_id returns 200 immediately and also costs nothing.
Net effect: 15 credits per clip, once, no matter how many times you poll.

If a conversion never finishes#

A conversion that has not completed after about 15 minutes is stopped and the
endpoint returns 400. That is not a problem with your request — the
conversion stalled and would not have finished. Use a different clip_id, or
regenerate the track and convert the new clip.
Without this, a stalled clip would answer 202 indefinitely and there would
be no way to tell it apart from one that was still working.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json

Example
{
    "clip_id":"29fc9d9e-a550-47d9-bfd2-6640a4025acc"
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://api.musicapi.ai/api/v1/sonic/midi' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "clip_id":"29fc9d9e-a550-47d9-bfd2-6640a4025acc"
}'

Responses

🟢200success
application/json
Bodyapplication/json

Example
{
    "code": 200,
    "data": {
        "midi_url": "https://cdn.musicapi.ai/storage/v1/object/public/midi/suno/c2de33fd-4427-4dec-bc3a-47c36e609e73.mid",
        "instruments": [
            {
                "name": "Electric Guitar (clean)",
                "notes": [
                    {
                        "end": 1.6979166666666667,
                        "pitch": 40,
                        "start": 1.3385416666666667,
                        "velocity": 1
                    },
                    {
                        "end": 1.6979166666666667,
                        "pitch": 47,
                        "start": 1.3385416666666667,
                        "velocity": 1
                    },
                    {
                        "end": 2.0625,
                        "pitch": 40,
                        "start": 1.703125,
                        "velocity": 1
                    },
                    {
                        "end": 2.0625,
                        "pitch": 47,
                        "start": 1.703125,
                        "velocity": 1
                    },
                    {
                        "end": 2.4270833333333335,
                        "pitch": 40,
                        "start": 2.0677083333333335,
                        "velocity": 1
                    },
                    {
                        "end": 2.4270833333333335,
                        "pitch": 47,
                        "start": 2.0677083333333335,
                        "velocity": 1
                    },
                    {
                        "end": 2.7916666666666665,
                        "pitch": 40,
                        "start": 2.4322916666666665,
                        "velocity": 1
                    },
                    {
                        "end": 2.7916666666666665,
                        "pitch": 47,
                        "start": 2.4322916666666665,
                        "velocity": 1
                    },
                    {
                        "end": 3.28125,
                        "pitch": 51,
                        "start": 2.796875,
                        "velocity": 1
                    },
                    {
                        "end": 3.28125,
                        "pitch": 46,
                        "start": 2.796875,
                        "velocity": 1
                    },
                    {
                        "end": 3.640625,
                        "pitch": 47,
                        "start": 3.28125,
                        "velocity": 1
                    },
                    {
                        "end": 4.005208333333333,
                        "pitch": 47,
                        "start": 3.6458333333333335,
                        "velocity": 1
                    },
                    {
                        "end": 4.364583333333333,
                        "pitch": 49,
                        "start": 4.005208333333333,
                        "velocity": 1
                    },
                    {
                        "end": 4.729166666666667,
                        "pitch": 49,
                        "start": 4.369791666666667,
                        "velocity": 1
                    },
                    {
                        "end": 5.21875,
                        "pitch": 51,
                        "start": 4.734375,
                        "velocity": 1
                    },
                    {
                        "end": 5.578125,
                        "pitch": 49,
                        "start": 5.21875,
                        "velocity": 1
                    },
                    {
                        "end": 5.578125,
                        "pitch": 46,
                        "start": 5.21875,
                        "velocity": 1
                    },
                    {
                        "end": 5.578125,
                        "pitch": 42,
                        "start": 5.21875,
                        "velocity": 1
                    },
                    {
                        "end": 5.9375,
                        "pitch": 42,
                        "start": 5.578125,
                        "velocity": 1
                    },
                    {
                        "end": 5.9375,
                        "pitch": 47,
                        "start": 5.578125,
                        "velocity": 1
                    },
                    {
                        "end": 6.302083333333333,
                        "pitch": 42,
                        "start": 5.942708333333333,
                        "velocity": 1
                    },
                    {
                        "end": 6.302083333333333,
                        "pitch": 47,
                        "start": 5.942708333333333,
                        "velocity": 1
                    },
                    {
                     
Modified at 2026-09-11 12:21:33
Previous
get wav
Next
get lyrics timeline
Built with