Docs Sign in Get a key

Docs / Platform

Authentication

Authenticate to the Hapti API with a bearer key. Test keys are free; live keys run real tasks and are billed only when a task succeeds.

Every request carries an API key in the Authorization header:

Terminal
curl https://api.hapti.dev/v1/me -H "Authorization: Bearer hp_test_..."

Create and revoke keys in the console, under Developers. A key belongs to your organisation and to one mode.

Test and live

Test keys hp_test_Live keys hp_live_
PriceAlways freeBilled only when a task succeeds
What the agent doesWorks on the real site, but holds back any request that would send the data you gave, so nothing is submitted for realDoes the task for real
DataTasks, people and webhooks of the test mode onlyTasks, people and webhooks of the live mode only

Build and test with a test key, then switch the key. Your code does not change.

OAuth for AI apps

AI apps such as Claude connect to the MCP server with OAuth instead of a key: the person signs in to Hapti, chooses the organisation and the mode, and approves. The app then holds an access token that lasts one hour and renews itself, tied to that person. It stops working as soon as the connection is removed in Developers, or the person leaves the organisation. Hapti follows the MCP authorization specification: protected resource metadata at /.well-known/oauth-protected-resource, dynamic client registration, client metadata documents and PKCE.

Keep keys secret

  • Keep keys on your server, never in a browser, a mobile app or a public repository.
  • Give each service its own key, so you can revoke one without stopping the others.
  • Revoke a key at once if it leaks. Requests made with it are listed in Developers, Requests, with the address they came from.

A missing or wrong key gets a 401:

JSON
{
  "error": {
    "type": "authentication_error",
    "code": 401,
    "message": "a valid key is required: Authorization: Bearer hp_live_… or hp_test_…"
  }
}