Skip to main content
Run a pre-built agent on a task and read the result. All you need is an API key. Prefer no code? See Run from the platform.
1

Get your API key

Create a key at platform.hcompany.ai/settings/api-keys. It is shown only once: store it securely and keep it server-side. The key is scoped to your organization, and everything you create with it is private to that org.Set it as HAI_API_KEY. The CLI and SDKs read it automatically. Raw HTTP sends it as a bearer token in the Authorization header.
2

Install the client

3

Run a pre-built agent

h/web-surfer-flash is a pre-built agent with a cloud browser attached. Give it a task as an instruction. The CLI and SDKs create the session and block until the agent finishes. Over raw HTTP, create the session, wait for it to finish (long-poll changes), then read latest_answer.
Output, with the day’s front page:
To watch the agent work screenshot by screenshot, or replay a finished run, open the H Platform. See Agent View.

Customize

Create your own agent when you need other browser settings, a model, or instructions. Create it once, then pass its name as agent in every session. Names you create have no prefix. The h/ prefix is reserved for H’s catalog.
The example defines the environment inline and sets start_url, which defaults to https://www.bing.com. Run it like the pre-built agent, with hn-reader as the agent (hai run ... --agent hn-reader from the CLI). Related: Agents (all fields, model, reasoning), Environments (reusable catalog environments), Browser configuration (modes, viewport).