A2A Protocol
The A2A protocol enables AI agents to communicate with Suwappu using natural language messages over JSON-RPC 2.0. Your agent sends a message, and Suwappu returns a task object that tracks the request through its lifecycle.
Endpoint
POST https://api.suwappu.bot/a2aAuthentication
Include your Bearer token in the Authorization header:
Authorization: Bearer suwappu_sk_YOUR_KEYObtain a token by registering at POST /v1/agent/register.
Protocol
All requests and responses follow the JSON-RPC 2.0 specification. Every request must include:
jsonrpc: Always"2.0"id: A unique request identifier (integer or string)method: One of the three supported methodsparams: Method-specific parameters
Methods
message/send
Send a natural language message to Suwappu and receive a task with the result.
Request:
Response:
tasks/get
Retrieve a task by its ID to check its current status and results.
Request:
Response:
Returns the same task object structure as message/send.
tasks/cancel
Cancel a task that is currently running.
Request:
Response:
Task Lifecycle
A task transitions through the following states:
submitted
Task received and queued for processing
working
Task is actively being processed
completed
Task finished successfully; results available in artifacts
failed
Task encountered an error; details in status.message
canceled
Task was canceled via tasks/cancel
Task Object
id
string (UUID)
Unique task identifier
status.state
string
Current lifecycle state
status.timestamp
string (ISO 8601)
When the status last changed
status.message
string (optional)
Human-readable status detail or error message
artifacts
array
Result data, present when state is completed
artifacts[].id
string
Artifact identifier
artifacts[].parts
array
Content parts (text and/or structured data)
messages
array
Full conversation history for the task
Supported Commands
Suwappu understands the following natural language intents:
Swap / Quote / Convert
"swap 0.5 ETH to USDC on base", "quote 100 USDC to WBTC on ethereum"
Price checks
"price of ETH", "prices for ETH, BTC, SOL"
Balance / Portfolio
"show my portfolio on base", "check balances for 0xabc..."
Token discovery
"list tokens on arbitrum", "search for PEPE token"
Chain discovery
"list supported chains", "what chains do you support"
Help
"help", "what can you do"
Error Codes
Standard JSON-RPC 2.0 error codes plus Suwappu-specific codes:
-32700
Parse error
Invalid JSON in request body
-32600
Invalid request
Request is not a valid JSON-RPC 2.0 object
-32601
Method not found
The method name is not one of the three supported methods
-32001
Task not found
The provided taskId does not match any existing task
-32002
Unsupported operation
The requested operation is not supported
Error response example:
Full Example: Quote and Execute
Last updated