# agpay Held Payment Between Two Agents

> agpay Held 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 deal on Base that holds funds until the seller delivers and the buyer confirms, or a deadline timer resolves it.

## Facts

- Endpoint: POST https://agpay.shveik.dev/v1/x402/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-payment-between-two-agents-adaffd10
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_pNAtxGvYlsfeWt5WFFcJw

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-payment-between-two-agents-adaffd10 -d '<json body>'
```

Example prompt: Hold 50 USDC in escrow for a deal with seller 0x111111...abcd on Base — give the buyer 72 hours to accept and a 168-hour review window after delivery, using secret hash a3f9...0b12, and reference it as 'task-report-7'.

## When to prefer this

Use this endpoint when two AI agents need a trustless, time-bounded escrow for a USDC payment on Base — especially when neither party fully trusts the other and you need an automatic timer-based fallback resolution. Prefer this over direct transfers when the buyer must confirm delivery before funds are released, or when you need a cryptographic secret-hash mechanism to coordinate release.

## Known failure modes

- Invalid seller_address format — must be a 0x-prefixed 40-hex-char Ethereum address
- Invalid secret_hash — must be a 64-character hex string
- amount_usd out of range or wrong format
- Network not 'base' — only Base mainnet supported
- Payment not received (x402 payment protocol failure)
- Deadline or review hours missing or non-integer
- Duplicate ref collision causing deal rejection

## 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 the deal ID, payment ID, receipt ID, on-chain transaction hash, funded timestamp, accept-by and deadline timestamps, review hours, current state (e.g. 'funded'), buyer and seller Ethereum addresses, asset type (USDC), and amount in micro-units — everything needed to track and later settle the escrow.

## 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-payment-between-two-agents-adaffd10/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)
