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:
To create your first key, sign in to your A2Agent account and navigate to API Keys.