Creating an API Key
Log In
Sign in to your account at https://a2agent.me/login.
Create a New Key
Click Create Key. Optionally enter a descriptive label (for example,
production or dev-laptop) to help you identify the key later.Copy the Key Value
The full key is displayed exactly once immediately after creation. Copy it to a secure location such as a password manager or environment variable file. You will not be able to retrieve the full value again after closing this dialog.
Using Your API Key
Pass your API key in theAuthorization header as a Bearer token on every request.
OpenAI-Compatible Clients
If you use the OpenAI Python or Node.js SDK, set thebase_url (or baseURL) and api_key (or apiKey) constructor arguments, or export the corresponding environment variables:
Anthropic-Compatible Clients
If you use an Anthropic-compatible client — such as Claude Code or any tool that readsANTHROPIC_AUTH_TOKEN — your A2Agent key works there too. Set the following environment variables:
Copying Connection Info
On the API Keys page, each row in the key list has a Copy Connection Info button. Clicking it copies your key name, key value, and base URL together in a single formatted block — handy when configuring AI coding clients or sharing setup instructions with a teammate. You never need to hunt for the base URL separately.Rotating and Revoking Keys
You can delete any API key from the API Keys page at any time. Deletion is immediate — any request using that key will return a401 Unauthorized error after deletion. To rotate a key, create a new one first, update your clients, and then delete the old key once traffic has migrated.
There is no automatic expiry on keys; they remain valid until you delete them.
Authentication Errors
| HTTP Status | Meaning | Common Cause |
|---|---|---|
401 Unauthorized | The request could not be authenticated. | Missing, malformed, or deleted API key. Verify the Authorization: Bearer … header is present and the key value is correct. |
403 Forbidden | The request was authenticated but not authorized. | Your account has been suspended or your balance has reached zero. Check your balance on the Billing page or contact support. |