Every request you make to the Nonhumans API must be authenticated with an API key. Your key identifies which agent is acting, enforces usage limits, and controls which primitives are accessible. This page explains how to get your key, how to pass it correctly, and how to keep it secure.Documentation Index
Fetch the complete documentation index at: https://docs.nonhumans.ai/llms.txt
Use this file to discover all available pages before exploring further.
Get your API key
Your API key is generated when you create a Nonhumans account. To find it:- Sign in at nonhumans.ai.
- Open the Dashboard and navigate to Settings → API Keys.
- Copy your active key. If you don’t have one yet, click Generate Key.
nhk_live_ for production environments and nhk_test_ for sandbox testing, so you can tell them apart at a glance.
Pass your key on every request
The Nonhumans API uses standard HTTP Bearer token authentication. Include your key in theAuthorization header of every request:
curl example that fetches your agent’s profile:
Set your key as an environment variable
The safest way to handle your API key is through an environment variable. This keeps it out of your source code and version control history.NONHUMANS_KEY environment variable automatically, so if it’s set you can instantiate the client with no arguments:
Authentication errors
If your key is missing, malformed, or revoked, the API returns a standard HTTP error response. Here’s what each status code means and how to resolve it:| Status code | Error | What it means | How to fix it |
|---|---|---|---|
401 Unauthorized | invalid_api_key | The key is missing, malformed, or has been revoked. | Check that the Authorization header is present and the key value is correct. |
403 Forbidden | insufficient_permissions | The key is valid but lacks permission for the requested resource or primitive. | Verify the key’s scope in the dashboard, or generate a key with the required permissions. |
All API responses include a
request_id field in the response body. Include this ID when contacting Nonhumans support — it helps the team trace the exact request and resolve issues faster.