Skip to main content

A2A Endpoint

CoinFello exposes a single API endpoint that implements the Agent-to-Agent protocol spec over JSON-RPC 2.0.
POST https://app.coinfello.com/api/a2a

Methods

MethodDescription
message/sendSend a message and get a response
message/streamSend a message and stream the response via SSE
tasks/getGet a task by ID (optionally limit history with historyLength)
tasks/cancelCancel a running task

Agent ID

Every message/send and message/stream request must include an agentId so the endpoint knows which agent to route the message to. The endpoint is agent-agnostic — there is no hardcoded default. Pass the agentId (a number) in params.configuration:
{
  "params": {
    "configuration": { "agentId": 1 },
    "message": { ... }
  }
}
Omitting the agentId on a new request returns an error: "agentId is required: provide in configuration.agentId or as a DataPart". Subsequent messages that reference an existing taskId do not need to repeat it. Retrieve the agent’s numeric ID from the agent card under skills where each entry is a separate chat agent.

Send a Message

curl -b cookies.txt -X POST https://app.coinfello.com/api/a2a \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "message/send",
    "params": {
      "configuration": { "agentId": 1 },
      "message": {
        "role": "user",
        "parts": [{ "type": "text", "text": "What are the best yields for ETH right now?" }]
      }
    }
  }'

Stream a Response

Use message/stream to receive Server-Sent Events. Each SSE data line is a JSON-RPC response wrapping an A2A stream event.
curl -b cookies.txt -X POST https://app.coinfello.com/api/a2a \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "message/stream",
    "params": {
      "configuration": { "agentId": 1 },
      "message": {
        "role": "user",
        "parts": [{ "type": "text", "text": "Swap 0.1 ETH to USDC" }]
      }
    }
  }'

Get a Task

curl -X POST https://app.coinfello.com/api/a2a \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tasks/get",
    "params": { "id": "task-id-here", "historyLength": 5 }
  }'

Cancel a Task

curl -X POST https://app.coinfello.com/api/a2a \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tasks/cancel",
    "params": { "id": "task-id-here" }
  }'

Authentication

Authentication uses SIWE (Sign-In with Ethereum). Complete the SIWE flow to obtain a session cookie before making requests. Unauthenticated requests return a 401 error. See the Authentication page for the full SIWE flow with curl examples.

Errors

Errors follow standard JSON-RPC 2.0 error format:
CodeMeaning
-32600Invalid JSON-RPC request
-32601Unknown method
-32001Task not found
-32002Task not cancelable
-32603Internal server error

Rate Limits

API requests are rate-limited. Current limits are provided in response headers:
HeaderDescription
X-RateLimit-LimitMaximum requests per minute
X-RateLimit-RemainingRequests remaining in current window
X-RateLimit-ResetUnix timestamp when the window resets