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.1.0.tar.gz (12.7 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.1.0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for elvenreader-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dbde47c2e9aa46b50f07603db462c8916baa0a6a029b676952535e09994cb4ef
MD5 9db2ac1e86cf50ca32520182562576a8
BLAKE2b-256 013c855e4c04d4ae74e4aad239c037f8747a20ad252ab0b35006b29af26a3b0e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: elvenreader-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.9 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 255076af6ad8303e6f9e735437b8a6f8d449bb41331e5bc2f25c67e459c7aa65
MD5 15341b5c33f99b4f64fdf9620e46b061
BLAKE2b-256 0d9726eaec58ac3c107c41e94264a34ec2015148d250e8ccd89da99a94f2fef1

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