Skip to main content
Media over QUIC (MoQ) connects a browser to your Pipecat Cloud agent through the MoQ relays in the agent’s region. The browser’s audio and RTVI messages travel over WebTransport, with a WebSocket fallback, and your agent reaches the region’s relays from inside Pipecat Cloud. Pipecat Cloud runs the relays and issues each session’s credentials, so there is no relay to deploy and no token to mint. MoQ is a browser transport. For telephony and server-to-server links, use the generic WebSocket endpoint; for Daily rooms, see Daily WebRTC.

Requirements

Your agent image needs:
  • pipecat-ai[moq] 1.13.0 or newer.
  • The Pipecat Cloud base image dailyco/pipecat-base 0.2.7 or newer. Name the version in your Dockerfile’s FROM rather than relying on latest: a cloud build can get the previous base image for up to a day after a release.
  • pipecatcloud 1.3.0 or newer, if your image installs its own rather than using the one the base image provides.
Your browser client needs @pipecat-ai/client-js 1.16 and @pipecat-ai/moq-transport 0.3.3 or newer.
Pipecat Cloud starts a MoQ session only for an agent whose current deployment can serve one. While a new deployment rolls out or reports what it can serve, /start with transport: "moq" can return 409 Conflict: retry. An image that can’t serve MoQ gets 400 Bad Request, with a message that says what to rebuild. See Errors.

Bot code

Add the moq extra to your requirements:
requirements.txt
For a MoQ session, the base image passes your bot() a MOQSessionArguments, which subclasses pipecat-ai’s MOQRunnerArguments. create_transport takes the "moq" entry for it and dials the relay, so one agent can serve MoQ beside its other transports:
bot.py
The relay URL the bot dials carries the session’s credential. MOQSessionArguments keeps it out of its repr; keep it out of your own logs too. See Session arguments for the fields.

Starting a session

Start a session with transport: "moq". As with the other transports, body reaches your bot as runner_args.body:
The response carries everything the browser transport needs under a moq key:
  • relayUrl reaches the MoQ relays in your agent’s region, with the browser’s credential for this session in its query string. Treat it as a secret. It stays valid for the agent’s maximum session duration.
  • certHash is null: the relays use publicly trusted certificates, so there is nothing to pin.
  • namespace, clientId and botId place the browser and the bot in the session: the browser publishes under <namespace>/<clientId> and subscribes to <namespace>/<botId>, and the bot the reverse.
A MoQ session has no Daily room and no ICE servers, so createDailyRoom and enableDefaultIceServers can’t be set to true with transport: "moq". Sending either as false, its default, is fine.

Connecting from the browser

The JavaScript SDK’s MoqTransport reads the /start response’s moq block itself, so startBotAndConnect() can call /start and connect in one step:
See the MoQ transport reference for its options and events.

Reconnects

Pipecat Cloud drains a relay before replacing it, so relay updates don’t interrupt sessions. If a relay fails, both sides reconnect to another relay in the region on their own, and the session normally continues: the browser transport keeps trying for up to 60 seconds by default (relayRetryTimeoutMs), and the bot’s transport for its connection_timeout. Audio stops until both sides are back, typically for around 15 seconds, and RTVI messages sent meanwhile are delivered once each, in order.

Errors

A /start with transport: "moq" can be refused before any session starts. The message says what to change. 409 Conflict means retry:
  • The agent’s latest deployment hasn’t finished reporting what it can serve. This can take a few minutes after a deploy; retry with backoff.
  • A new deployment is still rolling out, or the latest one failed while the previous one keeps serving. Retry once a deployment has completed.
400 Bad Request means change the agent or the request:
  • The agent’s current deployment can’t serve MoQ: for example, its image is older than pipecat-base 0.2.7, its pipecat-ai is older than 1.13.0, or the moq extra isn’t installed. Rebuild on the requirements above and deploy again.
  • The request also sets createDailyRoom or enableDefaultIceServers to true.
  • MoQ isn’t offered in the agent’s region. Deploy the agent to a Daily-hosted region.

MoQ transport (JavaScript)

The JavaScript MoqTransport: options, events and connection states.

MoQ transport (server)

MOQTransport and MOQParams in the Pipecat framework.