Skip to main content

Python SDK for H Company's Agent API: autonomous agents powered by Holo.

Project description

H Agent API

PyPI Python versions License: MIT

Python SDK for the H Company Agent API. Launch autonomous agents powered by Holo, stream their progress, and steer them mid-run.

Documentation  ·  Get an API key  ·  PyPI  ·  TypeScript SDK  ·  H Company

Installation

pip install hai-agents

Install the optional command-line entry point when you want local tools:

pip install "hai-agents[cli]"

Requires Python 3.10 or newer. Grab an API key at portal.hcompany.ai and export it:

export H_API_KEY=hk-...

Quickstart

Launch the built-in h/web-surfer-holo3-1-35b agent, which ships with its own browser, and describe the task in plain language. run_session polls until the agent finishes and returns the final answer.

from hai_agents import Client, run_session

client = Client()  # reads H_API_KEY from the environment

result = run_session(
    client,
    agent="h/web-surfer-holo3-1-35b",
    messages="What are the top 3 stories on Hacker News right now?",
)

print(result.status)  # "completed"
print(result.answer)

An AsyncClient mirrors this API for asyncio.

CLI

The hai-agents[cli] extra installs the hai command:

hai login                  # browser sign-in; stores a key in ~/.config/hai/.env
hai run "Summarize the H Agent API quickstart"
hai --json run "Reply with exactly: hello" --max-steps 3 --max-time 60
hai sessions list
hai sessions get <session-id>
hai sessions send <session-id> "continue"
hai sessions cancel <session-id>
hai sessions share <session-id>
hai mcp install            # wire the hai-agents MCP server into every detected editor
hai mcp install list       # see supported clients (Cursor, VS Code, Claude Code, Windsurf)

hai mcp install adds the remote hai-agents MCP server to your local editors and writes your API key into each client config (in plaintext, so keep them private). On clients that support agent skills (Cursor, Claude Code) it also symlinks a SKILL.md that teaches the model how to drive the server.

hai login opens your browser, mints a per-machine API key, and writes it to ~/.config/hai/.env. hai whoami shows the resolved endpoint and whether you are authenticated; hai logout removes the stored key.

Credentials resolve from flags, then HAI_API_KEY/H_API_KEY in the environment, then a local .env, then ~/.config/hai/.env. Use --base-url or HAI_API_BASE_URL to target a specific Agent Platform host.

Documentation

Guides, core concepts, and the full API reference live at hub.hcompany.ai/agent-api, covering streaming progress, steering a live session, regions, structured output, and error handling.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hai_agents-0.1.6.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hai_agents-0.1.6-py3-none-any.whl (124.2 kB view details)

Uploaded Python 3

File details

Details for the file hai_agents-0.1.6.tar.gz.

File metadata

  • Download URL: hai_agents-0.1.6.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hai_agents-0.1.6.tar.gz
Algorithm Hash digest
SHA256 728dd343c986704714536bcb4ed8d7ad6e78658067867f1bca1b2a5ff2360be5
MD5 1fb096b33e47e8fcfec1bc1a49e23480
BLAKE2b-256 6a667c7c090500f8181a9873237adac83bf3a31a168ceb43c728f796c68554ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for hai_agents-0.1.6.tar.gz:

Publisher: publish.yml on hcompai/hai-agents-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hai_agents-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: hai_agents-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 124.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hai_agents-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 ce4fa81aa7307d28a268a35e1b7c8b760a7fe43df508ea5ff37df6082b79fa41
MD5 ead95aebbbbe1847e867122ac7bcc104
BLAKE2b-256 099b9654a043bc2d5156d0ede3a6578dcadea96fe58aaefe06e1c86898b0e7fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for hai_agents-0.1.6-py3-none-any.whl:

Publisher: publish.yml on hcompai/hai-agents-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page