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

# Deploy your agent

One agent, bound by its `agent_id`, answers wherever you point it. Pick where.

<CardGroup cols={2}>
  <Card title="From a browser" icon="globe" href="/docs/voice-agents/voice-agent-api/browser-integration">
    A web app, widget, or in-product voice. Your server mints a short-lived token so no API key reaches the page.
  </Card>

  <Card title="Over the phone" icon="phone" href="/docs/voice-agents/voice-agent-api/connect-to-twilio">
    An inbound number people call. Twilio hands the call straight to AssemblyAI over SIP.
  </Card>
</CardGroup>

|                 | Browser                                      | Phone                                      |
| --------------- | -------------------------------------------- | ------------------------------------------ |
| **Best for**    | Web apps, widgets, demos                     | Support lines, reception, order taking     |
| **You provide** | A server endpoint that mints tokens          | A Twilio account and a number you own      |
| **You run**     | Your web app                                 | Nothing                                    |
| **Auth**        | Short-lived token, per session               | API key, server-side at setup              |
| **Audio**       | The browser captures and plays it            | Twilio and AssemblyAI handle it end to end |
| **Echo**        | Handled by the browser, no headphones needed | Handled by the carrier                     |
| **Setup**       | Minutes                                      | About 10 minutes, mostly Twilio config     |

Want both? Publish the agent once and point both at the same `agent_id`. The [Quickstart](/docs/voice-agents/voice-agent-api) does exactly that in five commands.

## Whichever you pick

Both open the same WebSocket, `wss://agents.assemblyai.com/v1/ws`, and bind the same way. Send one `session.update` with the `agent_id` and nothing else, and the stored prompt, voice, and tools load server-side:

```json theme={null}
{
  "type": "session.update",
  "session": { "agent_id": "7ad24396-b822-4dca-871a-be9cc4781cf9" }
}
```

Wait for [`session.ready`](/docs/voice-agents/voice-agent-api/events-reference#session-ready) before streaming audio, and finish with [`session.end`](/docs/voice-agents/voice-agent-api/events-reference#session-end). Skipping `session.end` leaves the session in a 30-second grace window that you pay for. See [Ending the session cleanly](/docs/voice-agents/voice-agent-api/browser-integration#6-ending-the-session-cleanly).

<Note>
  `agent_id` is **mutually exclusive** with inline session fields. Binding to a stored agent and also sending `system_prompt`, `greeting`, `tools`, `input`, or `output` is rejected. To configure per session instead, send those inline and omit `agent_id`. See [Inline configuration](/docs/voice-agents/voice-agent-api/session-configuration).
</Note>

## Neither of these

On another telephony provider, or embedding in something we don't have a guide for? You connect the same way with your API key in the `Authorization` header, and move the audio yourself. [Stream audio](/docs/voice-agents/voice-agent-api/audio-format) has the encodings and the send, play, and barge-in handling.

<Warning>
  A raw API key is fine for servers and trusted backends. **Never ship it in browser or mobile client code.** Use the [browser token flow](/docs/voice-agents/voice-agent-api/browser-integration) for anything client-side.
</Warning>
