{"id":6693,"date":"2026-12-01T22:14:16","date_gmt":"2026-12-01T19:14:16","guid":{"rendered":"https:\/\/mubert.com\/blog\/background-music-api-streams-files-licence-latency"},"modified":"2026-12-01T22:14:53","modified_gmt":"2026-12-01T19:14:53","slug":"background-music-api-streams-files-licence-latency","status":"publish","type":"post","link":"https:\/\/mubert.com\/blog\/background-music-api-streams-files-licence-latency","title":{"rendered":"Background Music API: Files or Streams, the Endpoints, the Licence, and Where the Spinner Really Waits","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A background music API gives your app music in one of two shapes: a finished file (MP3 or WAV, from 5 seconds up) or a stream URL that plays until someone closes the tab. On the Mubert API, 12 round durations are stocked and can come back instantly. Anything else gets composed on request. This post is for developers and product teams putting music into an app, game or video tool. It covers which endpoints do what, when a stream beats a file, what the licence lets your users do and where the waiting actually happens.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The usual alternative is a folder of MP3s someone licensed years ago. It works until a user makes a 47-second clip and the 3-minute track gets faded out mid-chorus, like a waiter taking your plate while you are still holding the fork. (Everyone has shipped this. We have too.) A background music API that writes to the length is the fix.<\/p>\n\n\n\n<figure class=\"post-illustration\"><img decoding=\"async\" width=\"1024\" height=\"1024\" class=\"wp-image-6696 art-light\" src=\"https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-light-2-1024x1024.webp\" alt=\"Background Music API: Streams, Files, Licence, Latency\" loading=\"lazy\" srcset=\"https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-light-2-1024x1024.webp 1024w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-light-2-300x300.webp 300w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-light-2-150x150.webp 150w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-light-2-768x768.webp 768w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-light-2-1536x1536.webp 1536w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-light-2-640x640.webp 640w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-light-2-1200x1200.webp 1200w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-light-2-60x60.webp 60w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-light-2-24x24.webp 24w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-light-2-48x48.webp 48w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-light-2-96x96.webp 96w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-light-2.webp 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><img decoding=\"async\" width=\"1024\" height=\"1024\" class=\"wp-image-6697 art-dark\" src=\"https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-dark-2-1024x1024.webp\" alt=\"Background Music API: Streams, Files, Licence, Latency\" loading=\"lazy\" srcset=\"https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-dark-2-1024x1024.webp 1024w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-dark-2-300x300.webp 300w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-dark-2-150x150.webp 150w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-dark-2-768x768.webp 768w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-dark-2-1536x1536.webp 1536w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-dark-2-640x640.webp 640w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-dark-2-1200x1200.webp 1200w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-dark-2-60x60.webp 60w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-dark-2-24x24.webp 24w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-dark-2-48x48.webp 48w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-dark-2-96x96.webp 96w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-1-dark-2.webp 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">A background music API hands you files or streams<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use files when the music ends up inside something the user exports. Use streams when the music plays live inside your app and nobody downloads it. Video editors, ad builders and slideshow tools want files. Focus apps, fitness, games and in-store screens want streams.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Every feature that touches a background music API ends up on one side of that line. A file has a length, a download URL and an expiry. A stream has a playlist, an intensity level and a quota counted in seconds. Each one uses up its own quota, so the choice also ends up in your pricing model.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Length is the part users change most. About one in four generated tracks in our Render tool (25.1%) gets re-cut to another duration afterwards (Mubert&#8217;s own data, last 28 days). So when you design the API calls for background music, treat &#8220;same music, different length&#8221; as a normal request, because it is one.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Files: one POST, a status, and a link that expires<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A file starts with <code>POST \/api\/v3\/public\/tracks<\/code>, and what comes back is a job, not music. According to the <a href=\"https:\/\/mubert.com\/api\/docs\" target=\"_blank\">API documentation<\/a> and its v3 spec, the request takes a text prompt (up to 255 characters), an image (PNG, JPG, JPEG, WEBP or BMP, 50 KB to 10 MB) or a <code>playlist_index<\/code>, which is a music channel you list with <code>GET \/api\/v3\/public\/playlists<\/code>. There are four modes: <code>track<\/code>, <code>jingle<\/code>, <code>loop<\/code> and <code>mix<\/code>. Output is MP3 at 32, 96, 128, 192, 256 or 320 kbps, or WAV.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The track then moves through <code>processing<\/code>, <code>done<\/code> or <code>failed<\/code>. Fetch it with <code>GET \/api\/v3\/public\/tracks\/{track}<\/code> and you get a download <code>url<\/code> plus an <code>expired_at<\/code> timestamp. That timestamp is the part teams forget. Copy the background music out of the API&#8217;s storage into your own once it is done, because a link saved in your database stops working after it expires.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Polling works, but a webhook is nicer. You set <code>webhook_url<\/code> and <code>webhook_enabled<\/code> on the licence with <code>PUT \/api\/v3\/service\/licenses\/{license}<\/code>, and the reference says webhooks &#8220;receive track models when generation completes&#8221;. Keep a slow poll as a fallback anyway, since webhooks fail like everything else. We covered that pattern line by line in <a href=\"https:\/\/mubert.com\/blog\/text-to-music-api-mubert-v3-webhook-polling\">the post on one POST and the webhook that saves you from polling<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Two more endpoints handle &#8220;almost, but not quite&#8221;. <code>POST \/tracks\/{track}\/edit<\/code> changes an existing track (duration between 5 and 3600 seconds, bitrate, format, intensity). <code>POST \/tracks\/{track}\/similar<\/code> generates a variation. The MCP server describes edits as re-rolling or removing parts, &#8220;swap the bass&#8221; style, which is the feature users ask for once they stop being polite.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Two kinds of credentials, and which one goes where<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Authentication uses headers only, in two pairs. <code>company-id<\/code> and <code>license-token<\/code> belong to your company and call the service endpoints. <code>customer-id<\/code> and <code>access-token<\/code> belong to a customer you create with <code>POST \/api\/v3\/service\/customers<\/code>, and they call everything that makes music.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So the licence token stays on your server, always. Get this wrong and your background music API key ends up in someone&#8217;s browser network tab. Create one customer per user or per workspace. Keep the mapping stable. The MCP docs say it plainly: every new client value provisions a customer and consumes a seat. A careless retry loop that creates a customer per request is how you run out of seats before lunch.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Streams: one URL that never ends, and three knobs<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A stream starts with <code>GET \/api\/v3\/public\/streaming\/get-link<\/code> and returns a URL for &#8220;continuous music playback&#8221;. It takes a <code>playlist_index<\/code> (up to 10 characters), an optional bitrate, an intensity of <code>low<\/code>, <code>medium<\/code> or <code>high<\/code>, and a <code>type<\/code> of <code>http<\/code> or <code>webrtc<\/code>. Any player that speaks HTTP streaming or WebRTC can play it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then you get three POST endpoints, and this is where streams beat files for live apps:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>set-intensity<\/code> changes how busy the arrangement is (low, medium, high), and the docs say the change happens &#8220;without stream interruption&#8221;.<\/li>\n\n\n<li><code>set-loop-state<\/code> turns looping on or off. Send <code>time<\/code> with the current playback position in seconds so the loop starts where the listener is.<\/li>\n\n\n<li><code>restart<\/code> switches to a different track on the same URL, so your player never reconnects.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">A game can raise intensity when the boss appears and drop it in the menu. A workout app can follow the interval timer. For background music in a live app, this is the API path that never runs out of song, the opposite of a 30-second loop playing for the fortieth time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The price is quota. Licences cap streaming in seconds, daily, monthly and in total, and an exceeded limit comes back as an error naming which of the three you hit. A background music API stream nobody hears still counts. Somewhere a tablet in a closed shop is playing lo-fi to a mop. Anyway.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Stop the stream when the app goes to the background or the screen locks. Then restart it when the user comes back.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Latency in a background music API lives in the cache<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A stocked duration (5, 6, 8, 10, 15, 20, 30, 40, 60, 180, 240 or 300 seconds) can come back instantly. Anything else gets rendered fresh, and you wait for <code>done<\/code>. The docs publish no render-time figure for the background music API, so measure it on your own licence before you promise users anything.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The instant path is <code>POST \/api\/v3\/public\/tracks\/stored<\/code>. You send a <code>playlist_index<\/code> (or a <code>stream_id<\/code>) and a <code>duration<\/code>, and it &#8220;returns a cached track matching the requested parameters if available&#8221;. If nothing matches, you get a 404 and fall back to normal creation. There is also <code>POST \/tracks\/record<\/code>, which skips the cache on purpose when you need something nobody else has heard.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here is the trade-off for a 47-second clip. Ask for 47 seconds and wait for a render, or take 60 stocked seconds now and fade out at 47 in your editor. Instant music with a fade, or exact music with a spinner. Most editors can offer both: preview the stocked track at once, then swap in the exact cut once it&#8217;s done.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Two smaller notes. A <code>playlist_index<\/code> is more predictable than a text prompt, and the MCP guidance prefers it for speed. The free library search (<code>GET \/api\/v3\/public\/music-library\/tracks<\/code>, over 12,000 pre-made tracks) costs no generation at all, so check it first when the user just wants &#8220;something calm&#8221;.<\/p>\n\n\n\n<figure class=\"post-illustration\"><img decoding=\"async\" width=\"1024\" height=\"1024\" class=\"wp-image-6698 art-light\" src=\"https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-light-2-1024x1024.webp\" alt=\"Closed shop at night with the lights off and a mop leaning on the counter, while a tablet on the wall keeps playing music to the empty room and a usage meter beside it ticks upward\" loading=\"lazy\" srcset=\"https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-light-2-1024x1024.webp 1024w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-light-2-300x300.webp 300w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-light-2-150x150.webp 150w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-light-2-768x768.webp 768w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-light-2-1536x1536.webp 1536w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-light-2-640x640.webp 640w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-light-2-1200x1200.webp 1200w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-light-2-60x60.webp 60w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-light-2-24x24.webp 24w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-light-2-48x48.webp 48w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-light-2-96x96.webp 96w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-light-2.webp 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><img decoding=\"async\" width=\"1024\" height=\"1024\" class=\"wp-image-6699 art-dark\" src=\"https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-dark-2-1024x1024.webp\" alt=\"Closed shop at night with the lights off and a mop leaning on the counter, while a tablet on the wall keeps playing music to the empty room and a usage meter beside it ticks upward\" loading=\"lazy\" srcset=\"https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-dark-2-1024x1024.webp 1024w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-dark-2-300x300.webp 300w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-dark-2-150x150.webp 150w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-dark-2-768x768.webp 768w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-dark-2-1536x1536.webp 1536w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-dark-2-640x640.webp 640w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-dark-2-1200x1200.webp 1200w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-dark-2-60x60.webp 60w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-dark-2-24x24.webp 24w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-dark-2-48x48.webp 48w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-dark-2-96x96.webp 96w, https:\/\/mubert.com\/blog\/wp-content\/uploads\/2026\/12\/illustration-2-dark-2.webp 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">The cache-first background music API call, in 20 lines<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This is the shortest client we would ship: try the stocked track, then create the exact one. Field names come from the v3 OpenAPI spec, and the response shapes are in the docs.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span class=\"tok-dim\">\/\/ Field names from the v3 OpenAPI spec; check the API docs for response shapes.<\/span>\nconst BASE = <span class=\"tok-str\">\"https:\/\/music-api.mubert.com\/api\/v3\/public\"<\/span>;\nconst headers = <span class=\"tok-dim\">{<\/span>\n  <span class=\"tok-str\">\"customer-id\"<\/span>: CUSTOMER_ID,\n  <span class=\"tok-str\">\"access-token\"<\/span>: ACCESS_TOKEN,\n  <span class=\"tok-str\">\"content-type\"<\/span>: <span class=\"tok-str\">\"application\/json\"<\/span>,\n<span class=\"tok-dim\">}<\/span>;\nconst STOCKED = <span class=\"tok-dim\">[<\/span><span class=\"tok-num\">5<\/span>, <span class=\"tok-num\">6<\/span>, <span class=\"tok-num\">8<\/span>, <span class=\"tok-num\">10<\/span>, <span class=\"tok-num\">15<\/span>, <span class=\"tok-num\">20<\/span>, <span class=\"tok-num\">30<\/span>, <span class=\"tok-num\">40<\/span>, <span class=\"tok-num\">60<\/span>, <span class=\"tok-num\">180<\/span>, <span class=\"tok-num\">240<\/span>, <span class=\"tok-num\">300<\/span><span class=\"tok-dim\">]<\/span>;\nconst roundUp = (s) =&gt; STOCKED.find((d) =&gt; d &gt;= s) ?? s;\n\nasync function musicFor(playlistIndex, seconds) <span class=\"tok-dim\">{<\/span>\n  const cached = await fetch(`$<span class=\"tok-dim\">{<\/span>BASE<span class=\"tok-dim\">}<\/span>\/tracks\/stored`, <span class=\"tok-dim\">{<\/span>\n    method: <span class=\"tok-str\">\"POST\"<\/span>, headers,\n    body: JSON.stringify(<span class=\"tok-dim\">{<\/span> playlist_index: playlistIndex, duration: roundUp(seconds) <span class=\"tok-dim\">}<\/span>),\n  <span class=\"tok-dim\">}<\/span>);\n  if (cached.ok) return <span class=\"tok-dim\">{<\/span> preview: await cached.json() <span class=\"tok-dim\">}<\/span>;   <span class=\"tok-dim\">\/\/ play now, fade at `seconds`<\/span>\n\n  const job = await fetch(`$<span class=\"tok-dim\">{<\/span>BASE<span class=\"tok-dim\">}<\/span>\/tracks`, <span class=\"tok-dim\">{<\/span>\n    method: <span class=\"tok-str\">\"POST\"<\/span>, headers,\n    body: JSON.stringify(<span class=\"tok-dim\">{<\/span> playlist_index: playlistIndex, duration: seconds, mode: <span class=\"tok-str\">\"track\"<\/span> <span class=\"tok-dim\">}<\/span>),\n  <span class=\"tok-dim\">}<\/span>);\n  return <span class=\"tok-dim\">{<\/span> pending: await job.json() <span class=\"tok-dim\">}<\/span>;                     <span class=\"tok-dim\">\/\/ wait for webhook, poll as backup<\/span>\n<span class=\"tok-dim\">}<\/span><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Run it on a server, never in the client, because the headers are real credentials. Then hand the player only the URL.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The licence travels with the key, not with the file<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Background music generated through the API is cleared for commercial use under the platform licence, and the exact scope depends on the plan. The company&#8217;s product summary says the music is owned by the company and is royalty-free for licensed uses. Its limits matter for anyone building an export button. Generated tracks are not cleared for release on Spotify or Apple Music as an artist&#8217;s own music, for Content ID monetisation, or for resale on stock music marketplaces, unless the plan explicitly allows it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So say this in your export dialog, in one line, before a user registers their exported video&#8217;s soundtrack with a claiming service and starts a fight with their own tool. Your terms of service will not be read. A tooltip might be.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Everything else (max duration, formats, bitrates, modes, streaming seconds, remaining quota) is set per licence. The MCP server&#8217;s <code>get_capabilities<\/code> call reports it, and the docs warn these values &#8220;cannot be guessed&#8221;. Plans and their limits live on the API plans page; check the live page rather than any number someone pasted into Slack.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The supply chain is part of the licence story. Tracks are composed from over 3 million samples by more than 10,000 musicians, who upload them and get paid. We wrote a longer checklist on licence scope, edits and formats in <a href=\"https:\/\/mubert.com\/blog\/music-generation-api-what-to-check\">what to check before you build on a music generation API<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Platform audio rules no background music API fixes for you<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Browsers and phones decide when your music may play, and no endpoint changes that. <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/Media\/Guides\/Autoplay\" target=\"_blank\" rel=\"nofollow noopener\">MDN&#8217;s autoplay guide<\/a> says audio is generally blocked until the user has interacted with the page (a click, a tap, a key press), unless it is muted. Even a perfect API cannot start background music in a tab nobody clicked, so start the stream from a button, not from page load.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Android has its own rule, called audio focus: only one app holds it at a time. The <a href=\"https:\/\/developer.android.com\/media\/optimize\/audio-focus\" target=\"_blank\" rel=\"nofollow noopener\">Android guide<\/a> says to request focus right before playing, then duck (lower the volume) or pause when another app takes it. From Android 12, the system fades your app out itself. Apps targeting Android 15 cannot even request focus unless they are the top app or run a foreground service.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then there is your own voice track. Background music under speech has to sit well below it, which is a mixing job and not an API one. Our post on <a href=\"https:\/\/mubert.com\/blog\/background-music-for-videos-podcasts-levels\">how far under the voice music should sit<\/a> has the levels.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A checklist for adding a background music API this week<\/h2>\n\n\n\n<ol class=\"wp-block-list post-steps\">\n<li>Read your licence limits (max duration, formats, streaming seconds) before writing any UI.<\/li>\n\n\n<li>Decide per feature: files for anything exported, streams for anything played live.<\/li>\n\n\n<li>Default lengths to stocked durations and try <code>\/tracks\/stored<\/code> before creating.<\/li>\n\n\n<li>Set <code>webhook_url<\/code> on the licence and keep a slow poll as a backup.<\/li>\n\n\n<li>Copy finished files to your own storage before <code>expired_at<\/code>.<\/li>\n\n\n<li>Create one customer per user or workspace and keep <code>license-token<\/code> on the server.<\/li>\n\n\n<li>Start streams after a user tap and stop them when the app goes to the background.<\/li>\n\n\n<li>Put the licence limits in one line in your export dialog.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Keys, docs and plans start at <a href=\"https:\/\/mubert.com\/api\" target=\"_blank\">mubert.com\/api<\/a>. Wire the API in where the background music used to live, then delete the 3-minute MP3 that&#8217;s been fading out under every short clip.<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>A background music API gives your app either a file (MP3 or WAV, from 5 seconds up) or an endless stream URL, and 12 stocked durations can come back instantly. Below: the endpoints, the licence limits and where latency hides.<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":6694,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[301,283,300,299,238],"class_list":["post-6693","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-insights","tag-app-development","tag-background-music","tag-game-audio","tag-music-api","tag-video-editing"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO Pro 5.0.6.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"A background music API for apps and video tools: when to stream, when to fetch a file, the 12 instant durations, licence limits and the endpoints to call.\" \/>\n\t<meta name=\"robots\" content=\"max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n\t<meta name=\"author\" content=\"Mubert Team\"\/>\n\t<meta name=\"google-site-verification\" content=\"Z0lMgBGD_DdV-YJXlBW_mpnjKZhnISUJLElngis7ecg\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/mubert.com\/blog\/background-music-api-streams-files-licence-latency\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO Pro (AIOSEO) 5.0.6.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Mubert \u2013 Royalty-free AI Music for Content Creators\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Background Music API: Streams, Files, Licence, Latency\" \/>\n\t\t<meta property=\"og:description\" content=\"A background music API for apps and video tools: when to stream, when to fetch a file, the 12 instant durations, licence limits and the endpoints to call.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/mubert.com\/blog\/background-music-api-streams-files-licence-latency\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/mubert.com\/blog\/wp-json\/mubert\/v1\/og\/6694.jpg?v=36323a32bf\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/mubert.com\/blog\/wp-json\/mubert\/v1\/og\/6694.jpg?v=36323a32bf\" \/>\n\t\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-12-01T19:14:16+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-12-01T19:14:53+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/mubert.app\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@mubertapp\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Background Music API: Streams, Files, Licence, Latency\" \/>\n\t\t<meta name=\"twitter:description\" content=\"A background music API for apps and video tools: when to stream, when to fetch a file, the 12 instant durations, licence limits and the endpoints to call.\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@mubertapp\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/mubert.com\/blog\/wp-json\/mubert\/v1\/og\/6694.jpg?v=36323a32bf\" \/>\n\t\t<!-- All in One SEO Pro -->\r\n\t\t<title>Background Music API: Streams, Files, Licence, Latency<\/title>\n\n","aioseo_head_json":{"title":"Background Music API: Streams, Files, Licence, Latency","description":"A background music API for apps and video tools: when to stream, when to fetch a file, the 12 instant durations, licence limits and the endpoints to call.","canonical_url":"https:\/\/mubert.com\/blog\/background-music-api-streams-files-licence-latency","robots":"max-snippet:-1, max-image-preview:large, max-video-preview:-1","keywords":"","webmasterTools":{"google-site-verification":"Z0lMgBGD_DdV-YJXlBW_mpnjKZhnISUJLElngis7ecg","miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"Mubert \u2013 Royalty-free AI Music for Content Creators","og:type":"article","og:title":"Background Music API: Streams, Files, Licence, Latency","og:description":"A background music API for apps and video tools: when to stream, when to fetch a file, the 12 instant durations, licence limits and the endpoints to call.","og:url":"https:\/\/mubert.com\/blog\/background-music-api-streams-files-licence-latency","og:image":"https:\/\/mubert.com\/blog\/wp-json\/mubert\/v1\/og\/6694.jpg?v=36323a32bf","og:image:secure_url":"https:\/\/mubert.com\/blog\/wp-json\/mubert\/v1\/og\/6694.jpg?v=36323a32bf","og:image:width":1200,"og:image:height":630,"article:published_time":"2026-12-01T19:14:16+00:00","article:modified_time":"2026-12-01T19:14:53+00:00","article:publisher":"https:\/\/facebook.com\/mubert.app","twitter:card":"summary","twitter:site":"@mubertapp","twitter:title":"Background Music API: Streams, Files, Licence, Latency","twitter:description":"A background music API for apps and video tools: when to stream, when to fetch a file, the 12 instant durations, licence limits and the endpoints to call.","twitter:creator":"@mubertapp","twitter:image":"https:\/\/mubert.com\/blog\/wp-json\/mubert\/v1\/og\/6694.jpg?v=36323a32bf"},"aioseo_meta_data":{"post_id":"6693","title":"Background Music API: Streams, Files, Licence, Latency","description":"A background music API for apps and video tools: when to stream, when to fetch a file, the 12 instant durations, licence limits and the endpoints to call.","keywords":null,"keyphrases":{"focus":{"keyphrase":"background music api","score":0,"analysis":[]},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-12-01 19:15:26","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"open_ai":null,"ai":null,"created":"2026-12-01 19:14:16","updated":"2026-12-01 19:15:26","focus_keyword":"background music api","additional_keywords":null,"truseo_locale":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t<a href=\"https:\/\/mubert.com\/blog\/\" title=\"Home\">Home<\/a>\n<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t<a href=\"https:\/\/mubert.com\/blog\/category\/insights\" title=\"Insights\">Insights<\/a>\n<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\tBackground Music API: Files or Streams, the Endpoints, the Licence, and Where the Spinner Really Waits\n<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/mubert.com\/blog\/"},{"label":"Insights","link":"https:\/\/mubert.com\/blog\/category\/insights"},{"label":"Background Music API: Files or Streams, the Endpoints, the Licence, and Where the Spinner Really Waits","link":"https:\/\/mubert.com\/blog\/background-music-api-streams-files-licence-latency"}],"permalink_manager":null,"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/mubert.com\/blog\/wp-json\/wp\/v2\/posts\/6693","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mubert.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mubert.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mubert.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mubert.com\/blog\/wp-json\/wp\/v2\/comments?post=6693"}],"version-history":[{"count":1,"href":"https:\/\/mubert.com\/blog\/wp-json\/wp\/v2\/posts\/6693\/revisions"}],"predecessor-version":[{"id":6700,"href":"https:\/\/mubert.com\/blog\/wp-json\/wp\/v2\/posts\/6693\/revisions\/6700"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mubert.com\/blog\/wp-json\/wp\/v2\/media\/6694"}],"wp:attachment":[{"href":"https:\/\/mubert.com\/blog\/wp-json\/wp\/v2\/media?parent=6693"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mubert.com\/blog\/wp-json\/wp\/v2\/categories?post=6693"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mubert.com\/blog\/wp-json\/wp\/v2\/tags?post=6693"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}