Get started (56)
Last updated Oct 15, 2026 Stream Live WebRTC is now GA:
Billing for WebRTC delivery began on October 15th, 2026.
Upload your first video
Step 1: Upload an example video from a public URL
You can upload videos using the API or directly on the Stream page of the Cloudflare dashboard.
For a list of accepted file types, refer to Supported video formats.
To use the API, replace the API_TOKEN and ACCOUNT_ID values with your credentials in the example below.
curl \
-X POST \
-d '{"url":"https://storage.googleapis.com/stream-example-bucket/video.mp4","meta":{"name":"My First Stream Video"}}' \
-H "Authorization: Bearer <API_TOKEN>" \
https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/stream/copy
const client = new Cloudflare({
apiEmail: process.env['CLOUDFLARE_EMAIL'],
apiKey: process.env['CLOUDFLARE_API_KEY'],
});
const video = await client.stream.copy.create({
account_id: '<ACCOUNT_ID>',
url: 'https://storage.googleapis.com/stream-example-bucket/video.mp4',
meta: { name: 'My First Stream Video' },
});
See the full Stream REST API and SDK reference for details on using REST API from external applications, with pre-generated SDK's for external TypeScript, Python, or Go applications.
export default {
async fetch(request, env, ctx): Promise<Response> {
const videoDetails = await env.STREAM.upload(
"https://storage.googleapis.com/stream-example-bucket/video.mp4",
{ meta: { name: "My First Stream Video" } }
);
return new Response(JSON.stringify(videoDetails));
},
} satisfies ExportedHandler<{ STREAM: StreamBinding }>;
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "<ENTER_WORKER_NAME>",
"main": "src/index.ts",
"upload_source_maps": true,
"compatibility_date": "$today",
"observability": {
"enabled": true
},
"stream": {
"binding": "STREAM"
}
}
See the full Workers Stream binding API reference.
Step 2: Wait until the video is ready to stream
Because Stream must download and process the video, the video might not be available for a few seconds depending on the length of your video. You should poll the Stream API until readyToStream is true, or use webhooks to be notified when a video is ready for streaming.
Use the video UID from the first step to poll the video:
Requestbash
curl \
-H "Authorization: Bearer <API_TOKEN>" \
https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/stream/<VIDEO_UID>
Responsejson
{
"result": {
"uid": "6b9e68b07dfee8cc2d116e4c51d6a957",
"preview": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/watch",
"thumbnail": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/thumbnails/thumbnail.jpg",
"readyToStream": true,
"status": {
"state": "ready"
},
"meta": {
"downloaded-from": "https://storage.googleapis.com/stream-example-bucket/video.mp4",
"name": "My First Stream Video"
},
"created": "2020-10-16T20:20:17.872170843Z",
"size": 9032701
//...
},
"success": true,
"errors": [],
"messages": []
}
Step 3: Play the video in your website or app
Videos uploaded to Stream can be played on any device and platform, from websites to native apps. See Play videos for details and examples of video playback across platforms.
To play video on your website with the Stream Player, copy the uid of the video from the request above, along with your unique customer code, and replace <CODE> and <VIDEO_UID> in the embed code below:
<iframe
src="https://customer-<CODE>.cloudflarestream.com/<VIDEO_UID>/iframe"
title="Example Stream video"
frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
>
</iframe>
The embed code above can also be found on the Stream page of the Cloudflare dashboard.
Next steps
- Edit your video and add captions or watermarks
- Customize the Stream player
Start your first live stream
Step 1: Create a live input
You can create a live input using the API or the Live inputs page of the Cloudflare dashboard.
To use the API, replace the API_TOKEN and ACCOUNT_ID values with your credentials in the example below.
curl -X POST \
-H "Authorization: Bearer <API_TOKEN>" \
-D '{"meta": {"name":"test stream"},"recording": { "mode": "automatic" }}' \
https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/stream/live_inputs
const client = new Cloudflare({
apiEmail: process.env['CLOUDFLARE_EMAIL'],
apiKey: process.env['CLOUDFLARE_API_KEY'],
});
const liveInput = await client.stream.liveInputs.create({
account_id: '<ACCOUNT_ID>',
meta: { name: 'test stream' },
recording: { mode: 'automatic' },
});
Responsejson
{
"uid": "f256e6ea9341d51eea64c9454659e576",
"rtmps": {
"url": "rtmps://live.cloudflare.com:443/live/",
"streamKey": "MTQ0MTcjM3MjI1NDE3ODIyNTI1MjYyMjE4NTI2ODI1NDcxMzUyMzcf256e6ea9351d51eea64c9454659e576"
},
"created": "2021-09-23T05:05:53.451415Z",
"modified": "2021-09-23T05:05:53.451415Z",
"meta": {
"name": "test stream"
},
"status": null,
"recording": {
"mode": "automatic",
"requireSignedURLs": false,
"allowedOrigins": null
}
}
See the full Stream REST API and SDK reference for details on using REST API from external applications, with pre-generated SDK's for external TypeScript, Python, or Go applications.
Step 2: Copy the RTMPS URL and key, and use them with your live streaming application.
We recommend using Open Broadcaster Software (OBS) ↗︎ to get started.
Step 3: Play the live stream in your website or app
Live streams can be played on any device and platform, from websites to native apps, using the same video players as videos uploaded to Stream. See Play videos for details and examples of video playback across platforms.
To play the live stream you just started on your website with the Stream Player, copy the uid of the live input from the request above, along with your unique customer code, and replace <CODE> and <VIDEO_UID> in the embed code below:
<iframe
src="https://customer-<CODE>.cloudflarestream.com/<VIDEO_UID>/iframe"
title="Example Stream video"
frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
>
</iframe>
The embed code above can also be found on the Stream page of the Cloudflare dashboard.
Next steps
Accessibility considerations
To make your video content more accessible, include captions and high-quality audio recording ↗︎.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/stream/get-started/#page","headline":"Get started","description":"Upload your first video or start your first live stream with Cloudflare Stream.","url":"https://developers.cloudflare.com/stream/get-started/","inLanguage":"en","image":"https://developers.cloudflare.com/stream/get-started/og.png?v=cca869b4b7a6bf73","dateModified":"2026-10-15","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Review upload methods, supported formats, and recommendations for Cloudflare Stream. title: Upload videos image: https://developers.cloudflare.com/stream/uploading-videos/og.png?v=6a137c2b6f67377b
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/stream/llms.txt
Use this file to discover all available pages before exploring further.
Docs