---
title: "Stream Composed Music With A Detailed Response"
method: POST
path: "/v1/music/detailed/stream"
tags: ["music-generation"]
---

# Stream Composed Music With A Detailed Response

`POST /v1/music/detailed/stream`

Stream a song and its detailed metadata using Server-Sent Events (SSE).

## Query parameters

- `output_format` 'auto' | 'mp3_48000_128' | 'mp3_48000_192' | 'mp3_48000_240' | 'mp3_48000_320' | 'mp3_22050_32' | 'mp3_24000_48' | 'mp3_44100_32' | 'mp3_44100_64' | 'mp3_44100_96' | 'mp3_44100_128' | 'mp3_44100_192' | 'pcm_8000' | 'pcm_16000' | 'pcm_22050' | 'pcm_24000' | 'pcm_32000' | 'pcm_44100' | 'pcm_48000' | 'ulaw_8000' | 'alaw_8000' | 'opus_48000_32' | 'opus_48000_64' | 'opus_48000_96' | 'opus_48000_128' | 'opus_48000_192'

## Headers

- `xi-api-key` string, nullable — Your API key. This is required by most endpoints to access our API programmatically. You can view your xi-api-key using the 'Profile' tab on the website.

## Request body

- BodyStreamComposedMusicWithADetailedResponseV1MusicDetailedStreamPost
  - `prompt` string, nullable — A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`.
  - `generation_mode` 'track' | 'loop' | 'ambience' | 'video_to_music', nullable — Optional generation mode hint for prompt-based music generation. Can only be used with `prompt`.
  - `music_prompt` object, nullable — Composition plan for the `music_v1` model. Using this field with any other model will result in an error.
    - `positive_global_styles` string[], required — The styles and musical directions that should be present in the entire song. Use English language for best result.
    - `negative_global_styles` string[], required — The styles and musical directions that should not be present in the entire song. Use English language for best result.
    - `sections` SongSection[], required — The sections of the song.
      - `section_name` string, required — The name of the section. Must be between 1 and 100 characters.
      - `positive_local_styles` string[], required — The styles and musical directions that should be present in this section. Use English language for best result.
      - `negative_local_styles` string[], required — The styles and musical directions that should not be present in this section. Use English language for best result.
      - `duration_ms` integer, required — The duration of the section in milliseconds. Must be between 3000ms and 120000ms.
      - `lines` string[], required — The lyrics of the section. Max 30 lines per section and max 200 characters per line.
      - `source_from` SectionSource
        - `song_id` string, required — The ID of the song to source the section from. You can find the song ID in the response headers when you generate a song.
        - `range` TimeRange, required
          - `start_ms` integer, required
          - `end_ms` integer, required
        - `negative_ranges` TimeRange[] — The ranges to exclude from the 'range'.
          - `start_ms` integer, required
          - `end_ms` integer, required
  - `lyrics_text` string, nullable — The lyrics text to use for the generation.
  - `composition_plan` union — A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`.
    - MusicPrompt — Composition plan for the `music_v1` model. Using this field with any other model will result in an error.
      - `positive_global_styles` string[], required — The styles and musical directions that should be present in the entire song. Use English language for best result.
      - `negative_global_styles` string[], required — The styles and musical directions that should not be present in the entire song. Use English language for best result.
      - `sections` SongSection[], required — The sections of the song.
        - `section_name` string, required — The name of the section. Must be between 1 and 100 characters.
        - `positive_local_styles` string[], required — The styles and musical directions that should be present in this section. Use English language for best result.
        - `negative_local_styles` string[], required — The styles and musical directions that should not be present in this section. Use English language for best result.
        - `duration_ms` integer, required — The duration of the section in milliseconds. Must be between 3000ms and 120000ms.
        - `lines` string[], required — The lyrics of the section. Max 30 lines per section and max 200 characters per line.
        - `source_from` SectionSource
          - `song_id` string, required — The ID of the song to source the section from. You can find the song ID in the response headers when you generate a song.
          - `range` TimeRange, required
            - `start_ms` integer, required
            - `end_ms` integer, required
          - `negative_ranges` TimeRange[] — The ranges to exclude from the 'range'.
            - `start_ms` integer, required
            - `end_ms` integer, required
    - CompositionPlan — Composition plan for the `music_v2` model. Using this field with any other model will result in an error.
      - `chunks` union[], required — The chunks that make up the generation.
        - union
          - GenerationChunkInput
            - `text` string, required — The text config to be generated for this chunk. Can contain section name in square brackets, e.g. [Verse 1], lyrics lines, and inline directions in curly braces, e.g. {scratching}.
            - `duration_ms` integer, required — The duration of the chunk in milliseconds. Must be between 3000ms and 120000ms.
            - `positive_styles` string[], required — The styles and musical directions that should be present in this chunk. Use English language for best results. The styles for the first chunk are the most important as they set the overall tone and genre. Styles for subsequent chunks can be used to add nuance, progression, emphasis, or change the direction of the song. Aim to have at least 6-7 styles in early chunks until the direction is established. Generic styles like 'great production quality' are good default styles to append to the list.
            - `negative_styles` string[] — The styles and musical directions that should not be present in this chunk. Use English language for best results. Leaving empty is a good default, only use this field if you want to explicitly avoid a particular style or direction.
            - `context_adherence` 'low' | 'medium' | 'high' — How much the model adheres to the context of its surrounding chunks. Low adherence means the model can deviate from the context and be more creative. High adherence means the model will be more consistent with the context.
            - `conditioning_ref` AudioRefChunk
              - …
            - `condition_strength` 'low' | 'medium' | 'high' | 'xhigh', nullable — How strongly the model adheres to the conditioning reference. Low strength means the model will be more creative and deviate from the reference. High strength means the model will be more consistent with the reference.
          - AudioRefChunk
            - `song_id` string, required — The ID of the song to source the chunk from. You can find the song ID in the response headers when you generate a song.
            - `range` TimeRange, required
              - …
  - `music_length_ms` integer, nullable — The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt.
  - `model_id` 'music_v1' | 'music_v2' — The model to use for the generation.
  - `seed` integer, nullable — Random seed to initialize the music generation process. Providing the same seed with the same parameters can help achieve more consistent results, but exact reproducibility is not guaranteed and outputs may change across system updates. Cannot be used in conjunction with prompt.
  - `force_instrumental` boolean — If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`.
  - `finetune_id` string, nullable — The ID of the finetune to use for the generation
  - `finetune_strength` number — How strongly the finetune influences the generation. Defaults to 1.0 (full strength). Lower values soften the influence of the finetune, leaving more room for prompt-level steering. Only meaningful when `finetune_id` is also provided.
  - `use_phonetic_names` boolean — If true, proper names in the prompt will be phonetically spelled in the lyrics for better pronunciation by the music model. The original names will be restored in word timestamps.
  - `store_for_inpainting` boolean — Whether to store the generated song for inpainting.
  - `with_timestamps` boolean — Whether to return the timestamps of the words in the generated song.

## Response `200`

Server-Sent Events for composition plan, song metadata, audio chunks with optional word timestamps, and completion.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/elevenlabs/apis/elevenlabs-api-documentation.md) · [All operations](https://skmtc.net/elevenlabs/apis/elevenlabs-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elevenlabs/elevenlabs-api-documentation/versions/e77a0a530a82/schema)
