# Browsers

6 endpoints at `https://api.kosa8.com`, sent with `Authorization: Bearer $KOSA8_API_KEY`. Generated from the API's own [OpenAPI description](https://api.kosa8.com/openapi.json), which a test holds to the router.

## Open a headless browser for an agent (Cloudflare Browser Run), driven over CDP[#]

POST`/v1/browsers`scope sandboxes:write

Billed per second at BROWSER_PRICE_PER_HOUR ($0.12/browser-hour; GET /v1/pricing rates.browser_h). Against a plan's sandbox-hours a browser-hour counts as an hour of the smallest sandbox (0.25 vCPU). Refused 429 browser_limit past the org's concurrency (Solo 1, Pro 3, Team 5, Scale 10), 503 browsers_full past the account's 200, 402 like a sandbox (plan_required, payment, spending cap).

JSON body

`ttl_s`integer

Closed at this age; an idle browser (no CDP traffic for min(ttl, 20 min)) closes sooner Default `300`. Min 30. Max 3600.

`sandbox_id`string

Attach to a sandbox: the browser closes when the sandbox is deleted

`name`string

—

Responses

201400401402403404429501503

```
curl -s -X POST https://api.kosa8.com/v1/browsers \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json
```

## Open browsers (state=all: the last 100)[#]

GET`/v1/browsers`scope sandboxes:read

Parameters

`state`query · "open" | "all"

—

Responses

200401403

```
curl -s -X GET https://api.kosa8.com/v1/browsers \
  -H "Authorization: Bearer $KOSA8_API_KEY"
```

## A browser, with a fresh cdp_url while it is open[#]

GET`/v1/browsers/{id}`scope sandboxes:read

Parameters

`id`requiredpath · string

Browser id (brw_…)

Responses

200401403404

```
curl -s -X GET https://api.kosa8.com/v1/browsers/$SBX \
  -H "Authorization: Bearer $KOSA8_API_KEY"
```

## Close a browser (billing stops)[#]

DELETE`/v1/browsers/{id}`scope sandboxes:write

Parameters

`id`requiredpath · string

Browser id (brw_…)

Responses

200401403404

```
curl -s -X DELETE https://api.kosa8.com/v1/browsers/$SBX \
  -H "Authorization: Bearer $KOSA8_API_KEY"
```

## Open a URL in the browser and answer its title, text and a screenshot[#]

POST`/v1/browsers/{id}/page`scope sandboxes:write

A new tab, closed after. For agents without a CDP client of their own.

Parameters

`id`requiredpath · string

Browser id (brw_…)

JSON body

`url`requiredstring

—

`screenshot`boolean

—

`text`boolean

—

`full_page`boolean

—

Responses

200400401403404410502504

```
curl -s -X POST https://api.kosa8.com/v1/browsers/$SBX/page \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json
```

## The browser's CDP WebSocket (open cdp_url with a CDP client)[#]

GET`/v1/browsers/{id}/cdp`public

Authenticated by the token in cdp_url, never an API key.

Parameters

`id`requiredpath · string

Browser id (brw_…)

`token`requiredquery · string

—

Responses

101401410

```
curl -s -X GET https://api.kosa8.com/v1/browsers/$SBX/cdp
```

---
Source: https://docs.kosa8.com/api/browsers/
