{"uid":"cap_czHi3C8S8YGBi3eoYo7D9","slug":"agent402-uk-budget-preflight-check-ac16182c","name":"Agent402 UK — Budget Preflight Check","description":"Don't burn tokens on deterministic work. Go/no-go jobs first: payout preflight, text firewall (PII/secrets), budget check — then rails, calendars, finmath. x402 USDC on Base. UK + global. agent402.co.uk — not agent402.tools. $0.001–$0.002 USDC on Base. No API keys.","url":"https://agent402.co.uk/v1/jobs/budget-preflight","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"text":{"type":"string","description":"Prompt / context to count (optional if input_tokens set)"},"calls":{"type":"number","description":"Repeat factor, default 1"},"model":{"type":"string","description":"gpt-4o | cl100k_base | …"},"max_usd":{"type":"number","description":"Hard ceiling for this turn"},"input_tokens":{"type":"number","description":"Skip counting if you already know"},"output_tokens":{"type":"number","description":"Optional; default 25% of input"}}},"responseSchema":{"type":"json","example":{"allow":true,"valid":true,"headroom_usd":0.0479,"estimated_usd":0.0021}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_XgKELqJRQmi2cvod6E6U6","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Checks whether a planned LLM call fits within a specified USD budget ceiling before executing, returning an allow/deny decision with estimated cost and headroom","exampleAgentPrompt":"Before running this GPT-4o call with my 3,000-token prompt repeated twice, check if the total cost fits under my $0.05 budget ceiling and tell me the estimated spend and how much headroom I have.","exampleUseCases":[{"title":"Guard expensive multi-step agent turn","prompt":"I'm about to run a 5,000-token prompt through GPT-4o three times — check whether that fits under my $0.20 hard limit before I fire it off, and show me the estimated cost and remaining headroom."},{"title":"Per-call budget validation for cost-capped product","prompt":"My app has a $0.01 per-user-turn limit on cl100k_base. Before I process this user's message, verify that the 800-token prompt won't exceed that ceiling."},{"title":"Preflight check before batch LLM scoring job","prompt":"I need to score 50 documents using GPT-4o with roughly 400 tokens each — can you check upfront whether the total cost stays under $0.15, and tell me the estimated spend?"}],"resultDescription":"Returns a JSON object with: `allow` (boolean go/no-go), `valid` (boolean), `estimated_usd` (computed cost for the call), and `headroom_usd` (budget ceiling minus estimated cost). Allows the agent to gate execution before spending tokens.","failureModes":["Missing both `text` and `input_tokens` — cannot estimate cost without one or the other","Unknown or unsupported model name — may return an error or fall back to a default rate","max_usd not provided — budget comparison cannot be performed","Negative or zero calls factor — invalid repeat multiplier","Payment failure via x402 — call blocked if USDC payment on Base is not completed"],"whenToPreferThis":"Choose this endpoint when you need a cheap ($0.001), deterministic, pre-execution gate to avoid overspending on LLM calls — especially in multi-turn agents, cost-capped products, or batch jobs. Prefer it over post-hoc cost tracking because it prevents spend rather than reporting it. Better than computing token costs in-agent because it offloads deterministic arithmetic and keeps the decision auditable without burning agent context.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T19:00:01.672Z","isFirstParty":false}