---
title: "Python SDK"
description: "Connect AI agents to phone numbers with 4 lines of Python."
icon: "compass"
---

# Python SDK

The Patter Python SDK lets you connect AI voice agents to phone numbers in minutes. Power inbound call centers, outbound dialers, and conversational AI experiences with minimal code.

## Installation

```bash
pip install getpatter
```

## Requirements

- Python 3.11 or higher
- A telephony account — Twilio or Telnyx (both fully supported)
- An AI provider key (OpenAI, ElevenLabs, or Deepgram)

## Minimal Example

```python
import asyncio
from getpatter import Patter, Twilio, OpenAIRealtime

phone = Patter(carrier=Twilio(), phone_number="+15550001234")    # TWILIO_* from env
agent = phone.agent(engine=OpenAIRealtime(), system_prompt="You are a friendly receptionist.")
asyncio.run(phone.serve(agent))                                  # OPENAI_API_KEY from env
```

That's the full file. Every provider class reads its API key from an env var when you omit `api_key=` — so as long as you have `TWILIO_ACCOUNT_SID`, `TWILIO_AUTH_TOKEN`, and `OPENAI_API_KEY` set, the example above is paste-runnable.

## How Patter runs

Patter runs entirely in your own process. You bring your own telephony (Twilio or Telnyx) and AI provider credentials — no external platform or hosted backend required.

<Note>A hosted Patter Cloud option will return in a future release.</Note>

## What's Next

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/python-sdk/quickstart">
    Connect your first agent to a phone number.
  </Card>
  <Card title="Configuration" icon="gear" href="/python-sdk/configuration">
    All constructor parameters and options.
  </Card>
  <Card title="Agents" icon="robot" href="/python-sdk/agents">
    Configure voice, model, tools, and guardrails.
  </Card>
  <Card title="Engines" icon="bolt" href="/python-sdk/engines">
    OpenAI Realtime, ElevenLabs ConvAI.
  </Card>
  <Card title="LLM" icon="brain" href="/python-sdk/llm">
    Pipeline mode and custom LLMs.
  </Card>
  <Card title="Tools" icon="wrench" href="/python-sdk/tools">
    Function calling and webhook integrations.
  </Card>
</CardGroup>
