MIDI retrieval API
Endpoint description
The MIDI endpoint converts tracks that already have stems into a standard MIDI file, for arranging, further creative work or importing into a DAW.
Suno does not provide a MIDI download address; it only provides the note data of each track (pitch, start/end time, velocity). This endpoint converts that note data into a standard MIDI file (SMF format 1) and returns it directly, so what you get is always a real .mid file that a DAW can open.
Endpoint: POST /api/music/download-file
This page is the MIDI-specific example. The full description of the download family (media addresses, single files, packing, previewing while generating) is in the song media download and preview API.
Billing: Free. This endpoint reads the note data of existing stems and does not deduct quota.
Request parameters
Headers
| Parameter | Type | Required | Notes |
|---|---|---|---|
| Authorization | string | yes | Bearer YOUR_API_KEY |
| Content-Type | string | yes | application/json |
Body parameters
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| song_id | string | yes | - | The song ID of a single post-separation track (each clip id returned by /api/music/separate) |
| kind | string | yes | - | Fixed to midi |
Request example
curl -X POST https://www.suno-api.io/api/music/download-file \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"song_id": "stem_clip_id",
"kind": "midi"
}' \
--output track.mid
Response
The response body is the binary content of the MIDI file, not JSON.
| Response header | Value |
|---|---|
| Content-Type | audio/midi |
| Content-Disposition | attachment; filename="<song title>.mid" |
Getting a download address
If you need the address before downloading (for example to pack several files), call this first:
curl -X POST https://www.suno-api.io/api/music/download-url \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"song_id":"stem_clip_id","kind":"midi"}'
{
"success": true,
"message": "",
"data": {
"song_id": "stem_clip_id",
"kind": "midi",
"url": "https://www.suno-api.io/api/music/download?song_id=stem_clip_id&kind=midi"
}
}
That address also requires the Authorization header to be accessible; without an API key it returns 401.
About the MIDI file
| Item | Value | Notes |
|---|---|---|
| File format | SMF format 1 | 1 tempo track + 1 track per instrument |
| Timing resolution | 480 PPQ | 480 ticks per beat |
| Tempo | 120 BPM | Suno only gives seconds, not BPM, so a fixed tempo is used to write the timeline |
| Timeline | 1 second = 960 ticks |
Maps one-to-one to the seconds the platform returns; change the tempo in the DAW as needed |
| Velocity | 0–127 | The platform gives 0–1 floats; the endpoint has already converted them with ×127 |
| Drum kit | MIDI channel 10 | Tracks the platform marks as drums are placed on the percussion channel automatically |
Notes
- Only valid for tracks that already have stems:
song_idmust be a track ID returned by/api/music/separate, not the original song ID. - A stem with no notes is a normal result: some tracks (for example FX) have no transcribable notes; in that case a valid MIDI file with no notes is returned instead of an error.
- MIDI contains note information only: volume, pan and effects are not part of MIDI; set the instrument sound yourself in the DAW.
- Request each track separately: one request returns the
.midof one track; for several tracks, call each one, or use the Create UI batch packing download.
Get an API key
Create an API key in the console after signing up. ¥0.6 per run returns 2 tracks, downloads are unlimited, and no phone number is required.
Get API key Back to overview