# ElevenLabs Text to Speech (v3, v4, Multilingual v2) (`speakvela/elevenlabs-text-to-speech`) Actor

Turn text into MP3 with ElevenLabs v4, v3, Multilingual v2 and Flash v2.5, using any public voice from the ElevenLabs Voice Library. Up to 250,000 characters per text. $0.01 per 1,000 characters.

- **URL**: https://apify.com/speakvela/elevenlabs-text-to-speech.md
- **Developed by:** [SpeakVela](https://apify.com/speakvela) (community)
- **Stats:** 1 total users, 1 monthly users, 92.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 1,000 characters

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What this Actor does

It turns text into speech with ElevenLabs models and gives you an MP3 file for each text. You can use any public voice from the [ElevenLabs Voice Library](https://elevenlabs.io/voice-library), in any language the model supports.

A single text can be up to 250,000 characters, which is enough for a long audiobook chapter or a full video script. Long texts are split, rendered in parallel and joined back into one MP3, so you don't have to cut them up yourself.

On the Apify Free plan the Actor works as a trial: texts up to 1,000 characters and 5,000 characters per day. Any paid Apify plan removes these limits.

### Models and pricing

You pay per character of text. There is no rounding.

| Model | Price per 1,000 characters | Price per 1 million characters |
|---|---|---|
| Multilingual v2 | $0.01 | $10 |
| Flash v2.5 | $0.01 | $10 |
| Turbo v2.5 | $0.01 | $10 |
| Eleven v3 | $0.02 | $20 |
| Eleven v4 | $0.02 | $20 |
| Eleven v4 Turbo | $0.02 | $20 |

Each run also has a $0.001 start fee.

- You are charged only after the MP3 has been saved to your run's storage.
- Failed texts and texts refused by the content policy are not charged.
- Every voice costs the same.
- If a text would go over your "Maximum cost per run", the Actor skips it and tells you, instead of charging part of it.

On the Apify Free plan you can try the Actor with texts up to 1,000 characters, 5,000 characters per day, one text at a time. Any paid Apify plan removes these limits.

### How to use it

1. Paste your text into **Text**. Add more texts under **More texts** if you want several files from one run.
2. Set **Voice ID**. Open a voice in the ElevenLabs Voice Library and copy its ID, or keep the default voice.
3. Pick a **Model**. Eleven v3 and v4 sound the most natural and handle emotion well. Flash v2.5 is the fastest. Multilingual v2 is a good, cheaper choice for long narration.
4. Click **Start**. Short texts usually finish in under a minute.

### Output

Each text gives one MP3 in the run's key-value store (`audio.mp3`, or `audio-001.mp3`, `audio-002.mp3`… for several texts) and one row in the dataset:

```json
{
  "index": 1,
  "status": "completed",
  "audioUrl": "https://api.apify.com/v2/key-value-stores/…/records/audio.mp3",
  "durationSec": 6.4,
  "characters": 79,
  "billedCharacters": 79,
  "modelId": "eleven_multilingual_v2",
  "voiceId": "auq43ws1oslv0tO4BDa7",
  "voiceName": "Adam Stone - Smooth and Relaxed",
  "text": "Welcome to our channel! Today we are going to talk about the history of coffee."
}
```

A failed text has `"status": "failed"`, an `error` message and `"billedCharacters": 0`. When the content policy refuses part of a text, `errorCode` is `content_blocked` and `blockedText` shows which part, so you can edit it and run again.

### Input settings

| Setting | Default | Notes |
|---|---|---|
| `text` | | up to 250,000 characters |
| `texts` | | up to 100 extra texts per run |
| `voiceId` | `auq43ws1oslv0tO4BDa7` | any public ElevenLabs Voice Library voice |
| `modelId` | `eleven_multilingual_v2` | see the pricing table |
| `language` | `auto` | ISO code such as `en`, `es`, `de`, `ja` |
| `stability` | 0.5 | 0 to 1 |
| `similarity` | 0.75 | 0 to 1 |
| `style` | | 0 to 1, Multilingual v2 only |
| `speed` | 1 | 0.7 to 1.2 |
| `speakerBoost` | true | |

### Use it from code

Run the Actor through the Apify API and wait for the result:

```bash
curl -X POST "https://api.apify.com/v2/acts/speakvela~elevenlabs-text-to-speech/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "text": "Hello from the Apify API.", "voiceId": "auq43ws1oslv0tO4BDa7", "modelId": "eleven_v3" }'
```

The response is the dataset, with an `audioUrl` for each text. The Apify JavaScript and Python clients, Make, Zapier and n8n integrations work the same way.

### FAQ

**Can I use my cloned or private voices?** No. Only public voices from the ElevenLabs Voice Library are supported.

**How long are files kept?** As long as Apify keeps your run storage (see your Apify plan's data retention).

**Can I use the audio commercially?** The Actor returns the audio generated by ElevenLabs models. Check the ElevenLabs terms and the terms of the voice you pick.

**I found a problem or need higher volume.** Write to support@speakvela.com.

# Actor input Schema

## `text` (type: `string`):

The text to read aloud, up to 250,000 characters. Long texts come back as one MP3 file.

## `texts` (type: `array`):

Extra texts, one MP3 per text. Up to 100 texts per run, with the same voice and settings.

## `voiceId` (type: `string`):

Any public voice from the ElevenLabs Voice Library (elevenlabs.io/voice-library): open a voice, copy its ID. The default is "Adam Stone, smooth and relaxed" (English).

## `modelId` (type: `string`):

Eleven v4, v4 Turbo and v3 cost $0.02 per 1,000 characters. Multilingual v2, Flash v2.5 and Turbo v2.5 cost $0.01 per 1,000 characters.

## `language` (type: `string`):

ISO 639-1 code such as en, es, de, fr, ja, vi. Leave "auto" to detect it from the text.

## `stability` (type: `number`):

0 to 1. Lower sounds more expressive, higher sounds steadier.

## `similarity` (type: `number`):

0 to 1. How closely the output follows the original voice.

## `style` (type: `number`):

0 to 1. Multilingual v2 only; ignored by other models.

## `speed` (type: `number`):

0.7 to 1.2. 1 is normal speed.

## `speakerBoost` (type: `boolean`):

Makes the voice closer to the original speaker.

## Actor input object example

```json
{
  "text": "Welcome to our channel! Today we are going to talk about the history of coffee.",
  "voiceId": "auq43ws1oslv0tO4BDa7",
  "modelId": "eleven_multilingual_v2",
  "language": "auto",
  "stability": 0.5,
  "similarity": 0.75,
  "speed": 1,
  "speakerBoost": true
}
```

# Actor output Schema

## `results` (type: `string`):

One row per text: status, MP3 link, duration in seconds, and billed characters.

## `audio` (type: `string`):

The MP3 files: audio.mp3 for a single text, audio-001.mp3, audio-002.mp3 and so on for several texts.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "text": "Welcome to our channel! Today we are going to talk about the history of coffee.",
    "voiceId": "auq43ws1oslv0tO4BDa7"
};

// Run the Actor and wait for it to finish
const run = await client.actor("speakvela/elevenlabs-text-to-speech").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "text": "Welcome to our channel! Today we are going to talk about the history of coffee.",
    "voiceId": "auq43ws1oslv0tO4BDa7",
}

# Run the Actor and wait for it to finish
run = client.actor("speakvela/elevenlabs-text-to-speech").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "text": "Welcome to our channel! Today we are going to talk about the history of coffee.",
  "voiceId": "auq43ws1oslv0tO4BDa7"
}' |
apify call speakvela/elevenlabs-text-to-speech --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,speakvela/elevenlabs-text-to-speech"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/FpxKndO75kb5LynOI/builds/u3KykdffK2CM6LUYe/openapi.json
