# Agent402 LLM Token Cost Estimator

> Agent402 LLM Token Cost Estimator 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).

Estimates total USD cost for LLM API calls given model, token counts, and number of calls, with comparison to Agent402 utility call cost

## Facts

- Endpoint: POST https://agent402.co.uk/v1/utils/token-cost
- 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-llm-token-cost-estimator-dd9c0ada
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_CU2b6cu5o_geF_BKtH7Bt

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-llm-token-cost-estimator-dd9c0ada -d '<json body>'
```

Example prompt: How much would it cost in USD to run 500 calls to GPT-4o with 800 input tokens and 300 output tokens each? Also show me how that compares to the cost of 500 agent402 utility calls.

## When to prefer this

Use this endpoint when you need a fast, arithmetic estimate of LLM API spend before executing a workflow, or when comparing model costs against fixed-rate utility calls. Prefer it over manual calculation when dealing with multiple models or custom pricing tiers. It is not a real-time billing lookup — use it for pre-flight budgeting and cost-benefit analysis within an agentic pipeline.

## Known failure modes

- Missing required fields (model or token counts) returns validation error
- Unknown model ID not found in /utils/model-rates returns error or null result
- Non-numeric string values for tokens or calls may cause parse failure
- Negative or zero token/call counts may return invalid result
- Custom rate overrides with malformed values may be rejected

## 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 a validity flag, the total estimated USD cost for the specified number of LLM calls, and a ratio comparing that cost to the equivalent number of Agent402 utility calls at $0.001 each.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "calls": {
   "type": "string",
   "description": "Number of calls"
  },
  "model": {
   "type": "string",
   "description": "Model id from /utils/model-rates"
  },
  "input_tokens": {
   "type": "string",
   "description": "Input tokens per call"
  },
  "output_tokens": {
   "type": "string",
   "description": "Output tokens per call"
  },
  "input_per_mtok": {
   "type": "string",
   "description": "Override USD/MTok in"
  },
  "output_per_mtok": {
   "type": "string",
   "description": "Override USD/MTok out"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "valid": true,
  "total_usd": 0.006,
  "vs_agent402_util_calls": 6
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-llm-token-cost-estimator-dd9c0ada/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)
