apicheats.dev elevenlabs/llms.txt Raw .md
POST

POST /v1/text-to-dialogue/with-timestamps — ElevenLabs API

ElevenLabs API

Text To Dialogue With Timestamps

Base URL
https://api.elevenlabs.io
Auth
xi-api-key: <ELEVENLABS_API_KEY>
Last verified
2026-10-20 · upstream hash matched
Actions Try in browser→
Agents: curl -H "Accept: text/markdown" this URL
→ 234 tokens · Vary: Accept

Critical gotchas

Authentication uses the non-standard xi-api-key header, not Authorization: Bearer. Sending a Bearer token returns HTTP 401.

Text-to-speech responses are raw binary audio, not JSON. Write the body to a file (--output speech.mp3) rather than parsing it.

cURL

curl -X POST 'https://api.elevenlabs.io/v1/text-to-dialogue/with-timestamps?output_format=mp3_44100_128&enable_logging=true' \  -H "xi-api-key: $ELEVENLABS_API_KEY" \  -H 'Content-Type: application/json' \  -d '{  "inputs": [    {      "text": "example-text",      "voice_id": "example-voice-id"    }  ],  "model_id": "eleven_v3",  "language_code": "example-language-code",  "settings": {    "stability": 0.5  },  "pronunciation_dictionary_locators": [    {      "pronunciation_dictionary_id": "example-pronunciation-dictionary-id",      "version_id": "example-version-id"    }  ],  "seed": 0,  "apply_text_normalization": "auto",  "use_pvc_as_ivc": true,  "previous_request_ids": [    "example-previous-request-ids"  ],  "next_request_ids": [    "example-next-request-ids"  ],  "previous_text": "example-previous-text",  "future_text": "example-future-text",  "audio_effects": {    "filter_preset_id": "example-filter-preset-id",    "distance": 0,    "environment_id": "example-environment-id",    "background_noise_id": "example-background-noise-id",    "send_level": 1,    "pan": 0  }}'

Parameters

Name In Type Required Description
output_format query string No Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM and WAV formats with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
enable_logging query boolean No When enable_logging is set to false zero retention mode will be used for the request. This will mean history features are unavailable for this request, including request stitching. Zero retention mode may only be used by enterprise customers.
inputs body object[] Yes A list of dialogue inputs, each containing text and a voice ID which will be converted into speech. The maximum number of unique voice IDs is 10. For reliable generation, keep the total character count across all `inputs[].text` values at or below 2,000 characters per request. Longer requests can terminate early in streaming responses or return a validation error.
model_id body string No Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property.
language_code body string No Language code (ISO 639-1) used to enforce a language for the model and text normalization. If the model does not support the provided language code, it will be ignored. This parameter is not supported for multilingual_v2 models.
settings body object No Settings controlling the dialogue generation.
pronunciation_dictionary_locators body object[] No A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request
seed body integer No If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295.
apply_text_normalization body string No This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped.
use_pvc_as_ivc body boolean No Whether to use the IVC version of a professional voice. This may improve expressiveness and reduce latency.
previous_request_ids body string[] No A list of request_ids of dialogue generations that came before this one. Used to condition the model for continuity when splitting a large task into multiple requests. A maximum of 3 request_ids can be sent. The last request_id is the audio which is closest to the current request. Not supported by every model.
next_request_ids body string[] No A list of request_ids of dialogue generations that come after this one. Useful for maintaining continuity when regenerating a clip in the middle of a sequence. A maximum of 3 request_ids can be sent. The first request_id is the audio which is closest to the current request. Not supported by every model.
previous_text body string No The text that comes immediately before this generation, used to condition the model for prosodic continuity. A maximum of 100 characters can be sent. Not supported by every model.
future_text body string No The text that comes immediately after this generation, used to condition the model for prosodic continuity. A maximum of 100 characters can be sent. Not supported by every model.
audio_effects body object No Audio effects applied to the generated audio. Unknown IDs return 404 with `param` naming the field. Reverb (`environment_id` with `send_level` above 0) and a non-zero `pan` produce stereo audio and are rejected with 400 for `ulaw_*`, `alaw_*`, and `pcm_*` output formats. Effects don't change the cost of the request.

Response 200 OK

{
  "alignment": {
    "character_end_times_seconds": [
      0.1,
      0.2,
      0.3,
      0.4,
      0.5,
      0.6,
      0.7
    ],
    "character_start_times_seconds": [
      0,
      0.1,
      0.2,
      0.3,
      0.4,
      0.5,
      0.6
    ],
    "characters": [
      "H",
      "e",
      "l",
      "l",
      "o",
      "H",
      "i"
    ]
  },
  "audio_base64": "base64_encoded_audio_string",
  "normalized_alignment": {
    "character_end_times_seconds": [
      0.1,
      0.2,
      0.3,
      0.4,
      0.5,
      0.6,
      0.7
    ],
    "character_start_times_seconds": [
      0,
      0.1,
      0.2,
      0.3,
      0.4,
      0.5,
      0.6
    ],
    "characters": [
      "H",
      "e",
      "l",
      "l",
      "o",
      "H",
      "i"
    ]
  },
  "voice_segments": [
    {
      "character_end_index": 5,
      "character_start_index": 0,
      "dialogue_input_index": 0,
      "end_time_seconds": 0.5,
      "start_time_seconds": 0,
      "voice_id": "21m00Tcm4TlvDq8ikWAM"
    },
    {
      "character_end_index": 7,
      "character_start_index": 5,
      "dialogue_input_index": 1,
      "end_time_seconds": 0.7,
      "start_time_seconds": 0.5,
      "voice_id": "VEDscrYI8uIMttlO2Ztu"
    }
  ]
}
Get a free ElevenLabs API key → sponsored

Affiliate link - we may earn a commission, at no extra cost to you.