Skip to main content
Call the API directly over HTTP, use a typed client, or connect any MCP host. The clients and CLI ship as hai-agents.

Python

Sync and async clients, typed with Pydantic v2.

TypeScript

A fully typed client for sessions, agents, skills, and environments.

Install

pip install "hai-agents[cli]"

Authenticate

Set HAI_API_KEY in your environment, or pass the key explicitly. See Authentication for regions and security.
hai login   # browser sign-in; stores the key in ~/.config/hai/.env
The API reference playground runs in your browser and shows raw HTTP, handy for exploring the wire format. Use the SDK snippets here and in the Quickstart for code you’d ship.

Examples

The hcompai/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.
ExampleWhat it showsInterface
qa/mcpAn autonomous browser agent QAs a remote URL and returns a structured {verdict, summary, findings}MCP server (review_web_ui, visual_check)
qa/cliThe same QA agent exposed as a shell command, surfaced to Claude Code via the hai-qa-via-cli skillCLI (qa-cli review / visual)
extract_anythingWrap an agent call as a typed function: a generic extract(url, task, schema) or curated get_* toolsMCP server (extract) + CLI (extract-cli)
counterfeit_detectionA 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 sweepCLI (counterfeit-cli simple / tooled / sweep)

See it in action

QA a live page from Claude Code: “Use review_web_ui to check the top story link works and the page has reasonable accessibility.”
Drive the agent straight from a natural-language prompt in Python: “Search for ‘Random Access Memories’ by Daft Punk, add it to the shopping cart.”
Runnable code: 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.