Overview
Agent endpoints are mounted under /agents/v2/* and gated by x402 middleware using exact USDC payments.
| Item | Value |
|---|---|
| Protocol | x402 (exact scheme) |
| Network | eip155:8453 (Base mainnet) |
| Token | USDC (Base) 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
| Payee | punkpredictor.eth → 0x4f6e0faec10cf04b428ec9e34cd88ae04fba6062 |
| Headers | payment-required challenge, payment-response settlement |
Main API endpoints still use API-key auth. This document covers only the x402 agent surface.
Quickstart
- Call endpoint normally — you will receive
402with apayment-requiredheader. - Use an x402 client to sign the payment payload with a funded Base mainnet USDC wallet.
- Retry the same request through the x402-aware client — you will receive
200.
Python Example
import os
import requests
from eth_account import Account
from x402.client import x402ClientSync
from x402.http.clients.requests import wrapRequestsWithPayment
from x402.mechanisms.evm.signers import EthAccountSigner
from x402.mechanisms.evm.exact.client import ExactEvmScheme
base_url = "https://api.punkpredictor.xyz"
# Never hardcode private keys. Use a funded Base-mainnet wallet with USDC.
account = Account.from_key(os.environ["EVM_PRIVATE_KEY"])
client = x402ClientSync()
client.register("eip155:8453", ExactEvmScheme(EthAccountSigner(account)))
session = wrapRequestsWithPayment(requests.Session(), client)
r = session.post(
f"{base_url}/agents/v2/fair-price",
json={"id_punk": 9999},
timeout=90,
)
print(r.status_code, r.json())
Endpoint Reference
| Endpoint | Method | Purpose | Price |
|---|---|---|---|
/agents/v2/fair-price |
POST | Single fair valuation | 5.00 USDC |
/agents/v2/fair-price-plus |
POST | Fair value + distribution + uncertainty + intervals | 10.00 USDC |
/agents/v2/top-delayed |
GET | Top undervalued listings (excl. recently listed) | 25.00 USDC |
/agents/v2/top-realtime |
GET | Top undervalued listings (incl. recent listings) | 50.00 USDC |
Parameters
fair-priceandfair-price-plus: JSON body{"id_punk": <int>}top-delayedandtop-realtime: optional querylimit(default 10, max 100)
Response Contracts
POST /agents/v2/fair-price
{
"id_punk": 24,
"fair_price_eth": 36.35,
"pricing": { "usdc": "5.00" },
"network": "eip155:8453",
"x402_scheme": "exact"
}
POST /agents/v2/fair-price-plus
{
"id_punk": 24,
"fair_price_eth": 36.35,
"distribution_of_possible_valuations": { "type": "ensemble", "summary": { "...": "..." } },
"uncertainty_score": 0.11,
"intervals": { "80": { "lower": 30.2, "upper": 41.9 } },
"pricing": { "usdc": "10.00" },
"network": "eip155:8453",
"x402_scheme": "exact"
}
GET /agents/v2/top-delayed & /top-realtime
{
"mode": "realtime",
"as_of_utc": "2026-02-12T22:29:05.100000+00:00",
"count": 3,
"results": [
{
"id_punk": 5730,
"listed_price_eth": 35.0,
"fair_price_eth": 39.1,
"potential_upside_eth": 4.1,
"discount_to_fair_pct": 10.49,
"source": "blur"
}
],
"pricing": { "usdc": "50.00" },
"network": "eip155:8453",
"x402_scheme": "exact"
}
Errors & Refusals
402
Payment challenge. Client should sign and retry.
403
Forbidden Punk IDs return forbidden_punk_id.
400
Invalid request payload (e.g. missing id_punk).
404
Prediction not found.
503
Agent surface disabled or x402 not configured.
Forbidden ID checks happen in route handlers. A forbidden request returns
403 and no payment is settled.
Pricing
Prices are fixed per endpoint (USDC on Base mainnet):
| Endpoint | Price |
|---|---|
/agents/v2/fair-price | 5.00 USDC |
/agents/v2/fair-price-plus | 10.00 USDC |
/agents/v2/top-delayed | 25.00 USDC |
/agents/v2/top-realtime | 50.00 USDC |
Verifying Payment
Every successful call settles an on-chain USDC transfer to punkpredictor.eth. Your x402 client should also expose the settlement receipt returned in the payment-response (or x-payment-response) header.
# After a paid 200 response:
# - Parse tx hash from the payment-response header
# - Verify it on Basescan
Integration Checklist
- Call an endpoint and handle the
402payment challenge. - Sign and retry via an x402-aware client.
- Confirm you receive
200and a JSON response. - Extract the settlement tx hash from
payment-responseand verify it on Basescan.