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

# Eleven v3

> Expressive ElevenLabs Eleven v3 text to speech with audio tags through the OpenAI-compatible speech endpoint. $0.12 per 1,000 characters.

`eleven-v3` runs ElevenLabs Eleven v3 text to speech on the OpenAI-compatible speech endpoint. Send up to 5,000 characters with one of 21 premade voices and receive the audio file in the response. Eleven v3 follows audio tags in square brackets, such as `[excited]`, `[whispers]`, or `[laughs]`, so you can direct the delivery line by line.

| Property | Value |
| - | - |
| Model ID | `eleven-v3` |
| Endpoint | `POST /v1/audio/speech` (synchronous) |
| Output | Audio bytes: MP3 (default), Opus, PCM, or WAV |
| Voices | 21 ElevenLabs premade voices, by ID or first name |
| Limits | Up to 5,000 characters per request |
| Billed on | Characters of `input`, including audio tags |
| Price | \$0.12 per 1,000 characters (12 credits) |

Confirm live rates on the [SnapGen models page](https://snapgen.org/models). Failed requests are not charged.

For a conversation between several voices in one file, use
[`eleven-v3-dialogue`](/api-manual/audio/eleven-v3-dialogue). For longer text
per request, use [`eleven-v4`](/api-manual/audio/eleven-v4) (10,000
characters) or [`eleven-flash-v2.5`](/api-manual/audio/eleven-flash-v2-5)
(40,000 characters).

<ParamField body="model" type="string" required>
  Set to `eleven-v3`.
</ParamField>

<ParamField body="input" type="string" required>
  The text to speak, up to 5,000 characters, including audio tags. Newlines
  are allowed; blank text and other control characters are rejected. Each
  character is billed.
</ParamField>

<ParamField body="voice" type="string" required>
  A voice ID or first name from the
  [voice list](/api-reference/audio-speech#voices), for example
  `JBFqnCBsd6RMkjVDRZzb` or `George`. Names are case-insensitive.
</ParamField>

<ParamField body="response_format" type="string" default="mp3">
  `mp3`, `opus`, `pcm`, or `wav`. See
  [Output formats](/api-reference/audio-speech#output-formats).
</ParamField>

<ParamField body="speed" type="number">
  Speaking speed, from `0.7` to `1.2`.
</ParamField>

<ParamField body="language" type="string">
  An ISO 639 language code of two or three lowercase letters, such as `en` or
  `de`. The provider rejects a code the model doesn't support.
</ParamField>

<ParamField body="stability" type="number">
  From `0` to `1`. Lower values give a broader emotional range; higher values
  sound more consistent.
</ParamField>

<ParamField body="similarity_boost" type="number">
  From `0` to `1`. How closely the output follows the original voice.
</ParamField>

<ParamField body="style" type="number">
  From `0` to `1`. Exaggerates the voice's speaking style.
</ParamField>

<ParamField body="use_speaker_boost" type="boolean">
  Boosts similarity to the original speaker.
</ParamField>

<ParamField body="seed" type="integer">
  From `0` to `4294967295`. Makes repeated requests more repeatable, without
  guaranteeing identical audio.
</ParamField>

<ParamField body="previous_text" type="string">
  Up to 5,000 characters that come before `input`, for continuity across
  requests. Not billed.
</ParamField>

<ParamField body="next_text" type="string">
  Up to 5,000 characters that follow `input`, for continuity across requests.
  Not billed.
</ParamField>

<ParamField body="apply_text_normalization" type="string">
  `auto`, `on`, or `off`: whether numbers, dates, and similar text are spelled
  out before speaking.
</ParamField>

## Request

```bash theme={null}
curl https://api.snapgen.org/v1/audio/speech \
  -H "Authorization: Bearer $SNAPGEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "eleven-v3",
    "input": "Welcome back! Today we explore the northern lights.",
    "voice": "JBFqnCBsd6RMkjVDRZzb",
    "response_format": "mp3"
  }' \
  --output speech.mp3
```

The response body is the audio file, with a `Content-Type` that matches
`response_format` (`audio/mpeg` for MP3).

## Direct the delivery with audio tags

Put a tag before the words it should shape. Tags are part of `input`, so they
count toward the 5,000-character limit and are billed like any other text.

```bash theme={null}
curl https://api.snapgen.org/v1/audio/speech \
  -H "Authorization: Bearer $SNAPGEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "eleven-v3",
    "input": "[whispers] The results are in. [excited] We actually did it! [laughs]",
    "voice": "Sarah",
    "stability": 0.5
  }' \
  --output speech.mp3
```

<CodeGroup>
  ```python Python theme={null}
  import os

  from openai import OpenAI

  client = OpenAI(
      api_key=os.environ["SNAPGEN_API_KEY"],
      base_url="https://api.snapgen.org/v1",
  )

  with client.audio.speech.with_streaming_response.create(
      model="eleven-v3",
      voice="Sarah",
      input="[whispers] The results are in. [excited] We actually did it!",
      extra_body={"stability": 0.5},
  ) as response:
      response.stream_to_file("speech.mp3")
  ```

  ```javascript Node.js theme={null}
  const fs = require("node:fs");
  const OpenAI = require("openai");

  async function main() {
    const client = new OpenAI({
      apiKey: process.env.SNAPGEN_API_KEY,
      baseURL: "https://api.snapgen.org/v1",
    });

    const response = await client.audio.speech.create({
      model: "eleven-v3",
      voice: "Sarah",
      input: "[whispers] The results are in. [excited] We actually did it!",
    });

    fs.writeFileSync("speech.mp3", Buffer.from(await response.arrayBuffer()));
  }

  main();
  ```
</CodeGroup>

## Price examples

| Text | Price |
| - | - |
| 100 characters | \$0.012 |
| 1,000 characters | \$0.12 |
| 5,000 characters | \$0.60 |

<Note>
  Synchronous audio endpoints reject `Idempotency-Key`. If a request times
  out, check your Console request logs before you retry. See
  [Text to speech](/api-reference/audio-speech) for the response headers and
  errors.
</Note>
