Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@ sidebar:
order: 30

---
import { DashButton } from "~/components";

A browser session may close for a variety of reasons, occasionally due to connection errors or errors in the headless browser instance. As a best practice, wrap `puppeteer.connect` or `puppeteer.launch` in a [`try/catch`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch) statement.

The reason that a browser closed can be found on the Browser Rendering Dashboard in the [logs tab](https://dash.cloudflare.com/?to=/:account/workers/browser-renderingl/logs). When Cloudflare begins charging for the Browser Rendering API, we will not charge when errors are due to underlying Browser Rendering infrastructure.
To find the reason that a browser closed:

1. In the Cloudflare dashboard, go to the **Browser Rendering** page.

<DashButton url="/?to=/:account/workers/browser-rendering" />

2. Select the **Logs** tab.

When Cloudflare begins charging for the Browser Rendering API, we will not charge when errors are due to underlying Browser Rendering infrastructure.

| Reasons a session may end |
| ---------------------------------------------------- |
Expand Down
19 changes: 9 additions & 10 deletions src/content/docs/browser-rendering/platform/pricing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Pricing
sidebar:
order: 31
---
import { Details } from "~/components"
import { DashButton } from "~/components"

There are two ways to use Browser Rendering. Depending on the method you use, here is how billing works:
- [**REST API**](/browser-rendering/rest-api/): Charged for **Duration** only ($/browser hour)
Expand All @@ -15,14 +15,6 @@ There are two ways to use Browser Rendering. Depending on the method you use, he
| **Workers Free** | 10 minutes per day | 3 concurrent browsers | N/A |
| **Workers Paid** | 10 hours per month | 10 concurrent browsers (averaged monthly) | **1. REST API**: $0.09 per additional browser hour <br />**2. Workers Bindings**: $0.09 per additional browser hour <br /> $2.00 per additional concurrent browser |

<Details header="Where can I monitor my usage?">
You can monitor your Browser Rendering usage in the [Cloudflare dashboard](https://dash.cloudflare.com). Go to **Compute (Workers)** > **Browser Rendering**.
</Details>

<Details header="How is the number of concurrent browsers calculated?">
Cloudflare calculates concurrent browsers as the **monthly average of your daily peak usage**. In other words, we record **the peak number of concurrent browsers each day** and then average those values over the month. This approach reflects your typical traffic and ensures you are not disproportionately charged for brief spikes in browser concurrency.
</Details>

## Examples of Workers Paid pricing
<br/>
#### Example: REST API pricing
Expand Down Expand Up @@ -52,7 +44,14 @@ For **browser duration** and **concurrent browsers**:

### How do I estimate my Browser Rendering costs?

You can monitor your Browser Rendering usage in the [Cloudflare dashboard](https://dash.cloudflare.com). Go to **Compute (Workers)** > **Browser Rendering**. Then, you can use [the pricing page](/browser-rendering/platform/pricing/) to estimate your costs.
To monitor your Browser Rendering usage in the Cloudflare dashboard, go to the **Browser Rendering** page.

<DashButton url="/?to=/:account/workers/browser-rendering" />

Then, you can use [the pricing page](/browser-rendering/platform/pricing/) to estimate your costs.

### Do failed API calls, such as those that time out, add to billable browser hours?
No. If a request to the Browser Rendering REST API fails with a `waitForTimeout` error, the browser session is not charged.

### How is the number of concurrent browsers calculated?
Cloudflare calculates concurrent browsers as the **monthly average of your daily peak usage**. In other words, we record **the peak number of concurrent browsers each day** and then average those values over the month. This approach reflects your typical traffic and ensures you are not disproportionately charged for brief spikes in browser concurrency.
8 changes: 5 additions & 3 deletions src/content/docs/browser-rendering/rest-api/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: REST API
sidebar:
order: 2
---
import { DashButton } from "~/components";

The REST API is a RESTful interface that provides endpoints for common browser actions such as capturing screenshots, extracting HTML content, generating PDFs, and more.
The following are the available options:
Expand All @@ -22,8 +23,9 @@ Before you begin, make sure you [create a custom API Token](/fundamentals/api/ge

:::note[Note]

You can monitor Browser Rendering usage in two ways:
- [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/workers/browser-rendering): View aggregate metrics, including total REST API requests and total browser hours used.
- `X-Browser-Ms-Used` header: Returned in every REST API response, reporting browser time used for that request (in milliseconds).
You can monitor Browser Rendering usage in two ways:
- In the Cloudflare dashboard, go to the **Browser Rendering** page to view aggregate metrics, including total REST API requests and total browser hours used.
<DashButton url="/?to=/:account/workers/browser-rendering" />
- `X-Browser-Ms-Used` header: Returned in every REST API response, reporting browser time used for that request (in milliseconds).

:::
Loading