{"uid":"cap_eYr2jz6nlvZqm-Rc2agZT","slug":"screwtape-ai-budget-authorization-audit-endpoint-aa4f925d","name":"Screwtape.ai Budget Authorization & Audit Endpoint","description":"Screwtape advises and records. Your agent must cooperate by checking the result before acting; we do not hold funds or independently stop payments.","url":"https://screwtape.ai/v1/budget?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"cap":{"type":"number"},"action":{"type":"string"},"amount":{"type":"number"},"run_id":{"type":"string"},"currency":{},"event_id":{"type":"string"},"merchant":{"type":"string"},"parent_run_id":{"type":"string"}}},"responseSchema":{"type":"json","schema":{"type":"object","required":["decision","remaining_budget","reasons","run_id","root_run_id","spent","reserved"],"properties":{"spent":{"type":"number"},"run_id":{"type":"string","pattern":"^[A-Za-z0-9._:-]+$","maxLength":128,"minLength":1},"reasons":{"type":"array","items":{"type":"string"}},"decision":{"enum":["allow","warn","block"]},"event_id":{"type":"string","pattern":"^[A-Za-z0-9._:-]+$","maxLength":128,"minLength":1},"replayed":{"type":"boolean"},"reserved":{"type":"boolean"},"request_id":{"type":"string"},"retry_count":{"type":"integer"},"root_run_id":{"type":"string","pattern":"^[A-Za-z0-9._:-]+$","maxLength":128,"minLength":1},"remaining_budget":{"type":"number"},"velocity_per_minute":{"type":"number"}}}},"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_v9oHHWGXD1ySAiiyJ-H6n","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":"Evaluates whether an AI agent's proposed spend is within its budget cap and records the decision as an auditable proof.","exampleAgentPrompt":"Before you buy those cloud credits for $45 from AWS, check Screwtape to see if that spend is allowed under my $200 budget cap for this run — use run ID 'prod-agent-2024-05-20', action 'purchase cloud credits', and block if it would exceed the cap.","exampleUseCases":[{"title":"Pre-purchase budget gate for shopping agent","prompt":"Before my agent buys those API credits from OpenAI for $30, run a Screwtape budget check to see if it's allowed — my overall cap is $100 for this session, run ID is 'shop-run-001', and the currency is USD."},{"title":"Audit trail for autonomous expense agent","prompt":"My expense-filing agent just paid $12.50 to Stripe — log that spend decision in Screwtape under run ID 'expense-agent-may-20', event ID 'stripe-pay-001', with a $500 cap, so I have a proof record."},{"title":"Velocity cap enforcement for multi-step pipeline","prompt":"My pipeline agent is about to trigger a $75 payment to Twilio in a background job — ask Screwtape if that's within my $150 budget cap for parent run 'pipeline-parent-42', and block it if it's going to exceed the limit."}],"resultDescription":"Returns a decision field ('allow', 'warn', or 'block'), the remaining budget after the proposed spend, the total spent so far, a list of human-readable reasons for the decision, whether the event was replayed, whether funds are reserved, spending velocity per minute, and the canonical run and root_run_id identifiers for audit linkage.","failureModes":["Missing required fields (run_id, event_id) returns a validation error","Amount exceeds cap returns a 'block' decision with reasons","Duplicate event_id returns replayed:true with the original decision","Currency other than USD is rejected (const constraint)","cap set to 0 or negative triggers exclusiveMinimum validation error","Network timeout means agent must retry and handle replayed:true gracefully","Malformed run_id pattern (non-alphanumeric chars) causes schema rejection"],"whenToPreferThis":"Use Screwtape when you need a lightweight, per-call budget policy check with an immutable audit trail before an autonomous agent executes any payment or financial action. Prefer it over manual budget tracking in agent code when you need reproducible proof-of-decision, support for hierarchical run trees (parent_run_id), or velocity monitoring. It is not a payment processor or funds custodian — pair it with an actual payment rail (e.g. x402, Stripe) and treat its decision as advisory enforcement that your agent must respect.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-28T12:30:35.510Z","isFirstParty":false,"canonicalSlug":"screwtape-ai-budget-authorization-audit-endpoint-aa4f925d"}