{"uid":"cap_fRyd1ImK291wmECDCKTh4","slug":"async-job-payment-lifecycle-decision-procedure-for-agents-509e9312","name":"Async Job Payment Lifecycle Decision Procedure for Agents","description":"Deterministic procedure for an agent that must pay for a long-running or asynchronous job over x402/MPP (video generation, scraping, inference, batch processing). Covers: submit-payment split (pay only for submission, never for the whole job up front), polling budget with max polls and max total spend across polls, cancel-before-completion refund thresholds, resume-after-timeout rules with re-payment guardrails, job-status code interpretation (queued/running/succeeded/failed/canceled), and a","url":"https://k2so-8080.on.ascii.dev/api/services/decision-procedure-for-agents-paying-for-long-ru","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":"Async job payment lifecycle decision procedure for agents 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_x4FkqMsEjz2_LeGVwjr8O","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 deterministic decision procedure guiding AI agents through the payment lifecycle for long-running asynchronous jobs over x402/MPP, covering submission, polling, cancellation, timeouts, and job-status interpretation.","exampleAgentPrompt":"I need the decision procedure for paying for a long-running async video generation job over x402 — specifically how to split the submission payment, manage polling budgets, handle cancel-before-completion refunds, and interpret job status codes like queued, running, succeeded, and failed.","exampleUseCases":[{"title":"Video generation job payment flow","prompt":"My agent is about to kick off a long-running video generation job via x402. Can you get me the decision procedure for how to handle submission payment, how many polls are safe, when to cancel and expect a refund, and what to do if the job times out before finishing?"},{"title":"Batch inference polling budget enforcement","prompt":"I'm running batch inference jobs and I need to know the rules for how my agent should manage total spend across polling rounds — what's the max number of polls allowed, when should I stop polling and treat the job as failed, and how do I avoid burning budget on a stuck job?"},{"title":"Resume after async job timeout with repayment guardrails","prompt":"One of my async scraping jobs timed out midway through. Can you pull the decision procedure that explains when and how my agent is allowed to retry and re-pay for the job without double-spending or violating x402 guardrails?"}],"resultDescription":"A structured decision procedure document containing prose guidance for agents covering: how to split payments at job submission vs. completion, polling budget limits with max poll counts and max total spend, cancel-before-completion refund thresholds, resume-after-timeout re-payment rules and guardrails, and an interpretation guide for job-status codes (queued, running, succeeded, failed, canceled). Also includes metadata such as generation source (llm, reasoning, or deterministic), ISO-8601 timestamp, topic, and service slug.","failureModes":["Invalid or missing method parameter returns validation error","Unrecognized topic override may result in fallback to default procedure","Service unavailability returns non-200 with no procedure content","Payment not made (no x402 header) results in 402 Payment Required with payment details","Meta flag set to 1 returns free metadata instead of paid procedure content"],"whenToPreferThis":"Choose this endpoint when your agent needs authoritative, structured guidance on handling payment lifecycle decisions for async or long-running jobs over x402/MPP — especially when you need concrete rules for polling budgets, cancellation thresholds, timeout recovery, and status-code interpretation. Prefer this over general x402 documentation when the job type is asynchronous (video generation, scraping, batch inference) and deterministic guardrails are needed rather than open-ended advice.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T19:00:20.883Z","isFirstParty":false}