Buyer Agent Examples

402 to paid 200, without guessing.

Copy-paste examples for buyer agents that need to inspect the expected 402 challenge, pay with their own x402 client, and retry for HTTP 200.

Base mainnet x402 No secrets in examples Buyer-controlled payment

1. Inspect the expected 402 with curl

No wallet needed for the unpaid challenge.

curl -i -X POST "https://apexscout.ai/api/opportunity-check" \
  -H "content-type: application/json" \
  --data '{
  "subject": "Agent trust scoring for crypto vendors",
  "buyer": "Crypto fund operator",
  "marketType": "vendor",
  "geography": "United States",
  "goal": "Decide whether this topic is strong enough to package into a deeper diligence offer.",
  "knownSignals": [
    "Operators keep asking for a faster first-pass trust screen before pilots",
    "Funds want a lightweight way to compare agent vendors before deeper diligence"
  ],
  "constraints": [
    "Keep the first offer lightweight",
    "Do not assume the buyer already trusts agent vendors"
  ]
}'

2. Retry with TypeScript x402 fetch

Buyer-controlled wallet pays the listed route price.

import { wrapFetchWithPaymentFromConfig, decodePaymentResponseHeader } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";

const baseUrl = "https://apexscout.ai";
const payload = {
    "subject": "Agent trust scoring for crypto vendors",
    "buyer": "Crypto fund operator",
    "marketType": "vendor",
    "geography": "United States",
    "goal": "Decide whether this topic is strong enough to package into a deeper diligence offer.",
    "knownSignals": [
      "Operators keep asking for a faster first-pass trust screen before pilots",
      "Funds want a lightweight way to compare agent vendors before deeper diligence"
    ],
    "constraints": [
      "Keep the first offer lightweight",
      "Do not assume the buyer already trusts agent vendors"
    ]
  };

const account = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
const fetchWithPayment = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }],
});

const response = await fetchWithPayment(`${baseUrl}/api/opportunity-check`, {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify(payload),
});

const paymentResponse = response.headers.get("PAYMENT-RESPONSE");
console.log(response.status); // 200 after payment
console.log(await response.json());
if (paymentResponse) console.log(decodePaymentResponseHeader(paymentResponse));

3. Python challenge inspection

Use this before wiring a Python x402 client.

import requests

base_url = "https://apexscout.ai"
payload = {
  "subject": "Agent trust scoring for crypto vendors",
  "buyer": "Crypto fund operator",
  "marketType": "vendor",
  "geography": "United States",
  "goal": "Decide whether this topic is strong enough to package into a deeper diligence offer.",
  "knownSignals": [
    "Operators keep asking for a faster first-pass trust screen before pilots",
    "Funds want a lightweight way to compare agent vendors before deeper diligence"
  ],
  "constraints": [
    "Keep the first offer lightweight",
    "Do not assume the buyer already trusts agent vendors"
  ]
}

response = requests.post(f"{base_url}/api/opportunity-check", json=payload)
print(response.status_code)
print(response.json())

if response.status_code == 402:
    print('Expected x402 challenge. Configure your Python x402 client, pay the listed route price, then retry the same POST.')

Copy-paste payloads

Start cheap, then escalate only when needed.

$0.01

/api/opportunity-check

Use this when you are unsure whether a target or claim deserves more paid work.

{
  "subject": "Agent trust scoring for crypto vendors",
  "buyer": "Crypto fund operator",
  "marketType": "vendor",
  "geography": "United States",
  "goal": "Decide whether this topic is strong enough to package into a deeper diligence offer.",
  "knownSignals": [
    "Operators keep asking for a faster first-pass trust screen before pilots",
    "Funds want a lightweight way to compare agent vendors before deeper diligence"
  ],
  "constraints": [
    "Keep the first offer lightweight",
    "Do not assume the buyer already trusts agent vendors"
  ]
}

$0.05

/api/company-intel

Use this for a quick company snapshot before outreach, approval, or a deeper trust review.

{
  "companyName": "Alpine Foods",
  "website": "https://example.com",
  "industry": "Food distribution",
  "geography": "United States",
  "researchFocus": "growth",
  "knownClaims": [
    "Regional specialty food distributor",
    "Expanding private-label program"
  ],
  "knownSignals": [
    "Hiring for operations and sales",
    "Launching new product categories"
  ],
  "questions": [
    "How concentrated is demand around a few buyers?",
    "What trust signals matter most to partners?"
  ]
}

$0.05

/api/vendor-risk

Use this before a pilot, procurement review, partnership decision, or vendor approval.

{
  "vendorName": "Northwind AI",
  "website": "https://example.com",
  "serviceCategory": "AI workflow automation",
  "useCase": "Automate intake triage and case routing for an operations team.",
  "dataSensitivity": "high",
  "criticality": "high",
  "geography": "United States",
  "knownControls": [
    "SOC 2 Type II claimed",
    "SSO and role-based access controls"
  ],
  "knownConcerns": [
    "No published uptime history",
    "Third-party model dependency"
  ],
  "questions": [
    "What is the rollback plan if the workflow misroutes tasks?"
  ]
}

$0.50

/api/deep-diligence

Use this when missing evidence could change a real decision and the buyer needs a structured verification map.

{
  "subject": "Northwind AI",
  "subjectType": "vendor",
  "website": "https://example.com",
  "geography": "United States",
  "industry": "AI workflow automation",
  "objective": "Decide whether this vendor deserves a serious trust review before procurement or pilot planning.",
  "knownClaims": [
    "SOC 2 Type II claimed",
    "Enterprise-ready deployment posture"
  ],
  "knownSignals": [
    "No public uptime history",
    "Third-party model dependency",
    "Growing enterprise go-to-market motion"
  ],
  "questions": [
    "Which missing proof would most change the trust decision for this vendor?"
  ]
}

$5.00

/api/agent-revenue-audit

Use this when the buyer wants monetization help for their own agent, API, x402 service, or paid route.

{
  "serviceName": "Example Agent API",
  "serviceUrl": "https://example.com",
  "buyerType": "x402-builder",
  "currentOffer": "A pay-per-call endpoint that helps agents decide what paid route to buy first.",
  "currentPaymentRail": "base-x402",
  "targetBuyer": "Agent and API builders trying to monetize faster.",
  "currentProblem": "Buyers hit the 402 challenge but do not always understand the exact paid retry path.",
  "knownMetrics": {
    "visits": "413 source-tagged visits",
    "unpaid402Challenges": "559 unpaid 402 challenges",
    "paidCompletions": "10 paid completions",
    "feedbackCount": "1 feedback item"
  },
  "riskTolerance": "medium",
  "source": "docs-example"
}

Guardrails