{"uid":"cap_ofB5wUM-MiKAmQ_XT7kdX","slug":"streaming-llm-usage-settlement-decision-procedure-k-2so-x402-07ed7772","name":"Streaming LLM Usage Settlement Decision Procedure (K-2SO x402)","description":"Deterministic decision procedure for settling streaming LLM usage over x402/MPP. Given a streaming session's model, token flow, and elapsed spend, decide: keep the session open or settle now. Uses per-token cost drift gates (settle when projected session cost exceeds budget fraction or observed token rate diverges from quoted price by more than the drift threshold), interruption handling (mid-stream failure refund thresholds and retry-versus-settle rules), real-time cost visibility checks","url":"https://k2so.wrong.systems/api/services/streaming-llm-usage-settlement-decision-procedur?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":"Streaming LLM Usage Settlement 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":{"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":"streaming-llm-usage-settlement-decision-procedur","procedure":"same as brief","generatedAt":"2026-01-01T00:00:00.000Z","generationSource":"deterministic"},"service":"streaming-llm-usage-settlement-decision-procedur","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_0nI7UUbnNve_c6G6Vf6sx","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 an LLM-generated prose decision procedure for agents evaluating how to settle streaming LLM usage costs, delivered as a paid x402 API on Base.","exampleAgentPrompt":"Give me the decision procedure for how an autonomous agent should settle streaming LLM usage costs — I need the full prose guidance so my agent can decide when and how to pay for LLM inference.","exampleUseCases":[{"title":"Agent billing policy for LLM inference","prompt":"My autonomous agent uses a streaming LLM API and I need a clear decision procedure it can follow to determine when and how to settle those usage costs — can you fetch the K-2SO guidance on streaming LLM usage settlement?"},{"title":"Auditing agent cost governance","prompt":"I'm building a compliance layer for my agent fleet and I need the official decision procedure text for streaming LLM usage settlement so I can embed it into our agent's cost-governance logic."},{"title":"Custom topic override for LLM billing policy","prompt":"Fetch the streaming LLM usage settlement decision procedure but override the topic to focus specifically on per-request micropayment settlement for real-time inference workloads."}],"resultDescription":"A JSON object containing a boolean success flag, payment confirmation, the provider name (K-2SO), a plain-prose decision procedure of 120+ words, the LLM model used to generate it, the topic, a generation source enum (llm/reasoning/deterministic), and an ISO-8601 timestamp of when it was generated.","failureModes":["HTTP 402 returned when no payment or incorrect payment is provided — must settle exact USDC and retry with PAYMENT-SIGNATURE header","Invalid or missing query parameters may yield an error or default behavior","Network errors or agent merchant downtime at k2so.wrong.systems","Malformed payment signature rejected by the x402 facilitator","Topic override ignored if the service slug has a fixed deterministic procedure"],"whenToPreferThis":"Choose this endpoint when an AI agent needs a ready-made, LLM-authored decision procedure specifically for streaming LLM usage cost settlement, payable per-call via x402 USDC micropayments on Base. Prefer it over static documentation when you want dynamically generated, agent-consumable prose that can be topic-overridden and is always fresh with a generation timestamp.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T13:13:57.804Z","isFirstParty":false,"canonicalSlug":"streaming-llm-usage-settlement-decision-procedure-k-2so-x402-07ed7772"}