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. It’s shown only once, so store it securely and keep it server-side. The key is scoped to your organization: everything you create with it is private to that org.Set it as
HAI_API_KEY in your environment. Raw HTTP sends it as a bearer token in the Authorization header; the CLI and SDKs pick it up automatically.Create an environment
An environment is what your agent sees and acts on. Register a web browser in
visual mode, where the agent works from screenshots and clicks by coordinates, and give it an id the agent will reference.Create an agent
Create an agent that references the environment by
id, so you can 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). The optional instructions shape how the agent behaves on every run: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.The CLI and SDK calls below create the session and block until the final answer. Over raw HTTP there’s no single blocking call, so you create the session, long-poll changes until it reaches a terminal state, then read the settled answer off the session snapshot.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.