> ## 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 trained agent, over one speech-in speech-out session. Brain included.

Like a realtime voice API - except the brain is already trained on 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](/speech-stack/agents).

### 2. Connect a session

<Tabs>
  <Tab title="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](/speech-stack/websocket).

    <Warning>
      `@unpod/web-sdk` is **not yet published on npm**. Until it ships, reach a
      browser session through the
      [Playground](https://superdialog.unpod.ai/playground?tab=preview), or connect
      over telephony.
    </Warning>
  </Tab>

  <Tab title="Telephony / SIP">
    Attach a [number](/speech-stack/numbers) to the `agent_id` - provision from
    Unpod or bring your own over a [trunk](/speech-stack/numbers#trunks). LiveKit SIP
    works too: [LiveKit integration](/telephony/integrations/livekit/api).
  </Tab>
</Tabs>

Raw audio-frame WebSocket streaming for custom transports is on the
[roadmap](/telephony/integrations/websockets).

### 3. Test it

Call the number, or open your web session and talk. Recordings and
transcripts land automatically - see
[Recordings & Transcripts](/speech-stack/recordings-transcripts).

## Go deeper

<CardGroup cols={2}>
  <Card title="WebSocket sessions" icon="plug" href="/speech-stack/websocket">
    Session tokens, events, capabilities.
  </Card>

  <Card title="Voice profiles" icon="audio-waveform" href="/speech-stack/voice-profiles">
    STT + TTS bundles per language, with failover.
  </Card>

  <Card title="Speech pipes" icon="workflow" href="/speech-stack/pipes">
    The unit that wires voice, agent, and numbers.
  </Card>

  <Card title="Bring your agent" icon="bot" href="/speech-stack/bring-your-agent">
    Point a pipe at any HTTP endpoint or LangChain brain.
  </Card>
</CardGroup>
