Here you can find all the methods and properties of our API.
File Upload
Retrieve a signed URL to upload a file to our temporary server. More info here.
GET /upload
Example Request:
curl --request GET \
--url https://api.music.ai/api/upload \
--header 'Authorization: your-api-key-here'
Example Response:
{
"uploadUrl": "https://storage.googleapis.com/moises/939b7898b3ef?(...)X96cb5",
"downloadUrl": "https://storage.googleapis.com/moises/939b7898b3ef?(...)SSScb5"
}
Jobs
Submit or retrieve a processing job from our servers.
Job Status Types
Every job has a status respresenting its current state:
Status | Description |
---|---|
QUEUED | Awaiting to start |
STARTED | Processing has started |
SUCCEEDED | Everything has completed and the results are ready |
FAILED | There was an error processing your media |
GET /job/:id
Example Request:
curl --request GET \
--url https://api.music.ai/api/job/:id \
--header 'Authorization: your-api-key-here'
Example Response:
{
"id": "2e35babc-91c4-4121-89f4-5a2acf956b28",
"name": "My job 123",
"status": "SUCCEEDED",
"workflow": {
"id": "2ae5eea3-63dd-445e-9a3f-ff0473e82fd2",
"name": "Stems Isolations - Vocals & accompaniments"
},
"workflowParams": {
"inputUrl": "https://your-server.com/audio-input.m4a"
},
"result": {
"vocals": "https://cdn.music.ai/something/vocals.wav",
"accompaniments": "https://cdn.music.ai/something/accompaniments.wav"
},
"metadata": {},
"createdAt": "2022-12-07T19:21:42.170Z",
"startedAt": "2022-12-07T19:21:42.307Z",
"completedAt": "2022-12-07T19:22:00.325Z"
}
GET /job
Paginated job listing endpoint. The result is sorted by creation date.
Available filters through query parameters:
Parameter | Description | Example |
---|---|---|
status | Filters by one or more statuses. Possible values: QUEUED , STARTED , SUCCEEDED , and FAILED . | ?status=QUEUED&status=STARTED |
workflow | Filters by workflows given their slugs. | workflow=audio-encoder&workflow=stem-separation |
batchName | Filters by batch name. | batchName=my-batch |
page | Page number (defaults to 0). | page=1 |
size | Page size (defaults to 100). | size=20 |
Example Request:
curl --request GET \
--url https://api.music.ai/api/job?page=0&size=20 \
--header 'Authorization: your-api-key-here'
Example Response:
[
{
"id": "2e35babc-91c4-4121-89f4-5a2acf956b28",
"name": "My job 123",
"status": "SUCCEEDED",
"workflow": {
"id": "2ae5eea3-63dd-445e-9a3f-ff0473e82fd2",
"name": "Stems Isolations - Vocals & accompaniments"
},
"workflowParams": {
"inputUrl": "https://your-server.com/audio-input.m4a"
},
"result": {
"vocals": "https://cdn.music.ai/something/vocals.wav",
"accompaniments": "https://cdn.music.ai/something/accompaniments.wav"
},
"metadata": {},
"createdAt": "2022-12-07T19:21:42.170Z",
"startedAt": "2022-12-07T19:21:42.307Z",
"completedAt": "2022-12-07T19:22:00.325Z"
},
// ...
]
POST /job
Body schema:
{
name: string
workflow: string
params: { [key: string]: any }
metadata?: { [key: string]: string | number | boolean }
}
name
: Job name for identification purposes;workflow
: Workflow slug;params
: Workflow params;metadata
: Optional metadata for identification purposes.
Example Request:
curl --request POST \
--url https://api.music.ai/api/job \
--header 'Authorization: your-api-key-here' \
--header 'Content-Type: application/json' \
--data '{
"name": "My job 123",
"workflow": "my-workflow-id",
"params": {
"inputUrl": "https://music.ai/demo.ogg"
},
"metadata": {
"user": 123,
}
}'
Example Response:
{
"id": "2e35babc-91c4-4121-89f4-5a2acf956b28"
}
DELETE /job/:id
Example Request:
curl --request DELETE \
--url https://api.music.ai/api/job/:id \
--header 'Authorization: your-api-key-here'
Example Response:
{
"id": "2e35babc-91c4-4121-89f4-5a2acf956b28"
}
Application
Check the information about the current used apiKey/application
GET /application
Example Request:
curl --request GET \
--url https://api.music.ai/api/application \
--header 'Authorization: your-api-key-here'
Example Response:
{
"id": "80b069ab-8410-4cc9-9bfa-1282b97dc1df",
"name": "Default Application"
}