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

# Realtime API overview

> Build low-latency voice agents over WebSocket or WebRTC, with turn detection and interruptions handled for you.

The Realtime API connects STT, the LLM you choose, and TTS in one spoken conversation. It uses one WebSocket or WebRTC connection and handles turn detection and interruptions. It follows the OpenAI Realtime protocol, so you can [migrate an OpenAI Realtime client](https://docs.inworld.ai/realtime/openai-migration.md) with few changes. Inworld [extensions](https://docs.inworld.ai/realtime/provider-data.md) add back-channel responses, fillers, and memory.

<CardGroup cols={3}>
  <Card title="WebSocket quickstart" icon="bolt" href="https://docs.inworld.ai/realtime/quickstart-websocket.md">
    A Node.js server and a browser client, streaming audio both ways.
  </Card>

  <Card title="WebRTC quickstart" icon="phone" href="https://docs.inworld.ai/realtime/quickstart-webrtc.md">
    Voice using the browser's built-in support, with automatic echo cancellation.
  </Card>

  <Card title="Realtime Playground" icon="play" href="https://platform.inworld.ai/realtime-playground">
    Talk to a voice agent in the Portal.
  </Card>

  <Card title="JS examples" icon="js" href="https://github.com/inworld-ai/inworld-api-examples/tree/main/realtime/js">
    Complete Node.js and browser projects.
  </Card>

  <Card title="Python examples" icon="python" href="https://github.com/inworld-ai/inworld-api-examples/tree/main/realtime/python">
    Complete Python projects.
  </Card>

  <Card title="API reference" icon="books" href="https://docs.inworld.ai/api-reference/realtimeAPI/realtime/realtime-websocket.md">
    Every event, for WebSocket and WebRTC.
  </Card>
</CardGroup>

<Tip>
  **Using AI to code?** Give your assistant the docs index at `https://docs.inworld.ai/llms.txt`. For live search, [add the docs MCP server](https://docs.inworld.ai/developer-tools/vibe-coding#docs-mcp-server).

  **Prefer the terminal?** Install the [Inworld CLI](https://docs.inworld.ai/developer-tools/inworld-cli.md) with `npm install -g @inworld/cli`. Use it to create and manage API keys for the Realtime API. AI agents can use it too.
</Tip>

## Your first session

Connect and set up a session, then stream audio or text and handle the responses:

```text
wss://api.inworld.ai/api/v1/realtime/session?key=<session-id>&protocol=realtime
```

1. Connect with `Authorization: Basic <api-key>` from a server, or a [session token](https://docs.inworld.ai/portal/session-tokens.md) from a browser. You receive `session.created`.
2. Send `session.update` with your instructions, model, voice, and tools.
3. Stream audio with `input_audio_buffer.append`, or text with `conversation.item.create`.
4. Handle `response.output_*` events until `response.done`.

## Explore

<CardGroup cols={3}>
  <Card title="Configuring models" icon="sliders" href="https://docs.inworld.ai/realtime/usage/using-realtime-models.md">
    Choose the STT model, the LLM or router, the voice, and turn detection.
  </Card>

  <Card title="Tool calling" icon="plug" href="https://docs.inworld.ai/realtime/usage/tool-calling.md">
    Let the agent call your functions mid-conversation.
  </Card>

  <Card title="Managing conversations" icon="messages" href="https://docs.inworld.ai/realtime/usage/managing-conversations.md">
    Conversation items, turn detection events, interruptions, and errors.
  </Card>

  <Card title="Adding naturalness" icon="wand-magic-sparkles" href="https://docs.inworld.ai/realtime/usage/naturalness.md">
    Steering, back-channel responses, and fillers that keep the agent feeling present.
  </Card>

  <Card title="Twilio integration" icon="phone" href="https://docs.inworld.ai/realtime/usage/twilio.md">
    Put the agent on a phone number.
  </Card>
</CardGroup>

For voice output without speech input, use [Voice responses](https://docs.inworld.ai/router/guides/llm-plus-tts.md). Generate and speak an answer in one HTTP request.
