API reference
Each operation is a REST route, an MCP tool and a CLI command, with the same inputs and outputs everywhere.
Make your first call
Every request goes to https://api.mozartai.com/v1 with your key as a bearer token. Requests and responses are JSON.
curl https://api.mozartai.com/v1/me \
-H "Authorization: Bearer $MOZART_API_KEY"- Base URL
https://api.mozartai.com/v1. Every path below is relative to it.- Authentication
Authorization: Bearer mzk_..., with a key from the Developer page. Each endpoint lists the scopes it needs.Get started- Jobs
- Work that takes time answers 202 with
job.idat once. PollGET /v1/jobs/{job_id}, wait withPOST /v1/jobs/wait, or register a webhook. - Idempotency
- Writes take an
idempotency-keyheader. Retrying with the same key returns the first answer and spends nothing twice. - Pagination
- Lists take
limitandcursor. Pass thenext_cursorof one page to get the next. - Errors and limits
- Every error has the same JSON envelope. Rate-limit headers come back on every answer.Errors
Songs
- POST
/v1/songsCreate a songStarts a job that makes two new songs from a text prompt with Hans 2.0, with optional lyrics.25 credits - POST
/v1/coversCreate a cover of a songStarts a job that remakes an existing song or an uploaded audio file in a new style, keeping its melody, as two covers.27 credits - POST
/v1/inpaintsRewrite a section of a songStarts a job that rewrites one section of a song or an uploaded audio file, 3 to 60 seconds long, and blends it into the music on each side, as two new songs.Depends on audio length, see Cost - POST
/v1/stemsCreate a solo instrument loopStarts a job that makes a new solo loop of one instrument, in a key and tempo you choose, as two songs cut exactly on the bar.Depends on audio length, see Cost - GET
/v1/songsList songsLists the user's songs, newest first, one page at a time, optionally for one project or one source.Free - GET
/v1/songs/{song_id}Get a songGets one song: title, status, model, length, lyrics, cover art and a link to open it in Mozart.Free - PATCH
/v1/songs/{song_id}Rename a song or change who can see itRenames a song or changes who can see it.Free - DELETE
/v1/songs/{song_id}Delete a songDeletes a song from the user's library.Free - POST
/v1/songs/{song_id}/downloadGet a download link for a songReturns a short-lived link to the audio file of a finished song in mp3, wav, flac or m4a.Free - GET
/v1/songs/{song_id}/waveformGet the loudness outline of a songReturns the loudness outline of a song as a list of peaks between 0 and 1.Free
Audio tools
- POST
/v1/songs/{song_id}/stemsSplit a song into stemsStarts a job that splits a song into separate stems: vocals and instrumental (twoStem, 1 to 3 files), or up to nine labelled instrument stems (fourStem).Depends on audio length, see Cost - POST
/v1/midiTurn audio into MIDIStarts a job that turns the audio of a song or an uploaded file into a MIDI file of its notes.16 credits - POST
/v1/songs/{song_id}/masterMaster a songStarts a job that masters a song in place: balances its loudness and tone, and the master replaces the song's audio on the samesong_id.725 credits
Lyrics and cover art
Jobs
- GET
/v1/jobs/{job_id}Get a jobGets the current state of one job at once, without waiting: status, outputs, credits charged and any error.Free - POST
/v1/jobs/waitCheck one or more jobsChecks up to 20 jobs and waits up to 25 seconds for them to become playable or finish.Free - POST
/v1/jobs/{job_id}/cancelCancel a jobCancels a job that has not yet been sent to the music or image provider.Free
Uploads
Account
- GET
/v1/meShow the signed-in accountShows who is signed in: the user, their plan, the key or app in use, its scopes and whether it is in test mode.Free - GET
/v1/limitsShow limits and how much is usedLists every limit that applies to the caller with how much is used, how much remains and when it resets.Free - GET
/v1/modelsList the models you can useLists the music models this key may use, what each can make and which is the default.Free - GET
/v1/creditsShow the credit balanceShows the user's credit balance, what this key spent today against its daily limit, what each spending operation costs, and the plans page link.Free - POST
/v1/estimatesPrice a request without running itPrices a request without running it: the credits it needs, the balance now and the balance after.Free
Webhooks
- POST
/v1/webhooksCreate a webhook endpointRegisters an https address that Mozart calls when a job becomes playable, succeeds, fails or is cancelled.Free - GET
/v1/webhooksList webhook endpointsLists the user's webhook endpoints with their address, event types and status.Free - DELETE
/v1/webhooks/{webhook_id}Delete a webhook endpointDeletes a webhook endpoint so it receives no more events.Free
The details below are generated from the definitions the server runs, in English.