Pre-flight an x402 payment: decode the endpoint's challenge, report the cost on every rail
Pre-flight an x402 payment: decode the endpoint's challenge, report the cost on every rail (Base and Solana) and the cheapest, and — with a payer address — verify the wallet can afford the call on Base.
3000 (raw units)
price
1
calls / 30d
1
unique payers
2026-09-18
updated
Provider
quartermaster.surewhynot.app · discovered, not yet claimed by its owner
Payment (x402 accepts[])
[
{
"scheme": "exact",
"network": "eip155:8453",
"payTo": "0x5253666c40432f009ebd99908b9cd2a7fd1019cb",
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "3000",
"maxTimeoutSeconds": 300
},
{
"scheme": "exact",
"network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
"payTo": "FgcKNzsBXSEHGNZNWetPsjXiBZk1WFoU6sF2zVsnzXfa",
"asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "3000",
"maxTimeoutSeconds": 300
}
]Output schema
{
"bazaar": {
"info": {
"input": {
"method": "GET",
"queryParams": {
"address": "0xc2a36e22ecbf353086cf83e7beea78bc28a64083",
"url": "https://api.example.com/paid-endpoint"
},
"type": "http"
},
"output": {
"example": {
"affordability": {
"address": "0xc2a3...4083",
"can_afford": true,
"cost_usdc": "0.005",
"rail_checked": "evm",
"usdc_balance": "1.234"
},
"cheapest": {
"cost_usdc": "0.005",
"network": "eip155:8453",
"rail": "evm"
},
"is_x402": true,
"payable": true,
"rails": [
{
"asset_name": "USDC (Base mainnet)",
"cost_usdc": "0.005",
"network": "eip155:8453",
"network_name": "Base mainnet",
"pay_to": "0x...",
"rail": "evm"
},
{
"asset_name": "USDC (Solana)",
"cost_usdc": "0.005",
"network": "solana:5eykt4...",
"network_name": "Solana mainnet",
"pay_to": "...",
"rail": "svm"
}
],
"url": "https://api.example.com/paid-endpoint",
"warnings": []
},
"type": "json"
}
},
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"input": {
"additionalProperties": false,
"properties": {
"method": {
"enum": [
"GET"
],
"type": "string"
},
"queryParams": {
"properties": {
"address": {
"description": "Optional payer wallet to check Base affordability",
"pattern": "^0x[0-9a-fA-F]{40}$",
"type": "string"
},
"url": {
"description": "The x402 endpoint to pre-flight",
"format": "uri",
"type": "string"
}
},
"required": [
"url"
],
"type": "object"
},
"type": {
"const": "http",
"type": "string"
}
},
"required": [
"type",
"method"
],
"type": "object"
},
"output": {
"properties": {
"example": {
"type": "object"
},
"type": {
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
}
},
"required": [
"input"
],
"type": "object"
}
}
}Use it
curl
curl "https://quartermaster.surewhynot.app/v1/x402/simulate" # -> 402 Payment Required, accepts[] lists how to pay # retry with a PAYMENT-SIGNATURE (or PAYMENT header) once paid
JavaScript
const res = await fetch("https://quartermaster.surewhynot.app/v1/x402/simulate");
if (res.status === 402) {
const { accepts } = await res.json();
// pay one of accepts[] via an x402 client, then retry with the payment header
}Python
import httpx
res = httpx.get("https://quartermaster.surewhynot.app/v1/x402/simulate")
if res.status_code == 402:
accepts = res.json()["accepts"]
# pay one of accepts[] via an x402 client, then retry with the payment headerMachine-readable
Everything on this page is also available as clean JSON at /resources/639.json, and this resource appears in /discovery/resources and /discovery/search.