# agent-business: paid research + verification APIs for agents Paid services for AI agents, priced per request via the x402 protocol (HTTP 402 micropayments, USDC on Base Sepolia testnet). ## FREE QUOTA: send X-Payer Free tiers apply ONLY to requests with an `X-Payer` header (any wallet address you control — it keys your quota). Requests without X-Payer always get HTTP 402. Directory crawlers see the paywall, real agents get the quota. ## Service 1: verified coding research (pre-verified, signed) POST /code-research Body: {"query": str, "context": str | null} Returns: {"answer": str, "citations": [{"title", "url", "snippet"}], "provider": str, "served_in_ms": int, "attestation": {...}, "attestation_hash": "0x...", "signature": "0x..."} Every answer's citations are re-checked by the verification pipeline and the result is EIP-191 signed — you receive PROOF the sources were checked, not just links. Price: 0.10 USDC/call after 25 free calls per identifier. ## Service 2: Verification Oracle (check other agents' work) POST /verify Body: {"job": {"type": "citation" | "code" | "data", ...payload}, "spec": {...optional}} citation: {"claim": str, "sources": [urls]} — do the sources support the claim? code: {"language": "python", "code": str, "tests": str} — run tests in a locked-down subprocess (rlimits, scrubbed env, 10s wall timeout) data: {"data": str (JSON array or CSV), "schema": JSONSchema, "freshness_field": str | null} — schema validation + stats + recency Returns: {"verdict": "pass" | "fail" | "partial" | "abstain", "confidence": 0..1, "evidence": [...], "attestation": {...}, "attestation_hash": "0x...", "signature": "0x...", "served_in_ms": int} "abstain" = the evidence was too ambiguous to call pass or fail (confidence below 0.45); it is NOT a free pass — treat it as "needs human/second-opinion review". The attestation is EIP-191 signed by verifier address 0x31520f9c14360470040807fAba64938ebcfF9C8f; verify it yourself: ecrecover(encode_defunct(canonical_json(attestation)), signature) must equal verifier_address. See /docs page docs/VERIFY.md. Price: 0.25 USDC/call after 5 free calls per identifier. ## Service 3: SLA Watchtower (do services honor their advertised terms?) POST /watchtower/report Body: {"service": ""} We probe watched x402 services every 30 minutes (expect 402, decode PAYMENT-REQUIRED, compare live price to advertised) and sign a 24h report: {"report": {"subject", "window", "checks", "uptime_pct", "price_match_pct", "current_verdict", "timestamp"}, "attestation": {...}, "attestation_hash": "0x...", "signature": "0x..."} Verdicts: honoring | price_mismatch | unexpected_status | invalid_payload | unreachable. Price: 0.05 USDC/report after 3 free reports per identifier. GET /watchtower/targets is free and lists every watched service with its latest verdict. ## Service 4: Spend Check (should you pay this counterparty?) POST /spend-check Body: {"payTo": "<0x address or URL>", "amount_usd": } Pre-payment policy gate for buyers. We combine our watchtower track record, the CDP merchant catalog, and address hygiene (0x shape, contract vs EOA, host resolution) into a deterministic verdict with a signed attestation: {"verdict": "clear" | "caution" | "avoid", "confidence": 0..1, "evidence": [...], "attestation": {...}, "signature": "0x..."} Unknown payees always come back "caution" at low confidence, never "clear". Price: 0.005 USDC/check after 5 free checks per identifier. ## Service 5: QA Judge (grade agent output against your rubric) POST /judge Body: {"output": "", "rubric": [{"criterion": "...", "weight": }], "context": } Deterministic graders: structure coverage, citation presence, claim support (via the citation pipeline against sources in context), length rules like "under 200 words". Weighted 0-100 score with signed attestation: {"score": 0-100, "verdict": "pass" | "abstain" | "fail", "per_criterion": [...], "attestation": {...}, "signature": "0x..."} Bands: >=70 pass, 40-69 abstain, <40 fail; half the weight unjudgeable means abstain. Price: 0.10 USDC/grading after 3 free. ## Idempotency (safe retries) Send `Idempotency-Key: ` on either POST. Same key + same body within 24h replays the cached response WITHOUT re-executing or double-charging (header `Idempotent-Replay: true`); same key + different body returns 409. Retries carrying the same x402 payment nonce are deduplicated automatically. ## Errors & limits - Non-402 errors use RFC 9457 application/problem+json with machine fields (code, is_retriable, retry_after_seconds). - Rate limits: 60/min per IP, 120/min per X-Payer wallet; every response carries X-RateLimit-Limit/Remaining/Reset; on breach: 429. - Facilitator outage after a payment attempt: 503 + Retry-After (never a second 402) — retry with the same Idempotency-Key/payment payload. ## Pricing & payment - Payments settle on eip155:8453 via the x402 facilitator https://api.cdp.coinbase.com/platform/v2/x402. 1. Call the endpoint. Expect HTTP 402 with a PAYMENT-REQUIRED header (base64 JSON describing accepted schemes/networks/payees). 2. Sign an x402 payment payload with an EVM wallet holding Base Sepolia USDC (use the official `x402` Python SDK: x402HttpxClient does this automatically). 3. Retry with the PAYMENT-SIGNATURE header. On success you get 200 + the answer + a PAYMENT-RESPONSE header containing the settlement transaction hash. - To skip your free tier (e.g. to test the paid path), send header `X-Force-Payment: true`. ## Other endpoints - GET /demo/code-research — FREE sample (cached, real pipeline output) - GET /demo/verify — FREE sample (cached, real pipeline output) - POST /receipts/verify — FREE: verify any attestation we issued - GET /watchtower/targets — FREE: watched services + latest verdicts - GET /policy — machine-readable charge/idempotency/abstain/rate policy - GET /health — liveness - GET /metrics — usage metrics (research vs verify breakdown) - GET /.well-known/x402 — x402 metadata - GET /openapi.json — machine-readable API schema