Stream
All-in-one managed media pipeline for live and on-demand video
Stream makes storing, encoding, and distributing video effortless — eliminating the need for complex infrastructure, multiple vendors, or opaque pricing models.
Unified Media Pipeline
Simple, Predictable Pricing
Built on Cloudflare's Network
Fast, global, unified
Stream provides a complete media pipeline from upload to delivery. Upload videos via API or direct upload, automatically encode to multiple formats and bitrates, then deliver through Cloudflare's global network. Built-in player or integrate with your own — all managed through a single, unified API. With RTMP/SRT ingest for live streaming and HLS/DASH output for compatibility, Stream handles both real-time and on-demand content seamlessly.
E-learning and user-generated content
AI-generated media workflows
Live streaming events
Multi-platform video distribution
Cloudflare Stream delivers video at global scale with unified media pipeline
Transform, encode, and deliver video worldwide with a single API. Stream handles upload, encoding, delivery, and playback — letting you focus on creating great content instead of managing complex video infrastructure.
export default { async fetch(request, env, ctx): Promise<Response> { // Upload a video file const formData = new FormData(); formData.append('file', videoFile);
const uploadResponse = await fetch( 'https://api.cloudflare.com/client/v4/accounts/{account_id}/stream', { method: 'POST', headers: { Authorization: 'Bearer ' + env.CLOUDFLARE_API_TOKEN, }, body: formData, }, );
const uploadResult = await uploadResponse.json(); const videoId = uploadResult.result.uid;
// Get video details const videoResponse = await fetch( 'https://api.cloudflare.com/client/v4/accounts/{account_id}/stream/' + videoId, { headers: { Authorization: 'Bearer ' + env.CLOUDFLARE_API_TOKEN, }, }, );
const videoData = await videoResponse.json();
return new Response( JSON.stringify({ videoId: videoId, playbackUrl: videoData.result.playback.hls, thumbnailUrl: videoData.result.thumbnail, }), ); },};export default { async fetch(request, env) { // Create a live stream const streamResponse = await fetch( 'https://api.cloudflare.com/client/v4/accounts/{account_id}/stream/live_inputs', { method: 'POST', headers: { Authorization: 'Bearer ' + env.CLOUDFLARE_API_TOKEN, 'Content-Type': 'application/json', }, body: JSON.stringify({ meta: { name: 'Live Event Stream', }, recording: { mode: 'automatic', requireSignedURLs: false, }, }), }, );
const streamData = await streamResponse.json(); const streamId = streamData.result.uid;
// Get RTMP ingest URL const rtmpUrl = streamData.result.rtmps.url;
// Get HLS playback URL const playbackUrl = 'https://customer-' + env.CUSTOMER_CODE + '.cloudflarestream.com/' + streamId + '/manifest/video.m3u8';
return new Response( JSON.stringify({ streamId: streamId, rtmpIngestUrl: rtmpUrl, hlsPlaybackUrl: playbackUrl, }), { headers: { 'content-type': 'application/json' }, }, ); },} satisfies ExportedHandler; Stream Pricing
Video hosting and live streaming. View Media pricing details
Minutes Stored
—
$5.00 / thousand minutes
Minutes Delivered
—
$1.00 / thousand minutes
Hypixel