> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hotkey.so/llms.txt
> Use this file to discover all available pages before exploring further.

# HTTP API

> Version 1 of the API for scripts and backends. It manages browsers, asks, tabs, downloads, events and agent keys.

Fields may be added to `/v1`, but nothing in it will be renamed or removed without a new version. Agents should use the [MCP tools](https://docs.hotkey.so/tools.md).

The [TypeScript](https://docs.hotkey.so/sdk/typescript.md) and [Python](https://docs.hotkey.so/sdk/python.md) clients send the idempotency keys, wait out the retries and page the lists described below for you. The examples on this page show curl and both clients.

The console's host serves the API, under `/v1`:

```text theme={null}
https://console.hotkey.so/v1
```

Requests and answers are JSON. Keys are snake\_case, and every time is RFC 3339 in UTC (`2026-11-14T09:00:00.000Z`). The MCP host (`https://mcp.hotkey.so`) serves MCP only.

## Authentication

Send an agent key in the `Authorization` header:

```bash curl theme={null}
curl https://console.hotkey.so/v1/account -H "Authorization: Bearer $HOTKEY_KEY"
```

```ts TypeScript theme={null}
import { Hotkey } from '@hotkeyso/sdk';

const hotkey = new Hotkey({ apiKey: process.env.HOTKEY_KEY });
const account = await hotkey.account.get();
```

```python Python theme={null}
import os
from hotkey import Hotkey

hotkey = Hotkey(api_key=os.environ["HOTKEY_KEY"])
account = hotkey.account.get()
```

To make a key in the console, open **Settings**, then **Connect your agent**, then **Tokens for scripts**. You can also make one with `POST /v1/agent_keys`. The console shows each key once.

* Production keys start with `hk_live_`. Keys made on a test hub such as staging start with `hk_test_`. A key sent to a hub of the other mode gets 401 `key_wrong_mode`, which names the mode the hub takes.
* Keys from before November 2026 start with `rbt_` and still work.
* A key belongs to one workspace: your personal one, or a team you belong to. It works on `/v1` and on MCP and reaches only that workspace's browsers. Objects of other workspaces answer as if they don't exist (404). To make a key for a team, switch to the team in the console first. If you leave the team or are removed from it, its keys stop working.
* A key can be made for one browser (`browser` on [`POST /v1/agent_keys`](#agent-keys)). It is the key to give an agent that works for one of your end users: it sees and reaches that browser alone, on `/v1` and on MCP. Every other browser, with its tabs, asks, downloads and events, answers as if it doesn't exist. It makes no browsers or keys, deletes not even its own browser, changes no workspace setting, and gets 403 `key_scoped` on `/api`. Its webhook endpoints get its browser's events only. When the browser is deleted or moved to another workspace, the key stops working (401 `key_revoked`). See [One browser per end user](https://docs.hotkey.so/per-end-user.md).
* Keys that an agent gets by signing in over OAuth (Claude, ChatGPT, Claude Code's `/mcp`) work on MCP only (401 `key_mcp_only` on `/v1`).
* A key you revoked, or one that stopped working because its person left the team, answers 401 `key_revoked` for 90 days.
* Ten wrong keys in 10 minutes from one address block that address for 10 minutes: every request from it gets 429 `too_many_attempts`, with good keys too. A revoked key, an expired one and a key of the other mode never count as wrong, so a script that still holds an old key can't lock its address out.

## Ids

Every id names its kind:

| Prefix | Object |
| - | - |
| `brw_` | browser |
| `acct_` | account |
| `ws_` | workspace |
| `ask_` | ask, written `ask_<browser>_<12 hex>` |
| `dl_` | download, written `dl_<browser>_<uuid>` |
| `key_` | agent key |
| `evt_` | event |
| `we_` | webhook endpoint |
| `req_` | request, in the `Request-Id` header |

A tab's id is the number the agent's tools use (`1001`, `1002` …). Routes also take a browser's id without its `brw_`. If you send the wrong kind of id, the error says which kind you sent.

## Errors

Every answer has a `Request-Id` header. An error answers with a 4xx or 5xx status and this body:

```json theme={null}
{
  "error": {
    "type": "not_found",
    "code": "browser_not_found",
    "param": "id",
    "message": "No browser brw_k3m9x2p7qa4t in this account.",
    "request_id": "req_8Fq2LmZp0XcV4tRa"
  }
}
```

`message` is a sentence for people. Branch on `code`. `param` names the field at fault, or is null. Quote the `request_id` when you report a problem.

The clients throw these as exceptions by status (`NotFoundError`, `ConflictError`, `RateLimitError` …), each carrying `type`, `code`, `param`, the request id and the whole error body:

```ts TypeScript theme={null}
import { NotFoundError } from '@hotkeyso/sdk';

try {
  await hotkey.browsers.get('brw_k3m9x2p7qa4t');
} catch (err) {
  if (err instanceof NotFoundError && err.code === 'browser_not_found') { /* … */ }
  else throw err; // err.requestId names the request
}
```

```python Python theme={null}
from hotkey import NotFoundError

try:
    hotkey.browsers.get("brw_k3m9x2p7qa4t")
except NotFoundError as e:
    if e.code != "browser_not_found":
        raise  # e.request_id names the request
```

| Status | `type` | Some codes |
| - | - | - |
| 400 | `invalid_request` | `parameter_missing`, `parameter_invalid`, `parameter_unknown`, `body_not_json`, `body_not_object`, `owner_only` |
| 401 | `authentication` | `key_missing`, `key_invalid`, `key_revoked`, `key_expired`, `key_replaced`, `key_mcp_only`, `key_wrong_mode` |
| 403 | `permission` | `account_waiting`, `role_too_low` (a team member deleting a browser, changing another member's webhook endpoint, or changing the workspace's settings), `key_scoped` (a key for one browser doing what only a workspace's key does), `https_required` |
| 404 | `not_found` | `browser_not_found`, `ask_not_found`, `tab_not_found`, `download_not_found`, `agent_key_not_found`, `webhook_endpoint_not_found`, `route_not_found` |
| 405 | `invalid_request` | `method_not_allowed`, with an `Allow` header |
| 402 | `plan_limit` | `free_hours_used` (Free's awake minutes for the month are used), `browser_over_plan` (a browser past the plan's kept browsers), `proxy_data_used` (the workspace reached its monthly cap on proxy data; its browsers that go out from a country sleep), `plan_has_no_proxies` (a country asked for on Free) |
| 409 | `conflict` | `browser_exists`, `name_taken`, `limit_reached`, `fair_use`, `ask_pending`, `ask_resolved`, `ask_ending`, `download_in_progress`, `idempotency_key_reused`, `idempotency_key_in_use` |
| 429 | `rate_limit` | `rate_limited` and `too_many_attempts`, and `browsers_busy` (every browser the plan lets work at once is busy, after a wait of about 20 s for one to give its place up), with `Retry-After` |
| 502 | `upstream` | `browser_unreachable` |
| 503 | `busy` | `server_busy`, `restarting`, with `Retry-After` |

A 429 `browsers_busy` means the call needed a browser to wake, and every browser your plan lets work at once was in use for the 20 seconds it waited ([Plans and limits](https://docs.hotkey.so/limits.md#plans)). Nothing ran; send it again after `Retry-After` (30 seconds). The error's `limit` is the plan's number. A browser gives its place up once nothing has used it for 15 seconds, and one kept awake only by an ask that nobody has open gives it up too.

A 503 means the server was short of memory and couldn't wake the browser in time (`server_busy`), or Hotkey is restarting for an update (`restarting`, for a few seconds). Try again after the `Retry-After` time. Errors that carry `Retry-After` also have it in the body, as `retry_after` in seconds.

## Rate limits

Each key gets 25 requests a second on `/v1`, in bursts of up to 100. Past that, the answer is 429 `rate_limited` with a `Retry-After` header; wait that many seconds and send it again. Each key counts on its own, and so does the console of each person in each workspace.

## Lists

Every list answers in the same shape:

```json theme={null}
{ "object": "list", "data": [ … ], "has_more": true, "next_cursor": "brw_k3m9x2p7qa4t" }
```

The newest objects come first. `limit` is 1 to 100, and 20 by default. To get the next page, pass `next_cursor` back as `starting_after`. Events are the one exception, described below.

```bash curl theme={null}
curl "https://console.hotkey.so/v1/browsers?limit=100" -H "Authorization: Bearer $HOTKEY_KEY"
# then, while has_more is true:
curl "https://console.hotkey.so/v1/browsers?limit=100&starting_after=$NEXT_CURSOR" -H "Authorization: Bearer $HOTKEY_KEY"
```

```ts TypeScript theme={null}
// Every browser, page after page.
for await (const browser of hotkey.browsers.list({ limit: 100 })) console.log(browser.id);

// One page at a time.
const page = await hotkey.browsers.list({ limit: 100 });
if (page.hasNextPage()) await page.nextPage();
```

```python Python theme={null}
# Every browser, page after page.
for browser in hotkey.browsers.list(limit=100):
    print(browser["id"])

# One page at a time.
page = hotkey.browsers.list(limit=100)
if page.has_next_page():
    page.next_page()
```

A script may delete what it reads, page by page: a `starting_after` that names a browser deleted since still gives the page after where it was. In the other lists, a cursor whose object is gone answers 400 `parameter_invalid`.

## Retries

Send an `Idempotency-Key` header on any `POST` or `PATCH`. A key you sent in the last 24 hours with the same request gets the first answer back, with `Idempotent-Replayed: true`, and nothing runs twice. Use one key per action, for example one UUID per end user you make a browser for.

* The same request means the same method, path and body, byte for byte. The same key with anything else gets 409 `idempotency_key_reused`.
* Keys count per person and workspace: your key for a team and your personal key can use the same `Idempotency-Key` for two different actions.
* While the first request still runs, the same key gets 409 `idempotency_key_in_use`. Try again once it has answered.
* Only an answer that succeeded is kept. An error isn't, 4xx or 5xx, so the same key runs the request again: a `browsers_busy` or `browser_exists` sent again with its key is tried anew, not answered from before.
* Answers outlive Hotkey's restarts and deploys, so a request that timed out during one is safe to send again.

The clients put a new key on every `POST` and `PATCH` and send the same one with each retry of it. Pass your own to make an action safe across runs of your code:

```bash curl theme={null}
curl https://console.hotkey.so/v1/browsers -H "Authorization: Bearer $HOTKEY_KEY" \
  -H "content-type: application/json" -H "Idempotency-Key: browser-user_829" \
  -d '{ "external_id": "user_829" }'
```

```ts TypeScript theme={null}
await hotkey.browsers.create({ external_id: 'user_829' }, { idempotencyKey: 'browser-user_829' });
```

```python Python theme={null}
hotkey.browsers.create(external_id="user_829", idempotency_key="browser-user_829")
```

They also wait out 429 and 503 answers by their `Retry-After`, and try a lost connection or a 500, 502 or 504 again when the request is safe to repeat.

## Your account

### `GET /v1/account`

```json theme={null}
{ "id": "acct_Zx9qT1vB0aLmP3ke", "object": "account", "name": "Ada Lovelace", "email": "ada@acme.com",
  "admin": false, "key_mode": "live", "created": "…", "waiting": false, "browsers": 3,
  "workspace": { "id": "ws_q8Lm2Xr0TbYe", "name": "Acme", "personal": false, "role": "member", "phone_alerts": true },
  "browser": null }
```

`waiting` is true while the account waits for a seat. While it waits, it can't make browsers or keys (403 `account_waiting`).

`workspace` is the workspace the key belongs to, and your role there: `owner`, `admin` or `member`. `browsers` counts that workspace's browsers. For a key made for one browser, `browser` is that browser's id and `browsers` is 1.

## Workspaces

A workspace holds browsers, agent keys and app sign-ins. Every account has a personal workspace that only its owner uses. A team workspace has members, who all use its browsers and all get its asks on their phones.

* People make teams, invite members by email and change roles in the console, under **Settings**, then **Workspace**. `/v1` has no routes for that: a key works inside one workspace and changes none.
* Owners and admins invite people, remove members, and move or delete the team's browsers. Members use the browsers and add browsers and keys. Only an owner makes owners and admins.
* When a member is removed or leaves, the keys and app sign-ins they made for the team stop working (401 `key_revoked`), and the [webhook endpoints](https://docs.hotkey.so/webhooks.md) they made for it are deleted. The browsers stay with the team.
* A browser moved to another workspace stops every key made for it alone, and takes its history with it: the new workspace's `GET /v1/events` lists what happened in it before the move, and the old workspace's lists it no more. The old workspace's webhook endpoints get the `browser.moved` event, and those of the new one too.

### `GET /v1/workspace`

The workspace the key belongs to (the console: the one in view).

```json theme={null}
{ "id": "ws_q8Lm2Xr0TbYe", "object": "workspace", "name": "Acme", "personal": false, "role": "admin", "members": 3, "phone_alerts": true, "created": "…",
  "plan": { "id": "growth", "name": "Growth", "browsers": null, "browsers_at_once": 20, "browsers_working": 7,
    "status": "active", "extras": 0, "grace_until": null, "renews_at": "…", "ends_at": null, "payment_failed": null,
    "pending": { "plan": "starter", "browsers_at_once": 3, "extras": 0, "interval": "month", "at": "…" },
    "awake_hours": null, "browsers_held": 0 } }
```

`plan` is the workspace's plan ([Plans and limits](https://docs.hotkey.so/limits.md#plans)): `browsers` it keeps and `browsers_at_once` it may run (null for no limit), and `browsers_working` now. A job that starts many agents at once can start as many as fit and queue the rest, instead of meeting 429 `browsers_busy` ([a nightly run over every user](https://docs.hotkey.so/per-end-user.md)). A key for one browser reads it too.

The rest says why the limits are what they are:

* `status`: `free`, `active`, `trialing`, `past_due` (a renewal that Stripe couldn't charge: the plan stays while Stripe tries the card again), Stripe's state of a plan that ended (`unpaid`, `canceled`), `grace` (a workspace from before plans keeps its old limits until `grace_until`), or `before_billing`.
* `renews_at`, or `ends_at` for a plan cancelled at the end of its period.
* `payment_failed`: `at` and `free_from`, the day Free's limits apply if it still isn't paid.
* `pending`: a smaller plan that starts at the next renewal, and when.
* `awake_hours` (Free; named before Free counted minutes): `used_minutes`, `limit_minutes` (100) and `resets_at`, the first of next month. `used_minutes` counts agent work and watching ([what counts](https://docs.hotkey.so/limits.md#plans)).
* `minutes`: this month's minutes by use, on every plan: `agent`, `watched`, `waiting`, `other` and `plan_minutes` (what Free counts).
* `captchas`: the captchas Hotkey passed for the workspace's agents in this period (`used`), the plan's allowance (`limit`, null for none), whether it counts by `day` or `month` (`per`), and when it starts again (`resets_at`).
* `browsers_held`: browsers asleep because the workspace has more than its plan keeps (402 `browser_over_plan` when asked to wake). None is deleted.
* `proxy` (paid plans): `addresses` (its browsers on a fixed residential address), `address_price_usd` and `address_price_per` (`month` or `year`), and this month's `used_bytes`, `included_bytes`, `overage_bytes`, `overage_usd` (billed so far, never past the cap), `overage_per_gb_usd`, `cap_usd` and `stopped` ([Proxies](https://docs.hotkey.so/concepts/proxies.md#what-it-costs)).

[Webhooks](https://docs.hotkey.so/webhooks.md) and `GET /v1/events` tell the backend when any of it changes: `workspace.plan_changed`, `workspace.payment_failed`, `workspace.hours_used`, `workspace.proxy_data_low`, `workspace.proxy_cap_low`, `workspace.proxy_data_used`.

### `PATCH /v1/workspace`

```bash curl theme={null}
curl -X PATCH https://console.hotkey.so/v1/workspace -H "Authorization: Bearer $HOTKEY_KEY" \
  -H "content-type: application/json" -d '{ "phone_alerts": false }'
```

```ts TypeScript theme={null}
const workspace = await hotkey.workspace.update({ phone_alerts: false });
```

```python Python theme={null}
workspace = hotkey.workspace.update(phone_alerts=False)
```

Body: `{ "phone_alerts": false }`, `{ "embed_origins": ["https://app.acme.com"] }`, or both. `embed_origins` lists the origins whose pages may frame this workspace's browsers ([embeds](#embeds)); `GET` shows it too.

With phone alerts off, nobody in the workspace gets a push for its asks or for its sites' notifications. Asks still wait in the console's Needs you and in `GET /v1/asks`, and [webhooks](https://docs.hotkey.so/webhooks.md) still get `ask.created`. Turn them off for a product that tells its own end users about each ask: with them on, every member is pushed for every ask. In a team, only owners and admins change it (403 `role_too_low`); in the console it is under **Settings**, then **Workspace**.

## Browsers

```json theme={null}
{
  "id": "brw_k3m9x2p7qa4t", "object": "browser", "name": "Customer 829",
  "created": "2026-11-14T09:00:00.000Z", "account": "acct_Zx9qT1vB0aLmP3ke", "workspace": "ws_Zx9qT1vB0aLmP3ke", "default": true,
  "state": "asleep", "agent": "idle", "waiting_asks": 0,
  "time_zone": "Europe/Paris", "languages": ["fr-FR", "en"],
  "proxy": { "server": "gate.example.com:8000", "user": "abc…", "has_password": true, "state": "ok", "checked": "…" },
  "external_id": "user_829", "metadata": { "plan": "pro" },
  "console": "https://console.hotkey.so/b/brw_k3m9x2p7qa4t",
  "usage": { "month": "2026-11", "awake_minutes": 312, "agent_minutes": 240, "watched_minutes": 61, "waiting_minutes": 9, "other_awake_minutes": 7, "plan_minutes": 280, "agent_calls": 1840, "asks": 2, "downloads": 41, "download_bytes": 3829110,
    "storage_bytes": 7491584, "storage_measured": "…" }
}
```

* `state` is one of these:
  * `asleep`: parked, with nothing running.
  * `waking`
  * `awake`
  * `napping`: paused, and wakes in well under a second.
* `agent` is `idle`, `working`, `waiting` (an ask is pending and the agent made no call since) or `paused` (the person paused the agent).
* `workspace` is the workspace it lives in. `account` is the person whose personal workspace that is, and null for a team's browser.
* `external_id` is your own id for the browser, such as your end user's id. It is unique in your workspace.
* `metadata` holds up to 20 string values. Keys are up to 40 characters and values up to 500. Hotkey stores them and never reads them.
* `proxy` never holds the password. It is null when the browser has no proxy.
* `usage` is what the browser used this UTC month so far, as [`GET /v1/usage`](#usage) counts it.

### `GET /v1/browsers`

Your browsers, newest first. Filters, all optional, and all of them must match:

* `external_id=user_829`: the browser with that id.
* `q=…`: every word in its name, its `external_id` or a `metadata` value, in any case, as part of it. A word with a colon (`plan:pro`) matches that metadata key's value.
* `metadata[plan]=pro`: that metadata key has exactly that value. Several may be given.
* `state=awake`: its state now (`asleep`, `waking`, `awake` or `napping`).

A filtered list pages like any other. A parameter the route doesn't take answers 400 `parameter_unknown`.

```bash curl theme={null}
curl -G https://console.hotkey.so/v1/browsers -H "Authorization: Bearer $HOTKEY_KEY" \
  --data-urlencode "q=plan:pro" --data-urlencode "metadata[region]=eu" -d state=awake
```

```ts TypeScript theme={null}
for await (const b of hotkey.browsers.list({ q: 'plan:pro', metadata: { region: 'eu' }, state: 'awake' })) console.log(b.name);
const one = await hotkey.browsers.findByExternalId('user_829'); // or null
```

```python Python theme={null}
for b in hotkey.browsers.list(q="plan:pro", metadata={"region": "eu"}, state="awake"):
    print(b["name"])
one = hotkey.browsers.find_by_external_id("user_829")  # or None
```

### `POST /v1/browsers`

```json theme={null}
{ "name": "Customer 829", "external_id": "user_829", "metadata": { "plan": "pro" },
  "time_zone": "Europe/Paris", "languages": ["fr-FR", "en"], "proxy": "http://user:pass@gate.example.com:8000" }
```

Every field is optional. Without a name, the browser is named after its `external_id`. Answers 201 with the browser.

```bash curl theme={null}
curl https://console.hotkey.so/v1/browsers -H "Authorization: Bearer $HOTKEY_KEY" \
  -H "content-type: application/json" -H "Idempotency-Key: browser-user_829" \
  -d '{ "name": "Customer 829", "external_id": "user_829", "metadata": { "plan": "pro" }, "time_zone": "Europe/Paris" }'
```

```ts TypeScript theme={null}
// Makes it, or returns the browser that already has this external_id (409 browser_exists).
const browser = await hotkey.browsers.getOrCreate({ name: 'Customer 829', external_id: 'user_829', metadata: { plan: 'pro' }, time_zone: 'Europe/Paris' });
```

```python Python theme={null}
# Makes it, or returns the browser that already has this external_id (409 browser_exists).
browser = hotkey.browsers.get_or_create(name="Customer 829", external_id="user_829", metadata={"plan": "pro"}, time_zone="Europe/Paris")
```

* If `external_id` is taken, the answer is 409 `browser_exists`, and the error's `browser` field holds the existing browser's id. Together with `Idempotency-Key`, this makes "one browser per end user" safe to retry.
* The browser goes into the key's workspace. How many browsers a workspace keeps is its plan's ([Plans and limits](https://docs.hotkey.so/limits.md#plans)); past it the answer is 409 `limit_reached`.
* `country` makes it go out from a country through one of Hotkey's proxies, on a fixed residential address of its own, for \$5 a month ([Proxies](https://docs.hotkey.so/concepts/proxies.md)): `"auto"` (the caller's country as Cloudflare sees it, else the nearest with a free address, else Hotkey's server), a two-letter code such as `"FR"`, or `"server"`. Paid plans only: on Free it answers 402 `plan_has_no_proxies`. A country with no free address answers 409 `no_free_proxy`, and no browser is made. Pass `country` or `proxy`, not both.
* The browser's `egress` says where it goes out: `mode` (`pool`, `own` or `server`), `country`, `city`, `ip`, `time_zone`, `state` (`ok`, `down`, `auth-failed`, `checking`), `down_since`, `replacement_offered` (its proxy has been down 10 minutes and the console offers another) `automatic`, and `price` on a pool address: `amount_usd` (5, or 50 on a yearly plan), `per` (`month` or `year`), `included_gb` (10) and `overage_per_gb_usd` (3). A browser on a proxy of Hotkey's has `proxy` null.

### `GET /v1/browsers/{id}`

### `PATCH /v1/browsers/{id}`

Changes `name`, `external_id`, `metadata`, `time_zone`, `languages`, `egress` or `default`.

* `default: true` makes it its workspace's default browser, where an agent's calls go when it never picked one. Only `true` is taken: to move the default, make another browser the default. A workspace's first browser is its default, a new browser never takes it, and when the default is deleted or moved the oldest one left takes it. Every browser object has `default`. A key made for one browser can't set it (403 `key_scoped`).

* `metadata` merges into what is there. A key set to `null` is removed, and `"metadata": null` clears all of them.

* `egress`: `"server"` turns its fixed residential address off (the address goes back, and its $5 stops from the next period), `"auto"` or a two-letter code gives it one ($5 a month, paid plans; 402 `plan_has_no_proxies` on Free, 409 `no_free_proxy` when none is free). An awake browser restarts to use it, and the change waits while an ask in it is open (409 `ask_waiting`).

* Another country for a browser that already has an address is a new address: $5 on the next invoice, and the current one's $5 for this period is not credited. It answers 409 `confirm_charge_required` (with `amount_usd`) and changes nothing until you send `"confirm_charge": true` with it.

```bash curl theme={null}
curl -X PATCH https://console.hotkey.so/v1/browsers/brw_k3m9x2p7qa4t -H "Authorization: Bearer $HOTKEY_KEY" \
  -H "content-type: application/json" -d '{ "name": "Customer 829 (EU)", "metadata": { "seats": null, "region": "eu" } }'
```

```ts TypeScript theme={null}
await hotkey.browsers.update('brw_k3m9x2p7qa4t', { name: 'Customer 829 (EU)', metadata: { seats: null, region: 'eu' } });
```

```python Python theme={null}
hotkey.browsers.update("brw_k3m9x2p7qa4t", name="Customer 829 (EU)", metadata={"seats": None, "region": "eu"})
```

* A new time zone or new languages apply from the browser's next start.

### `DELETE /v1/browsers/{id}`

Deletes the browser and everything in it, for good: profile, logins, saved passwords and passkeys, downloads, pictures, activity and backups. From the moment you call, the browser is gone from every list and route, and nothing can wake it.

* 200 `{ "id", "object": "browser", "external_id", "deleted": true, "status": "deleted", "details", "pending" }` when it was done within a second and a half, which is the usual case for a sleeping browser. `pending` lists what is still going, such as `backup_drive` while its backup is being removed.
* 202 with `"status": "deleting"` when its browser was still stopping. The deletion goes on, and a [`browser.deleted`](https://docs.hotkey.so/webhooks#browsers-coming-and-going) event says when it is done.

`DELETE /v1/browsers?external_id=user_829` does the same for the browser with that `external_id`.

### `POST /v1/browsers/delete`

Deletes up to 100 browsers in one request, named by id, by `external_id`, or both:

```json theme={null}
{ "browsers": ["brw_k3m9x2p7qa4t"], "external_ids": ["user_830", "user_831"] }
```

Answers 202 with a list of `{ "id", "object": "browser", "external_id", "deleted": true, "status" }`, one for each browser found, and `not_found` with the ids and external ids that matched no browser in the workspace. A name in `not_found` doesn't stop the others, so a retry after a partial run is safe; with the same `Idempotency-Key` it gets the first answer back. Each browser deleted sends its own `browser.deleted`.

### `POST /v1/browsers/{id}/wake` and `/sleep`

Wakes the browser or puts it to sleep, and answers with the browser. Sleep is refused (409 `ask_pending`) while an ask in it waits.

## Tabs

### `GET /v1/browsers/{id}/tabs`

```json theme={null}
{ "id": 1001, "object": "tab", "browser": "brw_k3m9x2p7qa4t", "title": "Sign in", "url": "https://…", "state": "active" }
```

`state` is `active`, `resting`, `asleep` or `discarded`. A discarded tab reloads when it is used. While the browser sleeps, the list shows the tabs it saved, which come back when it wakes.

## Asks

An ask puts a step in front of a person, the way an agent does with `request_human`. The person's phone gets a push, and the step shows in the console's Needs you.

```json theme={null}
{
  "id": "ask_k3m9x2p7qa4t_7f3a91c2e0d4", "object": "ask",
  "browser": { "id": "brw_k3m9x2p7qa4t", "object": "browser", "name": "Customer 829", "external_id": "user_829" },
  "tab": 1002, "url": "https://www.linkedin.com/login", "reason": "Log into LinkedIn",
  "status": "pending", "requested_by": "API",
  "created": "…", "expires": "…", "resolved": null, "resolved_by": null, "note": null,
  "member": null, "answered_by": null,
  "link": "https://console.hotkey.so/hkl_8fK2mQ9xLp3vT6wZbC4d", "link_expires": "…",
  "console": "https://console.hotkey.so/inbox/ask_k3m9x2p7qa4t_7f3a91c2e0d4",
  "return_url": "https://app.acme.com/connected"
}
```

* `status` is `pending`, `done`, `cancelled`, `expired` or `tab_closed`.
* `note` is what the person wrote when they couldn't do it.
* In a team's browser, `member` names the person whose agent asked, and `answered_by` the member who pressed Done or Can't do it. Every member gets the push, and the first answer ends the ask.
* `link` is the hand link. Send it to whoever should do the step. It opens that one tab without a sign-in. A pending ask has a link for its first 30 minutes, then `null`; the person still finds the ask in the console, where Copy link makes a new one, and `POST /v1/asks/{id}/link` (below) makes one too. Ended asks show `null`.
* `return_url` is where the link's page sends the person after they press Done or Can't do it, or null.
* `save_sign_in` says whether the link's guest is offered to let the browser keep their sign-in ([Sign-ins your users let the browser keep](https://docs.hotkey.so/link-sign-ins.md)).

### `POST /v1/asks`

```json theme={null}
{ "browser": "brw_k3m9x2p7qa4t", "url": "https://www.linkedin.com/login", "reason": "Log into LinkedIn", "timeout_minutes": 120 }
```

* Pass `tab` (a tab id) to ask in an open tab, or `url` to open a new tab.
* `reason` is the one sentence the person reads.
* `timeout_minutes` is 1 to 1440 (24 hours), and 1440 by default. The ask waits in the person's Needs you that long; its link works for 30 minutes of it.
* `save_sign_in` is optional, false by default: true offers the link's guest, once their sign-in went through, to let the browser sign in to that site by itself next time ([details](https://docs.hotkey.so/link-sign-ins.md)).
* `return_url` is optional: your app's page to send the person back to after Done or Can't do it. The link's page says where it returns to, and goes there 2.5 seconds after the answer. It must be https, or http on `localhost`, `127.0.0.1` or a `.localhost` name, with no user name or password and at most 2,000 characters (400 `parameter_invalid` otherwise). Agents pass it to `request_human` the same way.

The call wakes a sleeping browser and answers 201 with the ask.

```bash curl theme={null}
curl https://console.hotkey.so/v1/asks -H "Authorization: Bearer $HOTKEY_KEY" -H "content-type: application/json" \
  -d '{ "browser": "brw_k3m9x2p7qa4t", "url": "https://www.linkedin.com/login", "reason": "Log into LinkedIn",
        "return_url": "https://app.acme.com/connected" }'
```

```ts TypeScript theme={null}
const ask = await hotkey.asks.create({ browser: 'brw_k3m9x2p7qa4t', url: 'https://www.linkedin.com/login',
  reason: 'Log into LinkedIn', return_url: 'https://app.acme.com/connected' });
console.log(ask.link);
const ended = await hotkey.asks.wait(ask.id); // reads it every 2 s until it ends
```

```python Python theme={null}
ask = hotkey.asks.create(browser="brw_k3m9x2p7qa4t", url="https://www.linkedin.com/login",
                         reason="Log into LinkedIn", return_url="https://app.acme.com/connected")
print(ask["link"])
ended = hotkey.asks.wait(ask["id"])  # reads it every 2 s until it ends
```

### `GET /v1/asks`

Pending asks and those that ended in the last 7 days. Filter with `?browser=` and `?status=`. `GET /v1/browsers/{id}/asks` lists one browser's asks.

### `GET /v1/asks/{id}`

### `POST /v1/asks/{id}/cancel`

Withdraws the ask, which takes it off the person's phone and the console. Body: `{ "note": "…" }`, optional. An ask that already ended answers 409 `ask_resolved`.

```bash curl theme={null}
curl -X POST https://console.hotkey.so/v1/asks/ask_k3m9x2p7qa4t_7f3a91c2e0d4/cancel -H "Authorization: Bearer $HOTKEY_KEY" \
  -H "content-type: application/json" -d '{ "note": "Not needed any more" }'
```

```ts TypeScript theme={null}
await hotkey.asks.cancel('ask_k3m9x2p7qa4t_7f3a91c2e0d4', { note: 'Not needed any more' });
```

```python Python theme={null}
hotkey.asks.cancel("ask_k3m9x2p7qa4t_7f3a91c2e0d4", note="Not needed any more")
```

### `POST /v1/asks/{id}/link`

Makes a new link for a pending ask, as Copy link does in the console, and answers with the ask and its new `link`. Use it when the link you sent ran out, or to send the step by email or text later than 30 minutes after the ask began.

* The new link works for 30 minutes, and never past the ask's end.
* The link before it stops at once. Whoever opens it later reads that it has ended; the browser's owner, signed in, goes to the ask in the console.
* In an ask's last 2 minutes there is no new link (409 `ask_ending`): it would stop almost at once. An ask that ended answers 409 `ask_resolved`.

```bash curl theme={null}
curl -X POST https://console.hotkey.so/v1/asks/ask_k3m9x2p7qa4t_7f3a91c2e0d4/link -H "Authorization: Bearer $HOTKEY_KEY"
```

```ts TypeScript theme={null}
const { link } = await hotkey.asks.newLink('ask_k3m9x2p7qa4t_7f3a91c2e0d4');
```

```python Python theme={null}
link = hotkey.asks.new_link("ask_k3m9x2p7qa4t_7f3a91c2e0d4")["link"]
```

To learn when the person finished, use the `ask.done` webhook, or read the ask again.

## Saved sign-ins

### `GET /v1/browsers/{id}/sign_ins`

The browser's saved passwords, never the password itself:

```json theme={null}
{ "id": "login_Xq3pT0aB", "object": "sign_in", "browser": "brw_k3m9x2p7qa4t", "site": "mail.example.com", "username": "ana@example.com",
  "saved_by": "link", "ask": "ask_k3m9x2p7qa4t_7f3a91c2e0d4", "created": "…", "updated": null, "last_used": "…" }
```

`saved_by` is `person` (Save password? in the live view), `console` (added by hand), or `link` (the guest of an ask with `save_sign_in`, whose `ask` it names). The call wakes a sleeping browser.

### `DELETE /v1/browsers/{id}/sign_ins/{id}`

Forgets one. `sign_in` then asks for the person again on that site.

## 1Password

### `PUT /v1/browsers/{id}/onepassword`

Gives the browser a 1Password to sign in from ([Sign in with 1Password](https://docs.hotkey.so/onepassword.md)). Body: `token`, a service account token (`ops_…`), or `kind: "connect"` with `url` (https) and the Connect server's `token`. The browser checks the token by listing the vaults it reaches, and keeps it encrypted; no answer carries it again.

```json theme={null}
{ "object": "onepassword", "browser": "brw_k3m9x2p7qa4t", "connected": true, "kind": "service_account", "url": null,
  "vaults": ["Hotkey: Ana"], "connected_at": "…", "logins": 4 }
```

`logins` counts the logins with a website the vaults hold. 400 `parameter_invalid` for a malformed token or address, 400 `onepassword_refused` when 1Password refuses the token, 502 `onepassword_unreachable` when the browser can't reach it. The call wakes a sleeping browser.

### `GET /v1/browsers/{id}/onepassword`, `DELETE /v1/browsers/{id}/onepassword`

`GET` answers the same object without `logins` (`connected: false` when none is set). `DELETE` forgets the token; 404 `onepassword_not_set` when there was none.

## Embeds

An embed shows one browser's live view in an iframe on your own site ([Embed the live view](https://docs.hotkey.so/embed.md)).

### `POST /v1/browsers/{id}/embed`

Body: `mode` (`view` or `interact`, `view` by default), `origins` (some of the workspace's `embed_origins`, all of them by default), `sites` (up to three; the embed keeps to tabs on them), `expires_in` (30 to 86400 seconds, 900 by default). Answers 201 with the embed, its `token` and its `url`, which this answer alone carries. Not kept under an `Idempotency-Key`: each call mints one. 409 `embed_origins_missing` when the workspace lists no origin, 400 `origin_not_allowed` for an origin off its list.

### `GET /v1/browsers/{id}/embeds`, `GET /v1/embeds/{id}`

`status` is `live`, `expired` or `ended`, with `ended_why` (`revoked`, `expired`, `origins-removed`, `browser-deleted`, `browser-moved`).

### `DELETE /v1/embeds/{id}`

Revokes it. A view open on it ends at once, and its page tells your page `ended`.

## Downloads

```json theme={null}
{ "id": "dl_k3m9x2p7qa4t_34fd0402-d993-4028-ba81-0f33a130a605", "object": "download", "browser": "brw_k3m9x2p7qa4t",
  "name": "report.csv", "size_bytes": 8, "media_type": "text/csv", "site": "example.com",
  "state": "done", "started": "…", "finished": "…", "saved_from": "site", "total_bytes": null, "error": null, "expires": "…" }
```

* `state` is `downloading`, `done`, `failed` or `cancelled`.
* `saved_from` is `site` for a file a site sent, or `page` for a page saved as a PDF.
* `expires` is when the file is deleted.

Downloads can be listed and fetched while the browser sleeps.

### `GET /v1/browsers/{id}/downloads`

### `GET /v1/downloads/{id}`

### `GET /v1/downloads/{id}/content`

The file, as an attachment.

```bash curl theme={null}
curl -OJ https://console.hotkey.so/v1/downloads/dl_k3m9x2p7qa4t_34fd0402-d993-4028-ba81-0f33a130a605/content -H "Authorization: Bearer $HOTKEY_KEY"
```

```ts TypeScript theme={null}
const { data, filename } = await hotkey.downloads.content('dl_k3m9x2p7qa4t_34fd0402-d993-4028-ba81-0f33a130a605');
```

```python Python theme={null}
f = hotkey.downloads.content("dl_k3m9x2p7qa4t_34fd0402-d993-4028-ba81-0f33a130a605")
open(f["filename"], "wb").write(f["data"])
```

### `DELETE /v1/downloads/{id}`

## Events

What agents, people and Hotkey did in your browsers. These are the same events that [webhooks](https://docs.hotkey.so/webhooks.md) send.

```json theme={null}
{ "id": "evt_4182", "object": "event", "type": "ask.created", "created": "…",
  "browser": { "id": "brw_k3m9x2p7qa4t", "object": "browser", "name": "Customer 829", "external_id": "user_829" },
  "data": { "text": "Log into LinkedIn", "ask": "ask_k3m9x2p7qa4t_7f3a91c2e0d4" } }
```

### `GET /v1/events`

Events come oldest first, so a reader can follow the log.

* Without `starting_after`, the answer has the newest `limit` events, and `has_more` is false.
* With `starting_after=evt_N`, it has the next `limit` events after that one, and `has_more` is true when more are already there.
* `next_cursor` is the last event's id, or, on an empty page, where the log stands now. Keep passing it back to follow the log, from your first call on: a reader that starts before any event exists misses none.
* Event ids only go up, across restarts too, but they skip numbers: compare them, never count on the next one being N + 1.
* Hotkey keeps the last 1,500 events of each browser. A reader that falls further behind misses the older ones.

Filter with `?browser=` and `?type=`. A type can be exact (`ask.done`) or a group (`ask.*`).

```bash curl theme={null}
curl "https://console.hotkey.so/v1/events?type=ask.*&starting_after=evt_4182&limit=100" -H "Authorization: Bearer $HOTKEY_KEY"
```

```ts TypeScript theme={null}
// Follows the log as it grows, from the last id you kept (or from now without one).
for await (const event of hotkey.events.follow({ type: 'ask.*', after: 'evt_4182' })) console.log(event.type);
```

```python Python theme={null}
# Follows the log as it grows, from the last id you kept (or from now without one).
for event in hotkey.events.follow(type="ask.*", after="evt_4182"):
    print(event["type"])
```

| Type | When |
| - | - |
| `ask.created`, `ask.done`, `ask.cancelled`, `ask.expired`, `ask.tab_closed` | An ask starts or ends. |
| `agent.call` | An agent called a tool. `data` has `tool`, `by`, `text`, `ms` and `error`. |
| `download.finished`, `download.failed`, `download.deleted` | |
| `browser.created`, `browser.renamed`, `browser.moved`, `browser.woke`, `browser.parked`, `browser.crashed`, `browser.proxy`, `browser.locale` … | Changes to the browser. `browser.moved` has `from_workspace` and `to_workspace`. `browser.created` has the browser's `metadata`. |
| `browser.deleted` | The browser and its files are gone. Its `browser` and `data` have its id and `external_id` only, no name or metadata, and `backup_pending: true` while its backup is still being removed. It stays in `GET /v1/events` for 24 hours after the browser's other events went with it. |
| `person.*`, `keys.*`, `site.*` | The person paused the agent, a passkey was used, a site asked for a permission, and the like. |
| `browser.plan` | The browser went to sleep for its workspace's plan. `data.reason`: `browsers_kept` (past the browsers the plan keeps), `hours_used` (Free's hours), `at_once` (it gave its place up after the plan's browsers at once fell). |
| `workspace.plan_changed` | The limits that apply changed. `browser` is null; `data` has `plan`, `previous_plan`, `browsers_at_once`, `previous_browsers_at_once`, `browsers`, `awake_minutes` (and `awake_hours`, the same in hours), `status` and `reason`: `subscribed`, `upgrade`, `downgrade` (at the renewal), `payment_failed` (still unpaid when Stripe's retries ran out), `payment_fixed`, `cancelled` or `grace_ended`. |
| `workspace.payment_failed` | Stripe couldn't take a renewal's payment. The plan stays while Stripe tries the card again; `data.free_from` is the day Free's limits apply if it still isn't paid. |
| `workspace.hours_used` | A Free workspace used its awake minutes for the month. `data.resets_at` is when they start again. |
| `workspace.proxy_data_low` | The workspace used 80 % of the proxy data its addresses include this month. `data` has `used_bytes`, `included_bytes`, `overage_usd`, `cap_usd` and `allowance_bytes` (where its browsers stop). |
| `workspace.proxy_cap_low` | Its proxy data past what's included comes to 80 % of its monthly cap. Same `data`. |
| `workspace.proxy_data_used` | It reached the cap: its browsers that go out from a country sleep until `data.resets_at`, or a higher cap. |

## Usage

What each of your browsers used, so you can bill your own users or find the one that takes every place. Counted per UTC day:

| Field | |
| - | - |
| `awake_minutes` | Minutes the browser was awake: each stretch from a start or a nap's end to the next nap or sleep, in whole minutes rounded up. |
| `agent_minutes` | Minutes with an agent's call running in the browser, or ending under 10 s before (from 2026-11-30 on; each kind counts each UTC minute once). |
| `watched_minutes` | Minutes a person's view of the browser was open and in use: not hidden, not out of focus, not left 10 minutes with no input. |
| `waiting_minutes` | Minutes a `wait_for_human` call was open: the agent waiting on a person. |
| `other_awake_minutes` | Minutes awake with none of the three above: starts, restarts onto new code, the hub's own wakes. |
| `plan_minutes` | Minutes with agent work or watching, counted once when both happen: what Free's 100 minutes count. |
| `agent_calls` | Tool calls an agent made in the browser, over MCP. |
| `asks` | Asks raised in it, by an agent or over `/v1`. |
| `downloads`, `download_bytes` | Files it downloaded, pages saved as PDF included, and their size. |
| `proxy_bytes_sent`, `proxy_bytes_received` | Bytes it sent to and got from a proxy of Hotkey's ([Proxies](https://docs.hotkey.so/concepts/proxies.md)), what counts toward the plan's proxy data. On Hotkey's servers they are the firewall's counts of the IP packets, headers included. |
| `proxy_bytes_estimated` | The part of those two counted from the browser's own network sizes instead, an estimate (a server without isolation). |
| `captchas_solved`, `captchas_tried` | Captchas Hotkey passed for the agent in the browser, and those it tried (each plan includes so many a day or month: see [Limits](https://docs.hotkey.so/limits.md)). |
| `storage_bytes` | Its profile's size on disk now (logins, site data, downloads), as last measured: after each time it sleeps or naps, at most every 10 minutes. `storage_measured` says when. Null until the first measurement. |

### `GET /v1/usage`

```bash theme={null}
curl "https://console.hotkey.so/v1/usage?from=2026-11-01&to=2026-12-01" -H "Authorization: Bearer $HOTKEY_KEY"
```

```json theme={null}
{ "object": "list", "from": "2026-11-01T00:00:00.000Z", "to": "2026-12-01T00:00:00.000Z", "group_by": "browser",
  "data": [ { "id": "brw_k3m9x2p7qa4t", "object": "usage",
    "browser": { "id": "brw_k3m9x2p7qa4t", "object": "browser", "name": "Customer 829", "external_id": "user_829", "deleted": false, "deleted_at": null },
    "external_id": "user_829", "from": "…", "to": "…",
    "awake_minutes": 312, "agent_calls": 1840, "asks": 2, "downloads": 41, "download_bytes": 3829110,
    "proxy_bytes_sent": 1203311, "proxy_bytes_received": 48221930, "proxy_bytes_estimated": 0, "storage_bytes": 7491584, "storage_measured": "…" } ],
  "has_more": false, "next_cursor": null,
  "total": { "awake_minutes": 312, "agent_calls": 1840, "asks": 2, "downloads": 41, "download_bytes": 3829110 } }
```

* `from` and `to` are dates (`2026-11-01`) or RFC 3339 times, in whole UTC days: `from` counts from the start of its day, a date in `to` is the first day not counted, and a time in `to` counts its own day. By default the range is this month so far, today included. At most 400 days, and Hotkey keeps 13 months.
* Every browser in the workspace has a row, with zeros when it did nothing. A browser deleted in the range keeps its row, with `browser.deleted` true, so the month a user left can still be billed: its id and `external_id` stay, its name is null. Every row of a deleted workspace or account goes with it.
* `group_by=external_id` gives one row per `external_id`, with the `browsers` it covers: a user whose browser was deleted and made again is one row. Browsers without an `external_id` share the row whose `external_id` is null, which comes last.
* `browser=brw_…` and `external_id=…` keep one browser or one user.
* Rows come in order of their id (the browser's, or the `external_id`), 20 by default and up to 100 with `limit`, and page with `starting_after` like any list. `total` sums every row in the range, not only this page.
* `format=csv`, or `Accept: text/csv`, answers every row as CSV, with no paging.
* A key for one browser sees that browser's row only.

## Agent keys

```json theme={null}
{ "id": "key_Q8xk2a", "object": "agent_key", "name": "Nightly report", "created": "…", "last_used": "…", "expires": null, "oauth_client": null, "browser": null }
```

`oauth_client` names the app for a key that an agent got by signing in. `browser` names the one browser a key reaches, or is null for a key of the whole workspace.

### `GET /v1/agent_keys`

Your own keys in this workspace. `?browser=` lists the keys made for one browser.

### `POST /v1/agent_keys`

Body: `{ "name": "Nightly report" }`, or `{ "name": "Agent for user_829", "browser": "brw_k3m9x2p7qa4t" }` for a key that reaches that browser only. Answers 201 with the key and its `secret`, which is shown only here. The new key belongs to the same workspace as the key that made it, and its browser must be in that workspace.

```bash curl theme={null}
curl https://console.hotkey.so/v1/agent_keys -H "Authorization: Bearer $HOTKEY_KEY" -H "content-type: application/json" \
  -d '{ "name": "Agent for user_829", "browser": "brw_k3m9x2p7qa4t" }'
```

```ts TypeScript theme={null}
const { secret } = await hotkey.agentKeys.create({ name: 'Agent for user_829', browser: 'brw_k3m9x2p7qa4t' });
```

```python Python theme={null}
secret = hotkey.agent_keys.create(name="Agent for user_829", browser="brw_k3m9x2p7qa4t")["secret"]
```

* A person keeps at most 50 keys of the whole workspace in each workspace.
* Keys for one browser don't count toward the 50; a browser has at most 5 of its own (409 `limit_reached`).
* In the console, **Tokens for scripts** has a menu for the browsers a new token reaches.

### `DELETE /v1/agent_keys/{id}`

Revokes the key at once.

## Example

Make one browser per end user, ask the person to sign in, and wait for the answer:

```ts TypeScript theme={null}
import { Hotkey } from '@hotkeyso/sdk';

const hotkey = new Hotkey(); // HOTKEY_KEY

// One browser per user, safe to run again.
const browser = await hotkey.browsers.getOrCreate({ external_id: 'user_829', time_zone: 'Europe/Paris' });

const ask = await hotkey.asks.create({ browser: browser.id, url: 'https://www.linkedin.com/login', reason: 'Log into LinkedIn' });
console.log('Send this to the person:', ask.link);

const ended = await hotkey.asks.wait(ask.id);
console.log('Ended:', ended.status, ended.note ?? '');
```

```python Python theme={null}
from hotkey import Hotkey

hotkey = Hotkey()  # HOTKEY_KEY

# One browser per user, safe to run again.
browser = hotkey.browsers.get_or_create(external_id="user_829", time_zone="Europe/Paris")

ask = hotkey.asks.create(browser=browser["id"], url="https://www.linkedin.com/login", reason="Log into LinkedIn")
print("Send this to the person:", ask["link"])

ended = hotkey.asks.wait(ask["id"])
print("Ended:", ended["status"], ended["note"] or "")
```

```bash curl theme={null}
H="Authorization: Bearer $HOTKEY_KEY"
API=https://console.hotkey.so/v1

# One browser per user: a second run gets 409 browser_exists, whose error names the browser.
BROWSER=$(curl -s $API/browsers -H "$H" -H "content-type: application/json" -H "Idempotency-Key: browser-user_829" \
  -d '{ "external_id": "user_829", "time_zone": "Europe/Paris" }' | jq -r '.id // .error.browser')

ASK=$(curl -s $API/asks -H "$H" -H "content-type: application/json" \
  -d "{ \"browser\": \"$BROWSER\", \"url\": \"https://www.linkedin.com/login\", \"reason\": \"Log into LinkedIn\" }")
echo "Send this to the person: $(echo "$ASK" | jq -r .link)"

ID=$(echo "$ASK" | jq -r .id)
while [ "$(curl -s $API/asks/$ID -H "$H" | jq -r .status)" = pending ]; do sleep 5; done
curl -s $API/asks/$ID -H "$H" | jq '{ status, note }'
```

## The console's own routes

The console uses routes under `/api` for its screens: the fleet, pictures, seats, site permissions, saved sign-ins and certificates. They keep working, but they change with the console. Use `/v1` in your own code.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.