Skip to main content
Deploy agents as A2A servers for agent-to-agent communication.

CLI

praisonai serve a2a runs the agents YAML workflow in --file for every message/send request (the same YAML path praisonai serve agents uses). The message text becomes the workflow topic.
A missing --file is rejected at startup with exit code EXIT_VALIDATION_ERROR and the error Agents file not found: <path>. The server no longer starts a stub that only echoed Received: <text>.
Expected Output:

Security

praisonai serve a2a runs your agents (and their tools) for every request, so binding it to a non-localhost interface without authentication is refused.
Binding to any host other than 127.0.0.1 / localhost / ::1 requires an API key. The server exits immediately (SystemExit) if neither --api-key nor PRAISONAI_SERVE_API_KEY is set:praisonai serve a2a: --api-key (or PRAISONAI_SERVE_API_KEY) is required when binding to a non-localhost host; it exposes tool-driving routes.
Clients send the key in Authorization: Bearer … or X-API-Key: …. Only /, /status and /.well-known/agent.json are public; POST /a2a always needs the key when one is set.

Python

serve() creates a FastAPI app and starts uvicorn for you. For custom FastAPI apps, use a2a.get_router() instead.
Expected Output:
Verify:
Response:

agents.yaml

The CLI command praisonai serve a2a --file agents.yaml runs the YAML workflow via praisonai.arun(...) for each message/send request. The Python A2A(agent=...) path above serves a single in-process Agent and does not read YAML.

A2A Endpoints

A2A Parameters

Authentication

Clients must send Authorization: Bearer sk-my-secret-key. Discovery (/.well-known/agent.json) stays public per A2A spec.

Send A2A Message

Response:

JSON-RPC Errors

Python Client

Troubleshooting