Skip to content
CrawlfolioSourced research on web data for AI
Menu

Explainer

What does Cloudflare Browser Run's /script bill you?

Cloudflare Browser Run's /script runs Playwright in one request. It bills browser hours for the whole session, not per script, plus concurrent browsers.

A navy-framed hourglass with vermilion sand gathered at the bottom
AI-generated image · Made for this page

Cloudflare’s new /script endpoint bills as a Browser Sessions product: browser hours for the session’s whole lifetime, plus concurrent browsers. The docs say it directly: “Browser hours are billed for the session’s lifetime, not per script request.” Docs.

Neither script endpoint closes the session afterwards, so you close it yourself. For a one-page job I’d use a Quick Action, which bills hours only.

Short on time?

Short on time? Here's my pick

One-page jobs: a screenshot, markdown or a single scrape
Quick Actions, which bill browser hours only
No concurrent-browser charge. The pricing page is the source, verified 2026-11-23.
Multi-step flows: log in, click, extract
The script endpoint, and close the session when the script ends
High confidence on the billing rule; medium on cost, because the run times in my examples are assumptions.
Long-lived or interactive sessions you manage yourself
A Browser Sessions connection (CDP or Playwright)
You already own the session lifecycle there, and it bills the same way. This is my judgment.
You're budgeting a month
Assume hours for the whole session, not per script
Read X-Browser-Ms-Used on a small first batch and replace my assumed run times with real ones.

Prices verified . Sponsors cannot buy a verdict or a position.

What is the script endpoint? #

On November 20, Cloudflare let Browser Run run Playwright, Puppeteer or raw CDP code in one API request. You submit a JavaScript function, and it runs “in an isolated Worker connected to a browser session”, so you don’t need to deploy a Worker of your own. Changelog.

POST /script acquires a browser, runs the function and returns the result. POST /script/<sessionId> runs a follow-up script in an existing session. The changelog says nothing about billing and gives no timeout lengths.

The docs fill in the limits. The request body is capped at 10 MiB, and a script times out at 60 seconds by default and 120 at most. Docs, API reference. Rate and concurrency limits match POST /devtools/browser.

Does it bill like Quick Actions? #

No. Quick Actions bill browser hours only. Browser Sessions, which include Puppeteer, Playwright, CDP and custom scripts, bill browser hours plus concurrent browsers, and hours are pooled across all methods. Pricing.

Quick Actions Script endpoint Session via CDP or Playwright
What you send One stateless call: markdown, screenshot, PDF, snapshot, links, scrape, JSON, crawl A JavaScript function in one HTTP request A connection you manage
Bills Browser hours Browser hours + concurrent browsers Browser hours + concurrent browsers
Time limits Navigation 30 s default, 60 s max Script 60 s default, 120 s max Idle timeout 60 s, up to 20 min

Sources: overview, timeouts, limits, script docs.

The rates, verified 2026-11-23: on Workers Paid, 10 browser hours a month are included, then $0.09 an hour. Up to 10 concurrent browsers, averaged monthly, are included, then $2.00 per extra. Workers Free lists 10 browser minutes a day and up to 3 concurrent. Pricing.

The Browser Run pages show “$” without naming a currency. The Workers page states USD, with a $5 a month base. Workers pricing.

Each day’s usage is totalled in seconds, and the monthly total rounds to the nearest whole hour. Concurrency is the average of each day’s peak browsers. The full rate breakdown is in my Browser Run pricing post, so I don’t repeat it.

One neighbouring change: on November 19, /snapshot gained pdf, links, scrape and json formats, and json “incurs Workers AI usage”. Changelog.

What happens to the session after my script runs? #

It stays open. Neither endpoint closes the session after a script. Close it with DELETE /devtools/browser/<sessionId> or browser.close(), or it ends at its idle timeout. Script docs, reuse sessions.

The keep_alive default is 60,000 ms, with a range of 10,000 to 1,200,000. Disconnecting doesn’t close the browser. Script Studio in the dashboard has a “Close browser” option, and the session ID comes back in the cf-browser-session-id header.

The X-Browser-Ms-Used header reports cumulative browser time. The pricing page also warns that a session can stay active after the last script, so billed time may be higher than expected. Pricing.

My reading: if billing follows the session’s lifetime, the idle tail is paid time on every call that doesn’t close its session.

A white marble spiral staircase seen from above, its brass-trimmed steps winding down to a small bright centre
A session can stay open after your last script, so close it yourself and read the idle tail as paid time. Photo: Ludde Lorentz / Unsplash · Unsplash License

What would three jobs cost? #

These are my arithmetic on the published rates, using run times I assumed. They’re illustrations, not measurements, and the docs give no worked /script example. They exclude the $5 Workers base and any other Worker or AI usage.

Job shape (my assumption) Browser time Billable hours Hours charge Concurrency charge
A. One-page jobs on a Quick Action: 20,000 a month at 4 s each 80,000 s = 22.2 h, rounds to 22 12 $1.08 None (hours only)
B. Multi-step flows on the script endpoint, closed at the end: 5,000 a month at 30 s, one at a time 150,000 s = 41.7 h, rounds to 42 32 $2.88 $0 (daily peak 1)
C. Same flows, never closed, 60 s idle timeout: 30 + 60 = 90 s each 450,000 s = 125 h 115 $10.35 $0 (daily peak 1)
D. Cloudflare’s own sessions example: 50 h, average 15 concurrent browsers 50 h 40 $3.60 5 x $2 = $10.00, total $13.60

Estimates, using the rates verified 2026-11-23. Row D is Cloudflare’s example; A to C are mine. B and C assume one browser at a time, so the daily peak stays under the 10 included.

Rows B and C do the same work. C uses about three times the browser time, but only if the session lives to the 60 s idle timeout and is billed for its whole lifetime, which is how I read the docs. Closing the session is the lever.

What does the documentation leave unsaid? #

  • Whether the isolated Worker that runs your code is billed on top of browser hours.
  • Whether a failed script run is billed. Only a Quick Actions waitForTimeout failure is documented as free.
  • Whether parallel pages in one session count as one concurrent browser. I’d guess one, but no page says.
  • Whether browser hours include start-up time.

I don’t claim the Worker is free, or that it’s billed. Until Cloudflare says, budget the hours and the concurrency, and treat the Worker as an open question.

What about Kitesurf? #

The changelog says browser=kitesurf runs “a CDP script”, and no session or page ID headers come back for Kitesurf runs. The Kitesurf page calls it a beta, “available for free, behind per-account limits”. Kitesurf docs.

The script docs say Kitesurf runs follow Kitesurf pricing, and I found no figures. Playwright or Puppeteer scripts on Kitesurf aren’t confirmed, and the API reference describes browser=kitesurf as CDP-only. See my Kitesurf post.

A warm orange plaster spiral staircase seen from below, narrowing to a pale opening
Billing is still partly unknown here, so price a pilot of your own jobs before you commit a pipeline to it. Photo: Adrien Olichon / Unsplash · Unsplash License

What I would do #

For a one-page job I’d use a Quick Action. For a multi-step flow I’d use the script endpoint, finish by closing the session, and read X-Browser-Ms-Used on a first small batch to swap my assumed run times for real ones before pricing a month.

I wouldn’t leave sessions to time out: with the default 60-second idle timeout that is paid time on every call. If you’re still choosing between providers, see the cloud browsers compared, what Browserbase charges for browser hours, search vs fetch vs browser and the agent browsers pillar.

FAQ

Is the script endpoint billed per script?

No. Cloudflare's docs say browser hours are billed for the session's lifetime, not per script request. The pricing page also lists Custom scripts under Browser Sessions, which bill browser hours plus concurrent browsers.

Does the script endpoint close the browser?

No. Neither POST /script nor POST /script/<sessionId> closes the session. Close it with DELETE /devtools/browser/<sessionId> or browser.close(); otherwise it ends at its idle timeout, which defaults to 60 seconds.

How long can a script run?

60 seconds by default and 120 seconds at most. The request body, including the JSON-encoded code, is capped at 10 MiB.

Do I need to deploy a Worker to use it?

No. Your function runs in an isolated Worker that Cloudflare connects to a browser session. Whether that Worker is billed on top of browser hours isn't stated in the docs I read.

Is there a free allowance?

Workers Free lists 10 browser minutes a day and up to 3 concurrent browsers. Workers Paid includes 10 browser hours a month and 10 concurrent browsers, averaged monthly. Verified 2026-11-23.

Can I run the script endpoint on Kitesurf?

The changelog says browser=kitesurf runs a CDP script. I couldn't confirm that Playwright or Puppeteer scripts work on Kitesurf, and session and page ID headers aren't returned for Kitesurf runs.

Sources

14 sources, accessed .

Official pricing, docs, changelogs and status pages 14

  1. Cloudflare changelog: Run custom scripts in Browser Run with /script (2026-11-20) developers.cloudflare.com · accessed
  2. Browser Run docs: Custom scripts developers.cloudflare.com · accessed
  3. Cloudflare API reference: create script developers.cloudflare.com · accessed
  4. Browser Run pricing developers.cloudflare.com · accessed
  5. Browser Run limits developers.cloudflare.com · accessed
  6. Browser Run overview developers.cloudflare.com · accessed
  7. Browser Run: Quick Actions developers.cloudflare.com · accessed
  8. Browser Run: timeouts reference developers.cloudflare.com · accessed
  9. Browser Run: Kitesurf developers.cloudflare.com · accessed
  10. Browser Run: reuse sessions developers.cloudflare.com · accessed
  11. Cloudflare changelog: /snapshot gains all formats (2026-11-19) developers.cloudflare.com · accessed
  12. Browser Run product changelog developers.cloudflare.com · accessed
  13. Workers pricing developers.cloudflare.com · accessed
  14. Cloudflare Browser Run product page cloudflare.com · accessed