docs.sunoapi.org
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
Support
Suno API
Common APIFile Upload API
Suno API
Common APIFile Upload API
  1. Vocal Removal
  • Suno API Documentation
  • Suno API Quick Start
  • Generate Music
    • Music Generation Callbacks
    • Music Extension Callbacks
    • Upload and Cover Audio Callbacks
    • Upload and Extend Audio Callbacks
    • Add Instrumental Callbacks
    • Add Vocals Callbacks
    • Music Cover Generation Callbacks
    • Replace Music Section Callbacks
    • Generate Music
      POST
    • Extend Music
      POST
    • Upload And Cover Audio
      POST
    • Upload And Extend Audio
      POST
    • Add Instrumental
      POST
    • Add Vocals
      POST
    • Get Music Generation Details
      GET
    • Recovery Audio
      POST
    • Get Recovery Audio Details
      GET
    • Get Timestamped Lyrics
      POST
    • Boost Music Style
      POST
    • Generate Music Cover
      POST
    • Replace Music Section
      POST
    • Get Music Cover Details
      GET
    • Generate Persona
      POST
    • Generate Mashup
      POST
  • Suno Voice
    • Suno Voice Validation Phrase Callbacks
    • Suno Voice Generation Callbacks
    • Suno Voice Regenerate Phrase Callbacks
    • Suno Voice Generate Verification Phrase
    • Suno Voice Get Verification Phrase
    • Suno Voice Create Custom Voice
    • Suno Voice Get Custom Voice Record
    • Suno Voice Regenerate Verification Phrase
    • Suno Voice Check Availability
  • Generate Lyrics
    • Lyrics Generation Callbacks
    • Generate Lyrics
    • Get Lyrics Generation Details
  • Generate Sounds
    • Generate Sounds
  • WAV Conversion
    • WAV Format Conversion Callbacks
    • Convert to WAV Format
    • Get WAV Conversion Details
  • Vocal Removal
    • Audio Separation Callbacks
    • MIDI Generation Callbacks
    • Vocal & Instrument Stem Separation
      POST
    • Get Audio Separation Details
      GET
    • Generate MIDI from Audio
      POST
    • Get MIDI Generation Details
      GET
  • Music Video Generation
    • Music Video Generation Callbacks
    • Create Music Video
    • Get Music Video Details
  • Generate Speech
    • Generate Speech
  1. Vocal Removal

Generate MIDI from Audio

POST
/api/v1/midi/generate
Convert separated audio tracks into MIDI format with detailed note information for each instrument.

Usage Guide#

Convert separated audio tracks into structured MIDI data containing pitch, timing, and velocity information
Requires a completed vocal separation task ID (from the Vocal Removal API)
Generates MIDI note data for multiple detected instruments including drums, bass, guitar, keyboards, and more
Ideal for music transcription, notation, remixing, or educational analysis
Best results on clean, well-separated audio tracks with clear instrument parts

Prerequisites#

You must first use the Vocal & Instrument Stem Separation API to separate your audio before generating MIDI.

Parameter Reference#

NameTypeDescription
taskIdstringRequired. Task ID from a completed vocal separation
callBackUrlstringRequired. URL to receive MIDI generation completion notifications
audioIdstringOptional. Specifies which separated audio track to generate MIDI from. This audioId can be obtained from the originData array in the Get Vocal Separation Details endpoint response. Each item in originData contains an id field that can be used here. If not provided, MIDI will be generated from all separated tracks.

Developer Notes#

The callback will contain detailed note data for each detected instrument
Each note includes: pitch (MIDI note number), start (seconds), end (seconds), velocity (0-1)
Not all instruments may be detected - depends on audio content
Billing: Check current per-call credit costs at https://sunoapi.org/dashboard

Request

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

Examples

Responses

🟢200Success
application/json
MIDI generation task created successfully
Bodyapplication/json

🔴500Server Error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://apibox.erweima.ai/api/v1/midi/generate' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "taskId": "5c79****be8e",
    "callBackUrl": "https://example.callback",
    "audioId": "8ca376e7-******-08aaf2c6dd27"
}'
Response Response Example
{
    "code": 200,
    "msg": "success",
    "data": {
        "taskId": "5c79****be8e"
    }
}
Previous
Get Audio Separation Details
Next
Get MIDI Generation Details
Built with