AGTCloud API Docs
GuidesAPI ReferenceIntegrations and resourcesUpdate and help
Music generationMiniMax Music

Music and cover generation

Generate music or cover results synchronously with the MiniMax Music protocol.

This API generates music or a cover within a single synchronous HTTP request. A standard request can return a temporary audio URL or Hex-encoded audio content; a streaming request returns JSON audio chunks line by line.

For a streaming result, concatenate the Hex content in data.audio in the order received, then decode and save it after receiving data.status=2. Even when the HTTP status is 200, check base_resp.status_code; only 0 indicates business-level success.

POST/v1/music_generation

Generate music or a cover synchronously. When stream=true, the response returns JSON audio chunks line by line over the same HTTP connection and does not create an asynchronous task.

In a streaming result, data.audio contains Hex audio chunks that must be concatenated in the order received. data.status=2 indicates that generation is complete.

Streaming responses always return Hex audio chunks. When stream=true, the current gateway may ignore output_format=url and still return Hex chunks.

Authorization

bearerAuth
AuthorizationBearer <token>

Use Bearer your-api-key in the Authorization Header.

In: header

Request Body

application/json

Music or cover generation parameters. Conditional requirements depend on the generation mode.

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json