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

# Browser Use

> Run your Hermes agents' browser on Browser Use Cloud, with stealth, residential proxies, and CAPTCHA solving: one environment variable for your own agent, or a small broker that gives every user's agent a browser without exposing your Browser Use key.

`agent37-hermes` browses the web out of the box with a Chromium inside the instance. To run that browser on [Browser Use Cloud](https://browser-use.com) instead, with its [stealth](https://docs.browser-use.com/cloud/browser/stealth) and [residential proxies](https://docs.browser-use.com/cloud/browser/proxies), pick the setup that matches who chats with the agent:

| | Your own agent | An agent per user |
| - | - | - |
| Who chats with it | You or your team | Your users |
| What the instance holds | Your `BROWSER_USE_API_KEY` | A per-user link to your server |
| Setup | Two `env` values | The [hermes-browser-use](https://github.com/agent37-platform/examples/tree/main/hermes-browser-use) broker on your server, plus one `env` value |

Anything in an instance's environment, the agent can read and repeat back. When your users chat with their agents, a key in the environment is a key your users can take, so keep it on your server.

## An agent per user

```text title="Paste this into your coding agent" wrap theme={null}
Read https://www.agent37.com/docs/llms-full.txt.
I want each of my users' Hermes agents to browse on Browser Use Cloud without my Browser Use key in their instance.
Run https://github.com/agent37-platform/examples/tree/main/hermes-browser-use behind a cloudflared tunnel as its README says, then create an agent for a test user with npm run create-agent.
Done when that agent, asked to open https://ipinfo.io/json with its browser tool, reports a consumer internet provider as the org.
My keys are in AGENT37_API_KEY and BROWSER_USE_API_KEY.
```

> [card] [agent37-platform/examples: hermes-browser-use](https://github.com/agent37-platform/examples/tree/main/hermes-browser-use)
>
> A broker server and a create script, plain Node with no dependencies. Your Browser Use key stays on the server; each user's agent gets a link that opens only that user's browser.

Hermes reads `BROWSER_CDP_URL` the way it reads a Chrome debugging port: it asks that URL's `/json/version` for a browser and drives whatever comes back. Point it at your server with a token for the user:

```bash theme={null}
curl -X POST https://api.agent37.com/v1/instances \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "template": "agent37-hermes",
    "env": { "BROWSER_CDP_URL": "https://your-server.com/browser/<user token>" },
    "budget": { "monthly_cap_micros": 2000000 }
  }'
```

Your server checks the token, starts that user's Browser Use browser with your key (or reuses the one already running), and returns the browser's address. The agent then drives the browser directly; no page traffic passes through your server.

* **One browser per user.** It is labelled with the user in your Browser Use dashboard and reused across that user's chats until it times out (15 minutes by default), so a sign-in carries over between chats while it lives.
* **A copied link opens one browser.** A user who takes their link can only reach their own browser, and you cut them off in the token check.
* **Concurrency.** Each user holds at most one browser, so your Browser Use plan's concurrent session limit caps how many users browse in the same window.
* **If your server is down,** browsing fails for that turn and the rest of the agent keeps working.

## Your own agent

When you are the one chatting with the agent, put your Browser Use key straight into its environment, with `TMPDIR` set to `/tmp`:

```bash theme={null}
curl -X POST https://api.agent37.com/v1/instances \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "template": "agent37-hermes",
    "env": { "BROWSER_USE_API_KEY": "bu_...", "TMPDIR": "/tmp" },
    "budget": { "monthly_cap_micros": 5000000 }
  }'
```

Hermes picks the key up by itself. `TMPDIR` works around a Hermes bug that makes Browser Use sessions fail when Hermes keeps its temp files under the home directory ([hermes-agent#122786](https://github.com/NousResearch/hermes-agent/issues/122786)); without it the browser tool fails and the agent falls back to fetching pages without a browser.

* **One browser per turn.** Each chat turn that browses opens its own cloud browser, and Hermes closes it when the turn ends. A sign-in does not carry over to the next turn.
* **Fallback to the instance.** If Browser Use won't start a browser, for example because the account is out of credits or at its concurrency limit, Hermes loads the page in the instance's own Chromium and the turn still completes.

To add either setup to an existing instance, [edit its environment](https://www.agent37.com/docs/agents-api/instances/edit.md) and [restart](https://www.agent37.com/docs/agents-api/instances/restart.md) it. Waking a [sleeping](https://www.agent37.com/docs/agents-api/instance-auto-sleep.md) instance keeps the old environment.

## Check it works

Ask the agent to open an IP lookup page with its browser tool:

```bash theme={null}
curl https://ab12cd34ef.agent37.app/v1/responses \
  -H "X-Agent37-Key: sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "input": "Open https://ipinfo.io/json with your browser tool and tell me the ip and org fields." }'
```

An `org` that is a consumer internet provider (Charter, Comcast, and the like) means the page loaded through Browser Use's residential proxy. A cloud or hosting company means it did not: either the browser ran inside the instance, or the agent fetched the page without a browser.

## Browser Use Cloud or the built-in browser

| | Built-in Chromium | Browser Use Cloud |
| - | - | - |
| Setup | None | See above |
| Cost | Included in the instance | Billed by Browser Use ([pricing](https://browser-use.com/pricing)) |
| Visits from | The instance's datacenter IP | Residential proxies |
| Bot checks and CAPTCHAs | Often blocked | Stealth browser and CAPTCHA solving |

Use the built-in browser for sites that don't fight automation, and Browser Use Cloud when the sites your agents visit block datacenter traffic. To watch the built-in browser work and take over a sign-in, see [Browser and desktop](https://www.agent37.com/docs/agents-api/desktop.md).


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