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

> ## Agent Instructions
> H Platform has three products: the Agents API (managed computer-use agents, base URL https://agp.eu.hcompany.ai/api/v2 or https://agp.hcompany.ai/api/v2 for the US), the Models API (OpenAI-compatible Holo vision-language models at https://api.hcompany.ai/v1), and HoloTab (a free no-code Chrome extension that runs Holo in the user's browser, with recordable routines and schedules). The `holo` CLI (`pip install "hai-agents[cli]"`) runs Agents API agents from a terminal, drives the user's own desktop with `-a h/holo-desktop`, and serves coding agents through `holo mcp`.
> Authenticate with a bearer API key from the HAI_API_KEY environment variable. SDKs: `pip install hai-agents` (Python, `from hai_agents import Client`) and `npm install hai-agents` (TypeScript, `import { HaiAgentsClient } from "hai-agents"`). CLI: `holo`.
> Agents do work in a browser or on a desktop; describe the task as an imperative instruction. To run a task quickly, prefer the pre-built agent `h/web-surfer-flash`. Read results from the session's `latest_answer` after it reaches a terminal status.
> Sessions are the unit of work; wait for a terminal status (completed, failed, timed_out, interrupted) before reading the answer. Use webhooks or the `changes` long-poll endpoint to follow progress.

# Your browser

> Let an agent drive Chrome on your machine, with your logins and your network.

## Run a session

The agent acts on your real browser. It can browse, run page scripts, and read that Chrome's cookies and storage. Prefer a dedicated machine over your primary one.

[Stop it](https://hub.hcompany.ai/holo-cli/introduction.md#drive-your-desktop) with `holo local stop` in any terminal, which stops every session driving this machine.

```bash Install theme={"system"}
pip install "hai-agents[cli,browser]"
```

It works from the Python SDK and the CLI. Create an agent whose environment sets `host` to `user_device`, then run a session with it. In Python there is nothing else to set up. From the CLI, serve your browser with [`holo local browser`](https://hub.hcompany.ai/holo-cli/reference#holo-local) and point the agent at the `session_id` it prints (the CLI example uses the agent the Python example creates).

```bash CLI theme={"system"}
# Serve the browser and leave it running; it prints the session_id it serves.
holo local browser

# In another terminal, route the agent's browser environment here.
holo run "Open news.ycombinator.com and summarize the top story" \
  --agent local-web \
  -o 'agent.environments[kind=web].session_id=<printed id>'
```

```python Python theme={"system"}
from hai_agents import Client

client = Client()

agent = client.agents.create_agent(
    name="local-web",
    description="Drives a browser on my own machine.",
    environments=[{"id": "my-laptop", "kind": "web", "host": "user_device"}],
)

result = client.run_session(
    agent=agent,
    messages="Open news.ycombinator.com and summarize the top story",
)
print(result.status, result.answer)
```

## The Chrome it drives

The SDK attaches to a Chrome with remote debugging open on port `9222`. If none is running, it launches one with its own profile in `~/.hai/chrome-profile`. That profile persists across sessions: sign in once and the agent finds you signed in next time. The SDK never touches your everyday Chrome profile (Chrome does not allow remote debugging on it).

To drive a different Chrome, start it yourself before the session. Chrome only opens the debugging port with `--user-data-dir`, so pick a dedicated directory and keep it for the logins you want the agent to have.

```bash macOS theme={"system"}
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
  --remote-debugging-port=9222 --user-data-dir="$HOME/chrome-for-agents"
```

```bash Linux theme={"system"}
google-chrome --remote-debugging-port=9222 --user-data-dir="$HOME/chrome-for-agents"
```

## Behavior and limits

When a session starts, the SDK opens a connection inside your Python process. It receives the agent's actions, carries them out in your browser, and ties the session to this machine. [Watch and steer](https://hub.hcompany.ai/agents-api/observe-and-steer.md) and [changes](https://hub.hcompany.ai/agents-api/sessions/changes.md) work as in the cloud.

* A Python process drives one browser at a time. A new session on it takes it over and cancels the earlier session.
* The connection closes when your Python process exits, and the sessions it served are cancelled (Chrome stays open). If the connection drops mid-session, the session is cancelled too.
* [Vaults](https://hub.hcompany.ai/agents-api/vaults/overview.md), browser profiles, and proxies are [cloud browser](https://hub.hcompany.ai/agents-api/browser/configuration.md) fields. Your Chrome's own logins and network fill that role.

### Auto-connect scope

| You start the session with | Connection |
| - | - |
| An agent spec or object passed to `run_session`, `start_session`, or `create_session` | The SDK connects your machine for you. |
| A registered agent referenced by name, or from the H Platform or another machine | Serve the browser with `holo local browser`, then set the printed `session_id` on the `user_device` environment (see the CLI example above). |
| `HAI_AUTO_BRIDGE=0` set | Auto-connect is off. Serve the browser yourself, as above. |


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