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

# Realtime

> Your agent, over one speech-in speech-out session. Brain included.

Like a realtime voice API - except the brain is already built for your use
case. The full speech loop (STT, VAD, barge-in, TTS) plus your agent, served
as one session. Your app or telephony connects; Unpod runs the conversation.

## How it connects

An **agent** bundles a brain with one or more voice profiles. Sessions reach it
from the web over WebSocket or from a phone number over SIP - same agent,
same behaviour, either way.

## Go live in 3 steps

### 1. Create an agent

```python theme={null}
from unpod import Prompt

voice = await client.agents.voice.create(
    "my-bot",                                        # agent_id
    brain=Prompt("You are a concise support assistant."),
    name="Support Bot",
    voice_profile="vp_en_female_hd",                 # from voice_profiles.list()
)
```

`brain=` takes one of `Prompt` / `Playbook` / `Runner` / `Endpoint` - see
[Agents](https://docs.unpod.ai/speech-stack/agents.md).

### 2. Connect a session

> [tab] Web / mobile
>
> ```javascript theme={null}
> import { UnpodSession } from "@unpod/web-sdk";
>
> const session = new UnpodSession({ token });  // short-lived token from your backend
> await session.connect();                      // mic + speaker, full duplex
> session.on("agent_reply", (text) => console.log("Agent:", text));
> ```
>
> Mint tokens server-side with `client.sessions.create_token(pipe_id=...)` -
> browser sessions still key on the pipe id of the agent-voice row.
> Protocol and auth: [WebSocket sessions](https://docs.unpod.ai/telephony/streaming/websocket.md).
>
> > [!WARNING]
> >
> > `@unpod/web-sdk` is **not yet published on npm**. Until it ships, reach a
> > browser session through the
> > [Playground](https://app.unpod.ai/playground?tab=preview), or connect
> > over telephony.

> [tab] Telephony / SIP
>
> Attach a [number](https://docs.unpod.ai/speech-stack/numbers.md) to the `agent_id` - provision from
> Unpod or bring your own over a [trunk](https://docs.unpod.ai/speech-stack/numbers.md#trunks). LiveKit SIP
> works too: [LiveKit integration](https://docs.unpod.ai/telephony/integrations/livekit/api.md).

Want to run your own speech pipeline instead? Stream the call's raw audio to your bot with
[Audio Streaming](https://docs.unpod.ai/telephony/apis/audio-streaming.md).

### 3. Test it

Call the number, or open your web session and talk. Recordings and
transcripts land automatically - see
[Recordings & Transcripts](https://docs.unpod.ai/agent-sdk/recordings-transcripts.md).

## Go deeper

> [card] [WebSocket sessions](https://docs.unpod.ai/telephony/streaming/websocket.md)
>
> Session tokens, events, capabilities.

> [card] [Voice profiles](https://docs.unpod.ai/agent-sdk/voice-profiles.md)
>
> STT + TTS bundles per language, with failover.

> [card] [Speech pipes](https://docs.unpod.ai/agent-sdk/pipes.md)
>
> The unit that wires voice, agent, and numbers.

> [card] [Bring your agent](https://docs.unpod.ai/agent-sdk/bring-your-agent.md)
>
> Point a pipe at any HTTP endpoint or LangChain brain.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.