# Agent402 UK — Budget Preflight Check

> Agent402 UK — Budget Preflight Check is a paid API for AI agents from agent402.co.uk, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

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

## Facts

- Endpoint: POST https://agent402.co.uk/v1/jobs/budget-preflight
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-uk-budget-preflight-check-ac16182c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_czHi3C8S8YGBi3eoYo7D9

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agent402-uk-budget-preflight-check-ac16182c -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "allow": true,
  "valid": true,
  "headroom_usd": 0.0479,
  "estimated_usd": 0.0021
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-uk-budget-preflight-check-ac16182c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.co.uk](https://www.zero.xyz/host/agent402.co.uk/llms.txt)
