API REFERENCE
Generate Music
On this page
/api/musicStart a song generation with MiniMax Music 3. Generation runs in the background and takes roughly one to two minutes, so this returns 202 immediately with a pending generation. Poll Get Music Generation until status is completed or failed; audio_url is populated on completion. Credits are checked before the model is called and deducted only when a generation completes, so a failed generation is never charged.
Authentication
x-api-key in header
bearerAuth bearer
Request
curl --request POST \
--url 'https://api.recoupable.dev/api/music' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "Genre: acoustic pop. BPM: 96. Key: C major. Warm and intimate, building gently into the chorus.",
"lyrics": "[verse]\nMorning light filtering through the pine\n[chorus]\nSoftly the world begins to breathe"
}'Request body required
application/json
promptstringrequiredMusic description: style, mood, vocals, instrumentation and arrangement.
lyricsstringrequiredThe lyrics to sing. Structure tags such as [intro], [verse], [chorus] and [outro] must each be on their own line; text on the same line as a leading tag is dropped by the model.
durationnumberUpper bound on the generated audio length in seconds. The model may stop earlier; the actual length comes back as duration_seconds.
Default: 60
minimum: 10 · maximum: 300
seedintegerSeed for reproducibility. Omit for a random seed.
num_inference_stepsintegerFlow-matching steps per denoising chunk. More steps improve quality at the cost of speed.
Default: 30
minimum: 1 · maximum: 100
guidance_scalenumberClassifier-free guidance scale of the flow-matching stage.
Default: 1.7
minimum: 0 · maximum: 20
account_idstringOptional. Generate on behalf of another account you can access (self, shared organization, or admin). Defaults to the calling account. Organizations are accounts, so this is also how an organization generation is scoped: send the organization's account id.
format: uuid
Responses
202Generation accepted and queued.+
Locationresponse headerURL of the created generation.
application/json
statusstring · enumStatus of the request
Values: "success"
generationobjectOne music generation.
Properties for generation
statusstring · enumLifecycle phase. pending until the workflow picks it up, processing while fal is rendering, then completed or failed.
Values: "pending", "processing", "completed", "failed"
promptstringThe music description the song was generated from.
lyricsstringThe lyrics the song was generated from.
modelstringThe generating model.
duration_secondsnumber | nullActual length of the generated audio. Null until completed; may be shorter than requested.
audio_urlstring | nullPlayable audio URL. Null until the generation completes.
error_messagestring | nullWhy the generation failed. Null unless status is failed.
created_atstringWhen the generation was created.
format: date-time
updated_atstringWhen the generation last changed.
format: date-time
400Validation failed. missing_fields names the first offending field.+
application/json
statusstring · enumrequiredAlways error
Values: "error"
missing_fieldsarray<one of>JSON path segments to the first field that failed validation, e.g. ["lyrics"]
Item properties for missing_fields
oneOf · string 1
string
oneOf · integer 2
integer
errorstringrequiredHuman-readable error message
401Unauthorized. Provide exactly one of x-api-key or Authorization: Bearer.+
application/json
statusstring · enumrequiredAlways error
Values: "error"
missing_fieldsarray<one of>JSON path segments to the first field that failed validation, e.g. ["lyrics"]
Item properties for missing_fields
oneOf · string 1
string
oneOf · integer 2
integer
errorstringrequiredHuman-readable error message
402Insufficient credits. No generation is created and the model is not called.+
application/json
statusstring · enumrequiredAlways error
Values: "error"
missing_fieldsarray<one of>JSON path segments to the first field that failed validation, e.g. ["lyrics"]
Item properties for missing_fields
oneOf · string 1
string
oneOf · integer 2
integer
errorstringrequiredHuman-readable error message
403Access denied to the specified account_id or organization_id.+
application/json
statusstring · enumrequiredAlways error
Values: "error"
missing_fieldsarray<one of>JSON path segments to the first field that failed validation, e.g. ["lyrics"]
Item properties for missing_fields
oneOf · string 1
string
oneOf · integer 2
integer
errorstringrequiredHuman-readable error message
500Internal server error.+
application/json
statusstring · enumrequiredAlways error
Values: "error"
missing_fieldsarray<one of>JSON path segments to the first field that failed validation, e.g. ["lyrics"]
Item properties for missing_fields
oneOf · string 1
string
oneOf · integer 2
integer
errorstringrequiredHuman-readable error message
Full specification
Download the OpenAPI file for complete schemas, constraints, and examples.
Download content.jsonView operation source
{
"summary": "Generate music",
"description": "Start a song generation with MiniMax Music 3. Generation runs in the background and takes roughly one to two minutes, so this returns **202** immediately with a `pending` generation. Poll [Get Music Generation](/api-reference/music/get) until `status` is `completed` or `failed`; `audio_url` is populated on completion. Credits are checked before the model is called and deducted only when a generation completes, so a failed generation is never charged.",
"security": [
{
"apiKeyAuth": []
},
{
"bearerAuth": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MusicGenerationRequest"
}
}
}
},
"responses": {
"202": {
"description": "Generation accepted and queued.",
"headers": {
"Location": {
"schema": {
"type": "string"
},
"description": "URL of the created generation."
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MusicGenerationCreateResponse"
}
}
}
},
"400": {
"description": "Validation failed. `missing_fields` names the first offending field.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MusicGenerationErrorResponse"
}
}
}
},
"401": {
"description": "Unauthorized. Provide exactly one of `x-api-key` or `Authorization: Bearer`.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MusicGenerationErrorResponse"
}
}
}
},
"402": {
"description": "Insufficient credits. No generation is created and the model is not called.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MusicGenerationErrorResponse"
}
}
}
},
"403": {
"description": "Access denied to the specified `account_id` or `organization_id`.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MusicGenerationErrorResponse"
}
}
}
},
"500": {
"description": "Internal server error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MusicGenerationErrorResponse"
}
}
}
}
}
}