Documentation
Mubert AI Music API
Version 3.0
Table of Contents
Welcome to the Mubert AI Music API v3!
This API allows to integrate track generation and music streaming features into apps, games or services. To start using the API please request your API Keys from Mubert team (via [email protected]).
The REST API communicates exclusively in JSON over SSL (HTTPS). All endpoint URLs begin with https://music-api.mubert.com/api/v3/ (except streaming urls, they begin with https://stream.mubert.com/b2b/v3/)
Parameters must be serialized in JSON and passed in the request body.
You should use the media type designation of application/json.
There are two main directories in the API:
service —
https://music-api.mubert.com/api/v3/service/— used by the company to manage licenses and customers.public —
https://music-api.mubert.com/api/v3/public/— used by customers to receive streaming features and tracks.
Authentication
The REST API accepts API Key - based authentication.
For Companies
For Customers
The REST API communicates exclusively in JSON over SSL (HTTPS). All endpoint URLs begin with https://music-api.mubert.com/api/v3/ (except streaming urls, they begin with https://stream.mubert.com/b2b/v3/)
For the service directory use a pair of COMPANY_ID and LICENSE_TOKEN and for the public directory use a pair of CUSTOMER_ID and ACCESS_TOKEN.
You must replace COMPANY_ID / LICENSE_TOKEN / CUSTOMER_ID / CUSTOMER_TOKEN with your actual tokens.
License
For your convenience, we have made it so that a company can have several licenses with their own capabilities and limits. It is made so that you can separate users under different licenses. By default, the company has one license and in most cases this is enough.
You can get information about your licenses and limits.
Use model licenses with GET request
You can also get information about a specific license
Response
200 OK
This is the license model. Here you can find license features, default parameters, limits and statistics.
You can notice -1 in some limit's values, it means a limit is not set (unlimited).
Webhooks
In this version of the API, you can add a webhook to the license through which you will receive notifications about the status of the tracks generation process.
Use PUT method to set a webhook
you will receive updated license model.
After you add the webhook, you will start to receive messages with tracks models. Like this:
You can find out more about track model in the section Track generation.
User Registration
Each end-user of your product (service) is identified by a unique token pair: customer-id and access-token. These tokens are required to access the content and features.
Make as many customers as there are users you want to be provided with music.
To create it use model customers with POST request described below.
Input parameters
custom_id — your internal unique customer ID, which can consist of Latin letters, numbers and allowed special characters: ".", "_", "@", "-"' and should not be longer than 255 characters.
company-id and license-token — provided by Mubert team
Responds with a 200 OK response and JSON response if successful.
There is customer model
Here:
customer-id =
data->access->customer_id(CUSTOMER_ID)access-token =
data->access->access_token(ACCESS_TOKEN)daily_reset_at, monthly_reset_at — nullable date
Also you can see personal customer limits and statistics.
User Management
User(s) Information
You can get information about all your users with pagination.
Use GET request with model customers
The response contains a list of customers models.
Use pagination to see all data.
You can also get information about a specific customer using his custom or customer identifier. Like this:
Or
The answers also contains the customer model.
User Deleting
Use DELETE request with model customers
Responds with a 204 No Content response if successful.
List of channels
User(s) Information
Both streaming and track generation require that you select a music channel.
Use GET in model playlists to get a list of all available categories, groups, channels and their playlist indexes.
Response 200 OK
Here you can also see bpm range and key list. These values are available for track generation.
Please note, the bpm parameter has an available range in which you can generate in a specific category.
gt means greater than, lt means less than.
Music Streaming
Before you start using the streaming function, make sure it’s enabled under the contract agreement. Also you can find it in your license info. To get a link to streaming, use the request below
Request
Response 200 Ok
Parameters
playlist_index(mandatory) — channel indexbitrate(optional) — sound quality measured in kbpsintensity(optional) — the complexity of the arrangement, fewer or more instruments are playing simultaneouslytype(optional) — streaming protocol type
Possible values for bitrate : 32, 96, 128, 192, 256, 320
Possible values for intensity : low, medium, high
Possible values for type : http, webrtc
If optional parameters are omitted or contain wrong values, then default parameters are applied with bitrate=128, intensity=high and type=http.
gt means greater than, lt means less than.
Loop Mode
Use the set-loop-state url to loop the latest part of the music composition (or turn the loop mode off).
Parameters
loop(mandatory) — possible values:off,ontime(optional) — set equal to the current stream playback time in seconds (since session start) to improve the UX
Request
Response
Responds with a 204 No content if successful.
Intensity
The set-intensity url allows changing the complexity of the arrangement. Different presets consist of fewer or more instruments playing simultaneously. Intensities change seamlessly without breaking the stream.
Possible values for intensity : low, medium, high
Request
Response
Responds with a 204 No content if successful.
Generation Restart
To restart the stream, so that a different track (melody) starts playing with the same url, use the POST method with streaming/restart.
Request
Response
Responds with a 204 No content if successful.
Track Generation
Before you start using the track generation function, make sure it’s enabled under the contract agreement. Also you can find it in your license info.
With this API you can create custom tracks by request. Each track is an exclusive music composition available for you to download via a special link.
To interact with tracks, use the model tracks.
Create Track
Use POST to create a track with a set of the selected characteristics.
Request
Parameters
playlist_index(mandatory) - channel indexduration(mandatory) - track duration in secondsformat(optional) - mp3 or wavbitrate(optional) - sound quality measured in kbpsintensity(optional) - complexity of the arrangement, fewer or more instruments are playing simultaneouslymode(optional) — composition type (track,loop,jingle,mix)
Possible values for bitrate : 32, 96, 128, 192, 256, 320
Possible values for intensity : low, medium, high
If optional parameters are omitted or contain wrong values, then default parameters are applied with format=mp3, bitrate=128 , intensity=high, mode=track
track - means a track with common structure with intro, drops, breaks and outro
loop - stands for a track that can be looped
jingle - is best for music content up to 40 seconds long – these are short completed tracks with fixed and logical structure
mix - is mimicking the DJ’s work tracks follow one after another, blending harmoniously
playlist_index is a universal channel index in the “0.0.0” format, which is comprised of category_id.group_id.channel_id. Omit the latter digits to blend several channels.
For example: playlist=0.0 will play all the channels inside the “Calm” group; playlist=0 will play the entire “Moods” category.
Response
Here:
prompt,key,bpm,url— nullable stringgenerated_at,expired_at— nullable date
To check if a track is created use the tracks model with TRACK_ID. Like this:
Request
Or add a webhook to your license and receive messages when it's done.
Text-2-Music
You can create a track with a text prompt and a set of selected characteristics. This method is like the previous but instead of choosing a channel, you send us a text message. It goes to the transformer neural network with a tags base, and corresponding sets of sounds are chosen automatically. After that our composer engine creates a track and returns the file to you.
Before you start using it, make sure it’s enabled under the contract agreement.
Request
Parameters
prompt(mandatory) —your text prompt in English, 200 characters maximumduration(mandatory) — track duration in secondsformat(optional) —mp3orwavbitrate(optional) — sound quality measured in kbpsintensity(optional) — complexity of the arrangement, fewer or more instruments are playing simultaneouslymode(optional) — composition type (track,loop)
Possible values for bitrate : 32, 96, 128, 192, 256, 320
Possible values for intensity : low, medium, high
prompt — text prompt that you can receive from your user input or any other connected inputs (language models, image-to-text, game mechanics etc.)
track — means a track with common structure with intro, drops, breaks and outro
loop — stands for a track that can be looped
If optional parameters are omitted or contain wrong values, then default parameters are applied with format=mp3, bitrate=128 , intensity=high, mode=track
Response
Responds with a 204 No content if successful.
Intensity
The set-intensity url allows changing the complexity of the arrangement. Different presets consist of fewer or more instruments playing simultaneously. Intensities change seamlessly without breaking the stream.
Possible values for intensity : low, medium, high
Request
Response
Responds with a 204 No content if successful.
Generation Restart
To restart the stream, so that a different track (melody) starts playing with the same url, use the POST method with streaming/restart.
Request
Response
Responds with a 204 No content if successful.
Image-2-Music
You can create a track with an image. Before you start using it, make sure it’s enabled under the contract agreement.
Request
Parameters
image(mandatory) — your image in jpeg/png format, 10 MB maximumduration(mandatory) — track duration in secondsformat(optional) — mp3 or wavbitrate(optional) — sound quality measured in kbpsintensity(optional) — complexity of the arrangement, fewer or more instruments are playing simultaneouslymode(optional) — composition type (track,loop)
Possible values for bitrate : 32, 96, 128, 192, 256, 320
Possible values for intensity : low, medium, high
track — means a track with common structure with intro, drops, breaks and outro
loop — stands for a track that can be looped
If optional parameters are omitted or contain wrong values, then default parameters are applied with format=mp3, bitrate=128 , intensity=high, mode=track
Bpm/Key Generation
You can add bpm and key to the playlist_index generation parameters.
Request
Response
Responds 200 OK with track model if if successful.
Generate Similar
You can generate a similar track to an existing one. It will not be exactly the same track, but similar.
Use POST with https://music-api.mubert.com/api/v3/public/tracks/TRACK_ID/similar
Request
Track Editing
You can change some parameters of an existing track.
Request
Response 200 OK
Also you can replace part of the track. Each track consists of instruments. The track may contain instruments such as:
DRUMS, PERCS, HATS, CLAPS, BASS, MIDS, LEADS, FX, VOCALS, PADS, RISER, IMPACT
These instruments can be combined into stems such as
So, these stems contain the following instruments:
DRUMSincludesDRUMS,PERCS,HATS,CLAPSBASSincludesBASSLEADSincludesMIDS,LEADS,PADSVOCALSincludesVOCALSFXincludesFX,RISER,IMPACT
You can replace both the instrument and the stem. Replace instrument(s):
Replace Instrument(s):
Replace Stems:
Delete Instrument(s):
Delete Stem(s):
All these requests receive track model.
List of Tracks
To get track list use GET with tracks model.
The response contains a list of tracks models.
Use pagination to see all data.
You can also get information about a specific track.
The response contains track model.
Track Store
The track store feature allows you to create a buffer with pre-generated tracks. It works great when you want to get a unique track of the exact duration, mode, and format without long responses. We create a cloud bucket and set up a dedicated generator to speed up the process of receiving files. Mubert creates a number of tracks with one set of parameters and puts them in the bucket. When you use one of these files, a similar track generation starts to fill the buffer.The quantity of files in the bucket depends on the average load of your service. To calculate this we also need to get a list of following parameters from you: mode, duration, bitrate, intensity, format. Please select the values of these parameters and send an email to our manager to continue creating the bucket. Also, you can choose playlists that you want to pre-generate, by default we use all channels.
You will automatically get track from track store, when the track request parameters match the store parameters. Before you start using the track store, make sure it’s enabled under the contract agreement.
Mubert Music Library
We have prepared a library of more than 12,000 tracks created using Mubert artificial intelligence and selected by our music editors.
Parameters
Use GET method to see music library statistics and parameters that you can filter tracks by.
Request
Response
You can also get information on a specific parameter. For example: BPM 120
Response
This means that you can find 315 tracks with BPM 120 in the theme "Сorporate", 12 tracks in the theme "Podcast", 138 tracks in the "Nu Disco" genre and 27 tracks in the genre "Folk".
You can specify several parameters and then logical AND will be applied to them.
Request
Response
In the response you can also see the count of tracks of each duration corresponding to the request BPM 120 AND Genre Nu Disco
Tracks
Use GET method to receive list of tracks.
Request
Response
The response contains a list of tracks models. Use pagination to see all data. You can also use one or more parameters to filter tracks and find the most suitable ones. For example: BPM 120 AND Genre Nu Disco AND Duraton 180
Request
Response
In the response also list of tracks models. Use pagination to see all data.
Swagger
For more technical information you can use swagger: https://music-api.mubert.com/api/v3/swagger
Pricing
Try as low as $49 per month