Music quickstart
This guide will show you how to generate music with Eleven Music.
Using the Eleven Music API
Create an API key
Create an API key in the dashboard here, which you’ll use to securely access the API.
Store the key as a managed secret and pass it to the SDKs either as a environment variable via an .env
file, or directly in your app’s configuration depending on your preference.
Composition plans
A composition plan is a JSON object that describes the music you want to generate in finer detail. It can then be used to generate music with Eleven Music.
Using a plan is optional, but it can be used to generate more complex music by giving you more granular control over each section of the generation.
Generating a composition plan
A composition plan can be generated from a prompt by using the API.
The above will generate a composition plan similar to the following:
Using a composition plan
A composition plan can be used to generate music by passing it to the compose
method.
Generating music with details
For each music generation a composition plan is created from the prompt. You can opt to retrieve this plan by using the detailed response endpoint.
Next steps
Explore the API reference for more information on the Music API and its options.