Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 596 Bytes

File metadata and controls

28 lines (18 loc) · 596 Bytes

ElevenLabs Text-to-Speech — Quickstart Python Example

Generate an MP3 file from text using the ElevenLabs Python SDK.

Setup

  1. Copy the environment file and add your API key:

    cp .env.example .env

    Then edit .env and paste your ElevenLabs API key.

  2. Create a virtual environment and install dependencies:

    python3 -m venv .venv
    .venv/bin/pip install -r requirements.txt

Run

.venv/bin/python main.py "Hello from ElevenLabs"

The generated audio is saved to output.mp3.