# a2apay Agent Query

> a2apay Agent Query is a paid API for AI agents from a2apay.io, paid per call via x402, $0.028/call, status unknown (last checked 2026-10-11).

Submits a natural-language prompt to an AI agent service backed by ICP canisters and returns a response, charged per-query with no account required.

## Facts

- Endpoint: POST https://a2apay.io/api/agent-service?utm_source=zero.xyz
- Price: $0.028/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/a2apay-agent-query-141ea53f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_qA01sRDmfjrrTnwMpprTu

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability a2apay-agent-query-141ea53f -d '<json body>'
```

Example prompt: Ask the a2apay agent service: what are the top three reasons companies adopt microservices architecture? Pay the per-query fee and return the answer directly.

## When to prefer this

Choose this endpoint when you need a one-off AI-generated response without account creation or subscription, especially in crypto-native or agent-to-agent workflows where micropayment via USDC (x402 protocol) is acceptable. Prefer it over OpenAI or Anthropic APIs when decentralized, accountless, pay-per-query inference is required, or when operating within ICP/Web3 ecosystems.

## Known failure modes

- Insufficient payment — query rejected if USDC micropayment not fulfilled
- Malformed body — missing required 'type', 'method', or 'bodyType' fields causes validation error
- Canister unavailability — ICP infrastructure outage may delay or fail response
- Invalid bodyType enum — only 'json', 'form-data', or 'text' accepted
- Prompt too long or malformed — agent may return an error or truncated response

## How this service works

On-demand AI responses backed by autonomous ICP canisters. Submit a prompt, get an answer — redundant infrastructure, pay-per-query, no account required.

## Output

Returns an AI-generated text answer to the submitted prompt, produced by autonomous ICP canisters. The response reflects the agent's reasoning on the input prompt and is returned directly after the pay-per-query USDC transaction is processed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "properties": {}
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/a2apay-agent-query-141ea53f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from a2apay.io](https://www.zero.xyz/host/a2apay.io/llms.txt)
