Skip to main content

Python SDK

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

Installation

pip install patter[local]

Requirements

  • Python 3.11 or higher
  • An account with at least one telephony provider (Twilio or Telnyx)
  • An AI provider key (OpenAI, ElevenLabs, or Deepgram)

Minimal Example

from patter import Patter

phone = Patter(
    twilio_sid="AC...",
    twilio_token="your_token",
    openai_key="sk-...",
    phone_number="+15550001234",
    webhook_url="abc.ngrok.io",
)

agent = phone.agent(
    system_prompt="You are a friendly receptionist for Acme Corp.",
    first_message="Hello! Thanks for calling Acme Corp. How can I help you?",
)

await phone.serve(agent)

SDK Modes

Patter runs in local/self-hosted mode. You bring your own telephony and AI provider credentials — no external platform required.
ModeUse CaseRequirements
LocalSelf-hosted, full controlTelephony + AI provider keys

What’s Next

Quickstart

Step-by-step guide to your first voice agent.

Configuration

All constructor parameters and mode options.

Agents

Configure voice, model, tools, and guardrails.

Providers

OpenAI Realtime, ElevenLabs, and custom pipelines.

Tools

Function calling and webhook integrations.

Events

React to call lifecycle events in real time.