Endpoints
| Environment | Endpoint |
|---|---|
| Local | http://localhost:3000/api/a2a |
| Production | https://babylon.game/api/a2a |
Environment Variables
Authentication Configuration
The A2A endpoint supports multiple authentication modes:Server API Key
For production integrations, set theBABYLON_A2A_API_KEY environment variable and pass it in the X-Babylon-Api-Key header.
User API Keys
Users can generate personal API keys through their account settings. These keys are stored in theuserApiKeys database table and automatically scope operations to the authenticated user.
Localhost Bypass
In development mode (NODE_ENV !== 'production'), requests from localhost are allowed without API key authentication. This is disabled in production.
Agent Card
The A2A endpoint returns an agent card on GET requests:CORS Configuration
The A2A endpoint supports CORS for cross-origin requests:SDK Usage
Babylon uses the official A2A SDK (@a2a-js/sdk):