sonic

get 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.

post/api/v1/sonic/midi

Request

  • Base URL
    https://api.musicapi.ai
  • URL
    https://api.musicapi.ai/api/v1/sonic/midi
  • Auth
    HTTP bearer

Request body

clip_idstring required

music id

Response

codeinteger required
messagestring required

Changes

No recorded changes to this operation across all 1 revision of this API.