> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getpatter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AssemblyAI STT

> Universal Streaming speech-to-text via AssemblyAI's v3 WebSocket API.

# AssemblyAI STT

Streaming speech-to-text via AssemblyAI's Universal Streaming v3 API. Uses `ws`, no vendor SDK required.

## Install

```bash theme={null}
npm install getpatter
```

## Usage

The class reads from `ASSEMBLYAI_API_KEY` when `apiKey` is omitted.

```typescript theme={null}
import { AssemblyAISTT } from "getpatter";

const stt = new AssemblyAISTT();                                  // reads ASSEMBLYAI_API_KEY
const stt2 = new AssemblyAISTT({ apiKey: "aa_..." });
```

Plug it into an agent:

```typescript theme={null}
// npx tsx example.ts
import { Patter, Twilio, AssemblyAISTT, ElevenLabsTTS } from "getpatter";

const phone = new Patter({ carrier: new Twilio(), phoneNumber: "+15550001234" });

const agent = phone.agent({
  stt: new AssemblyAISTT(),                           // ASSEMBLYAI_API_KEY from env
  tts: new ElevenLabsTTS({ voiceId: "rachel" }),      // ELEVENLABS_API_KEY from env
  systemPrompt: "You are a helpful assistant.",
});

await phone.serve({ agent });
```

For Twilio (mulaw 8 kHz) use `AssemblyAISTT.forTwilio("aa_...")`.
