Bring an audio file into Mozart
https://api.mozartai.com/v1/uploadsBrings an audio file into Mozart for a cover or for MIDI, from a public link or a one-time upload link.
- Cost
- Free
- Rate limit
- Write
- Idempotency key
- Optional
- Daily limit
- uploadFiles
- MCP tool
create_upload_link- CLI (coming soon)
mozart uploads create
When to use: The user has an audio file to use. Set purpose. With source_url, Mozart fetches the file. Without it, give the user upload_page_url to drop the file, or send the bytes to upload_url. Use the upload id once status is ready.
When not to use: For a song already in the library, pass its song id to POST /v1/covers or POST /v1/midi instead.
Side effects: Creates an upload. upload_url lets anyone holding it send a file: never show it to anyone but the user. A repeat call without the same idempotency key makes a second upload.
Authentication
Send your API key as Authorization: Bearer <key>. The key needs these scopes:
uploads:write
Headers
idempotency-keystringOptional1 to 255 charactersA unique string per intended action. Repeating a call with the same key returns the first answer instead of doing the work twice: a key is bound to its first request for 90 days; its response is replayed for 24 hours; use a new key for a new request.
Request body
purposeenumRequiredWhat the file is for:
coverfor a cover source,midifor audio to MIDI.personais refused: personas are not available in v1 yet.Allowed valuescovermidipersona
source_urlstring (uri)OptionalfilenamestringOptional1 to 255 characterscontent_typestringOptionalsize_bytesintegerOptionalgreater than 0
Response 201
Success.
idstringRequiredobjectconstantRequiredstatusenumRequiredAllowed valuesawaiting_fileprocessingreadyfailed
purposeenumRequiredAllowed valuescovermidipersona
upload_urlstringor nullRequiredupload_methodenumor nullRequiredAllowed valuesPUTPOST
upload_headersobjector nullRequiredupload_url_expires_atstringor nullRequiredupload_page_urlstringor nullRequiredduration_secondsnumberor nullRequiredcreated_atstringRequired
Response headers
x-request-idThe id of this request; quote it when asking for help.x-mozart-api-versionThe API version that answered.x-ratelimit-limitRequests allowed in the current window for this caller.x-ratelimit-remainingRequests left in the current window.x-ratelimit-resetWhen the window resets, in Unix seconds.idempotent-replayedtruewhen this answer is the stored answer to an earlier call with the same idempotency key; the work was not done again.
Errors
What to do: PUBLIC_API_DAILY_LIMIT_REACHED: stop and tell the user when it resets (resets_at). PUBLIC_API_URL_NOT_ALLOWED: use a public https link. PUBLIC_API_UPLOAD_TOO_LARGE: ask for a smaller file.
| Status | Type | Meaning |
|---|---|---|
| 400 | invalid_request | The request is malformed or an input is invalid. |
| 401 | authentication | The key or token is missing, invalid or revoked. |
| 402 | insufficient_credits | The account has too few credits for this call. A REST key also needs an API plan (Starter, Build, Scale or Growth) or API credits; with neither, every call is refused with PUBLIC_API_CREDITS_REQUIRED. payment_required: The account's plan does not include this; it needs an upgrade. |
| 403 | permission | The caller may not do this: a missing scope, a Mozart CLI sign-in whose account is below Pro, or access not enabled. |
| 404 | not_found | The resource or route does not exist for this caller. |
| 409 | conflict | The request conflicts with the current state, or an idempotency key was reused with a different body. |
| 422 | content_refused | The input was refused by content screening. |
| 429 | rate_limited | Too many requests; retry after Retry-After seconds. limit_reached: A daily, concurrent or total limit was reached. |
| 500 | internal | Mozart failed to answer; retry later. |
| 503 | provider_unavailable | A generation provider is unavailable; retry later. service_unavailable: A Mozart check the request needs, such as content screening, is temporarily unavailable; retry after retry_after_seconds. |