hai-agents.
Python
Sync and async clients, typed with Pydantic v2.
TypeScript
A fully typed client for sessions, agents, skills, and environments.
Install
Authenticate
SetHAI_API_KEY in your environment, or pass the key explicitly. See Authentication for regions and security.
Examples
Thehcompai/computer-use-agents-demos repo collects recipes for the hai-agents SDK. Each one runs on its own and is wired up as an MCP server, a CLI tool, or both, so you can call the agents from Claude Code, Cursor, Codex, or Hermes.
hcompai/computer-use-agents-demos
Use-case recipes for the
hai-agents SDK.| Example | What it shows | Interface |
|---|---|---|
qa/mcp | An autonomous browser agent QAs a remote URL and returns a structured {verdict, summary, findings} | MCP server (review_web_ui, visual_check) |
qa/cli | The same QA agent exposed as a shell command, surfaced to Claude Code via the hai-qa-via-cli skill | CLI (qa-cli review / visual) |
extract_anything | Wrap an agent call as a typed function: a generic extract(url, task, schema) or curated get_* tools | MCP server (extract) + CLI (extract-cli) |
counterfeit_detection | A custom-tools cookbook in three stages: bare run_session, then local screenshot-compare tools, then a max_steps / max_time_s budget for an exhaustive sweep | CLI (counterfeit-cli simple / tooled / sweep) |
See it in action
QA a live page from Claude Code: “Usereview_web_ui to check the top story link works and the page has reasonable accessibility.”
examples/add_to_cart/add_to_cart.py (Python)
Next steps
MCP server
Run and manage agents from Cursor, Claude Code, Codex, Hermes, and more, with no SDK code.
Coding assistants
Install the
hai-agents skill so Claude Code, Cursor, and other assistants know the H APIs and scaffold use cases for you.Quickstart
Run your first session end to end in under 5 minutes.
Agents
Reusable configurations: pre-built agents and how to create your own.