Skip to content

Changelog

New updates and improvements at Cloudflare.

createAI replaces workers-ai-provider and ai-gateway-provider

The Agents SDK has a new createAI function for the AI SDK and Pi AI. It unifies what workers-ai-provider and ai-gateway-provider did: Workers AI models, AI Gateway catalog models, dynamic routes, and vendor models, through the AI binding or an account id and API token.

workers-ai-provider and ai-gateway-provider are now feature frozen and marked as deprecated. Please migrate at your convenience.

npm i agents
import { createAI } from "agents/models/ai-sdk";
import { streamText } from "ai";

export default {
	async fetch(request, env) {
		const ai = createAI({ binding: env.AI, id: "my-gateway" });

		const result = streamText({
			model: ai("anthropic/claude-opus-5.5", {
				fallback: ["@cf/zai-org/glm-4.7-flash"],
			}),
			prompt: "Write a haiku about Durable Objects",
		});

		return result.toTextStreamResponse();
	},
};
import { createAI } from "agents/models/ai-sdk";
import { streamText } from "ai";

export default {
	async fetch(request: Request, env: Env) {
		const ai = createAI({ binding: env.AI, id: "my-gateway" });

		const result = streamText({
			model: ai("anthropic/claude-opus-5.5", {
				fallback: ["@cf/zai-org/glm-4.7-flash"],
			}),
			prompt: "Write a haiku about Durable Objects",
		});

		return result.toTextStreamResponse();
	},
};

With createAI you get:

  • Every model by id. Workers AI @cf/ ids, any model in the AI Gateway catalog, and dynamic routes as dynamic/<route>.
  • Vendor model objects. Pass a model from the vendor's own package, such as ai(anthropic("claude-opus-5-5")). It goes unchanged to AI Gateway's provider-native endpoint.
  • The binding, or an account id and API token. Use a gateway in another account, or call from outside a Worker.
  • Gateway options, fallback, and BYOK. Caching, logging, metadata, retries, byokAlias, zdr, and vendorKey.
  • Stream resume. Through the binding, a catalog or dynamic route stream that drops mid-answer resumes.
  • Other model types. Embeddings, images, speech, transcription, and reranking in the AI SDK provider, and images in Pi AI.
Before After
createWorkersAI({ binding }) createAI({ binding })
createWorkersAI({ accountId, apiKey }) createAI({ accountId, apiToken })
createAiGateway(...) createAI(...), with fallback for a list of models
createAISearch from workers-ai-provider createAISearchNamespace from ai-search-provider

For AI Search, use ai-search-provider. For more information, refer to Models.

Basin SQL supports OFFSET

Basin SQL is a serverless, distributed SQL engine for querying Apache Iceberg tables in Basin Catalog. It now supports OFFSET, which lets you skip a specified number of rows when retrieving query results.

Use LIMIT to set the page size and OFFSET to skip earlier rows. With a page size of 100, use OFFSET 0 for the first page, OFFSET 100 for the second, and increase the offset by 100 for each later page. Add ORDER BY on a unique column to keep the row order consistent.

For example, this query returns the second page of 100 rows:

SELECT sale_id, total_amount
FROM my_namespace.sales_data
ORDER BY sale_id
LIMIT 100 OFFSET 100

For syntax and examples, refer to the OFFSET clause in the Basin SQL reference.

WAF Release - 2026-10-21 - Emergency - Cloudflare Managed Ruleset

This emergency release adds seven rules to the Cloudflare Managed Ruleset to detect anomalous request patterns.

RulesetRule IDLegacy Rule IDDescriptionPrevious ActionNew ActionComments
Cloudflare Managed RulesetN/AGeneric Rules - Anomalous Execution - 1N/ABlockThis is a new detection.
Cloudflare Managed RulesetN/AGeneric Rules - Anomalous Execution - 2N/ABlockThis is a new detection.
Cloudflare Managed RulesetN/AGeneric Rules - Anomalous Execution - 3N/ABlockThis is a new detection.
Cloudflare Managed RulesetN/AGeneric Rules - Anomalous Execution - 4N/ABlockThis is a new detection.
Cloudflare Managed RulesetN/AGeneric Rules - Anomalous Execution - 5N/ABlockThis is a new detection.
Cloudflare Managed RulesetN/AGeneric Rules - Anomalous Execution - 6N/ABlockThis is a new detection.
Cloudflare Managed RulesetN/AGeneric Rules - Anomalous Execution - 7N/ABlockThis is a new detection.

For more information, refer to WAF Managed Rules.

WAF Release - 2026-10-21 - Emergency - Cloudflare Free Ruleset

This emergency release adds seven rules to the Cloudflare Free Ruleset to block anomalous request patterns.

RulesetRule IDLegacy Rule IDDescriptionPrevious ActionNew ActionComments
Cloudflare Free RulesetN/AGeneric Rules - Anomalous Execution - 1N/ABlockThis is a new detection.
Cloudflare Free RulesetN/AGeneric Rules - Anomalous Execution - 2N/ABlockThis is a new detection.
Cloudflare Free RulesetN/AGeneric Rules - Anomalous Execution - 3N/ABlockThis is a new detection.
Cloudflare Free RulesetN/AGeneric Rules - Anomalous Execution - 4N/ABlockThis is a new detection.
Cloudflare Free RulesetN/AGeneric Rules - Anomalous Execution - 5N/ABlockThis is a new detection.
Cloudflare Free RulesetN/AGeneric Rules - Anomalous Execution - 6N/ABlockThis is a new detection.
Cloudflare Free RulesetN/AGeneric Rules - Anomalous Execution - 7N/ABlockThis is a new detection.

For more information, refer to WAF Managed Rules.

Think agents now use a @cloudflare/computer workspace

Think and Agent Skills now use the workspace from @cloudflare/computer ↗︎ as well as the filesystem tools. A JavaScript execution environment can be configured by adding the WorkerJavaScriptBackend.

@cloudflare/shell is deprecated, and so is Think's createExecuteTool. These will no longer be developed nor supported from today onwards.

import { Think } from "@cloudflare/think";
import { Workspace } from "@cloudflare/computer";
import { WorkerJavaScriptBackend } from "@cloudflare/computer/backends/worker-javascript";

export class MyAgent extends Think {
	workspace = new Workspace({
		storage: this.ctx.storage,
		backends: [
			new WorkerJavaScriptBackend({ id: "js", loader: this.env.LOADER }),
		],
	});
}
import { Think } from "@cloudflare/think";
import { Workspace } from "@cloudflare/computer";
import { WorkerJavaScriptBackend } from "@cloudflare/computer/backends/worker-javascript";

export class MyAgent extends Think<Env> {
	override workspace = new Workspace({
		storage: this.ctx.storage,
		backends: [
			new WorkerJavaScriptBackend({ id: "js", loader: this.env.LOADER }),
		],
	});
}

Migrate your workspace data

This is a breaking change. @cloudflare/computer stores files in different tables from @cloudflare/shell, and there is no automatic data migration between workspace formats. To keep an existing workspace, copy its files with the script in Migrating from @cloudflare/shell to @cloudflare/computer ↗︎. Otherwise your agent will start with an empty workspace, though the original data will still be present in the existing tables.

For more information, refer to Think tools.

Wrangler and cf now upload source maps by default

From Wrangler 4.150.0, wrangler deploy, wrangler versions upload, and wrangler preview generate and upload source maps by default. You no longer need to set upload_source_maps to get stack traces with your original file names and line numbers.

cf deploy also uploads source maps by default. With the Cloudflare Vite plugin 1.64.0 or later, Worker builds generate source maps by default, and cf deploy uploads every source map in the build output.

Stack Trace with Source Map remapping

Remapped stack traces show up in Workers Logs, real-time logs, Tail Workers, and Workers Issues. Source maps are applied after your Worker runs, so they don't affect CPU time, bundle size, or cold starts.

If your Worker uses a custom build, Wrangler uploads any external source maps it finds. Maps it can't resolve, such as inline data: source maps, are skipped instead of failing the upload. Set upload_source_maps to true if you'd prefer the upload to fail.

To opt out with Wrangler, set upload_source_maps to false:

{
	"upload_source_maps": false
}
upload_source_maps = false

To opt out with cf or the Cloudflare Vite plugin, set build.sourcemap to false for your Worker's Vite environment. Refer to Disable source maps.

Cloudflare API MCP server now supports step-up authorization

The Cloudflare API MCP server now supports step-up authorization ↗︎.

Grant only the required scopes when you connect, then authorize more on demand as your agent performs a task. When a tool call needs a scope you have not granted, the server returns an insufficient_scope challenge ↗︎ naming it, and your MCP client asks you to approve it. Scopes you already granted are kept.

To start with the least access, choose Minimal on the consent page when you connect https://mcp.cloudflare.com/mcp. Refer to authorization in MCP.

Available now in all MCP clients that support step-up authorization.

Precursor adds Monitor mode

We released Monitor mode at customers' request so they can test Precursor and the Precursor Interstitial without updating bot score.

In Security > Settings, the Precursor Status dropdown now offers Off, Monitor, and Arm. Selecting Arm means Precursor detections can affect bot score and Challenge clearance. Selecting Monitor means Precursor detections do not affect bot score or Challenge clearance.

Precursor Status dropdown with Off, Monitor, and Arm options

We also separated the Precursor Interstitial from the mode. Set the sitewide default with Show Interstitial, then add Interstitial Rules to customize it for specific requests. For example, leave Show Interstitial off across most of your site, but require an interstitial Challenge on /checkout to enforce a valid session before purchase.

Precursor settings with Show Interstitial off and an Open interstitial rules button

For more information, refer to the Precursor documentation.

Cloud Workload Security is now available in Beta

Cloud Workload Security (CWS) is now available in Beta. Apply policy controls to cloud API requests before they reach your cloud provider.

Define policies with request filters and Rego checks. For example, block requests that would make an R2 bucket public. Use workloads and policy sets to target your cloud environments.

Manage your policies in the Cloudflare dashboard. Run the CWS proxy in your environment and route client requests through it to enforce your policies.

CWS requires a Zero Trust subscription. The Zero Trust Free plan is sufficient.

To configure your first guardrail, follow Get started with Cloud Workload Security.

Introducing Clairic: an extraction model for typed values, now on Workers AI

@cf/cloudflare/clairic is now available on Workers AI as a preview. Clairic is the first extraction model: a System One model that answers with values instead of text. We intend to release the model with open weights soon.

Decision models such as Clef choose among options you define up front. Many structured-output tasks do not have answers you can list in advance: an invoice total, a delivery date, the number of days a shipment is late, or what a repair will cost. Clairic handles these. You send a state and a schema of typed fields, and it returns one typed value per field. A value is read from the input, computed from it, or predicted beyond it.

Clairic does not generate tokens. It reads your input in one pass and decodes each answer under the rules of its type, so every answer is a valid value of the type you asked for, or null when the input does not determine it.

Typed fields

Define as many fields as you need. Fields that do not fit beside the input in one pass are split across parallel passes, so there is no upper limit.

Type Returns
text An exact span of the input, with its character offsets
number A number read or worked out from the input, honoring integer and decimals
date, time, datetime Real calendar dates and valid times, in ISO form
duration A length of time in the unit you choose
list Every matching text, number, or date, in input order
estimate A distribution inside your min and max, on your step grid, on a linear or log scale
forecast One estimate per future step of a series, up to 64 steps

Every scalar answer includes p_null, the probability that the input does not determine the value, and a confidence score. Estimates and forecasts include a median and an 80% interval (p10 to p90). Set options.include_quantiles to also get all 99 percentiles. Use these to decide what to automate and what to send to review.

You can also pass up to four images alongside the state.

const response = await env.AI.run("@cf/cloudflare/clairic", {
	model: "clairic",
	state:
		"Invoice INV-2291 from Northwind Supply, issued 2026-09-02, net 30. 4 pallets at $250.00 each, shipping $80.00. Contact: Dana Ruiz, Priya Shah.",
	fields: {
		invoice_number: { type: "text" },
		issued: { type: "date" },
		due_date: {
			type: "date",
			instructions: "Issue date plus the net payment days",
		},
		total: {
			type: "number",
			decimals: 2,
			unit: "USD",
			instructions: "Amount due including shipping",
		},
		contacts: { type: "list", items: "text" },
	},
});

// response.answers.invoice_number.value -> "INV-2291", with its span in the state
// response.answers.total.value -> the amount due, with p_null and confidence
const response = await env.AI.run("@cf/cloudflare/clairic", {
	model: "clairic",
	state:
		"Invoice INV-2291 from Northwind Supply, issued 2026-09-02, net 30. 4 pallets at $250.00 each, shipping $80.00. Contact: Dana Ruiz, Priya Shah.",
	fields: {
		invoice_number: { type: "text" },
		issued: { type: "date" },
		due_date: {
			type: "date",
			instructions: "Issue date plus the net payment days",
		},
		total: {
			type: "number",
			decimals: 2,
			unit: "USD",
			instructions: "Amount due including shipping",
		},
		contacts: { type: "list", items: "text" },
	},
});

// response.answers.invoice_number.value -> "INV-2291", with its span in the state
// response.answers.total.value -> the amount due, with p_null and confidence

Preview

The current endpoint is an early checkpoint, and we expect it to improve:

  • Arithmetic: One- and two-step calculations, such as totals, differences, conversions, and date arithmetic, are reliable. Long chains of dependent steps and aggregations across many table rows are not yet. Extract the inputs with Clairic and do the math in code.
  • Estimates: Clairic estimates best when the input contains evidence such as comparables, history, or descriptive text. Without evidence, the interval is wide.
  • Forecasts: Forecasting is basic. Next-step forecasts follow recent patterns, but forecasts several steps out flatten toward the average, and Clairic does not anticipate events the series does not show, such as holidays. It does not replace a time-series model trained on your data.
  • Calibration: Intervals are trained to be calibrated and are on most held-out sets, but they can run narrow on unfamiliar data.
  • Confidence: Every answer is well formed, not necessarily correct. Use confidence, p_null, and the intervals to decide what to automate and what to send to review.
  • Dates: Dates without a year are resolved from context. If a field depends on the current date, set reference_date or add a line such as Today: 2026-10-19 to the state.

Pricing

Clairic costs $0.10 per million input tokens. Because it generates no tokens, there is no output token charge.

Get started

Use Clairic through the Workers AI binding (env.AI.run()) or the REST API at /ai/run. You can also use AI Gateway with these endpoints.

For more information, refer to the Clairic model page, extraction models, pricing, and the blog post ↗︎.

DeepSeek V4.1 Flash 1017 now available on Workers AI

@cf/deepseek-ai/deepseek-v4.1-flash-1017 is now available on Workers AI. DeepSeek V4.1 Flash is a multimodal Mixture-of-Experts model with 552B backbone parameters. It activates 8B parameters per token during prefill and 16B during decode, which keeps input-heavy agentic workloads fast and low-cost.

The 1017 release is an update to DeepSeek V4.1 Flash with improvements across reasoning, coding, agentic tasks, and visual benchmarks, and it completes tasks with shorter outputs.

Key capabilities:

  • Vision: Send images alongside text in the same request.
  • Reasoning: Reasoning is on by default at high effort. Set reasoning_effort to low or max to change the effort, or to none to turn reasoning off.
  • Function calling: Build agents that invoke tools and APIs across multiple conversation turns.
  • Long context: A full 1,048,576 token context window.

DeepSeek V4.1 Flash requires the Workers Paid plan or prepaid AI Gateway credits. The default rate limit is 20 requests per minute with standard Workers AI billing and 50 requests per minute with prepaid AI Gateway credits. For details, refer to limits.

Use DeepSeek V4.1 Flash through the Workers AI binding (env.AI.run()), the REST API, the OpenAI-compatible endpoint, or AI Gateway.

For more information, refer to the DeepSeek V4.1 Flash model page and pricing.

Test Cron Triggers with Local Explorer

Local Explorer can now send one-off Cron Trigger invocations to a Worker's scheduled() handler during local development. This removes the need to construct request URLs when testing handler behavior.

Start your local development server with cf dev, wrangler dev, or the Cloudflare Vite plugin. Open /cdn-cgi/local/explorer on the server URL and select Cron Triggers.

The browser interface supports the following tasks:

  • Invoke configured cron expressions
  • Build ad hoc expressions
  • Set reusable scheduled times
  • Inspect outcomes and noRetry() status

Ad hoc triggers and scheduled time presets stay in your browser. They do not change cloudflare.config.ts, your Wrangler configuration, or deployed Cron Triggers. Local development does not run cron schedules automatically.

Full logs and traces are available in the development session that owns the Worker when that session has Observability turned on.

The following example uses port 8787. Replace it with your development server port, such as 5173 for Vite.

The Local Explorer API exposes the same operation for tools and AI agents. The request targets an exact Worker name and accepts a cron expression and optional scheduled time:

curl -X POST \
  "http://localhost:8787/cdn-cgi/local/explorer/api/local/scheduled?worker=my-worker" \
  -H "Content-Type: application/json" \
  --data '{"cron":"0 * * * *","scheduled_time":1745856238000}'

For more details, refer to Test Cron Triggers with Local Explorer.

AI Search keyword search supports Japanese, Chinese, and Korean queries

AI Search keyword search with the trigram tokenizer now matches Japanese, Chinese, and Korean queries, including full natural-language questions such as 経費精算の締め日はいつですか?. Previously, a query without spaces was treated as a single exact phrase and usually returned no keyword results.

The porter tokenizer does not work well for these languages. If your content is in Japanese, Chinese, or Korean, set keyword_tokenizer to trigram. Changing the tokenizer triggers a full reindex.

Refer to Keyword search for tokenizer details.

Search Cloudflare documentation with the Cloudflare CLI

Cloudflare CLI 1.0.0-beta.16 includes cf docs search, so you and your coding agent can find Cloudflare documentation without leaving the terminal. Search for guides, tutorials, and examples across Cloudflare products.

To install or update to the latest release:

npm install --global cf@latest

Describe what you want to do, or ask a question:

cf docs search "proxy a DNS record"
cf docs search "rate limit requests with WAF"
cf docs search "schedule a worker"

The command searches live Cloudflare documentation and returns up to five ranked JSON results. Each result includes a title, description, and documentation URL. An Internet connection is required.

Terminal demo of Cloudflare CLI beta-16 searching DNS and WAF documentation

Agents can parse the results and fetch a complete page as Markdown. For example, use jq to select the first result, then request its URL with the Accept: text/markdown header:

url=$(cf docs search "proxy a DNS record" | jq -r '.[0].url')
curl -H "Accept: text/markdown" "$url"

This release also standardizes generated command names to kebab-case. For example, cf accounts billing getCredits becomes cf accounts billing get-credits. For the full list of breaking command and flag changes, refer to the Cloudflare CLI release notes ↗︎.

For more information, refer to Find Cloudflare documentation with a coding agent.

50,000 routes per account and Tunnels for Platforms

Two changes make it easier to run Cloudflare Tunnel at scale.

50,000 routes per account by default

The default limit for routes is now 50,000 per account, up from 1,000. This limit covers CIDR routes and hostname routes for Cloudflare Tunnel and Cloudflare Mesh. The new limit applies to every account automatically, with no action required.

Published applications (public hostnames) are not routes and are not affected by this limit. Each tunnel supports roughly 5,000–10,000 published applications, depending on the size of its configuration. For details, refer to Published application limits.

Tunnels for Platforms

Every account includes 1,000 tunnels. With Tunnels for Platforms, you can now run more than 1,000 tunnels in a single account — for example, one tunnel per device, per end customer, or per development environment.

Buy additional tunnels from the Tunnels page in the Cloudflare dashboard

To buy additional tunnels, go to Networking > Tunnels and select Buy more tunnels in the Usage card. Additional tunnels are billed at $4.50 per tunnel per month. Enterprise customers can contact their account team for committed or usage-based pricing.

Go to Tunnels ↗

For pricing, limits, and best practices for managing large tunnel fleets, refer to Tunnels for Platforms.

Application Library now supports custom applications

Starting today, you can create custom applications in the Application Library and reference them in Gateway DNS, Network, and HTTP policies. You can define an application with hostnames, IP subnets, or both. Then, optionally add TCP or UDP ports or port ranges to restrict HTTP and Network matching.

Custom application form with a name, application ID, category, two hostnames, and a TCP port 443 constraint

This release also improves search and filtering in the Application Library, updates the interfaces, data, and metrics used to review applications, and makes it easier to select and manage applications in the Gateway policy builder.

Gateway HTTP policy builder with a custom application selected in the Application selector under the Artificial Intelligence category

For more information, refer to Custom applications and Applications and app types.

BGP route filtering for IPsec and GRE tunnels

Cloudflare WAN and Magic Transit IPsec and GRE tunnels now support BGP import and export filtering.

Create reusable filter profiles that specify an allow or deny action and a list of Classless Inter-Domain Routing (CIDR) targets with exact, more-specific, or prefix-length matching. Each tunnel supports one import filter and one export filter.

You can create and assign profiles through the dashboard, API, or Terraform. Profile changes apply without resetting the BGP session.

For configuration details, refer to:

Gateway and Workers integration is now in public beta

Cloudflare Gateway now integrates with Cloudflare Workers in public beta on all Zero Trust plans. You can use the Forward action in Gateway HTTP policies to run your own code on matching, permitted traffic without managing a separate proxy.

The Forward action lets you transform HTTP requests and responses, return a coaching page, or run background tasks such as Slack notifications and R2 captures. Your Worker receives the request and Gateway context, including connection metadata, user identity, and device posture when available.

A matching Gateway Forward policy sends HTTP traffic to a Worker, which processes requests and responses for Internet or private-network upstream services.

Gateway handles the proxy connection, TLS decryption, and upstream routing. It evaluates HTTP request policies before Forward policies and inspects the final response before returning it to the user.

Gateway inspects the original request body before delivering it to your Worker. A body-inspection Block decision can interrupt the Worker.

To get started, deploy a Worker and configure a Forward policy, or adapt one of the Worker templates.

Ultra-low latency live with WebRTC is now Generally Available in Stream

Stream WebRTC support ↗︎ lets you deliver high quality live video to thousands of concurrent viewers in milliseconds. WebRTC is compatible with native Web APIs and standard protocols, so creators can go live from a browser ↗︎ without needing a separate broadcast application. This powers platforms to build custom experiences with deep feature integration for creators as well as viewers. Here's how to get started with a Stream live input and a browser.

Usage-based billing for WebRTC begins today, October 15, 2026 and follows the standard rates for minutes of video delivered. Refer to pricing ↗︎ for rates.

What changed

While in beta, Stream’s WebRTC support was rebuilt from the ground up to leverage Cloudflare Realtime ↗︎’s primitives for stability and scale while managing these components in Stream’s familiar, unified API that makes it easy to build. We also adopted the latest WHIP and WHEP protocol standards for Trickle ICE, server and client offer modes, and counter-offer support for improved player library compatibility and network traversal adaptability. Finally, WebRTC delivery will now be visible in Stream’s analytics ↗︎ and billable usage charts.

How does this relate to Cloudflare Realtime

Realtime exposes a set of tools and primitives to build applications that connect people, AI systems, and devices together in many-to-many experiences powered by WebRTC. Stream leverages these building-blocks to deliver one-to-many broadcast capabilities, controlled and managed by a single, unified API with features like the built-in player ↗︎ and analytics ↗︎ that make it easy to get started.

How do I get started

First, create a live input ↗︎ using cf ↗︎, the API, or in the Stream Dashboard ↗︎:

Creating a live input with cf or APIsh
# Using cf, the new Cloudflare CLI
cf stream live-inputs create

# Using an API request,
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/stream/live_inputs \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
    -X POST

The response will include webRTC and webRTCPlayback properties, each containing a url for WHIP (broadcast) and WHEP (playback) respectively.

Next, you can go live using WHIP directly from a browser or supported broadcast software. Refer to our new tutorial ↗︎ that shows a dependency-free way to broadcast live video with browser-native JavaScript.

Finally, you can play using WHEP using Stream’s built-in player ↗︎, a supported player app/library, or simple JavaScript:

Abbreviated JavaScript playback examplejs
	const pc = new RTCPeerConnection();

	// 1. Ask to receive one audio track and one video track.
	pc.addTransceiver("video", { direction: "recvonly" });
	pc.addTransceiver("audio", { direction: "recvonly" });

	// 2. Attach incoming media to the video element as it arrives.
	const stream = new MediaStream();
	document.getElementById("playback-video").srcObject = stream;
	pc.ontrack = (event) => stream.addTrack(event.track);

	// 3. Create the SDP offer and set it as the local description.
	const offer = await pc.createOffer();
	await pc.setLocalDescription(offer);

	// 4. POST the offer to the WHEP endpoint.
	const response = await fetch(WHEP_URL, {
		method: "POST",
		headers: { "Content-Type": "application/sdp" },
		body: offer.sdp,
	});

	// 5. Apply the SDP answer returned by Cloudflare.
	const answer = await response.text();
	await pc.setRemoteDescription({ type: "answer", sdp: answer });

Learn more in the Stream WebRTC ↗︎ docs or try the all-in-one tutorial ↗︎ for yourself.