Base URL: https://public-api.beatoven.ai
Beatoven.ai API uses an API token based authentication (using Bearer authentication method). With each request, you need to include your API token as a bearer token in the Authorization
request header. For example, if your API token is qIN5iSz0CrGcFi0Ic8pGH3k9_iq6BSpC
, then include the following header in each API request -
Authorization: Bearer qIN5iSz0CrGcFi0Ic8pGH3k9_iq6BSpC
All POST
endpoints accept a json body, so please include content-type: application/json
in your requests.
Before composing a track, you'll need to create/initialize a track.
Endpoint
POST /api/v1/tracks
Payload Example
This example request body will create a new track with the prompt specified in the body.
{
"prompt": {
"text": "30 seconds peaceful lo-fi chill hop track"
}
}
On successful creation, you'll get a track object in response.
Example
{
"status": "created",
"tracks": ["ccb84650-7b4a-4d00-9f80-8a6427ca21aa"]
}
Description
tracks
: This is the list of track IDs created. Currently, there will be only one track in this list
Once a track has been initialized, you can use the track ID and compose API to compose the track.
Endpoint
POST /api/v1/tracks/compose/<track_id>
Arguments
track_id
: Track ID returned in the response of the track creation request.
Payload
{
"format": "wav",
"looping": false
}
Description
format
: format of the generated assets. Can be chosen asmp3
,aac
andwav
. Default iswav
looping
: control the extent of looping in the track. Settrue
for higher amount of looping. The default value isfalse
If the composition request succeeds, an asynchronous process will begin and you'll be delivered a task ID in the success response.
Example:
{
"status": "started",
"task_id": "ccb84650-7b4a-4d00-9f80-8a6427ca21aa_1"
}
Once a composition task has started, you can query the progress of the task using the status request.
Endpoint
GET /api/v1/tasks/<task_id>
Arguments
task_id
: Task ID returned in the response of the composition request.
Example
{
"status": "composed",
"meta": {
"project_id": "3ade3151-372d-4ac8-b1ef-866a67ef0875",
"track_id": "ccb84650-7b4a-4d00-9f80-8a6427ca21aa",
"prompt": {
"text": "30 seconds peaceful lo-fi chill hop track"
},
"version": 1,
"track_url":"<url-of-the-composed-track",
"stems_url": {
"bass": "<url-of-the-bass-track>",
"chords": "<url-of-the-chords-track>",
"melody": "<url-of-the-melody-track>",
"percussion": "<url-of-the-percussion-track>"
}
}
}
Description
status
: The value can be one of the following -
composing
: The task has been put in the queuerunning
: The task has started runningcomposed
: The composition task has finished and the generated assets are available