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

# WebRTC Simulations

> Run simulations over WebRTC instead of a phone line

## Overview

By default, Roark simulations are carried out over a phone line — the simulated caller dials your agent through a telephony provider and the entire conversation runs as a real PSTN call. This matches how most production voice agents are reached today.

If your agent supports **WebRTC**, the Roark simulation agent can connect to it directly over WebRTC instead of placing a phone call. This is useful when:

* Your agent is primarily accessed through a web or mobile client and you want simulations to exercise the same transport as production.
* You don't want to pay for telephony minutes just to run tests.
* Your agent doesn't expose a phone number at all (for example, an in-app voice assistant).
* You want lower-latency test runs without SIP in the middle.

Roark currently supports two WebRTC transports: **LiveKit** and **SmallWebRTC**.

The direction configured on the endpoint feeds the derived direction of any run that uses it — see [Inbound vs Outbound](/documentation/simulation-testing/inbound-vs-outbound).

***

## LiveKit

If your agent runs on LiveKit, Roark can join the same LiveKit room as your agent and carry out the simulation end-to-end over LiveKit's WebRTC infrastructure.

You can either let Roark create the room in your LiveKit project and dispatch your agent into it, or provide a callback URL where your own backend creates the room and returns the room name for Roark to join. Room metadata, named-agent dispatch, and automatic-dispatch behavior are all supported.

WebRTC endpoints are managed from the LiveKit integration page itself: open **Settings → Integrations → \{your LiveKit integration}** and use the **WebRTC** section to add or edit endpoints. Each endpoint is attached to one of the agents managed by the integration and can be reused across any run plan.

<Card title="LiveKit WebRTC Endpoint Setup" icon="link" href="/documentation/integrations/livekit#webrtc-endpoints">
  See the LiveKit integration docs for the full list of endpoint settings and room management modes.
</Card>

***

## SmallWebRTC

If your agent uses peer-to-peer / serverless WebRTC via Pipecat's [`SmallWebRTCTransport`](https://docs.pipecat.ai/server/services/transport/small-webrtc), Roark can connect to it directly with no intermediate media server. This is a good fit for Pipecat agents that don't use LiveKit or Daily and instead rely on the P2P WebRTC transport that ships with Pipecat.

To add a SmallWebRTC endpoint, navigate to **Agents → \{your agent} → Create Endpoint** and choose **SmallWebRTC**. You'll provide the URL that Roark should POST an SDP offer to, and Roark's simulation caller will negotiate the peer connection directly with your agent at simulation time.

<Note>
  SmallWebRTC is a good choice when you're running Pipecat locally or on minimal infrastructure and don't want to introduce a SFU. For Pipecat deployments that already use LiveKit or another SFU, prefer the matching transport endpoint.
</Note>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="LiveKit Integration" icon="plug" href="/documentation/integrations/livekit">
    Connect LiveKit and configure WebRTC endpoints
  </Card>

  <Card title="Run Plans" icon="list-check" href="/documentation/simulation-testing/run-plans">
    Use a WebRTC endpoint in a run plan
  </Card>

  <Card title="Running Simulations" icon="play" href="/documentation/simulation-testing/running-simulations">
    Execute simulations against your WebRTC agent
  </Card>

  <Card title="Pipecat SmallWebRTC Docs" icon="book-open" href="https://docs.pipecat.ai/server/services/transport/small-webrtc">
    Learn about the SmallWebRTC transport
  </Card>
</CardGroup>
