# Create a composition plan

Source: https://recoupable.dev/docs/api-reference/complete/content/post-music-plan

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.

## POST /api/music/plan

Full OpenAPI specification: https://recoupable.dev/docs/spec/content.json

## Authentication

This operation requires one of the security alternatives in the specification below. Security scheme definitions are included where present in the published specification.

[Authentication guide](https://recoupable.dev/docs/authentication)

## Operation and referenced schemas

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Recoup API - Content",
    "description": "API documentation for the Recoup platform - an AI agent platform for the music industry",
    "license": {
      "name": "MIT"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.recoupable.dev"
    }
  ],
  "paths": {
    "/api/music/plan": {
      "post": {
        "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"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "MusicCreatePlanRequest": {
        "type": "object",
        "required": [
          "prompt"
        ],
        "description": "Parameters for creating a composition plan from a text prompt.",
        "properties": {
          "prompt": {
            "type": "string",
            "description": "Text prompt describing the desired song."
          }
        }
      },
      "MusicCreatePlanResponse": {
        "type": "object",
        "description": "A structured composition plan that can be reviewed, edited, and passed to the compose endpoint.",
        "properties": {
          "plan": {
            "type": "object",
            "description": "The composition plan with sections, styles, lyrics, and durations.",
            "properties": {
              "sections": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "Section name (e.g. intro, verse, chorus)"
                    },
                    "duration": {
                      "type": "number",
                      "description": "Section duration in seconds"
                    },
                    "style": {
                      "type": "string",
                      "description": "Style description for this section"
                    },
                    "lyrics": {
                      "type": "string",
                      "description": "Lyrics for this section"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "MusicErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "description": "Error response from a music endpoint.",
        "properties": {
          "error": {
            "type": "string",
            "description": "Error message describing what went wrong."
          }
        }
      }
    },
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Your Recoup API key. [Learn more](/quickstart#api-keys)."
      },
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
```
