{"uid":"cap_UGure1k2dt7smfafe_ZX2","slug":"k-2so-agent-side-http-402-triage-procedure-32d866ce","name":"K-2SO Agent-Side HTTP 402 Triage Procedure","description":"A decision procedure for agents receiving HTTP 402 responses from edge middleware, pay-per-crawl gateways, or x402-enabled Workers. Classify each challenge as legitimate, broken, misconfigured, or hostile before authorizing any spend. Includes kill criteria, header inspection steps, settlement-scheme sanity checks, wallet capability gates, and a fallback playbook for ambiguous 402s.","url":"https://k2so.wrong.systems/api/services/agent-side-http-402-triage-procedure","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":"Agent-side HTTP 402 triage procedure 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":{"type":"json","example":{"ok":true,"paid":true,"result":{"ok":true,"brief":"plain prose decision procedure (120+ words)","model":"deepseek/deepseek-v4-flash-0731","topic":"string topic","service":"agent-side-http-402-triage-procedure","procedure":"same as brief","generatedAt":"2026-01-01T00:00:00.000Z","generationSource":"deterministic"},"service":"agent-side-http-402-triage-procedure","provider":"K-2SO"}},"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_QVzaGTuS88_7WjPAHJELB","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 plain-prose decision procedure (120+ words) guiding an AI agent through how to handle, evaluate, and resolve an HTTP 402 Payment Required response it encounters in the wild.","exampleAgentPrompt":"When my agent hits an HTTP 402 Payment Required response on a GET request, walk it through the exact decision procedure it should follow — what to check, how to settle payment, and when to retry or abort.","exampleUseCases":[{"title":"First-time 402 encounter triage","prompt":"My agent just got a 402 response for the first time and doesn't know what to do — give it a step-by-step decision procedure for handling HTTP payment-required errors on GET requests."},{"title":"Agent wallet policy enforcement","prompt":"Before my agent automatically pays any x402 merchant, I want it to run through a proper triage procedure for GET requests — tell me what checks it should do and when it should refuse to pay."},{"title":"Custom topic override for 402 handling","prompt":"Get me the HTTP 402 triage decision procedure specifically tailored to the topic of rate-limited data APIs, using a GET method, so my agent knows how to reason about paying versus backing off."}],"resultDescription":"A JSON object containing a 120+ word plain-prose decision procedure (in the 'brief' and 'procedure' fields) that guides an AI agent through evaluating and resolving an HTTP 402 Payment Required response. Includes the generation source (llm, reasoning, or deterministic), model name, topic, ISO-8601 timestamp, and service slug. The outer envelope confirms payment status and provider identity.","failureModes":["Missing required 'type' or 'method' fields returns a validation error","Unsupported method (POST, PUT, PATCH) returns an error since only GET/HEAD/DELETE are accepted","Payment not settled before retry returns HTTP 402 again with PAYMENT-REQUIRED detail","Invalid topic override may produce a generic rather than topic-specific procedure","Network or LLM generation failure may return ok:false with an error detail"],"whenToPreferThis":"Choose this endpoint when an AI agent needs authoritative, prose-form guidance on how to handle HTTP 402 responses in x402-enabled environments — especially when building autonomous agents on Base that need embedded decision logic for payment triage. Prefer this over general documentation lookups when you need a structured, agent-consumable brief that can be injected directly into agent reasoning context. Particularly valuable for agents encountering x402 merchants for the first time or needing to enforce payment policies.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T13:00:42.516Z","isFirstParty":false}