# Text to Speech MP3 (Open Voices, No API Key) – Kokoro TTS (`fast_data_asap/text-to-speech-kokoro`) Actor

Convert text to natural-sounding speech MP3 or WAV with the open Kokoro-82M TTS model. 41 voices (US/UK English, Spanish, French, Hindi, Italian, Portuguese), voice blending, bulk texts, long texts. No API key, $0.02 per 1,000 characters.

- **URL**: https://apify.com/fast_data_asap/text-to-speech-kokoro.md
- **Developed by:** [Fast Data](https://apify.com/fast_data_asap) (community)
- **Categories:** AI, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$20.00 / 1,000 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

## Text to Speech MP3 (Open Voices, No API Key) – Kokoro TTS

Turn any text into **natural-sounding speech as MP3 or WAV** with **Kokoro-82M**, one of the best open-weight text-to-speech models (Apache-2.0). No OpenAI, ElevenLabs or Google key needed, nothing to install: paste text, pick a voice, get a downloadable audio file per text.

- **41 voices in 7 languages**: US English, UK English, Spanish, French, Hindi, Italian, Brazilian Portuguese
- **Voice blending**: mix voices with weights, e.g. `am_michael:0.6,am_onyx:0.4`, for your own signature voice
- **Bulk**: send hundreds of texts in one run, one audio file per text
- **Long texts**: up to 20,000 characters per text by default (configurable), split at sentence boundaries and joined seamlessly into one file
- **Speed control** from 0.7 (slow) to 1.3 (fast)
- **MP3 (64–192 kbps) or WAV** (16-bit PCM, 24 kHz)
- **Public download link** for every file, ready for your app, CMS, podcast feed or automation
- **$0.02 per 1,000 characters**, failed or empty texts are free

### Who is it for?

- **Content creators and marketers**: audio versions of blog posts, newsletters and social videos
- **E-learning**: narrate lessons, flashcards and quizzes
- **Developers and no-code builders**: a cheap TTS API for apps, n8n/Make/Zapier flows and AI agents (MCP)
- **Accessibility**: listenable versions of articles and product pages
- **Video makers**: voice-overs for explainers, shorts and slides

### Why this actor?

| | This actor | Paid TTS API wrappers | Other Kokoro actors |
|---|---|---|---|
| API key needed | No | Yes (yours) or hidden markup | No |
| Price per 1,000 characters | **$0.02** | $0.04 – $0.40 | $0.09 – $0.10 |
| Start fee | None | often | sometimes |
| Voice blending | Yes | rarely | rarely |
| Bulk texts, one file each | Yes | varies | varies |

Kokoro runs entirely inside the actor (the model is baked into the Docker image), so your text is never sent to a third-party TTS service.

### Input

| Field | Description |
|---|---|
| `text` | One text to read aloud. |
| `texts` | Bulk list: `[{"id": "intro", "text": "..."}]` (plain strings also work). The `id` becomes the file name. |
| `voice` | Voice name or blend (default `af_heart`). The first letter sets the language. |
| `speed` | 0.7 – 1.3, default 1.0. |
| `format` | `mp3` (default) or `wav`. |
| `mp3Bitrate` | `64k`, `96k`, `128k` (default) or `192k`, mono. |
| `maxCharsPerText` | Safety cap per text (default 20,000). Longer texts are cut at the last full sentence and flagged `truncated: true`. |

Example:

```json
{
  "texts": [
    {"id": "intro", "text": "Welcome to our product tour. In the next two minutes you will see everything that matters."},
    {"id": "outro", "text": "Thanks for listening. See you next time!"}
  ],
  "voice": "am_michael:0.6,am_onyx:0.4",
  "speed": 1.0,
  "format": "mp3"
}
```

### Output

One dataset row per text; the audio file itself is stored in the run's key-value store (`<id>.mp3` / `<id>.wav`) and linked in `audioUrl`.

```json
{
  "id": "text",
  "voice": "af_heart",
  "language": "English (US)",
  "speed": 1,
  "format": "mp3",
  "characters": 77,
  "durationSeconds": 5.03,
  "sizeBytes": 81836,
  "audioUrl": "https://api.apify.com/v2/key-value-stores/mCHDdV98wNH6uet4c/records/text.mp3?signature=qPTCmKxQS2jdkK2fv37l",
  "key": "text.mp3",
  "truncated": false,
  "status": "ok",
  "error": null,
  "textPreview": "Hello! This is Kokoro, an open text to speech model, reading your text aloud."
}
```

`status` is `ok`, `error` (e.g. empty text, not charged) or `skipped` (your max charge limit was reached).

### Voices and languages

Only voices the engine really supports are accepted (Japanese and Chinese Kokoro voices are not supported in this actor).

| Language | Female | Male |
|---|---|---|
| English (US) – `a` | af_heart, af_alloy, af_aoede, af_bella, af_jessica, af_kore, af_nicole, af_nova, af_river, af_sarah, af_sky | am_adam, am_echo, am_eric, am_fenrir, am_liam, am_michael, am_onyx, am_puck, am_santa |
| English (UK) – `b` | bf_alice, bf_emma, bf_isabella, bf_lily | bm_daniel, bm_fable, bm_george, bm_lewis |
| Spanish – `e` | ef_dora | em_alex, em_santa |
| French – `f` | ff_siwis | – |
| Hindi – `h` | hf_alpha, hf_beta | hm_omega, hm_psi |
| Italian – `i` | if_sara | im_nicola |
| Portuguese (BR) – `p` | pf_dora | pm_alex, pm_santa |

Tips: `af_heart`, `af_bella`, `am_michael`, `am_fenrir`, `bf_emma` and `bm_george` are among the most natural. English pronunciation uses the misaki lexicon with an espeak-ng fallback for unknown words; the other languages use espeak-ng phonemes. You can force a pronunciation in English with inline phonemes: `[Kokoro](/kˈOkəɹO/)`. Blend only voices of the same language; the first voice decides the language.

### Pricing

Pay per event: **$0.02 per started 1,000 characters** of successfully synthesized text (event `1k-characters`), counted per text. A 77-character sentence costs $0.02, a 2,400-character article $0.06, a 20,000-character chapter $0.40. Empty or failed texts are free, and there is no start fee. Default memory is 4 GB: in our test it synthesized 2.2 minutes of audio in 108 s (2 GB took 209 s at the same compute cost).

Speed: roughly 1.5–2x faster than real time, i.e. about 30–50 seconds of processing per 1,000 characters (about 70 seconds of audio).

### API, n8n and MCP

Run it synchronously and get the rows back:

```bash
curl -X POST "https://api.apify.com/v2/acts/fast_data_asap~text-to-speech-kokoro/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello from the Apify API!", "voice": "bf_emma", "format": "mp3"}'
```

Then download the file from `audioUrl`.

- **n8n / Make / Zapier**: use the Apify integration ("Run Actor and get dataset items") with actor `fast_data_asap/text-to-speech-kokoro`.
- **AI agents (MCP)**: add `https://mcp.apify.com?tools=fast_data_asap/text-to-speech-kokoro` to Claude, Cursor or any MCP client to let your agent speak.

### Notes

- Model: Kokoro-82M v1.0 (Apache-2.0) via ONNX Runtime on CPU, voice pack v1.0.
- Audio is 24 kHz mono. Files stay in the run's key-value store according to your Apify data retention.
- Please only synthesize text you have the rights to use, and do not use the voices to impersonate real people.

# Actor input Schema

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

A single text to read aloud. Long texts are split at sentence boundaries and joined into one audio file. For many texts at once use "Texts (bulk)".

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

Optional list of texts, each becomes its own audio file: \[{"id": "intro", "text": "..."}, ...]. Plain strings work too. The id is used as file name.

## `voice` (type: `string`):

Kokoro voice, e.g. af_heart, af_bella, am_michael, am_onyx (US English), bf_emma, bm_george, bm_lewis (UK English), ef_dora (Spanish), ff_siwis (French), hf_alpha (Hindi), if_sara (Italian), pf_dora (Portuguese). Blend voices with weights: "am_michael:0.6,am_onyx:0.4". The first letter sets the language. See README for all 41 voices.

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

Speaking rate. 1.0 = normal, 0.7 = slow, 1.3 = fast.

## `format` (type: `string`):

MP3 (small, default) or WAV (16-bit PCM, 24 kHz, lossless).

## `mp3Bitrate` (type: `string`):

Mono MP3 bitrate. 64k is plenty for voice, 128k is the default.

## `maxCharsPerText` (type: `integer`):

Safety cap. Longer texts are cut at the last sentence before the limit (marked truncated=true).

## Actor input object example

```json
{
  "text": "Hello! This is Kokoro, an open text to speech model, reading your text aloud.",
  "voice": "af_heart",
  "speed": 1,
  "format": "mp3",
  "mp3Bitrate": "128k",
  "maxCharsPerText": 20000
}
```

# Actor output Schema

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

No description

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

No description

# 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": "Hello! This is Kokoro, an open text to speech model, reading your text aloud.",
    "voice": "af_heart"
};

// Run the Actor and wait for it to finish
const run = await client.actor("fast_data_asap/text-to-speech-kokoro").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": "Hello! This is Kokoro, an open text to speech model, reading your text aloud.",
    "voice": "af_heart",
}

# Run the Actor and wait for it to finish
run = client.actor("fast_data_asap/text-to-speech-kokoro").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": "Hello! This is Kokoro, an open text to speech model, reading your text aloud.",
  "voice": "af_heart"
}' |
apify call fast_data_asap/text-to-speech-kokoro --silent --output-dataset

```

## MCP server setup

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

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/RJwC1zUbIzKUtQk8G/builds/vf6geWpfu8wwOe5pa/openapi.json
