How To · Agent shopping · AGENT-PURCHASE.md

Full agent shopping flow (canonical)

Exact sequence an autonomous agent should follow. No human UI required. Recommended first skill: agent-x402-first-buy at $0.005.

Constants (live) — Network Base 8453 · USDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 · payTo from challenge (treasury 0x8E51309870394f79574452A52A3c916622f0c4d1) · Protocol field x402Version: 2 on apex challenges.

Seven steps

1 Discover — GET /api/shop (or /catalog.json)
curl -sS "https://lvlltd.com/api/shop" | python3 -c "import sys,json;j=json.load(sys.stdin);print(j.get('next_action'));print(j.get('inventory'))"
Use next_action.for_agents when present. Prefer canary or top confirmed demand.
2 Evaluate free — GET /skills/{id}/outline.json
curl -sS "https://lvlltd.com/skills/agent-x402-first-buy/outline.json"
curl -sS "https://lvlltd.com/skills/agent-x402-first-buy/sample.md" | head
If outline is empty/template, skip or escalate to human.
3 Challenge — GET /api/pay?skill={id} → HTTP 402
curl -si "https://lvlltd.com/api/pay?skill=agent-x402-first-buy" | head -n 40
Parse maxAmountRequired, payTo, assetContract, x402_version. Canary amount is atomic 5000 ($0.005 USDC, 6 decimals — not $5.00). Policy engines evaluate after this 402. Veridex contract.
4 Settle — Transfer exact atomic USDC on Base to payTo

Wrong chain, amount, or receiver → verification fails. Wait for inclusion before unlock POST.

5 Unlock — POST /api/pay with X-PAYMENT
curl -sS -X POST "https://lvlltd.com/api/pay" \
  -H "Content-Type: application/json" \
  -H 'X-PAYMENT: {"txHash":"0x…","skill":"agent-x402-first-buy"}' \
  -d '{"txHash":"0x…","skill":"agent-x402-first-buy"}'
Expect ok: true and sealed_pack.files.
6 Persist — Save files + txHash (+ license token if returned)
7 Optional verify — GET /api/proof
curl -sS "https://lvlltd.com/api/proof?limit=5"
Your unlock may appear under recent_unlocks when recorded. Empty/low ledger is honesty.

Canary skill (recommended first purchase)

idagent-x402-first-buy
price$0.005 USDC (atomic 5000)
outlineoutline.json
challenge/api/pay?skill=agent-x402-first-buy
human UI/first-unlock/

If unlock fails after payment

Do not pay again first. Re-submit the same txHash + skill via POST /api/pay or POST /api/recover. Docs: GET /api/recover · UI: /recover/
  1. Confirm tx on BaseScan: amount, payTo, Base mainnet
  2. Wait a few seconds for indexers / RPC lag
  3. Retry unlock (idempotent)
  4. If still failing, check /api/health and status surfaces

How agents should treat the proof ledger

End-to-end shell sketch

#!/usr/bin/env bash
# After you have a Base wallet + USDC and a way to broadcast ERC-20 transfers:
set -euo pipefail
BASE=https://lvlltd.com
SKILL=agent-x402-first-buy

curl -sS "$BASE/api/shop" > /tmp/shop.json
curl -sS "$BASE/skills/$SKILL/outline.json" > /tmp/outline.json

# Challenge (402 expected)
curl -sS -o /tmp/challenge.json -w "%{http_code}" \
  "$BASE/api/pay?skill=$SKILL" || true
# Parse payTo + maxAmountRequired from /tmp/challenge.json
# TX=$(your_wallet_transfer ...)

# Unlock (replace TX):
# curl -sS -X POST "$BASE/api/pay" \
#   -H "Content-Type: application/json" \
#   -H "X-PAYMENT: {\"txHash\":\"$TX\",\"skill\":\"$SKILL\"}" \
#   -d "{\"txHash\":\"$TX\",\"skill\":\"$SKILL\"}" > /tmp/unlock.json

Related

Setup detail: agent setup · Human path: human · Cards: quick reference · SDK: agent-shop.mjs

← Agent setup Quick reference →
GET canary 402 GET /api/shop GET /api/proof