MoQ (Media over QUIC) is a protocol for delivering live media content using QUIC transport. It provides efficient, low-latency media streaming by leveraging QUIC's multiplexing and connection management capabilities.
MoQ is designed to be an Internet infrastructure level service that provides media delivery to applications, similar to how HTTP provides content delivery and WebRTC provides real-time communication.
Cloudflare recommends draft-18 ↗︎ of the MoQ Transport specification for new deployments. Draft-16 and draft-14 endpoints remain available for existing clients. Refer to the MoQ feature matrix for draft-specific capabilities.
For the most up-to-date documentation on the protocol, please visit the IETF working group documentation.
Cloudflare MoQ relays are available through the Cloudflare dashboard ↗︎ and the API. They are free to use during the beta period.
Each relay provides an isolated scope — your namespaces, tracks, and objects are separated from those belonging to other relays. You control who can publish and who can subscribe by issuing tokens scoped to the operations each client needs.
Before using the API, create a Cloudflare API token with MoQ permissions. Use Account > MoQ > Edit, scoped to your account. The dashboard groups MoQ under Realtime, but Realtime permissions do not grant MoQ API access.
To create a relay via the API:
curl -X POST \
"https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/moq/relays" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "My Relay"}'Cloudflare returns a relay ID and two default tokens: one that can publish and subscribe, and one that can only subscribe. Token secrets are shown once in the response and never stored.
These relay connection tokens authenticate publishers and subscribers. They are separate from the Cloudflare API token used to manage relays. For response fields and token-management examples, refer to Use the MoQ API.
You can also create and manage relays in the Cloudflare dashboard under Media > Realtime > MoQ Relay.
Use https://draft-18.cloudflare.mediaoverquic.com with draft-18-compatible clients. Both publisher and subscriber must use the same draft endpoint and tokens from the same relay.
Clients send a relay connection token in the URL path when opening a MoQ session. For the open-source moq-rs ↗︎ tools, use the draft-18-dev branch for draft-18 support. Changing the endpoint alone does not upgrade a draft-16 client.
Publisher:
ffmpeg -stream_loop -1 -re -i input.mp4 \
-f mp4 -movflags empty_moov+frag_every_frame+separate_moof+omit_tfhd_offset - \
| moq-pub --name my-namespace \
"https://draft-18.cloudflare.mediaoverquic.com/<PUBLISH_SUBSCRIBE_TOKEN>"Subscriber:
moq-sub --name my-namespace \
"https://draft-18.cloudflare.mediaoverquic.com/<SUBSCRIBE_TOKEN>" \
| ffplay -hide_banner -For draft-16 clients, use the same relay-token URL format with the draft-16 endpoint:
https://draft-16.cloudflare.mediaoverquic.com/<RELAY_CONNECTION_TOKEN>Draft-14 clients use the draft-14 endpoint:
https://draft-14.cloudflare.mediaoverquic.com/