Python SDK
Give your Python AI agent a phone number with 4 lines of code. Async-first, type-hinted, production-ready. No Patter backend needed.
pip install getpatter
1from getpatter import Patter, Twilio, OpenAIRealtime
2
3phone = Patter(carrier=Twilio(), phone_number="+15550001234")
4agent = phone.agent(engine=OpenAIRealtime(), system_prompt="You are a friendly receptionist.")
5await phone.serve(agent, tunnel=True)
4 lines to a phone call
- Connect your telephony provider and start handling phone calls
- Patter handles STT, TTS, telephony, and audio streaming
- Embedded local server (FastAPI) — no Patter backend needed
- Works with any LLM — OpenAI, Anthropic, or your own
- Full type hints and async/await support
Everything you need to connect your agent to phone calls
Instance-based voice stack
Pass typed instances: engine=OpenAIRealtime() or engine=ElevenLabsConvAI() for end-to-end, or mix stt=, llm=, tts= freely across 6 STTs, 5 LLMs, and 5 TTSs.
Telephony Providers
Twilio (mulaw 8kHz) and Telnyx (Beta, PCM 16kHz) out of the box. Bring your own credentials, no Patter account required.
Call Recording
Enable recording per call with recording=True. Recordings stored via your telephony provider.
Call Transfer
Built-in transfer_call tool. Your agent decides when to transfer — Patter handles the redirect.
Event Hooks
on_call_start, on_call_end, on_transcript — lifecycle callbacks for logging, analytics, and custom logic.
Embedded Dashboard
Built-in local dashboard with call metrics, history, and CSV/JSON export. No external tools needed.
DTMF Input
Keypad presses forwarded as [DTMF: N] in the transcript. Build IVR flows with your agent.
Dynamic Variables
{name} placeholders in system prompts replaced from a variables dict at call time.