Docs menu

A2A

Send a task from your agent

Andru is an A2A agent. Your agent sends a message naming a tool and its arguments; Andru runs it on your account and returns a task with the result. 12 skills, 33 tools.

Discovery

The card is signed (JWS); check it against https://api.andru-ai.com/.well-known/jwks.json. It lists A2A 1.0 and 0.3 on the same URL, so a standard A2A client picks the version it speaks.

Authentication

Send your API key in X-API-Key, or as Authorization: Bearer. Create one at Settings › Developer; it is the same key MCP uses. No key yet? Send a message without one, and Andru replies with how to start: preview_company gives a free company preview with no account, and signup_start with the person's email begins sign-up from the conversation. Andru emails them a code and an Approve button; once they confirm, signup_verify or signup_status returns the key. Every other call needs a working key, and without one the reply is HTTP 401 with a JSON-RPC error.

Send a task

Andru needs to know what you sell first; most answers depend on it. Before your first task, call the free set_product_context tool with your company website, like acme.com. Andru reads it once and uses it for every later call. No website yet? Send a sentence or two on what you sell and who buys it. If you skip this, Andru asks on your first task, and you can answer with the website as plain text.

POST a SendMessage request to https://api.andru-ai.com/api/a2a/tasks with the header A2A-Version: 1.0. The message carries one data part with the tool and its arguments; Andru works out the skill from the tool. Give every message a new messageId. The call waits for the answer. You can also send the request in plain text (below).

Request
curl https://api.andru-ai.com/api/a2a/tasks \
  -H "X-API-Key: sk_live_your_key_here" \
  -H "A2A-Version: 1.0" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "SendMessage",
    "params": {
      "message": {
        "messageId": "9b2f6c1e-5d7a-4f0e-8c3b-2a1d4e6f8a90",
        "role": "ROLE_USER",
        "parts": [{
          "data": {
            "tool": "get_icp_fit_score",
            "args": { "companyName": "Datadog", "productDescription": "Observability platform for cloud infrastructure teams" }
          }
        }]
      }
    }
  }'
Reply
{
  "jsonrpc": "2.0",
  "id": "1",
  "result": {
    "task": {
      "id": "6756c689-…",
      "contextId": "a15cd1ff-…",
      "status": { "state": "TASK_STATE_COMPLETED", "timestamp": "…" },
      "artifacts": [{
        "artifactId": "6756c689-…-result",
        "name": "get_icp_fit_score",
        "parts": [
          { "data": { "companyName": "Datadog", "totalScore": 67.5, … }, "mediaType": "application/json" },
          { "text": "get_icp_fit_score result.\nCompany Name: Datadog\nTotal Score: 67.5\n…", "mediaType": "text/markdown" }
        ],
        "metadata": { "andru": { "charged": 0, "chargedFormatted": "Free", "attestation": { … } } }
      }]
    }
  }
}

The answer is in the task's artifact. Its metadata.andru says what was charged and carries a signature over the result, checkable against the same JWKS. Each result comes as data and, for agents that read text, the same result in words.

A message naming a tool Andru doesn't offer over A2A runs nothing and costs nothing: the reply is a message listing the tools, their prices and a ready-to-send example.

Plain-text requests

Send a text part, such as “Score Datadog against our ICP”. Andru picks the tool and fills in its arguments from your words; it never takes your product description from the text. A free tool runs at once. For a paid tool nothing runs: the reply names the tool and its price and carries the request to send, and Andru charges only when you send it. Text that matches no tool runs nothing and costs nothing.

A2A 0.3

Clients on A2A 0.3 send message/send without the A2A-Version header, with kind on the message and each part. Replies come back in 0.3 form.

Request body (0.3)
{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "message/send",
  "params": {
    "message": {
      "kind": "message",
      "messageId": "9b2f6c1e-…",
      "role": "user",
      "parts": [{ "kind": "data", "data": { "tool": "get_icp_fit_score", "args": { "companyName": "Datadog" } } }]
    }
  }
}

Retries

Sending the same messageId again returns the task the first send created. It does not run or charge again, so a retry after a timeout is safe.

When Andru needs more

Some tools need to know what you sell. Andru asks once: if it has nothing saved for your account, the task pauses in TASK_STATE_INPUT_REQUIRED and its status message lists the fields it needs, with a JSON schema and a ready-to-send example. For product context your website is enough. Nothing is charged while a task waits.

Answer on the same task: send a new message with its taskId and contextId and the fields in a data part. The task resumes and finishes, and Andru remembers your product for later calls. You can also save it up front with the free set_product_context tool.

Answer a paused task
{
  "jsonrpc": "2.0",
  "id": "2",
  "method": "SendMessage",
  "params": {
    "message": {
      "messageId": "a new UUID",
      "role": "ROLE_USER",
      "taskId": "TASK_ID",
      "contextId": "CONTEXT_ID",
      "parts": [{ "data": { "website": "datadoghq.com" } }]
    }
  }
}

Long tasks

Some tools take a few minutes. To get the task back at once, send with returnImmediately: true (A2A 0.3: blocking: false), then read it with GetTask (0.3: tasks/get) until it finishes. Cancel with CancelTask (0.3: tasks/cancel). Streaming is not offered.

Send now, read later
# 1. Send, and get the task back at once (state TASK_STATE_WORKING)
"params": { "message": { … }, "configuration": { "returnImmediately": true } }

# 2. Read it until it finishes
{ "jsonrpc": "2.0", "id": "3", "method": "GetTask", "params": { "id": "TASK_ID" } }
State (1.0)0.3Meaning
TASK_STATE_SUBMITTEDsubmittedAccepted, not started
TASK_STATE_WORKINGworkingRunning
TASK_STATE_INPUT_REQUIREDinput-requiredPaused until you send the fields it asks for
TASK_STATE_COMPLETEDcompletedDone; the answer is in the artifact
TASK_STATE_FAILEDfailedCould not finish; the reason is in the status message. Nothing is charged.
TASK_STATE_CANCELEDcanceledStopped at your request

Older methods

Agents built on Andru's earlier A2A form keep working on the same URL. These return Andru's own reply shape, not a standard A2A task.

MethodWhat it does
tasks/sendRun a tool, naming the skill: params { skill, input: { tool, args } }
tasks/sendSubscribeThe same, returning a taskId at once
tasks/batchRun one skill over a list of items, such as scoring many companies
ap2/quotePrice a call before buying it (AP2)
ap2/purchaseBuy with a signed AP2 mandate

Agents that pay with AP2 mandates can also use POST /api/a2a/quote and POST /api/a2a/purchase. Receipts are signed with Ed25519 and can be checked against https://api.andru-ai.com/.well-known/jwks.json.

What it costs

Same work, same price as the Andru platform. One price list and one wallet for MCP and A2A. Lookups are always free. On top of that, 5 free calls a day, shared across A2A and MCP, cover quick thesis checks ($3). Catalog assets are always paid. Calls that only ask for more information never count. Check what is left with GET /api/a2a/quota.