create_composition_plan
Generate a composition plan for music generation, defining segments, styles, and timing to guide the music creation process.
Instructions
Create a composition plan for music generation. Usage of this endpoint does not cost any credits but is subject to rate limiting depending on your tier. Composition plans can be used when generating music with the compose_music tool.
The returned plan shape depends on model_id:
- music_v2 (default): `{"chunks": [GenerationChunk | AudioRefChunk, ...]}`. Each GenerationChunk has `text`, `duration_ms`, `positive_styles`, `negative_styles`, `context_adherence` and optional `conditioning_ref` + `condition_strength`. AudioRefChunks reference a stored song via `song_id` and `range: {start_ms, end_ms}` for inpainting.
- music_v1: `{"positive_global_styles": [...], "negative_global_styles": [...], "sections": [...]}`.
Args:
prompt: Prompt to create a composition plan for
music_length_ms: The length of the composition plan to generate in milliseconds. Must be between 10000ms and 300000ms. Optional - if not provided, the model will choose a length based on the prompt.
source_composition_plan: An optional composition plan dict to use as a source for the new composition plan. Should match the shape of the model_id you request.
model_id: Which music model to plan for. One of "music_v1" or "music_v2". Defaults to "music_v2".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | ||
| music_length_ms | No | ||
| source_composition_plan | No | ||
| model_id | No | music_v2 |