{"uid":"cap_NZtRvyM0KoE1Y8JfgOx85","slug":"nightshift-labs-x402-preflight-check-e642dea4","name":"Nightshift Labs x402 Preflight Check","description":"x402 seller preflight: check a paid endpoint BEFORE paying. Probes it unpaid, parses the 402 (v2 header or v1 body) and checks each option: scheme, network, asset is real USDC on Base, EIP-712 name/version match on-chain, payTo not a burn address, amount, timeout, discovery metadata. Plus on-chain seller reputation: USDC payments to payTo over 1-7 days (distinct payers, total, last payment). Returns verdict ok/caution/fail, issues and the recommended option.","url":"https://nightshift-x402.nightshift-labs.workers.dev/v1/x402/preflight?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"https URL of the x402-paid endpoint"},"days":{"type":"integer","maximum":7,"minimum":1,"description":"on-chain payer history window in days (default 3; at most ~11 h is scanned per call, see windowHoursCovered)"},"method":{"enum":["GET","POST"],"type":"string","description":"HTTP method to probe (default GET)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"x402":true,"issues":[],"status":402,"options":[{"ok":true,"chain":"base","checks":[],"eip712":{"name":"USD Coin","version":"2"},"scheme":"exact","amountUsd":0.005,"assetName":"USD Coin","assetIsUsdc":true}],"verdict":"ok","transport":"header (x402 v2)","x402Version":2,"payToActivity":{"partial":false,"totalUsdc":"0.23","windowDays":3,"topPayerShare":0.69,"distinctPayers":4,"lastIncomingHoursAgo":50.8,"incomingUsdcTransfers":50,"transfersAtAdvertisedPrice":44},"recommendedOption":0}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_SrOTCu0xG3wZLHzuI7IYm","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Probes an x402-gated endpoint URL to assess its payment configuration, liveness, and on-chain payer activity before committing a payment","exampleAgentPrompt":"Before I pay to call it, can you do a preflight check on this x402 endpoint — https://some-api.example.com/data — using a GET request and look back 5 days of on-chain payer history, so I can see if it's properly set up and what the payment options look like?","exampleUseCases":[{"title":"Pre-integration x402 endpoint audit","prompt":"I'm about to integrate a new pay-per-call API at https://partner-api.example.com/v1/query — can you run a preflight check on it with GET and show me the payment options, verdict, and any issues before I commit?"},{"title":"On-chain payer activity review","prompt":"Can you check https://data-service.example.com/api/endpoint with a 7-day payer history window so I can see how many distinct payers have used it and what percentage paid at the advertised price?"},{"title":"Validating x402 config before agent deployment","prompt":"I'm deploying an agent that will auto-pay for calls to https://nightshift-x402.nightshift-labs.workers.dev/v1/some-tool — please preflight it via GET with 3 days of history so I know the USDC payment scheme is correctly set up on Base."}],"resultDescription":"A JSON object containing: a boolean x402 flag, a verdict string (e.g. 'ok'), a list of payment options (each with chain, scheme, USD amount, asset name, EIP-712 metadata, and pass/fail checks), the recommended option index, transport method, x402 version, and a payToActivity block with stats including total USDC received, number of distinct payers, top payer share, transfers at advertised price, and hours since last incoming transfer.","failureModes":["Target URL is not an x402-compliant endpoint — verdict may be 'not_x402' with issues listed","Target URL is unreachable or returns unexpected status — probe may fail or return error issues","Days parameter out of range (must be 1–7) — validation error","URL parameter missing — request rejected with schema validation error","On-chain data may be delayed or incomplete if the Base network is congested"],"whenToPreferThis":"Use this endpoint when you need to verify an x402-gated API's payment configuration, check on-chain payer history, or assess payment options before committing USDC — especially useful for agents performing due diligence on new pay-per-call integrations or auditing existing ones. Prefer this over simply attempting a paid call when you want to avoid failed payments or unexpected pricing.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-18T01:10:16.715Z","isFirstParty":false,"canonicalSlug":"nightshift-labs-x402-preflight-check-e642dea4"}