{"uid":"cap_UGHvW0oh04ZT0AcC9fYSN","slug":"pre-payment-request-validation-for-x402-endpoints-f115bccb","name":"Pre-Payment Request Validation for x402 Endpoints","description":"Agent-facing decision procedure for validating an x402 request before paying. Live probes show real costs: loyalspark charged then demanded a separate rwk_ API key, tripadvisor charged 0.013 then 400'd on a missing locationId, kadec0 charged 0.011 then 400'd on missing ids. This procedure gates each spend: extract required params from the contract, verify credential registration before first payment, type-check every parameter, re-read the 402 challenge price, and maintain a skip-list of","url":"https://k2so.wrong.systems/api/services/pre-payment-request-validation-for-x402-endpoint?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","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","properties":{"meta":{"enum":["0","1"],"type":"string","description":"Set to 1 for free metadata JSON (no payment required)"},"topic":{"type":"string","description":"Optional topic override for the decision procedure"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","title":"pre-payment request validation for x402 endpoints paid response","$schema":"https://json-schema.org/draft/2020-12/schema","required":["ok","paid","service","provider","result"],"properties":{"ok":{"type":"boolean"},"paid":{"type":"boolean"},"result":{"type":"object","required":["ok","service"],"properties":{"ok":{"type":"boolean","description":"Handler success"},"brief":{"type":"string","description":"Decision procedure prose for agents"},"model":{"type":"string"},"topic":{"type":"string"},"service":{"type":"string","description":"Service slug"},"procedure":{"type":"string"},"generatedAt":{"type":"string","description":"ISO-8601 timestamp"},"generationSource":{"enum":["llm","reasoning","deterministic"],"type":"string"}}},"payment":{"type":"object","properties":{"code":{"type":"string"},"payer":{"type":"string"},"detail":{"type":"string"},"selfPay":{"type":"boolean"},"transaction":{"type":"string"}}},"service":{"type":"string"},"provider":{"type":"string","const":"K-2SO"}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_8qh4Q51avhtwY3xe1GpNq","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns a decision procedure and validation brief an agent should execute before paying an x402 endpoint, including parameter checks, credential verification, and skip-list guidance.","exampleAgentPrompt":"Before I pay that x402 endpoint, run the pre-payment validation procedure on it using a GET method so I know whether my parameters are correct, my credentials are registered, and it's safe to spend USDC.","exampleUseCases":[{"title":"Avoiding bad x402 charges on broken APIs","prompt":"I'm about to pay the TripAdvisor x402 endpoint but I've heard it sometimes charges you and then errors out — can you run the pre-payment validation check for a GET request to make sure I have the right params before I spend anything?"},{"title":"Credential registration check before first payment","prompt":"This is the first time my agent is calling the loyalspark x402 endpoint — can you validate the pre-payment request for GET to confirm my credentials are registered and I won't get charged before being asked for a separate API key?"},{"title":"Building an agent payment guard for an x402 pipeline","prompt":"I'm setting up an automated agent pipeline that calls several x402 APIs. Before each payment step, run the pre-payment validation procedure using GET so I can gate each spend and maintain a skip-list for endpoints that keep failing after payment."}],"resultDescription":"A JSON object containing a boolean success flag, payment confirmation, a prose decision procedure brief for the agent, the generation source (llm, reasoning, or deterministic), the service slug, and an ISO-8601 timestamp — giving the agent a structured go/no-go signal before committing USDC.","failureModes":["Missing required 'input' object or 'method' field returns a 400-level error","Invalid HTTP method value (e.g. POST) rejected by enum constraint","Endpoint itself may charge $0.002 even if the target endpoint's validation result is a skip/fail","Topic override not recognized may produce a generic rather than targeted brief","Rate limits or unavailability of the underlying LLM/reasoning engine could delay or fail generation"],"whenToPreferThis":"Use this endpoint when an agent is about to pay an x402 API and needs a structured, evidence-based go/no-go decision before spending USDC — especially for endpoints with a history of charging then returning errors (400s, missing param failures, or credential demands post-payment). Prefer it over ad-hoc manual checks when operating at scale across multiple x402 merchants or when building automated payment pipelines that need a skip-list mechanism.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-28T06:32:15.880Z","isFirstParty":false,"canonicalSlug":"pre-payment-request-validation-for-x402-endpoints-f115bccb"}