Overview
Every Bindu agent exposes a standard HTTP API that follows the A2A (Agent-to-Agent) protocol. This API is automatically generated when you callbindufy() — you never write route handlers manually.
The API is generic and works identically across all agents, regardless of their specific capabilities. Domain-specific behavior is handled by your agent’s handler function, not by custom endpoints.
Base URL
Architecture: One Endpoint, Many Methods
Unlike traditional REST APIs, Bindu uses JSON-RPC 2.0 over HTTP. Almost all operations go to a single endpoint:method field in the request body determines what operation to perform:
| Method | Purpose |
|---|---|
message/send | Send a message to the agent, creates a new task |
message/stream | Stream task updates (experimental) |
tasks/get | Get the status and results of a task |
tasks/list | List all tasks for the current context |
tasks/cancel | Cancel a running task |
tasks/feedback | Provide feedback on a completed task |
tasks/pushNotificationConfig/set | Register a webhook for task updates |
tasks/pushNotificationConfig/get | Read the webhook registered for a task |
tasks/pushNotificationConfig/list | List webhook configs for a task |
tasks/pushNotificationConfig/delete | Remove a webhook from a task |
contexts/list | List all conversation contexts |
contexts/clear | Clear a conversation context |
Quick Start
1. Send a Message
2. Get Task Status
3. Get Agent Card
Authentication
Bindu supports three layers of authentication:Layer 1: Bearer Token (Required)
OAuth2 access token from Ory Hydra:agent:read— Read operations (tasks/get, tasks/list)agent:write— Write operations (message/send, tasks/cancel)agent:execute— Both read and write (legacy)
Layer 2: DID Signature (Optional, Agent-to-Agent)
For agent-to-agent communication, sign requests with your DID:Layer 3: x402 Payment (Optional, Paid Agents)
For paid agents, include payment proof:Task States
Every interaction creates a Task with a unique ID. Tasks follow this state machine:Non-Terminal States
submitted
Queued, not yet picked up by worker
working
Agent is actively processing
input-required
Paused, waiting for user clarification
auth-required
Paused, waiting for authentication
Terminal States
completed
Success, artifacts available
failed
Processing error occurred
canceled
User terminated the task
rejected
Agent declined to process
Terminal tasks are immutable. To refine a completed answer, submit a new
message/send with referenceTaskIds pointing to the old task.Error Codes
Errors follow JSON-RPC 2.0 format:Standard JSON-RPC Errors
| Code | Name | Meaning |
|---|---|---|
-32700 | Parse error | Invalid JSON |
-32600 | Invalid Request | Malformed JSON-RPC |
-32601 | Method not found | Unknown method |
-32602 | Invalid params | Schema validation failed |
-32603 | Internal error | Server bug |
A2A Protocol Errors
| Code | Name | Meaning |
|---|---|---|
-32001 | TaskNotFound | Task doesn’t exist |
-32002 | TaskNotCancelable | Task already terminal |
-32003 | PushNotificationNotSupported | Agent doesn’t support push |
-32004 | UnsupportedOperation | Operation not available |
-32005 | ContentTypeNotSupported | Unsupported output format |
Bindu Extensions
| Code | Name | Meaning |
|---|---|---|
-32009 | AuthenticationRequired | Missing bearer token |
-32010 | InvalidToken | Token introspection failed |
-32011 | TokenExpired | Token past expiration |
-32012 | InvalidTokenSignature | DID signature verification failed |
-32013 | InsufficientPermissions | Missing required scope |
Discovery Endpoints
Agent Card
- Agent DID
- Capabilities
- Published skills
- Payment requirements
- Supported protocols
Skills List
Skill Details
Health & Monitoring
Health Check
200 when healthy, 503 when degraded. Includes per-component status.
Metrics
- Request counts and latency
- Active tasks by state
- Token usage
- Error rates
Webhooks & Push Notifications
For long-running tasks, you don’t have to poll. Pass apush_notification_config inside configuration and the agent will POST updates to your webhook as the task progresses:
Best Practices
Use stable message IDs for idempotency
Use stable message IDs for idempotency
Generate a UUID for each message and reuse it if you need to retry. Check
tasks/list before resending to avoid duplicates.Poll tasks with exponential backoff
Poll tasks with exponential backoff
Start with 1s intervals, double up to 30s max. Don’t hammer the server with rapid polls.
Share contexts for conversations
Share contexts for conversations
Handle all terminal states
Handle all terminal states
Don’t assume tasks always complete successfully. Check for
failed, canceled, and rejected states.Verify DID signatures
Verify DID signatures
For agent-to-agent calls, always verify the response signature against the agent’s public key.
Next Steps
Authentication Guide
OAuth2 and DID setup
Payment Integration
x402 payment protocol
Push Notifications
Webhook updates for long-running tasks
Example Agents
Working code examples