> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gengen.farm/llms.txt
> Use this file to discover all available pages before exploring further.

# Create dialogue

> Generate multi-speaker audio with Eleven v3 and v4 using the shared audio generation endpoint.

Use `mode: "text_to_dialogue"` with `eleven_v3` or `eleven_v4` to generate a
conversation with multiple speakers. `eleven_v4_turbo` supports single-speaker
Text to Speech only.

Dialogue uses the same [Create audio generation](/api-reference/elevenlabs/create-generation)
endpoint as speech. Set each speaker's `voiceId` in `dialogue`, and omit `prompt`
and `controls.voiceId`.

```bash theme={"dark"}
curl https://gengen.farm/api/gengen/v1/audio/generations \
  --header "Authorization: Bearer $GENGEN_API_KEY" \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: dialogue-example-1' \
  --data '{
    "model": "eleven_v4",
    "mode": "text_to_dialogue",
    "dialogue": [
      { "text": "Welcome to GENGEN!", "voiceId": "voice_george" },
      { "text": "Let us build something together.", "voiceId": "voice_sarah" }
    ],
    "controls": { "outputFormat": "mp3_44100_128" }
  }'
```

Choose voices from the [voice library](/api-reference/elevenlabs/voice-library).
A request supports at most 100 dialogue entries, ten distinct voices, and 2,000
characters in total, including whitespace and speech tags. Supported output
formats are `mp3_44100_128` and `pcm_24000`.

## Estimate and retrieve audio

Send the same request body to [Estimate audio cost](/api-reference/elevenlabs/estimate)
before generation to see the current final USD estimate without generating audio.

Creating an asynchronous generation returns HTTP 202. Use the returned task ID
with [Get audio generation](/api-reference/elevenlabs/get-generation) until the
task reaches a terminal status. Successful output is in `outputs.audios`; polling
renews its URL during the seven-day retention period.

Reuse the same `Idempotency-Key` and request after a timeout. A changed request
under the same key returns 409. Continue polling tasks in reconciliation without
resubmitting. See the [Audio API guide](/api-reference/elevenlabs/overview) for
status, usage, errors, and delivery behavior, or use
[completion webhooks](/api-reference/elevenlabs/create-webhook) to receive results.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.