Beta Suno MIDI Generation API
POSThttps://api.01ai.cloud/suno/midi
Suno MIDI API, retrieve MIDI data from generated music.
Related Products
Suno - 零壹AI
Suno music generation platform, directly interfaces with this API, high-speed and stable availability.
Request Headers
acceptstring
Specify the format of the response returned by the server. If not specified, the default format is `application/json`.
Please select
authorizationstring
Bearer token
Request Body
audio_idstringRequired parameter
The source audio ID for generating MIDI will extract MIDI content based on the existing audio.
callback_urlstring
The callback address used to receive processing results. If not specified, the results will be returned directly in the response body.
asyncboolean
Whether to process in asynchronous mode. When set to `true`, the interface immediately returns `task_id`, without the need to provide `callback_url`, and then the result can be obtained by polling the corresponding task query interface; if `callback_url` is also provided, the result will be pushed to that callback address.
Please select
Response
Success200
Request successful.
Response Body
dataarray
Business data returned by the API.
Array of
statestring
MIDI generation status.
instrumentsarray
Instrument tracks extracted from the audio.
Array of
namestring
Instrument track name.
notesarray
The MIDI notes contained in this instrument track.
Array of
endnumber
Note end time, in seconds.
pitchinteger
MIDI pitch number.
startnumber
Note start time, in seconds.
velocitynumber
Note velocity, with a value range of 0 to 1.
successboolean
A flag indicating whether this request was successful.
task_idstring
The task ID for this request.
trace_idstring
The tracking ID for this request is used for debugging and link tracing.
Example
{
"data": [
{
"state": "complete",
"instruments": [
{
"name": "Bass",
"notes": [
{
"end": 1.5208333333333333,
"pitch": 49,
"start": 1.0260416666666667,
"velocity": 0.8503937007874016
}
]
}
]
}
],
"success": true,
"task_id": "19787138-49e9-413a-8611-156c375aa99f",
"trace_id": "ec232cf9-8b75-42df-a8a3-fe6d7d6fd02e"
}Failure400token_mismatched
Request error, possibly due to missing or invalid parameters.
Response Body
errorobject
codestring
Response error code.
messagestring
Error message of the response.
retryableboolean
Optional boolean field. `true` indicates that after this failure, it is allowed to make another request later using the same parameters; `false` indicates that it should not be retried as-is. When the field is missing, it should not automatically resend based on the HTTP status or error text. When the request has been accepted or the execution result is unclear, the original `task_id` should be queried.
trace_idstring
The tracking ID for this request.
Example
{
"error": {
"code": "token_mismatched",
"message": "The specified token is not matched with API."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}Failure400api_not_implemented
Request error, possibly due to missing or invalid parameters.
Response Body
errorobject
codestring
Response error code.
messagestring
Error message of the response.
retryableboolean
Optional boolean field. `true` indicates that after this failure, it is allowed to make another request later using the same parameters; `false` indicates that it should not be retried as-is. When the field is missing, it should not automatically resend based on the HTTP status or error text. When the request has been accepted or the execution result is unclear, the original `task_id` should be queried.
trace_idstring
The tracking ID for this request.
Example
{
"error": {
"code": "api_not_implemented",
"message": "The API is not implemented."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}Failure400disabled
Request error, possibly due to missing or invalid parameters.
Response Body
errorobject
codestring
Response error code.
messagestring
Error message of the response.
retryableboolean
Optional boolean field. `true` indicates that after this failure, it is allowed to make another request later using the same parameters; `false` indicates that it should not be retried as-is. When the field is missing, it should not automatically resend based on the HTTP status or error text. When the request has been accepted or the execution result is unclear, the original `task_id` should be queried.
trace_idstring
The tracking ID for this request.
Example
{
"error": {
"code": "disabled",
"message": "Your application has been disabled by Ace Data Cloud due to abnormal usage behavior, please contact our support to get more information."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}Failure400bad_request
Request error, possibly due to missing or invalid parameters.
Response Body
errorobject
codestring
Response error code.
messagestring
Error message of the response.
retryableboolean
Optional boolean field. `true` indicates that after this failure, it is allowed to make another request later using the same parameters; `false` indicates that it should not be retried as-is. When the field is missing, it should not automatically resend based on the HTTP status or error text. When the request has been accepted or the execution result is unclear, the original `task_id` should be queried.
trace_idstring
The tracking ID for this request.
Example
{
"error": {
"code": "bad_request",
"message": "model is invalid."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}Failure400no_token
Request error, possibly due to missing or invalid parameters.
Response Body
errorobject
codestring
Response error code.
messagestring
Error message of the response.
retryableboolean
Optional boolean field. `true` indicates that after this failure, it is allowed to make another request later using the same parameters; `false` indicates that it should not be retried as-is. When the field is missing, it should not automatically resend based on the HTTP status or error text. When the request has been accepted or the execution result is unclear, the original `task_id` should be queried.
trace_idstring
The tracking ID for this request.
Example
{
"error": {
"code": "no_token",
"message": "No token specified for the request."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}Failure401invalid_token
Unauthorized, authorization token is invalid or missing.
Response Body
errorobject
codestring
Response error code.
messagestring
Error message of the response.
retryableboolean
Optional boolean field. `true` indicates that after this failure, it is allowed to make another request later using the same parameters; `false` indicates that it should not be retried as-is. When the field is missing, it should not automatically resend based on the HTTP status or error text. When the request has been accepted or the execution result is unclear, the original `task_id` should be queried.
trace_idstring
The tracking ID for this request.
Example
{
"error": {
"code": "invalid_token",
"message": "The specified token is invalid or wrong."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}Failure401token_expired
Unauthorized, authorization token is invalid or missing.
Response Body
errorobject
codestring
Response error code.
messagestring
Error message of the response.
retryableboolean
Optional boolean field. `true` indicates that after this failure, it is allowed to make another request later using the same parameters; `false` indicates that it should not be retried as-is. When the field is missing, it should not automatically resend based on the HTTP status or error text. When the request has been accepted or the execution result is unclear, the original `task_id` should be queried.
trace_idstring
The tracking ID for this request.
Example
{
"error": {
"code": "token_expired",
"message": "token expired."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}Failure401token_mismatched
Unauthorized, authorization token is invalid or missing.
Response Body
errorobject
codestring
Response error code.
messagestring
Error message of the response.
retryableboolean
Optional boolean field. `true` indicates that after this failure, it is allowed to make another request later using the same parameters; `false` indicates that it should not be retried as-is. When the field is missing, it should not automatically resend based on the HTTP status or error text. When the request has been accepted or the execution result is unclear, the original `task_id` should be queried.
trace_idstring
The tracking ID for this request.
Example
{
"error": {
"code": "token_mismatched",
"message": "token and api does not match."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}Failure403used_up
Unauthorized, authorization token is invalid or missing.
Response Body
errorobject
codestring
Response error code.
messagestring
Error message of the response.
retryableboolean
Optional boolean field. `true` indicates that after this failure, it is allowed to make another request later using the same parameters; `false` indicates that it should not be retried as-is. When the field is missing, it should not automatically resend based on the HTTP status or error text. When the request has been accepted or the execution result is unclear, the original `task_id` should be queried.
trace_idstring
The tracking ID for this request.
Failure404no_api
Unauthorized, authorization token is invalid or missing.
Response Body
errorobject
codestring
Response error code.
messagestring
Error message of the response.
retryableboolean
Optional boolean field. `true` indicates that after this failure, it is allowed to make another request later using the same parameters; `false` indicates that it should not be retried as-is. When the field is missing, it should not automatically resend based on the HTTP status or error text. When the request has been accepted or the execution result is unclear, the original `task_id` should be queried.
trace_idstring
The tracking ID for this request.
Failure429too_many_requests
Too many requests, rate limit exceeded.
Response Body
errorobject
codestring
Response error code.
messagestring
Error message of the response.
retryableboolean
Optional boolean field. `true` indicates that after this failure, it is allowed to make another request later using the same parameters; `false` indicates that it should not be retried as-is. When the field is missing, it should not automatically resend based on the HTTP status or error text. When the request has been accepted or the execution result is unclear, the original `task_id` should be queried.
trace_idstring
The tracking ID for this request.
Failure500api_error
Internal server error, an exception occurred on the server side.
Response Body
errorobject
codestring
Response error code.
messagestring
Error message of the response.
retryableboolean
Optional boolean field. `true` indicates that after this failure, it is allowed to make another request later using the same parameters; `false` indicates that it should not be retried as-is. When the field is missing, it should not automatically resend based on the HTTP status or error text. When the request has been accepted or the execution result is unclear, the original `task_id` should be queried.
trace_idstring
The tracking ID for this request.

Integration guide
Shell
Python
JavaScript
Java
Go
PHP
Kind reminder: For streaming requests, the above code may not be fully applicable. Please refer to the integration documentation for changes.
Suno Music Generation
Allow Use General Balance
When 'Allow General Balance' is enabled, the general balance is used automatically if an app's balance is insufficient.

