KIE.AI
English
  • English
  • Chinese
English
  • English
  • Chinese
Support
English
  • English
  • Chinese
MarketVeo3.1 APISuno API
4o Image APIFlux Kontext APIRunway APILuma APIFile Upload APICommon API
MarketVeo3.1 APISuno API
4o Image APIFlux Kontext APIRunway APILuma APIFile Upload APICommon API
  1. Vocal Removal
  • Suno API Quickstart
  • Music Generation
    • Music Generation Callbacks
    • Music Extension Callbacks
    • Audio Upload and Cover Callbacks
    • Audio Upload and Extension 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 to Music
      POST
    • Add Vocals to Music
      POST
    • Get Music Task Details
      GET
    • Get Timestamped Lyrics
      POST
    • Boost Music Style
      POST
    • Create Suno Cover Task
      POST
    • Get Cover Generation Details
      GET
    • Replace Music Section
      POST
    • Generate Persona
      POST
  • Lyrics Generation
    • Lyrics Generation Callbacks
    • Generate Lyrics
    • Get Lyrics Task Details
  • WAV Conversion
    • Convert to WAV Callbacks
    • Convert to WAV Format
    • Get WAV Conversion Details
  • Vocal Removal
    • Audio Separation Callbacks
    • MIDI Generation Callbacks
    • Separate Vocals from Music
      POST
    • Get Vocal 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
English
  • English
  • Chinese
Support
English
  • English
  • Chinese
MarketVeo3.1 APISuno API
4o Image APIFlux Kontext APIRunway APILuma APIFile Upload APICommon API
MarketVeo3.1 APISuno API
4o Image APIFlux Kontext APIRunway APILuma APIFile Upload APICommon API
  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#

Required
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.
Pricing: Check current per-call credit costs at https://kie.ai/pricing.

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

🟢200
application/json
MIDI generation task created successfully
Body

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