{"uid":"cap_Fjo3ntFt9z3LXT74Vg8nL","slug":"per-rail-session-lifecycle-decision-procedure-c020adde","name":"Per-rail Session Lifecycle Decision Procedure","description":"A deterministic decision procedure for agents managing payment sessions on Nano v2, XRPL x402 facilitator, Algorand, and Base prepaid bearer-token endpoints. Covers when to open, reuse, close, or switch to one-shot settlement, plus deposit sizing, expiry handling, close-out, and per-rail reconciliation.","url":"https://k2so-8080.on.ascii.dev/api/services/per-rail-session-lifecycle-decision-procedure?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":"Per-rail session lifecycle decision 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":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_gpNVU5SrnsDfeykCQpR1D","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 for AI agents managing payment session lifecycle across Nano v2, XRPL x402, Algorand, and Base prepaid bearer-token rails","exampleAgentPrompt":"What's the decision procedure for managing payment sessions on Nano v2 and XRPL x402 — specifically when I should open a new session, reuse an existing one, or switch to one-shot settlement?","exampleUseCases":[{"title":"Session open vs reuse decision for XRPL","prompt":"I'm running an agent that makes frequent x402 calls on XRPL — can you give me the decision procedure for when I should open a fresh payment session versus reusing an existing one, and how to size the deposit?"},{"title":"Handling expired sessions on Algorand","prompt":"My agent is hitting expired payment sessions on Algorand prepaid bearer-token endpoints — what's the proper procedure for detecting expiry, closing out cleanly, and reconciling before opening a new session?"},{"title":"Switching to one-shot settlement on Base","prompt":"I'm managing a Base prepaid bearer-token session and the transaction volume dropped significantly — walk me through the decision procedure for when it makes sense to abandon the session and switch to one-shot per-call settlement instead."}],"resultDescription":"A structured JSON response containing a prose decision procedure brief tailored to per-rail session lifecycle management, covering when to open, reuse, close, or switch to one-shot settlement, deposit sizing guidance, expiry handling, close-out steps, and per-rail reconciliation logic. Also includes service metadata, generation timestamp, and generation source (llm, reasoning, or deterministic).","failureModes":["Payment required but not provided — endpoint returns 402 if called without payment","Invalid HTTP method — only GET, HEAD, DELETE are accepted","Topic override not recognized — may return generic procedure rather than rail-specific guidance","LLM generation failure — generationSource may indicate fallback to deterministic response","Service temporarily unavailable — provider infrastructure outage on ascii.dev"],"whenToPreferThis":"Choose this endpoint when an AI agent needs authoritative, structured guidance on payment session lifecycle decisions across multiple blockchain rails (Nano v2, XRPL x402, Algorand, Base). Prefer it over generic documentation lookups when you need a decision procedure — not just facts — covering conditional logic for open/reuse/close/one-shot scenarios. Especially valuable when operating across multiple rails simultaneously and needing consistent reconciliation logic.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-20T06:54:10.108Z","isFirstParty":false,"canonicalSlug":"per-rail-session-lifecycle-decision-procedure-c020adde"}