Create composition plan

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.

Headers

xi-api-keystringOptional

Query parameters

enable_loggingstringOptional

When enable_logging is set to false zero retention mode will be used for the request. Zero retention mode may only be used by enterprise customers.

Request

This endpoint expects an object.
promptstringRequired<=4100 characters
A simple text prompt to compose a plan from.
music_length_msinteger or nullOptional3000-600000

The length of the composition plan to generate in milliseconds. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt.

source_composition_planobject or nullOptional
An optional composition plan to use as a source for the new composition plan.
model_idenumOptionalDefaults to music_v1
The model to use for the generation.
Allowed values:

Response

Successful Response
MusicPromptobject

Composition plan for the music_v1 model. Using this field with any other model will result in an error.

OR
CompositionPlanobject

Composition plan for the music_v2 and music_v2_5 models. Using this field with any other model will result in an error.

Errors

422
Unprocessable Entity Error