API REFERENCE
Create a composition plan
On this page
/api/music/planCreate a composition plan from a text prompt. A composition plan is a structured representation of a song — sections, styles, lyrics, and durations — that you can review and tweak before passing to the compose endpoint. This endpoint is free and does not consume credits.
Authentication
x-api-key in header
bearerAuth bearer
Request
curl --request POST \
--url 'https://api.recoupable.dev/api/music/plan' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "string"
}'Request body required
Plan creation parameters
application/json
promptstringrequiredText prompt describing the desired song.
Responses
200Composition plan created successfully+
application/json
planobjectThe composition plan with sections, styles, lyrics, and durations.
Properties for plan
sectionsarray<object>Item properties for sections
namestringSection name (e.g. intro, verse, chorus)
durationnumberSection duration in seconds
stylestringStyle description for this section
lyricsstringLyrics for this section
400Validation failed — invalid or missing request body fields+
application/json
errorstringrequiredError message describing what went wrong.
401Unauthorized — invalid or missing API key+
application/json
errorstringrequiredError message describing what went wrong.
500Internal server error+
application/json
errorstringrequiredError message describing what went wrong.
Full specification
Download the OpenAPI file for complete schemas, constraints, and examples.
Download content.jsonView operation source
{
"description": "Create a composition plan from a text prompt. A composition plan is a structured representation of a song — sections, styles, lyrics, and durations — that you can review and tweak before passing to the compose endpoint. This endpoint is free and does not consume credits.",
"security": [
{
"apiKeyAuth": []
},
{
"bearerAuth": []
}
],
"requestBody": {
"description": "Plan creation parameters",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MusicCreatePlanRequest"
}
}
}
},
"responses": {
"200": {
"description": "Composition plan created successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MusicCreatePlanResponse"
}
}
}
},
"400": {
"description": "Validation failed — invalid or missing request body fields",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MusicErrorResponse"
}
}
}
},
"401": {
"description": "Unauthorized — invalid or missing API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MusicErrorResponse"
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MusicErrorResponse"
}
}
}
}
}
}