Cloudflare Stream
Add live and on-demand video to your app with one API — no servers, no encoding pipeline to babysit.
What is Cloudflare Stream?
Cloudflare Stream is an all-in-one video platform: you upload a video (or start a live broadcast) and Cloudflare encodes it, stores it, and delivers it worldwide with a ready-made player you can embed in one line.
Encoding (also called transcoding) means converting your raw video into multiple sizes and a streaming-friendly format. Stream does this automatically, so the same upload plays smoothly on a phone on slow data or a laptop on fast Wi-Fi.
Think of it like a video factory + courier
You drop off one master tape. The factory makes copies in every quality, and a global courier hands the right copy to each viewer based on their screen and internet speed — instantly.
Why use it?
Running your own video infrastructure is hard and expensive: encoding servers, storage, a streaming protocol, a player, and bandwidth bills. Stream replaces that whole stack with one API and predictable per-minute pricing.
Encoding included
Uploads are transcoded into an adaptive bitrate ladder automatically. Encoding and ingest are free.
Free player
A polished, mobile-friendly player ships with it — embed via an iframe, no coding required.
Simple pricing
Pay only for minutes stored and minutes watched. No surprise egress (bandwidth) fees.
Access control
Signed URLs let you protect paid or private videos so only authorized viewers can play them.
When should you use it?
Online courses
Host lesson videos that stream smoothly to students on any device or connection.
Live streaming
Broadcast events, webinars, or gaming live, then keep the recording on demand.
Creator platforms
Let users upload clips with one-time URLs and play them back instantly.
Marketing & product
Embed product demos or hero videos without slowing down your site.
How to get started
We'll upload a video, wait for it to finish encoding, then embed the player. You only need an API token and your Account ID from the Cloudflare dashboard.
Set your credentials
Export your API token and Account ID so the commands below can use them. The token is like a password for your code.
export CLOUDFLARE_API_TOKEN="your-token-here" export ACCOUNT_ID="your-account-id-here"Upload a video file
For files under 200 MB you can post the file directly. The -F file=@ part attaches a local video.
curl -X POST \ https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/stream \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -F file=@/path/to/video.mp4Or copy from a URL
Already have the video online? Tell Stream to fetch it. The response includes a uid — the video's unique id.
curl -X POST \ https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/stream/copy \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{"url":"https://example.com/video.mp4","meta":{"name":"My first video"}}'Check it is ready
Encoding takes a moment. When status.state is 'ready' and readyToStream is true, you can play it.
{ "result": { "uid": "6b9e68b07dfee8cc2d116e4c51d6a957", "readyToStream": true, "status": { "state": "ready" } }, "success": true }Embed the player
Paste this iframe into your page. Replace <CODE> with your customer code and <UID> with the video uid. Done — a full adaptive player appears.
<iframe src="https://customer-<CODE>.cloudflarestream.com/<UID>/iframe" title="My first video" allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;" allowfullscreen="true" style="border: none; width: 100%; aspect-ratio: 16/9;"> </iframe>
Big files? Use tus
For uploads over 200 MB (up to a 30 GB max), Stream supports the tus protocol, which resumes the upload if your connection drops.
Key concepts
Adaptive bitrate 自適應位元率
The player automatically switches between quality levels based on the viewer's network — fewer buffering spinners.
Transcoding 轉碼
Converting your original into multiple resolutions and a streaming format (HLS/DASH). Stream does this for you.
HLS / DASH
Streaming protocols that chop video into small chunks so playback can adapt quality on the fly.
Signed URLs 簽章網址
Time-limited tokens that restrict who can watch — perfect for paid or private content.
Direct creator upload 直接上傳
One-time upload URLs you give users so they upload to Stream without seeing your API token.
Live input 直播輸入
A reusable endpoint you stream to (via RTMPS/SRT) for live broadcasts, with optional recording.
Tips & pricing
How billing works
You pay $5 per 1,000 minutes of video stored per month, and $1 per 1,000 minutes delivered (watched). Uploading and encoding are always free, and there are no separate bandwidth charges.
Storage is prepaid
Stored minutes are bought in advance. If you run out, you can't upload new videos or start live streams until you add more storage or delete old videos.
- Live and on-demand video are billed the same way — by minutes stored and delivered.
- Max single upload is 30 GB; use tus for anything large to get resumable uploads.
- Add captions/subtitles and a thumbnail to make videos more accessible and clickable.
- Use signed URLs for paid content so links can't be freely shared.
Related products
menu_bookOfficial docsopen_in_new