A2A Protocol
The Anima A2A (Agent-to-Agent) protocol enables structured communication and task delegation between AI agents. Built on top of Agent Cards and DIDs, A2A provides authenticated, capability-aware messaging between agents regardless of their hosting platform.How A2A Works
- Discovery — Agent A resolves Agent B’s Agent Card to find its A2A endpoint and capabilities
- Authentication — Agent A authenticates using DID-based credentials
- Task Delegation — Agent A sends a structured task request describing what it needs
- Execution — Agent B processes the task and streams progress updates
- Completion — Agent B returns the result to Agent A
Sending a Task
- Tab Title
- Tab Title
- Tab Title
Receiving Tasks
Register a handler for incoming A2A tasks:- Tab Title
- Tab Title
Streaming Task Progress
For long-running tasks, stream progress updates back to the caller:Task Lifecycle
| Status | Description |
|---|---|
pending | Task submitted, awaiting processing |
in_progress | Handler is actively working on the task |
completed | Task finished successfully with a result |
failed | Task encountered an error |
cancelled | Task was cancelled by the sender |
timeout | Task exceeded the configured timeout |
API Reference
| Endpoint | Method | Description |
|---|---|---|
https://api.useanima.sh/api/a2a/tasks | POST | Send a task to another agent |
https://api.useanima.sh/api/a2a/tasks/:id | GET | Get task status and result |
https://api.useanima.sh/api/a2a/tasks/:id/cancel | POST | Cancel a pending/in-progress task |
https://api.useanima.sh/api/a2a/tasks | GET | List tasks (sent and received) |
https://api.useanima.sh/api/a2a/handlers | POST | Register a task handler |
https://api.useanima.sh/api/a2a/handlers | GET | List registered handlers |
Configuration
| Variable | Default | Description |
|---|---|---|
ANIMA_A2A_DEFAULT_TIMEOUT | 300000 | Default task timeout in ms (5 min) |
ANIMA_A2A_MAX_PAYLOAD_KB | 1024 | Maximum task input/output size |
ANIMA_A2A_REQUIRE_DID_AUTH | true | Require DID authentication for tasks |
ANIMA_A2A_STREAM_ENABLED | true | Enable streaming task updates |
Next Steps
- Agent Cards — Publish capabilities for discovery
- Agent Registry — Find agents to delegate tasks to
- Agent Wallet — Attach payments to task delegations
