MusicAPI
HomeDocs
HomeDocs
  1. sonic
  • Introduction
  • Credits Usage Guide
  • Music API FAQ & Troubleshooting
  • Special Scenarios
  • Error handling
  • Webhook Integration Guide
  • sonic
    • Sonic Instructions
    • create music (custom mode)
      POST
    • create music (no-custom mode)
      POST
    • create music (Control singer gender)
      POST
    • create music (auto lyrics mode)
      POST
    • extend music
      POST
    • concat music
      POST
    • cover music
      POST
    • stems basic
      POST
    • stems full
      POST
    • create persona
      POST
    • create music with persona
      POST
    • upload music
      POST
    • get wav
      POST
    • get midi
      POST
    • get music
      GET
  • riffusion(Deprecated)
    • Riffusion instructions
    • create music (with lyrics)
      POST
    • create music (with description)
      POST
    • cover music
      POST
    • extend music
      POST
    • replace music section
      POST
    • swap music sound
      POST
    • swap music vocals
      POST
    • upload
      POST
    • get music
      GET
  • producer
    • Producer instructions
    • Complete Request Examples
    • create music
    • upload
    • download
    • get music
  • 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 data of the specified clip id (latest clip id in 24 hours) , and the online url of the mid format we processed;
complete song or the single instrumental track clip id (after stems) all can be used;
this endpoint is a synchronous endpoint and requires polling;

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"//latest clip id in 24 hours
}

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 --request POST 'https://api.musicapi.ai/api/v1/sonic/midi' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "clip_id":"29fc9d9e-a550-47d9-bfd2-6640a4025acc"//latest clip id in 24 hours
}'

Responses

🟢200成功
application/json
Body

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 2025-10-27 10:50:03
Previous
get wav
Next
get music
Built with