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

/v1/text-to-dialogue/with-timestamps

ElevenLabs API

Text To Dialogue With Timestamps

Base URL
https://api.elevenlabs.io
Auth
xi-api-key: <ELEVENLABS_API_KEY>
Last verified
2026-09-03 · upstream hash matched
Actions
Agents: curl -H "Accept: text/markdown" this URL
→ 216 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": "string",      "voice_id": "string"    }  ],  "model_id": "eleven_v3",  "language_code": "string",  "settings": {    "stability": 0.5  },  "pronunciation_dictionary_locators": [    {      "pronunciation_dictionary_id": "string",      "version_id": "string"    }  ],  "seed": 0,  "apply_text_normalization": "auto"}'
Get a free ElevenLabs API key → sponsored

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.

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"
    }
  ]
}