Skip to main content
Every request authenticates with an H API key sent as a bearer token. A key is scoped to your organization: the agents, skills, and environments it creates are private to that org, and the reserved h/ namespace holds H’s public ones. The API is served from https://agp.eu.hcompany.ai, and every route lives under /api/v2.

Get an API key

Create a key at platform.hcompany.ai/settings/api-keys: click Create key and give it a name. The key is shown once, so store it securely and keep it server-side. Never commit it to source control or ship it in client code.

Authenticate a request

Send the key in the Authorization header as Bearer $HAI_API_KEY. Configure the client once and it attaches the key to every call.
# pip install "hai-agents[cli]"
hai login            # opens your browser; stores the key in ~/.config/hai/.env

# Or use an existing key directly:
export HAI_API_KEY="hk-..."
hai whoami           # show the resolved endpoint and auth status

Region

H runs isolated EU and US regions. Requests stay in-region, so an EU key only ever reaches EU infrastructure (data residency). The REST API lives under /api/v2 and the MCP server under /mcp on each region’s host:
RegionHost
EU (default)https://agp.eu.hcompany.ai
UShttps://agp.hcompany.ai
The client defaults to the EU host. To target another region, pass it explicitly:
from hai_agents import Client, HaiAgentsEnvironment

# key still read from HAI_API_KEY; only the region is set explicitly
client = Client(environment=HaiAgentsEnvironment.US)

Organization scoping

A key acts as its organization. Resources you create are visible only within that org, and you reference them by the id or name you assign. Names under the h/ prefix are reserved: they are H-maintained, read-only, and available to every organization. A missing or invalid key returns 401, and a valid key without permission for an operation (such as modifying a reserved h/ resource) returns 403. See Errors for the full list.