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

# TypeScript SDK

The Patter TypeScript SDK lets you connect AI voice agents to phone numbers in minutes. Run everything locally with full control over your infrastructure — no external platform required.

## Installation

```bash
npm install getpatter
```

## Requirements

- Node.js 18 or higher
- A telephony account — Twilio or Telnyx (both fully supported)
- An AI provider key (OpenAI, ElevenLabs, or Deepgram)

## Minimal Example

```typescript
// npx tsx example.ts
import { Patter, Twilio, OpenAIRealtime } from "getpatter";

const phone = new Patter({ carrier: new Twilio(), phoneNumber: "+15550001234" });   // TWILIO_* from env
const agent = phone.agent({ engine: new OpenAIRealtime(), systemPrompt: "You are a friendly receptionist." });
await 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 `apiKey`, 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 — an embedded Express server and all provider adapters live directly in your application. 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="/typescript-sdk/quickstart">
    Connect your first agent to a phone call.
  </Card>
  <Card title="Configuration" icon="gear" href="/typescript-sdk/configuration">
    All constructor parameters and options.
  </Card>
  <Card title="Agents" icon="robot" href="/typescript-sdk/agents">
    Configure voice, model, tools, and guardrails.
  </Card>
  <Card title="Engines" icon="bolt" href="/typescript-sdk/engines">
    OpenAI Realtime, ElevenLabs ConvAI.
  </Card>
  <Card title="LLM" icon="brain" href="/typescript-sdk/llm">
    Pipeline mode and custom LLMs.
  </Card>
  <Card title="Tools" icon="wrench" href="/typescript-sdk/tools">
    Function calling and webhook integrations.
  </Card>
</CardGroup>
