Home/Developer Tools/elevenlabs-python
elevenlabs-python logo

elevenlabs-python

elevenlabs/elevenlabs-python

Official Python SDK for ElevenLabs API.

GraphCanon updated 3w · GitHub synced 3w

3.0k stars431 forksLast push 4w Python MIT

Decision brief

The official Python SDK for ElevenLabs API which provides text-to-speech capabilities through asynchronous interaction supporting live session management and transcription handling.

Good fit when

  • You need to integrate advanced text-to-speech in your application that supports real-time conversation sessions with robust error and lifecycle event handling.
  • Your project requires a Python-based tool that offers fine-grained control over speech engines and can manage asynchronous responses, leveraging ElevenLabs' service capabilities.

Avoid when

  • You are looking for a simpler integration that does not require managing real-time sessions with custom events such as on_transcript or on_error.
  • Your project needs synchronous calls exclusively, as the elevenlabs-python SDK focuses heavily on asynchronous processes which may complicate implementation if synchronous behavior is desired.
Pricing:
freemium - The API usage costs are determined by ElevenLabs billing policies and not the SDK itself, which is available under the MIT license for free use.
Requirements:
Install via pip.; Requires Python asyncio knowledge for effective asynchronous process management within the application.

Observed Jul 17, 2026 · Source: enrich:decision_facts

Verify the decision

Maintenance and security

Full trust report
Maintenance
Very active (0d since push)
As of 3w
Provenance
Not a fork · Organization account
As of 3w
Security (OSV)
24 low (24 low)
As of 1mo

Public GitHub metadata and optional OSV scans. Signals, not a guarantee. Trust methodology.

Install

pip install elevenlabs-python
PyPI

Similar tools

Same-category neighbours. No typed graph edges are catalogued for this tool yet.

Evidence and technical details

Sourced facts, taxonomy, compatibility claims, README excerpt, and machine-readable endpoints.

Overview

The elevenlabs-python repository offers an official Python software development kit (SDK) that facilitates interaction with the ElevenLabs text-to-speech service through its API.

Capability facts

Languages
python

Source: github.language+pyproject.toml · Jul 29, 2026

Categories

Compatibility

Sourced claims from the README excerpt - not unsourced marketing copy.

Python runtimePython

Source: README excerpt (regex_v1, Jul 29, 2026)

```python import asyncio
Source link

Tags

README

Install

pip install elevenlabs

Quick Start

import asyncio
from openai import AsyncOpenAI
from elevenlabs import AsyncElevenLabs

openai_client = AsyncOpenAI()
elevenlabs = AsyncElevenLabs()

async def main():
    engine = await elevenlabs.speech_engine.get("seng_123")

    async def on_transcript(transcript, session):
        stream = await openai_client.responses.create(
            model="gpt-4o",
            input=[
                {"role": "assistant" if m.role == "agent" else m.role, "content": m.content}
                for m in transcript
            ],
            stream=True,
        )
        await session.send_response(stream)

    async def on_init(conversation_id, session):
        print(f"Session started: {conversation_id}")

    async def on_close(session):
        print(f"Session ended: {session.conversation_id}")

    async def on_error(err, session):
        print(f"Error: {err}")

    await engine.serve(
        port=3001,
        debug=True,
        on_init=on_init,
        on_transcript=on_transcript,
        on_close=on_close,
        on_error=on_error,
    )

asyncio.run(main())

For agents

This page has a .md twin and JSON over the API.

Was this helpful?

Anonymous feedback helps us improve pages and translations.