Mozart for developers
AI mastering API for the songs your app generates
The Mozart AI mastering API masters a song with one call to POST /v1/songs/{song_id}/master, which starts a job whose output is the mastered WAV file. It works on songs already in your Mozart library, not on files you upload.
Every master uses one fixed preset: pop style at streaming loudness. If your app already makes songs with Mozart, mastering is one more step on the same key and the same job model. To master in the browser with a choice of eight styles and two loudness targets, use mastering in the Mozart app.
The REST API needs an API plan (Starter, Build, Scale or Growth), from $20 a month, or prepaid API credits, and spends API credits.
Updated November 27, 2026
On this page
AI mastering API specifications
| Property | Detail |
|---|---|
| Endpoint | POST https://api.mozartai.com/v1/songs/{song_id}/master |
| Authentication | Bearer token in the Authorization header |
| Input | song_id of a song in your Mozart library (no file uploads) |
| Preset | One fixed preset: pop style at streaming loudness |
| Output | Mastered WAV file (audio/wav) at a URL that expires |
| Execution | Async (202): wait with POST /v1/jobs/wait or use webhooks |
| Price | 725 credits a track; free price check with "dry_run": true or POST /v1/estimates |
| Interfaces | REST (cURL, Python, Node.js) |
What is an AI mastering API?
An AI mastering API, also called an automatic or music mastering API, is a web service that automates the final mastering step of music production through code. It adjusts loudness and tone so tracks sound consistent on streaming services, then returns a finished audio file without a mastering engineer or plugin.
Mozart's AI mastering API runs this step on the AI-generated songs your app makes with Mozart, using the same API key and async job model.
What AI mastering does to a song
Mastering is the last step before release. An AI mastering engine analyses the finished mix, then typically sets its tonal balance with equalisation, controls dynamic range with compression, adjusts stereo width and uses a peak limiter to reach a loudness target, so the song holds up next to other tracks on any playback system. Mozart's mastering API applies one fixed preset, pop style at streaming loudness, to every song.
What streaming loudness means: LUFS and true peak
Loudness for streaming is measured in LUFS (loudness units relative to full scale, also written LKFS), the unit standardised in ITU-R BS.1770 and named LUFS in EBU R 128. Streaming services turn louder tracks down to a playback target. Spotify, for example, normalises to -14 LUFS by default and asks for a true peak below -1 dBTP, or below -2 dBTP for masters louder than -14 LUFS. True peak, in dBTP, is the highest level of the waveform as measured under the same ITU standard, and a mastering limiter keeps the song under that ceiling.
In Mozart's API, "streaming loudness" is the name of the one fixed loudness setting. Mozart doesn't publish the LUFS target or true peak ceiling behind it yet, so measure a master yourself if your platform needs a number.
How the automatic mastering API works
To use the music mastering API, pass the song_id you got back when you generated a song with Mozart to POST https://api.mozartai.com/v1/songs/{song_id}/master, with your API key as a bearer token and an Idempotency-Key header. The endpoint returns 202 and starts a job that masters the song for streaming loudness.
- Check the credit cost for free with
"dry_run": trueorPOST /v1/estimates. - Start the mastering job by calling
POST /v1/songs/{song_id}/masterwith anIdempotency-Keyheader. - Wait for completion with
POST /v1/jobs/waitor receive a webhook forjob.succeededandjob.failed. - Download the mastered
audio/wavfile fromoutputs[0].urlbeforeurl_expires_at.
There are no settings to tune. Every song gets the same preset, so it works as an automatic mastering API step right after generation.
When the job succeeds, the mastered recording becomes the song's current version, on the same song_id, and the unmastered version stays in the song's history. The v1 API cannot read that history: POST /v1/songs/{song_id}/download returns the master from then on, so download the WAV first if you need the unmastered audio.
- Body: optional. The only field is
dry_run(defaultfalse). - Response:
dry_run,estimate,jobandbalance_after. - Job: includes
id,kind("master"),status(queued,running,succeeded,failedorcancelled),outputs,credits_charged,credits_refunded,errorandpoll_after_seconds. - Output: one item of
type"audio", withsong_id(the same song),url,url_expires_at,content_type(audio/wav) andduration_seconds. Theurlexpires aturl_expires_at, so save the file before then.
The 202 response has this shape (values elided):
{
"dry_run": false,
"estimate": { "credits_required": "...", "balance": "...", "balance_after": "..." },
"job": { "id": "job_...", "kind": "master", "status": "queued", "poll_after_seconds": "..." },
"balance_after": "..."
}When POST /v1/jobs/wait returns all_settled: true, a succeeded job has this shape (values elided):
{
"id": "job_...",
"kind": "master",
"status": "succeeded",
"outputs": [
{
"type": "audio",
"song_id": "5d8e5a03-2c1f-4b7e-9a61-0f3d2c8b7e14",
"url": "https://...",
"url_expires_at": "...",
"content_type": "audio/wav",
"duration_seconds": "..."
}
],
"credits_charged": "...",
"credits_refunded": false
}To wait, call POST /v1/jobs/wait with job_ids, wait_seconds up to 25 and until set to "complete". It's free. If all_settled is false, call it again. To skip polling, register a webhook with POST /v1/webhooks and choose event_types such as job.succeeded and job.failed. Mozart then calls your HTTPS URL when a job reaches one of them.
# Register a webhook once. Mozart calls this URL when a job succeeds or fails.
curl https://api.mozartai.com/v1/webhooks \
-H "Authorization: Bearer $MOZART_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://example.com/mozart/events", "event_types": ["job.succeeded", "job.failed"] }'
# 201 { "id": "...", "object": "webhook_endpoint", "status": "active", ... }AI mastering API code samples: cURL, Python and Node.js
Create an API key on the Developer page, then export it:
export MOZART_API_KEY=mzk_...Mastering API with cURL
# 1. Check the price. Free, starts nothing.
curl https://api.mozartai.com/v1/songs/5d8e5a03-2c1f-4b7e-9a61-0f3d2c8b7e14/master \
-H "Authorization: Bearer $MOZART_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{ "dry_run": true }'
# estimate.credits_required is the price
# 2. Start the master. Keep this key: a retry with it never charges twice.
curl https://api.mozartai.com/v1/songs/5d8e5a03-2c1f-4b7e-9a61-0f3d2c8b7e14/master \
-H "Authorization: Bearer $MOZART_API_KEY" \
-H "Idempotency-Key: master-5d8e5a03-2c1f-4b7e-9a61-0f3d2c8b7e14-1" \
-H "Content-Type: application/json" \
-d '{}'
# 202 { "job": { "id": "job_...", "kind": "master", "status": "queued", ... } }
# 3. Wait for it. Free. Repeat while all_settled is false.
curl https://api.mozartai.com/v1/jobs/wait \
-H "Authorization: Bearer $MOZART_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "job_ids": ["job_..."], "wait_seconds": 25, "until": "complete" }'
# jobs[0].outputs[0].url is the mastered WAVMastering API in Python
import os, uuid, requests
API = "https://api.mozartai.com/v1"
AUTH = {"Authorization": f"Bearer {os.environ['MOZART_API_KEY']}"}
SONG_ID = "5d8e5a03-2c1f-4b7e-9a61-0f3d2c8b7e14"
# Check the price first (free, starts nothing)
quote = requests.post(
f"{API}/songs/{SONG_ID}/master",
headers={**AUTH, "Idempotency-Key": str(uuid.uuid4())},
json={"dry_run": True},
)
quote.raise_for_status()
print("credits:", quote.json()["estimate"]["credits_required"])
# Start the master. Reuse this key if you retry.
key = f"master-{SONG_ID}-1"
start = requests.post(
f"{API}/songs/{SONG_ID}/master",
headers={**AUTH, "Idempotency-Key": key},
json={},
)
start.raise_for_status()
job_id = start.json()["job"]["id"]
# Wait until the job settles (free, holds up to 25 s per call)
for _ in range(40): # about 16 minutes at 25 s a call
res = requests.post(
f"{API}/jobs/wait",
headers=AUTH,
json={"job_ids": [job_id], "wait_seconds": 25, "until": "complete"},
)
res.raise_for_status()
body = res.json()
if body["all_settled"]:
job = body["jobs"][0]
break
else:
raise TimeoutError(job_id)
if job["status"] == "succeeded":
print(job["outputs"][0]["url"]) # save it before url_expires_at
else:
err = job.get("error") or {}
print(job["status"], err.get("next_step") or err.get("message")) # failed jobs are refundedMastering API in JavaScript (Node.js)
Node.js 18 or later (built-in fetch). Save as master.mjs so top-level await works.
const API = "https://api.mozartai.com/v1";
const headers = {
Authorization: `Bearer ${process.env.MOZART_API_KEY}`,
"Content-Type": "application/json",
};
const songId = "5d8e5a03-2c1f-4b7e-9a61-0f3d2c8b7e14";
// Start the master. Reuse this key if you retry.
const start = await fetch(`${API}/songs/${songId}/master`, {
method: "POST",
headers: { ...headers, "Idempotency-Key": `master-${songId}-1` },
body: "{}",
});
if (start.ok === false) throw new Error(`start failed: ${start.status}`);
const { job: started } = await start.json();
// Wait until the job settles (free, holds up to 25 s per call)
let job;
for (let i = 0; i < 40 && job === undefined; i++) {
const res = await fetch(`${API}/jobs/wait`, {
method: "POST",
headers,
body: JSON.stringify({ job_ids: [started.id], wait_seconds: 25, until: "complete" }),
});
if (res.ok === false) throw new Error(`wait failed: ${res.status}`);
const body = await res.json();
if (body.all_settled) job = body.jobs[0];
}
if (job === undefined) throw new Error(`timed out: ${started.id}`);
console.log(job.status, job.outputs?.[0]?.url); // save it before url_expires_atBatch audio mastering API example in Python
Start one master per song, each with its own Idempotency-Key, then pass every job ID to one POST /v1/jobs/wait call. It returns when all of them settle or the wait ends; call it again while all_settled is false.
import os, requests
API = "https://api.mozartai.com/v1"
AUTH = {"Authorization": f"Bearer {os.environ['MOZART_API_KEY']}"}
SONG_IDS = ["5d8e5a03-2c1f-4b7e-9a61-0f3d2c8b7e14", "8f1c0b9e-7a43-4d2b-b5e6-3c9a1f0d2e47"]
# Start one master per song, each with its own key
job_ids = []
for song_id in SONG_IDS:
start = requests.post(
f"{API}/songs/{song_id}/master",
headers={**AUTH, "Idempotency-Key": f"master-{song_id}-1"},
json={},
)
start.raise_for_status()
job_ids.append(start.json()["job"]["id"])
# Wait for all of them in one call (free, holds up to 25 s per call)
for _ in range(40):
res = requests.post(
f"{API}/jobs/wait",
headers=AUTH,
json={"job_ids": job_ids, "wait_seconds": 25, "until": "complete"},
)
res.raise_for_status()
body = res.json()
if body["all_settled"]:
break
else:
raise TimeoutError(job_ids)
for job in body["jobs"]:
if job["status"] == "succeeded":
print(job["id"], job["outputs"][0]["url"]) # save each before url_expires_at
else:
print(job["id"], job["status"]) # failed jobs are refundedAudio mastering API pricing
A master costs 725 credits a track, whatever the song's length. To see the exact figure for a song before you spend anything, send "dry_run": true to the mastering endpoint or call POST /v1/estimates with { "operation": "masters.create" }. Both are free and start nothing. The dry run returns credits_required, balance and balance_after inside estimate; POST /v1/estimates returns the same three fields at the top level.
The real charge is in credits_charged. If a job fails, its credits are refunded and credits_refunded is true. See pricing for credit prices by plan.
Retries, errors and limits
The Idempotency-Key header is required, 1 to 255 characters. If a request times out, send it again with the same key: you get the first job back and spend nothing. Reuse the same Idempotency-Key when you retry the same request; use a new key for a new request, since a new key starts and charges a second job. A key is bound to its first request for 90 days; its response is replayed for 24 hours.
| Error code | Action |
|---|---|
PUBLIC_API_RATE_LIMITED | Wait retry_after_seconds, then retry once with the same Idempotency-Key. |
INSUFFICIENT_CREDITS | Stop. Don't retry. |
PUBLIC_API_DAILY_LIMIT_REACHED | Stop until resets_at. |
PUBLIC_API_PLAN_REQUIRED | Your account has no plan that includes the API. See pricing. |
Every code and its HTTP status is listed in the Mozart API error reference.
The REST API needs an API plan (Starter, Build, Scale or Growth), from $20 a month, or prepaid API credits, and spends API credits. Daily caps count your whole account, in the app and through every key. Caps by plan, request rates and sizes are in API rate limits and daily caps.
How to choose an AI mastering API
| What to check | Question to ask | Mozart |
|---|---|---|
| Input | Any file, or only audio already on the platform? | Songs already in your Mozart library |
| Controls | Style, loudness target or reference track, or one preset? | One fixed preset: pop style at streaming loudness |
| Async model | Blocking call, polling or webhooks? | 202 job, then POST /v1/jobs/wait or webhooks |
| Pricing | Per track, per credit or subscription; can you check first? | 725 credits a track; free dry run and estimates |
| Retries | Can a retry charge twice? | No: the same Idempotency-Key returns the first job |
| Output | Formats and link lifetime? | WAV (audio/wav) at a URL that expires at url_expires_at |
Mozart fits when your app already generates songs with Mozart: no upload step, one fixed preset at streaming loudness, a job model with webhooks, free price checks and retries that never charge twice.
| Capability | Mozart AI mastering API | Mastering in the Mozart app |
|---|---|---|
| Input | song_id of a song in your Mozart library | A song in the Mozart web app |
| Mastering styles | One fixed preset (pop style) | Eight styles |
| Loudness targets | One target (streaming loudness) | Two targets |
| Interface | REST | Browser (/tools/ai-mastering) |
Other AI mastering APIs for files you upload
Mozart's API masters only songs made in Mozart. If your app needs to master its users' own mixes, these are the routes that rank for "ai mastering api", with each vendor's published terms as fetched on 27 Nov 2026. Prices and features change, so check each source before you choose.
| Provider and route | Input and controls | Published price | Source (fetched 27 Nov 2026) |
|---|---|---|---|
| LANDR pro audio mastering API, access through sales | Your files; three mastering intensities and styles | From $2.50 a track | https://www.landr.com/pro-audio-mastering-api |
| RoEx Tonn API | A track URL; musicalStyle and desiredLoudness; WAV, FLAC or MP3 out; up to 10 minutes | 220 credits a full master, $1.76 at the Large pack | https://tonn-portal.roexaudio.com/ |
| Masterchannel API, credentials by contact form | Your files; zero parameters or profiles | From $1.50 a master; previews free | https://integrate.masterchannel.ai |
| Audial API (REST, Python SDK, MCP) | Your files, up to 100 MB; optional reference track | $10 a month or $100 a year, unlimited runs | https://www.audialmusic.ai/tools/ai-mastering |
| Chosen Masters API | Pre-signed S3 upload; modes process, lite and warm | 1 credit a song; $0.14 to $0.50 a credit | https://chosenmasters.com/ai-mastering-api |
| AI Mastering (Bakuage) API | OpenAPI spec, Node and Ruby clients; says its emphasis is now the offline version | Not on the page | https://aimastering.com/api_docs |
| Dolby.io Music Mastering | Postman collection still ranks; the old guide URLs redirect to optiview.dolby.com/docs | Not stated; current status unconfirmed | https://www.postman.com/dolbyio |
Add mastering to a music generation pipeline
Mozart makes songs with vocals, lyrics and cover art from $0.071 a song, 2 songs per request. Mastering is priced per track (see Audio mastering API pricing), and a dry run shows the cost before you spend anything. Common workflows on one song_id:
- Master only the keeper: generate 2 songs, let your user pick one, and master only that one, so you spend mastering credits on the keeper.
- Automated export pipelines: call the mastering endpoint from a script or CI job and wait on the job to pull mastered WAV files.
- Multi-step audio tooling: chain song generation, mastering, the stem separation API and the audio to MIDI API on the same
song_id.
Every operation is part of the Mozart AI music generator API.
Comparing music generation APIs? See Does Suno have an API? and ElevenLabs music API pricing compared.
Music mastering API FAQ
Can I upload my own audio file to this music mastering API?
No. The endpoint takes the song_id of a song already in your Mozart library, and the API has no upload route for mastering.
Can I choose a mastering style or loudness target?
No. The API masters every song with the pop style at streaming loudness, and the request body takes only dry_run. The Mozart app lets you choose from eight styles and two loudness targets.
How much does mastering cost per track?
725 credits a track, whatever the song's length. Send dry_run as true or call POST /v1/estimates to see the exact credits first. Both are free. See pricing for credit prices by plan.
Can I try the mastering API for free?
Price checks with dry_run and POST /v1/estimates are free. Mastering itself always uses credits, and failed jobs are refunded. The REST API needs an API plan (Starter, Build, Scale or Growth), from $20 a month, or prepaid API credits, and spends API credits.
What format is the master in?
A WAV file. The job's outputs[0].url points to it, with content_type audio/wav and duration_seconds.
Is AI mastering as good as a mastering engineer?
For consistent results across many songs, AI mastering is the practical choice: every song gets the same treatment with no booking or back and forth. A mastering engineer makes song-by-song judgment calls and can work from your notes, which still matters for a flagship release. In an app that generates songs at scale, an automatic mastering API is the step that fits.
What loudness and sample rate does the master use?
Streaming loudness. Mozart doesn't publish a LUFS target or sample rate for the API yet; the output's content_type is audio/wav.
Does mastering replace the original song?
The mastered recording becomes the current version of the same song, with the same song_id, and the unmastered version stays in the song's history, which the v1 API cannot read. Download the WAV before mastering if you need the unmastered audio. Save the mastered file from the job's outputs before url_expires_at.
Does the mastering call block?
No. The first call returns 202 at once with a job ID. Wait with POST /v1/jobs/wait, which holds up to 25 seconds a call, or register a webhook for job.succeeded and job.failed.
What happens if a master fails?
The job ends with status failed and an error with a next_step, and its credits are refunded (credits_refunded is true).
Is there a GitHub client or SDK for the mastering API?
The audio mastering API is plain REST, so any HTTP client works, and the cURL, Python and Node.js samples on this page are complete. Every operation is listed in the API reference.
Can I call the AI mastering API from an Android or iOS app?
Yes, from your backend. Call the REST endpoint from your server and send the mastered file's URL to the app, so your API key never ships inside the app.
What does streaming loudness mean?
It is the name of the API's one fixed loudness setting. Streaming loudness is measured in LUFS, and services such as Spotify normalise playback to a target (-14 LUFS by default on Spotify). Mozart doesn't publish the LUFS target or true peak ceiling of its preset yet.
Which mastering API should I use for files I upload?
Not this one: Mozart's API masters only songs made in Mozart. APIs that master your own files include LANDR, RoEx Tonn, Masterchannel, Audial and Chosen Masters. The table in Other AI mastering APIs for files you upload compares their published prices as of 27 Nov 2026.
Related pages
Does Suno have an API?
What Suno offers developers today, and the alternatives.
Read the guideElevenLabs Music API pricing compared
Per-minute pricing against a per-song music API.
Read the guideStem separation API
Split a song into vocals, drums, bass and other.
Read the guideAudio to MIDI API
Turn a song or a recording into a .mid file.
Read the guide
Master the songs your app makes
The REST API needs an API plan (Starter, Build, Scale or Growth), from $20 a month, or prepaid API credits, and spends API credits. See pricing.