> ## 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 own machine, with your logins and your local network.

Use it for sites you are signed in to and pages on your local network. Python only: the SDK or the `holo` CLI. The environment is `{"kind": "web", "host": "user_device"}`.

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 a run at any time: [cancel the session](https://hub.hcompany.ai/agents-api/sessions/cancel.md) with `holo sessions cancel <session-id>`, or run `holo local stop` in any terminal to stop every local session on this machine.

## Run a session

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

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 and point the agent at the `session_id` it prints (the CLI example uses the agent the Python example creates). All flags: [`holo local`](https://hub.hcompany.ai/agents-api/cli#holo-local).

```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)
```

```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>'
```

## 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 runs: 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. [Observe and steer](https://hub.hcompany.ai/agents-api/observe-and-steer.md), [changes](https://hub.hcompany.ai/agents-api/sessions/changes.md), and [Agent View](https://hub.hcompany.ai/agents-api/observe-and-steer.md) work as for a cloud run.

* **One at a time.** A Python process drives one local browser at a time. A new session on it takes it over and cancels the earlier session.
* **Tied to your process.** 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.
* **Cloud-only fields.** [Vaults](https://hub.hcompany.ai/agents-api/vaults/overview.md), [browser profiles](https://hub.hcompany.ai/agents-api/browser/configuration.md#browser-profiles), and [proxies](https://hub.hcompany.ai/agents-api/browser/configuration.md#route-through-a-proxy) apply to cloud browsers only. 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 web app 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.