Authorization header. Requests that omit the header or supply an invalid key are rejected before they reach any model. You can create and manage your keys from the A2Agent dashboard.
Header Format
Include the following header with every API request:YOUR_A2AGENT_KEY with the key you copied from your dashboard. Keys are sensitive — treat them like passwords.
OpenAI SDK
Pass your key to theapi_key argument when instantiating the client. The SDK attaches the Authorization header automatically on every request.
OpenAI SDK — pass key and base URL
OPENAI_API_KEY=YOUR_A2AGENT_KEY in your shell and omit the api_key argument — the SDK will pick it up from the environment.
Anthropic SDK
The Anthropic SDK reads authentication credentials from two environment variables. Set both before initialising the client:Anthropic SDK — set auth environment variables
curl
You can authenticate raw HTTP requests by adding theAuthorization header directly to your curl command:
curl — Bearer token in Authorization header
Error Responses
If authentication or authorisation fails, the API returns one of the following HTTP status codes:| Status | Meaning |
|---|---|
401 Unauthorized | The Authorization header is missing, malformed, or contains an invalid key. Check that you copied your key correctly and that it has not been revoked. |
403 Forbidden | Your account is suspended or your balance is insufficient to complete the request. Top up your balance from your A2Agent dashboard. |
429 Too Many Requests | You have exceeded your request rate limit. Wait briefly and retry, preferably with exponential back-off. |