# ElevenLabs Text To Voice [Design]

> Design voices using Eleven-V3 from ElevenLabs!


## Overview

- **Endpoint**: `https://fal.run/fal-ai/elevenlabs/text-to-voice/design/eleven-v3`
- **Model ID**: `fal-ai/elevenlabs/text-to-voice/design/eleven-v3`
- **Category**: text-to-audio
- **Kind**: inference
**Tags**: text-to-audio



## Pricing

You will be billed for **$0.1** per **1000** characters that the generated voice has **performed**. The performed text is `text` from your input if you have given it, or `text` from the response if you chose to autogenerate it.

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`prompt`** (`string`, _required_):
  Description to use for the created voice.
  - Examples: "A scary old and haggard witch who is sneaky and menacing. She has a croaky, harsh, shrill, high-pitch voice that cackles."

- **`text`** (`string`, _optional_):
  The text that will be voiced by the created voice. If not provided `auto_generate_text` must be enabled.

- **`auto_generate_text`** (`boolean`, _optional_):
  Whether to automatically generate a text suitable for the voice description. If text is provided, this field must be disabled. Default value: `true`
  - Default: `true`
  - Examples: true

- **`loudness`** (`float`, _optional_):
  Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS. Default value: `0.5`
  - Default: `0.5`
  - Range: `-1` to `1`

- **`seed`** (`integer`, _optional_):
  Random number that controls the voice generation. Same seed with same inputs produces same voice.

- **`guidance_scale`** (`float`, _optional_):
  Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale. Default value: `5`
  - Default: `5`
  - Range: `0` to `100`

- **`audio_url`** (`string`, _optional_):
  Reference audio to use for the voice generation.

- **`prompt_strength`** (`float`, _optional_):
  Controls the balance of prompt versus reference audio when generating voice samples. 0 means almost no prompt influence, 1 means almost no reference audio influence. Only supported when providing reference audio.
  - Range: `0` to `1`

- **`output_format`** (`OutputFormatEnum`, _optional_):
  Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Default value: `"mp3_44100_128"`
  - Default: `"mp3_44100_128"`
  - Options: `"mp3_22050_32"`, `"mp3_44100_32"`, `"mp3_44100_64"`, `"mp3_44100_96"`, `"mp3_44100_128"`, `"mp3_44100_192"`, `"pcm_8000"`, `"pcm_16000"`, `"pcm_22050"`, `"pcm_24000"`, `"pcm_44100"`, `"pcm_48000"`, `"ulaw_8000"`, `"alaw_8000"`, `"opus_48000_32"`, `"opus_48000_64"`, `"opus_48000_96"`, `"opus_48000_128"`, `"opus_48000_192"`

- **`sync_mode`** (`boolean`, _optional_):
  If `True`, the media will be returned as a data URI and the output data won't be available in the request history.
  - Default: `false`

- **`voice_name`** (`string`, _optional_):
  Name to use for the saved voice. If omitted, a name is generated automatically.



**Required Parameters Example**:

```json
{
  "prompt": "A scary old and haggard witch who is sneaky and menacing. She has a croaky, harsh, shrill, high-pitch voice that cackles."
}
```

**Full Example**:

```json
{
  "prompt": "A scary old and haggard witch who is sneaky and menacing. She has a croaky, harsh, shrill, high-pitch voice that cackles.",
  "auto_generate_text": true,
  "loudness": 0.5,
  "guidance_scale": 5,
  "output_format": "mp3_44100_128"
}
```


### Output Schema

The API returns the following output format:

- **`text`** (`string`, _required_):
  The text voiced by the created voice.
  - Examples: "[cackles] Heh heh heh... Well now, what have we here? Lost, little one? Don't you worry your pretty head. I can help you find your way. [short pause] Just a small price to pay, of course. Everything has a price, doesn't it? Come closer, my dear. Let's make a deal. Heh heh heh..."

- **`previews`** (`list<VoicePreview>`, _required_):
  A list of audio previews generated with the created voice.
  - Array of VoicePreview
  - Examples: [{"duration_seconds":32.7603125,"media_type":"audio/mpeg","audio":{"file_name":"preview0.mp3","file_size":524165,"url":"https://storage.googleapis.com/falserverless/example_outputs/elevenlabs/text-to-voice/design/preview0.mp3","content_type":"audio/mpeg"},"generated_voice_id":"XCVVVs8LsbGm09bualZo"},{"duration_seconds":33.570125,"media_type":"audio/mpeg","audio":{"file_name":"preview1.mp3","file_size":537122,"url":"https://storage.googleapis.com/falserverless/example_outputs/elevenlabs/text-to-voice/design/preview1.mp3","content_type":"audio/mpeg"},"generated_voice_id":"sQIDgd80L1zcoVctSUeS"},{"duration_seconds":29.3121875,"media_type":"audio/mpeg","audio":{"file_name":"preview2.mp3","file_size":468995,"url":"https://storage.googleapis.com/falserverless/example_outputs/elevenlabs/text-to-voice/design/preview2.mp3","content_type":"audio/mpeg"},"generated_voice_id":"qWwaGEJvfuaQclJj45Nj"}]

- **`seed`** (`integer`, _required_):
  Random seed for reproducibility.
  - Examples: 1352814518

- **`voice_id`** (`string`, _optional_):
  The ID of the saved voice.
  - Examples: "2ZagUwA5RiKZmn9KaEe5"



**Example Response**:

```json
{
  "text": "[cackles] Heh heh heh... Well now, what have we here? Lost, little one? Don't you worry your pretty head. I can help you find your way. [short pause] Just a small price to pay, of course. Everything has a price, doesn't it? Come closer, my dear. Let's make a deal. Heh heh heh...",
  "previews": [
    {
      "duration_seconds": 32.7603125,
      "media_type": "audio/mpeg",
      "audio": {
        "file_name": "preview0.mp3",
        "file_size": 524165,
        "url": "https://storage.googleapis.com/falserverless/example_outputs/elevenlabs/text-to-voice/design/preview0.mp3",
        "content_type": "audio/mpeg"
      },
      "generated_voice_id": "XCVVVs8LsbGm09bualZo"
    },
    {
      "duration_seconds": 33.570125,
      "media_type": "audio/mpeg",
      "audio": {
        "file_name": "preview1.mp3",
        "file_size": 537122,
        "url": "https://storage.googleapis.com/falserverless/example_outputs/elevenlabs/text-to-voice/design/preview1.mp3",
        "content_type": "audio/mpeg"
      },
      "generated_voice_id": "sQIDgd80L1zcoVctSUeS"
    },
    {
      "duration_seconds": 29.3121875,
      "media_type": "audio/mpeg",
      "audio": {
        "file_name": "preview2.mp3",
        "file_size": 468995,
        "url": "https://storage.googleapis.com/falserverless/example_outputs/elevenlabs/text-to-voice/design/preview2.mp3",
        "content_type": "audio/mpeg"
      },
      "generated_voice_id": "qWwaGEJvfuaQclJj45Nj"
    }
  ],
  "seed": 1352814518,
  "voice_id": "2ZagUwA5RiKZmn9KaEe5"
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/elevenlabs/text-to-voice/design/eleven-v3 \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "prompt": "A scary old and haggard witch who is sneaky and menacing. She has a croaky, harsh, shrill, high-pitch voice that cackles."
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "fal-ai/elevenlabs/text-to-voice/design/eleven-v3",
    arguments={
        "prompt": "A scary old and haggard witch who is sneaky and menacing. She has a croaky, harsh, shrill, high-pitch voice that cackles."
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("fal-ai/elevenlabs/text-to-voice/design/eleven-v3", {
  input: {
    prompt: "A scary old and haggard witch who is sneaky and menacing. She has a croaky, harsh, shrill, high-pitch voice that cackles."
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);
```


## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/fal-ai/elevenlabs/text-to-voice/design/eleven-v3)
- [API Documentation](https://fal.ai/models/fal-ai/elevenlabs/text-to-voice/design/eleven-v3/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/elevenlabs/text-to-voice/design/eleven-v3)

### fal.ai Platform

- [Platform Documentation](https://fal.ai/docs/documentation)
- [Python Client](https://fal.ai/docs/api-reference/client-libraries/python)
- [JavaScript Client](https://fal.ai/docs/api-reference/client-libraries/javascript)

### Other agent-readable surfaces

This file covers one model. To find anything else:

- [Platform overview](https://fal.ai/llms.txt): Entry points and representative endpoint IDs
- [Documentation index](https://fal.ai/docs/llms.txt): Every documentation page
- [Full documentation text](https://fal.ai/docs/llms-full.txt): The whole documentation inlined
- Any other model: `https://fal.ai/models/<endpoint-id>/llms.txt`
