h/web-surfer-flash agent does it (see the introduction).
Install the client
Install the
hai-agents client (and CLI). Pick a language below; it applies to every code block on this page.Get your API key
Create a key at platform.hcompany.ai/settings/api-keys: click Create key and give it a name. It’s shown only once, so copy it and keep it server-side. Set it as
HAI_API_KEY in your environment. See Authentication for details.Create an environment
An environment is what your agent sees and acts on. Register a web browser in
visual mode (it works from screenshots and clicks by coordinates) and give it an id the agent will reference. Today the Browser is available; Desktop is in What’s next.Create an agent
Create an agent that references the environment by
id and reuse it across sessions. Agents you create have no prefix; H’s pre-built agents and environments use the reserved h/ namespace (like h/web-surfer-flash and h/browser), which is how you tell the two apart. The optional instructions shape how it behaves on every run; here they enforce grounding, verification, and honesty:Run a session
Launch a session against Need live progress instead of one blocking call? Poll
web-navigator and describe the task in plain language. Google Flights is a good test: its date picker, filters, and result cards only respond to real clicks, so the agent has to drive the page.Each call below creates the session and returns the final answer. Over raw HTTP there’s no single blocking call, so you create the session and long-poll changes until it reaches a terminal state.status for state and step count, or long-poll changes to stream events as they happen.Watch it on the platform
Open the H Platform to see your sessions: watch a running one step by step, or scrub a finished run to replay the full trajectory. See Agent View for details.
Next steps
Agents
Reusable configurations: built-in agents and how to create your own.
Environments
The surfaces your agent perceives and acts on. Browser today; more in What’s next.
Skills
Reusable instruction fragments you can attach to agents.
Sessions
The session lifecycle and how to interact with a running agent.