a2a docsreferenceserve asgi

a2a_pack.serve.asgi

HTTP adapter that turns any :class:A2AAgent into a service.

This is intentionally minimal: it covers the surface needed to plug into the wider A2A ecosystem and the platform's control plane.

Endpoints: GET /healthz -> liveness GET /.well-known/agent-card -> Agent Card JSON POST /invoke/{skill} -> invoke skill (JSON in, JSON out)

Auth: a single bearer token is read from the A2A_API_KEY env var. If set, all routes except /healthz and the card require Authorization: Bearer <key>. The bearer token is materialized into the agent's declared auth_model (best-effort: APIKeyAuth, otherwise NoAuth).

build_app (function)

build_app(agent: 'A2AAgent') -> 'FastAPI'

Build a FastAPI app for the given agent instance.

serve (function)

serve(agent: 'A2AAgent', *, host: 'str' = '0.0.0.0', port: 'int' = 8000) -> 'None'

Run the agent's HTTP server with uvicorn (blocking).

Source: apps/a2a/a2a_pack/asgi.py