Scout.

Payment model

Both paid endpoints are gated by the OKX Agent Payments Protocol. You are only charged for a successful 200.

How it works

Both /analyze and /discover are gated by the OKX Agent Payments Protocol (x402), using the exact scheme with EIP-3009 transferWithAuthorization. The call pays for itself; there is no account, key, or invoice.

StepWhat happens
1. Unpaid requestYou call the endpoint with no payment header. You get back 402 Payment Required with a PAYMENT-REQUIRED header (base64-encoded JSON) describing what to pay: token, amount, recipient, network, and the input schema for the paid replay.
2. Paid replayYou sign the authorization and re-send the same request with a PAYMENT-SIGNATURE header carrying the signed payment.
3. Settled responseThe server verifies the signature, runs the work, and only if the result is 200 redeems the payment on-chain and attaches a PAYMENT-RESPONSE header: a base64-encoded receipt with the settlement transaction hash.

You do not assemble these headers by hand

Any standard x402 or OKX Agent Payments Protocol client handles all three steps for you. The headers are documented here so you can debug what your client is doing, not so you can hand-roll it.

The 402 challenge

Start with an ordinary unpaid request.

Unpaid request
curl -X POST https://aspscout.xyz/analyze \
  -H "Content-Type: application/json" \
  -d '{"agentId":"1891","maxPeers":3}'

The response is 402 Payment Required. Its body, which is also what the PAYMENT-REQUIRED header carries once decoded, spells out the terms in full.

402 challenge body
{
  "x402Version": 1,
  "resource": "https://aspscout.xyz/analyze",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:196",
      "asset": "0x779Ded0c9e1022225f8E0630b35a9b54bE713736",
      "payTo": "0x4E1fd7974f3b8c609EaCB0bA8228CEaA517819B4",
      "amount": "50000",
      "maxAmountRequired": "50000",
      "decimals": 6,
      "resource": "https://aspscout.xyz/analyze",
      "description": "ASP-Scout: on-chain-verified agent trust score + ranked category peers",
      "mimeType": "application/json",
      "maxTimeoutSeconds": 120,
      "extra": { "name": "USD₮0", "version": "1" },
      "outputSchema": {
        "input": {
          "type": "http",
          "method": "POST",
          "bodyType": "json",
          "body": {
            "type": "object",
            "required": ["agentId"],
            "properties": {
              "agentId": { "type": "string", "description": "OKX agentId to analyze (e.g. \"1891\")" },
              "maxPeers": { "type": "integer", "description": "max category peers to rank (1-5)", "default": 5, "minimum": 1, "maximum": 5 }
            }
          }
        }
      }
    }
  ]
}

amount is in atomic units: 50000 at 6 decimals is 0.05 USDT0. The /discover challenge is identical except for the resource, the description, and an outputSchema that describes query instead of agentId.

The gate runs before validation

An unpaid request always gets the 402 challenge first, whatever its body says. Posting {} to /analyze returns 402, not 400. The parameter errors below are only reachable on the paid replay, once a signature is present.

Gate values

These are the live values, also served unauthenticated from GET /x402/status. No private key is ever exposed there.

payTo0x4E1fd7974f3b8c609EaCB0bA8228CEaA517819B4
token0x779Ded0c9e1022225f8E0630b35a9b54bE713736
settler0xe5DDe548f730b567f709421221066D7E9E1cbAFd
networkeip155:196 (X Layer, chain 196)
schemeexact
feeAtomic50000 (0.05 USDT0)
maxTimeoutSeconds120

What you pay for

You are charged for a successful 200 and nothing else. A 400, 404, 429, or 503 costs nothing: the signed authorization simply expires unused, because settlement only happens after the work succeeds.

StatusChargedMeaning
200YesSuccess. 0.05 USDT0 redeemed; PAYMENT-RESPONSE carries the settlement tx hash.
400NoBad request: a required parameter is missing.
402NoPayment required, or the payment failed verification.
404NoAgent not listed, or no on-topic match.
429NoA payment from the same payer is still settling. Retry after it clears.
503NoGate not configured, listing unverifiable, or index not ready. Retryable.