---
title: "Cloudflare"
description: "Browser Run with routes for output, crawl jobs, links, extract and the accessibility tree, plus WebMCP page tools. Runs off your cf auth login."
canonical_url: "https://browsers.agntn.dev/providers/cloudflare"
---
# Cloudflare

> Browser Run with routes for output, crawl jobs, links, extract and the accessibility tree, plus WebMCP page tools. Runs off your cf auth login.

<provider-facts name="cloudflare">



</provider-facts>

Cloudflare's Browser Run has a REST route for nearly everything: `/markdown`, `/content`, `/screenshot`, `/pdf`, `/links`, `/json` for extract, `/accessibilityTree`, and `/crawl` for jobs. No session needed for any of them. The operations band above adds them up.

Already ran `cf auth login`? Cloudflare can use that session, so there's no token to export. The provider gets credentials through `@agntn/credentials`. It checks for a token in this order: config `apiKey`, `CLOUDFLARE_API_TOKEN`, then the cf session. For the account, it checks config `accountID`, `AGNTN_CLOUDFLARE_ACCOUNT_ID`, `CLOUDFLARE_ACCOUNT_ID`, then the session if it reaches exactly one account. An exported `CLOUDFLARE_API_TOKEN` still needs an account variable. The session doesn't lend it one.

The old `CF_API_TOKEN` and `CF_ACCOUNT_ID` dance is over. Neither name is read anymore, so this is a breaking change. A cf token expires, so the provider looks credentials up per request. A 401 with a cf token gets one retry with a fresh token from cf. A config or env token fails right away, because asking again returns the same one.

Ask for more than one output and it renders once: `formats: ["markdown", "html"]`, `screenshot: true` or `links: true` go through `/snapshot` and come back together. With `links: true` the unique hrefs land in `page.links`. That's a tidy way to keep text and destinations together. A scrape also fills `title` and `statusCode`.

The markdown starts with a front matter block. It puts `title: "Example Domain"` between `---` lines, followed by the page text.

`browser: "kitesurf"` switches to Cloudflare's Kitesurf engine. Without it you're on Chromium. Just don't ask it for a session. Cloudflare ties each Kitesurf browser to its CDP socket, and its session route used to start Chromium without a word. Now `createSession()` throws `InvalidInputError` before any request. Scrape, crawl, WebMCP and the rest still take Kitesurf.

Kitesurf's `/snapshot` answers every body with HTTP 422, even a bare `{ url }`, so scrapes with several outputs used to just fail. Now each output goes to its own route at once, `/markdown`, `/content`, `/screenshot` or `/links`, and comes back merged. The single render takes a break here. Each output costs a render, but at least the scrape works.

[WebMCP](https://browsers.agntn.dev/guide/webmcp) is the one thing here without a REST route. No route returns what a page's script returns. So each call gets a browser of its own, Kitesurf too. It closes when the call ends.


## Sitemap

See the full [sitemap](https://browsers.agntn.dev/sitemap.md) for all pages.
