Nuri / Agent API / x402
Agent-ready x402 postcards on Nuri
An agent supplies the postcard image, message and postal recipient. Nuri handles the seller, idempotency, x402 payment and thanks.io fulfillment.
TL;DR
- Point an agent to /api/x402; it discovers the postcard service and its complete schema.
- The agent supplies only a public image URL, message and postal recipient.
- Nuri automatically uses emino.nuri.eth as the service seller and creates the operation ID.
- x402 settles the thanks.io cost plus 21%, then Nuri sends and tracks the 4x6 postcard.
Endpoints
GET/api/x402
Service catalog, protocol metadata and schemas.
GET/api/x402/resolve/{username}
Resolve a Nuri username to its current ENS EVM address.
POST/api/x402/postcards/preview
Render a thanks.io preview. It never mails a card.
POST/api/x402/postcards
Create the x402 offer, verify payment, send one postcard and settle.
GET/api/x402/orders/{publicOrderId}
Read privacy-safe payment and delivery status.
Request
The paid endpoint accepts one explicit service request. The same JSON must be retried after the HTTP 402 response.
{
"front_image_url": "https://example.com/postcard.jpg",
"message": "Hello from Nuri.",
"handwriting_style_id": 4,
"size": "4x6",
"recipient": {
"name": "Example Person",
"address": "1 Main Street",
"city": "Berlin",
"province": "BE",
"postal_code": "10115",
"country": "DE"
}
}
Payment and fulfillment flow
- PrepareValidate image, message and postal recipient; choose the configured seller, resolve ENS, derive the operation ID and persist only the hash plus payout terms.
- ChallengeReturn HTTP 402 with x402 v2, Base USDC, scheme upto, the pinned payTo address, a $3.50 ceiling and required payment-identifier.
- VerifyThe buyer retries the identical JSON with PAYMENT-SIGNATURE. The facilitator verifies the signed maximum before fulfillment begins.
- FulfillSubmit exactly one 4x6 postcard to thanks.io. The response supplies authorization_total in cents.
- SettleRound authorization_total × 1.21 up to the next cent and settle only that USDC amount to the pinned seller address.
- TrackReturn a random public order ID. Status exposes delivery counts and transaction evidence, never the recipient address.
Pricing
The buyer authorizes at most $3.50 USDC through x402 v2 upto on Base.
ceil(thanks.io authorization_total × 1.21)
Example: 252 provider cents become 305 cents or 3,050,000 USDC atomic units.
Seller resolution
emino normalizes to emino.nuri.eth. ENSIP-10/CCIP-read resolves the full EVM address. That address is pinned into the payment offer.
Resolve the example seller Idempotency, failures and privacy
The request needs both an application operation_id and x402 payment-identifier. Nuri stores a SHA-256 request fingerprint, never the recipient address. A hard settlement failure triggers immediate thanks.io cancellation. A broadcast settlement_pending transaction enters reconciliation instead of being treated as failed.
Public status exposes payment and delivery evidence without recipient PII.
Current boundary
- Agents do not need to know or submit a seller; emino.nuri.eth is configured for this postcard service.
- A postal recipient address remains required because thanks.io must physically deliver the card.
- Only the reviewed thanks-postcard-v1 adapter is active.
- One recipient and 4x6 Standard Mail only; no mailing lists, radius search or arbitrary callbacks.
- The receiving wallet supplies no private key. The address is a payment destination only.
- This is a reusable payment and fulfillment seam, not an unmoderated arbitrary-offer marketplace.
Discovery and market listing
- Nuri catalog: /api/x402 lists active paid services and adapter boundaries.
- Agent discovery: OpenAPI, llms.txt, Markdown negotiation and /.well-known/agentic-commerce.json expose the endpoint immediately.
- Bazaar declaration: every 402 challenge includes a typed Bazaar body schema, service name and tags.
- External market listing: a paying client must echo the Bazaar extension through a supporting facilitator; verify /discovery/resources before claiming listed.
Current evidence: Nuri-owned discovery is live. External Bazaar inclusion still needs one funded client to echo and settle the Bazaar extension before we claim the endpoint is listed.
Add the next paid endpoint
- Define one fulfillment adapter ID, one bounded input schema and one authoritative cost source.
- Configure seller normalization and ENS resolution inside the adapter so ordinary buyers never enter a seller.
- Choose exact for known prices or upto for metered prices, then bind operation ID, payment ID and request fingerprint.
- Publish OpenAPI, llms, agentic-commerce and Bazaar input/output examples with descriptions for every field.
- Prove zero side effects before payment, one side effect under concurrent retries, public status, then one funded canary and Bazaar lookup.