# agpay: Held Stablecoin Payment Between Two Agents

> agpay: Held Stablecoin Payment Between Two Agents is a paid API for AI agents from agpay.shveik.dev, paid per call via x402, $0.597/call, status unknown (last checked 2026-10-13).

Creates an escrow-style USDC payment hold on Base between a buyer agent and a seller agent, releasing funds upon delivery confirmation or timer expiry.

## Facts

- Endpoint: POST https://agpay.shveik.dev/v1/mpp/deal?utm_source=zero.xyz
- Price: $0.597/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agpay-held-stablecoin-payment-between-two-agents-176bc1be
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hfCm-xZTbet88sVgJ4m2n

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 agpay-held-stablecoin-payment-between-two-agents-176bc1be -d '<json body>'
```

Example prompt: Create a held USDC payment deal on Base for $50.00 to seller 0x111111...aaaa with a 168-hour review window, a 7-day deadline, and use secret hash a1b2c3...64hexchars as the lock — reference it as 'task-report-001'.

## When to prefer this

Choose this endpoint when two AI agents need a trustless, time-bounded escrow mechanism for USDC payments on Base — specifically when the buyer wants funds held until delivery is confirmed or a timer resolves the dispute. Prefer it over direct transfers when there is meaningful delivery risk, when a review window is needed, or when autonomous agents must transact without human intermediaries. It is ideal for agent marketplaces, gig-style tasks, or any scenario where atomicity between payment and delivery matters.

## Known failure modes

- Invalid or malformed seller_address (not a valid 0x Ethereum address) returns a validation error
- secret_hash not exactly 64 hex characters causes a 400 bad request
- amount_usd format not matching the required pattern (e.g. too many decimal places) returns validation error
- Insufficient USDC balance or failed on-chain transaction results in a funding error
- Network set to anything other than 'base' is rejected
- Expired or duplicate ref string may cause conflict errors
- x402 payment header missing or underfunded causes a 402 Payment Required response before the deal is created

## How this service works

agpay holds a stablecoin payment between two AI agents until the seller delivers and the buyer confirms, or a timer decides. USDC on Base.

## Output

Returns a JSON object containing a unique deal_id and payment_id, the funded transaction hash on Base, current deal state ('funded'), buyer and seller addresses, the USDC amount in micro-units, timestamps for creation, funding, accept-by deadline, and the overall deadline, plus the review_hours window and a receipt_id for tracking.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "ref": {
   "type": "string",
   "maxLength": 200
  },
  "instant": {
   "type": "boolean"
  },
  "network": {
   "enum": [
    "base"
   ],
   "type": "string"
  },
  "amount_usd": {
   "type": "string",
   "pattern": "^(0|[1-9][0-9]{0,11})(\\.[0-9]{1,2})?$"
  },
  "secret_hash": {
   "type": "string",
   "pattern": "^[0-9a-fA-F]{64}$"
  },
  "review_hours": {
   "type": "integer"
  },
  "deadline_hours": {
   "type": "integer"
  },
  "seller_address": {
   "type": "string",
   "pattern": "^0x[0-9a-fA-F]{40}$"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ref": "report-4…",
  "note": "act only…",
  "asset": "USDC",
  "buyer": "0x222222…",
  "state": "funded",
  "amount": 5000000,
  "deal_id": "dl_01234…",
  "instant": false,
  "network": "base",
  "tx_hash": "0x9f2c4a…",
  "accept_by": 1791475260,
  "funded_at": 1791302460,
  "created_at": 1791302400,
  "payment_id": "pay_0123…",
  "receipt_id": "dl_01234…",
  "deadline_at": 1791907260,
  "review_hours": 168,
  "seller_address": "0x111111…"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agpay-held-stablecoin-payment-between-two-agents-176bc1be/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agpay.shveik.dev](https://www.zero.xyz/host/agpay.shveik.dev/llms.txt)
