Skip to main content

CLI and library for the ElevenReader TTS API

Project description

elvenreader

CLI and library for the ElevenReader TTS API. Read text aloud or save it as MP3 using your ElevenReader subscription.

Install

pip install elvenreader

Or for development:

uv sync
uv pip install -e .

Requires macOS (uses afplay for audio playback, including AirPlay) and a Tampermonkey browser extension for App Check token capture.

Library Usage

import asyncio
from elvenreader import ElvenReader

async def main():
    reader = ElvenReader.from_keychain()  # uses stored credentials
    mp3 = await reader.read("Hello world", voice="george")

    # Or save directly to file
    await reader.read_to_file("Hello world", "output.mp3", voice="brian")

asyncio.run(main())

Setup

1. Login

elvenreader login

Prompts for your ElevenLabs email and password. Stores a refresh token in the macOS Keychain.

2. App Check Token

The streaming API requires a Firebase App Check token (~7 day lifetime). A Tampermonkey userscript captures it automatically from elevenreader.io.

Install the script (one-time):

elvenreader app-check --show-script

Copy the output into a new Tampermonkey script.

Capture the token:

elvenreader app-check

Then open elevenreader.io and play any read. The script intercepts the token from the WebSocket handshake and sends it to the CLI. Re-run this when the token expires.

Commands

elvenreader read — Read text aloud

# Stream playback (plays through system audio output, including AirPlay)
elvenreader read "Hello world, this is a test." --play

# Save to MP3
elvenreader read "Hello world" --output hello.mp3

# Both at once
elvenreader read "Hello world" --play --output hello.mp3

# Read from a file
elvenreader read --file chapter1.txt --play

# Use a specific voice
elvenreader read "Hello world" --play --voice george

Options:

  • -p, --play — Stream audio playback via afplay
  • -o, --output PATH — Save MP3 to file
  • -f, --file PATH — Read text from a file instead of an argument
  • -v, --voice NAME — Voice name or ID (default: brian)

elvenreader voices — List available voices

elvenreader voices

Shows all voices with name, gender, and description.

elvenreader create-voice — Design a new voice

elvenreader create-voice "warm British male, slightly raspy, authoritative storyteller" --name "My Narrator"

Generates preview voices from your description, plays each one, then prompts you to pick which to save. The saved voice is immediately available for use with --voice.

Options:

  • -n, --name TEXT — Name for the new voice (required)

elvenreader login — Authenticate

elvenreader login

elvenreader app-check — Capture App Check token

elvenreader app-check              # Wait for token from Tampermonkey script
elvenreader app-check --show-script # Print the Tampermonkey script

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

elvenreader-0.2.0.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

elvenreader-0.2.0-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file elvenreader-0.2.0.tar.gz.

File metadata

  • Download URL: elvenreader-0.2.0.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for elvenreader-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f31603a2c2675a70997cced3044e398a5260cbed28c195b2a9ca1b8d121c5083
MD5 7ef25266909b72119eb8124633d3dc1d
BLAKE2b-256 92dcdd911bc0f415eeb6393aca962635af45486f734b769d53d144acfce56eb5

See more details on using hashes here.

File details

Details for the file elvenreader-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: elvenreader-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for elvenreader-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d86e84cab6081534a7898b7c5c477d98182ec0c29378ac3b48b705bd71d0b02
MD5 b5fee6dd660eabc49cadff6687ec4f7c
BLAKE2b-256 1258f7b5f2b5c79d84b8556e33950516a78969d5aaef29e715f9e9ee95597a49

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page