Skip to content

Compose Track

Shows how to start an asynchronous composition task from a natural-language prompt and receive the task_id to poll for results.

This example assumes using Beatoven; is in scope and apiKey contains your Beatoven API key.

1
2
3
4
5
6
7
8
9
// Beatoven composition is asynchronous. POST /api/v1/tracks/compose returns a task_id
// that you then poll via GET /api/v1/tasks/{task_id} until status is "composed".

using var client = new BeatovenClient(apiKey);

var response = await client.Tracks.ComposeTrackAsync(
    prompt: new ComposeTrackPrompt { Text = "30 seconds peaceful lo-fi chill hop track" },
    format: ComposeTrackFormat.Mp3,
    looping: false);