{"uid":"cap_3vysXJkxsTr1UHu8mGFAT","slug":"outcome-ledger-inference-cost-analyzer-8554ef5d","name":"Outcome Ledger Inference Cost Analyzer","description":"Reconciles x402 payment call logs against success outcome markers to compute true inference cost per successful agent transaction. Ingests per-call fees, retry attempts, failure records, refunds, and per-rail surcharges, then produces an amortized cost measure that attributes waste to the originating successful outcome.","url":"https://k2so.wrong.systems/api/services/outcome-ledger-inference-cost-analyzer?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":"Outcome Ledger Inference Cost Analyzer 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":"outcome-ledger-inference-cost-analyzer","procedure":"same as brief","generatedAt":"2026-01-01T00:00:00.000Z","generationSource":"deterministic"},"service":"outcome-ledger-inference-cost-analyzer","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_Yp7jIzapWr02kfZQKR_EN","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":"Reconciles x402 payment call logs against success outcomes to compute amortized true inference cost per successful agent transaction, attributing waste from retries and failures to their originating successful outcome.","exampleAgentPrompt":"Can you analyze my x402 payment call logs and work out the true amortized inference cost per successful transaction — factoring in all the retry attempts, failed calls, refunds, and per-rail surcharges so I know what each successful outcome actually cost me?","exampleUseCases":[{"title":"Agent fleet cost efficiency audit","prompt":"I'm running a fleet of agents making x402 API calls and I want to know the real cost per successful outcome — can you pull the inference cost analysis including all retries and failures so I can see how much waste is being attributed to each successful transaction?"},{"title":"Retry overhead attribution for budget planning","prompt":"My agents have been doing a lot of retries lately and I need to understand how much that's inflating the true cost per successful inference — can you run the outcome ledger analysis so I can see the amortized cost with all the failure overhead baked in?"},{"title":"Per-rail surcharge breakdown for payment optimization","prompt":"I want to compare the effective cost of using different payment rails for my x402 agent calls — can you reconcile the call logs to show me how per-rail surcharges affect the amortized cost per successful outcome so I can pick the cheapest rail?"}],"resultDescription":"Returns a structured response containing the amortized inference cost per successful agent transaction, with waste attributed back to originating successful outcomes. Includes a decision procedure brief (prose explanation for agents), generation source (llm/reasoning/deterministic), ISO-8601 timestamp, service slug, and payment confirmation fields indicating whether the x402 micropayment was processed.","failureModes":["Missing or malformed payment logs result in inability to reconcile cost data","No success outcome markers provided yields undefined amortized cost","x402 payment not completed returns 402 Payment Required before analysis is served","Invalid query parameters return schema validation errors","Upstream LLM generation failure may result in fallback to deterministic cost estimate or empty brief"],"whenToPreferThis":"Choose this endpoint when you need to understand the true economic cost of agentic inference workflows that use x402 micropayments, specifically when retry loops, failures, and multi-rail fees distort the naive per-call cost figure. It is purpose-built for x402 payment ecosystems and produces an amortized cost measure tied to successful outcomes rather than raw call volume — making it more useful than generic cost dashboards when failure rates are non-trivial or when comparing payment rail efficiency.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-17T06:50:23.639Z","isFirstParty":false,"canonicalSlug":"outcome-ledger-inference-cost-analyzer-8554ef5d"}