Mubert in Chat Describe a track, then edit it with words Edit music with words Mubert Cast Turn a raw recording into a finished podcast episode Finish podcast episodes Mubert Fuse Upload a clip, get music that fits its length and mood Music that fits your video

Music Generation API: Check the Licence, Edits, Streams, Formats and Latency Before You Build

Before you build on a music generation API, check five things: licence, edits, streams, formats and latency. One real spec offers 4 modes, 6 MP3 bitrates and 5 editable stem groups, and this post shows what to test in each.

  
Cloudflare: loading...
Need an idea? Browse 168 music prompts →
Music Generation API: 5 Things to Check Before You BuildMusic Generation API: 5 Things to Check Before You Build

Before you build on a music generation API, check five things: the licence, the edits, the streams, the formats and the latency. Mubert’s v3 spec makes a good worked example, because it lists 4 generation modes, 6 MP3 bitrates and 5 stem groups you can swap or delete. This post is for developers and product teams putting a music generation API into an app, a game or a device. It ends with a checklist you can work through this week.

Every music generation API demos well. The track plays in a notebook, the room nods and someone says “ship it”. The notebook never gets a takedown notice, though.

Your app might.

Music Generation API: 5 Things to Check Before You BuildMusic Generation API: 5 Things to Check Before You Build

A music generation API involves five decisions, not one endpoint

Choosing a music generation API comes down to five checks: licence, edits, streams, formats and latency. Most comparisons stop at “does it sound good”. That’s the easy part. It also changes every quarter. Your product keeps working in a year because of the boring parts: the licence text, the edit options, the stream protocol, the allowed formats and the cache.

So read the spec before the landing page. A machine-readable OpenAPI file tells you more in ten minutes than a sales call does in an hour. (No sales call has ever returned a 422.) The vendor in our example publishes the docs next to that spec, and its MCP server page adds the rule we wish every vendor printed in bold: call the capabilities method first, because bitrates, formats, modes and maximum duration “are per-license and cannot be guessed”.

That sentence is this whole post in miniature. Your licence isn’t a PDF that legal reads once. It’s a runtime object. Your code reads and checks it on every request.

The licence decides who owns the track and where it may go

Start with ownership, because the law protects the output of any music generation API less than most people assume. On January 29, 2025, the US Copyright Office released Part 2 of its AI report. It found that prompts alone generally do not give a user enough control to claim copyright in the output. So “you own what you generate” may mean less than it sounds. A clear licence beats a vague promise of ownership.

Next, read where the music may go. The vendor’s summary for AI systems says it plainly: generated music is owned by the company and royalty-free for licensed uses. Unless a plan explicitly permits it, the music is not cleared for release on Spotify or Apple Music as an artist’s own record, for Content ID monetisation or for stock marketplaces. That’s the sentence you want. If your users can export tracks and post them anywhere, get the same line in writing from your music generation API vendor before launch.

Then check sublicensing, which means passing the rights on to your own users. An API key covers your company. When your users download the file, the licence has to cover them too. Otherwise every export button becomes a small legal question.

Last, ask what the model generates from. Per the same page, this one works from more than 3 million samples made by more than 10,000 musicians, and those musicians get paid. Some other vendors are in court over their training data. Our piece on Suno’s API situation covers the extra risk an unofficial wrapper adds on top.

Edits save you from regenerating the whole track

A good edit endpoint in a music generation API changes one part of a track and leaves the rest alone. In the v3 spec, POST /tracks/{track}/edit can replace or delete five stem groups: drums, bass, leads, vocals and FX. A stem is one layer of the mix, exported on its own. The same endpoint works on twelve narrower instrument types, from hats and claps to pads and risers, and it resets duration to anything from 5 to 3,600 seconds. A separate /similar endpoint makes a variation that keeps the original’s character.

This matters because users rarely hate a whole track. They hate the hi-hats. Without an edit endpoint, a music generation API has one fix: a new generation, meaning a new random track, another round of approval and more quota spent. The user liked most of the old track and now has none of it. We have written that retry loop. It went badly, mostly for the quota.

Duration edits are the ones nobody talks about. Mubert’s own data, last 28 days, shows about one in four generated tracks getting re-cut to a different length. People change their minds about length constantly. An API that re-cuts a track instead of re-rolling it turns a support ticket into a parameter.

There’s also a trade-off to test. Our earlier v3 walkthrough found that only track mode returns exactly the requested duration. Loops and jingles can come back slightly short, so plan for that if your video editor snaps to frames.

Streams and files are different products in a music generation API

A file is a finished track you download. A stream is endless audio served from a URL, and it keeps playing as long as someone listens. Sessions of unknown length push file-only APIs into crossfades and loops: a workout, a focus timer, a game level that lasts as long as the player is bad at it. People hear the seams by the third repeat.

A streaming music generation API needs three checks. First, the transport. In the spec, GET /streaming/get-link takes a playlist_index (a music channel ID such as 1.0.0) and returns a stream over http or webrtc. Second, live control. set-intensity changes the energy between low, medium and high without interrupting playback, set-loop-state holds the current section and restart jumps to new music on the same URL. Third, the meter. Streaming quota is counted in seconds, with daily, monthly and total limits per licence and per customer.

Put that last one in your cost model on day one. A file costs you once. A stream keeps costing while somebody leaves your app open in a background tab and goes to lunch.

Also note what the stream endpoint does not take. It accepts a bitrate but has no format parameter, so a WAV stream isn’t on the menu. Fine for a fitness app. Less fine if you planned to record the stream straight into a broadcast chain.

Formats and bitrates come from the licence, not the marketing page

Your licence, not the brochure, decides which formats and bitrates a music generation API gives you. “Formats” means two things in this market, and vendors use whichever sounds bigger. One is the shape of the music, and the same AI summary counts five: jingle, track, loop, mix and neverending stream. Then there’s the file. In the v3 spec you get mp3 and wav, with MP3 bitrates of 32, 96, 128, 192, 256 and 320 kbps.

Your plan may not allow all of them, though. Dedicated errors exist for exactly this: LicenseForbiddenBitrate, LicenseForbiddenFormat, LicenseForbiddenDuration, LicenseForbiddenMode and LicenseForbiddenIntensity. So a request that works on your dev key can fail with a 403 on another plan. Read the capabilities at startup and build your interface from them. Don’t hard-code a WAV button that some customers will press and regret.

Then look at the inputs. The text prompt is capped at 255 characters and can’t be combined with bpm or key. You either describe the music in words or pick a channel and set the tempo. Never both. (255 is the database world’s favourite number. Somebody’s VARCHAR column has outlived several product roadmaps.) Anyway.

Row of finished music tracks on a shop shelf labelled with second counts like 30, 40 and 60, as a customer asks the shopkeeper for a 47-second one and the shopkeeper sighsRow of finished music tracks on a shop shelf labelled with second counts like 30, 40 and 60, as a customer asks the shopkeeper for a 47-second one and the shopkeeper sighs

Latency in a music generation API is mostly a caching question

In this music generation API, generation is asynchronous, and a cache decides most of the wait. You send a POST, get back a track marked processing, then wait for done or failed. Vendors rarely publish how long that takes. So measure it yourself, under load, with the durations your product actually asks for.

The v3 design says this outright. POST /tracks/stored returns a pre-rendered track that matches the request, and POST /tracks/record skips the store to render a new one. The MCP page advises rounding durations to stocked values (5, 6, 8, 10, 15, 20, 30, 40, 60, 180, 240 or 300 seconds) “so a track can come back instantly”. It also recommends picking a playlist over a free-text prompt. A 47-second request means a fresh render. A 40-second one may already be on the shelf. Your user won’t miss the seven seconds. They will notice the spinner.

For the wait itself, use a webhook rather than a polling loop. You set webhook_url and webhook_enabled on the licence, and the webhook receives the track model when generation finishes. Then copy the file to your own storage straight away, because every generated track carries an expired_at timestamp. The download URL is a pickup slip, not a CDN.

Concurrency belongs in the same test. The spec defines a LicenseLimitConcurrentTrackGenerationsCount error, so only a limited number of generations can run at once. Find that number before launch-day traffic does.

Quotas, seats and the errors you meet in production

Quotas and seats are the first errors a music generation API throws in production, so plan them before launch. A “customer” is the API’s record for one of your users, with its own credentials. The MCP docs warn that every new client key provisions a customer and uses up a seat. Run out, and you get LicenseLimitUsersCount. Decide early what a customer means: one of your users, one workspace or your whole backend.

Quotas come in several units: number of tracks, total track duration and streaming seconds. Each resets daily and monthly. A usage resource on the MCP server returns just those counters. That’s the admin dashboard, done. Without it, your support team files “music broken” tickets about a counter that simply hit its limit.

This is where the Mubert API fits, if you want a concrete starting point. It generates original tracks of any length from samples that musicians uploaded and get paid for, and it adapts streams to what happens in an app or a game. Use is cleared for commercial projects under the platform licence, with the exact scope depending on the plan. A pre-made library of more than 12,000 tracks comes with it, and the MCP server searches that library without spending quota. Restream, Picsart, Canva, Instories and VEED.io build on it, per the company’s summary. For plans, check live pricing on the product page rather than any number in a blog post, including this one.

A checklist for choosing a music generation API

  1. Download the vendor’s OpenAPI file and list every licence-related error code.
  2. Ask in writing where generated tracks may be published and if your users may download them.
  3. Swap one stem on a test track and confirm the rest of the track stays the same.
  4. Leave a stream running for an hour and check what it did to your quota.
  5. Read the capabilities or licence endpoint at startup and build format options from it.
  6. Time ten cached and ten fresh generations at your real durations and keep both numbers.
  7. Point a webhook at a staging URL and copy finished files to your storage before they expire.

Then run the demo again. The notebook still sounds great, and now you also know what happens after you ship. Docs and plans are on the Mubert API page.

Mubert Team

Editorial team, Mubert Inc

The musicians, sound designers and engineers behind Mubert, a generative music platform built from samples by real artists who get paid for them. We write about AI music, licensing, streaming and the creator economy, and we read the fine print so you do not have to.

Build it with Mubert

Vibe code Music apps

Add Mubert skills to your coding agent and ship music features in minutes

Terminal
$ npx skills add MubertAI/skills

MCP server

Generate royalty-free tracks right from Claude, Cursor or any MCP client

Terminal
$ claude mcp add --transport http mubert-music https://mcp.mubert.com/mcp

API

Bring music to your software product: apps, games and AI agents

cURL
curl -X POST "https://music-api.mubert.com/api/v3/public/tracks" \
  -H "customer-id: CUSTOMER_ID" \
  -H "access-token: ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "playlist_index": "1.0.0",
    "duration": 60,
    "bitrate": 128,
    "format": "wav",
    "intensity": "high",
    "mode": "track"
  }'
API documentation
Who we are

AI Music for Creators

Join 28 million creators generating music via Mubert apps & API integrations

Mubert is a platform powered by music producers that helps creators and brands generate unlimited royalty-free music with the help of AI. Our mission is to empower and protect the creators. Our purpose is to democratize the Creator Economy.

Anghami Adidas Canva DFF FIFA Instories Lift Miller Picsart Polkadot Restream VEED Visa Zoomerang