# LLM Cost & Capacity Calc – Per-Request & Total Cost

> LLM Cost & Capacity Calc – Per-Request & Total Cost is a paid API for AI agents from llm-cost-calc.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-29).

Calculates the cost of LLM API calls given input and output token counts and per-million-token prices, returning per-request and total cost breakdowns.

## Facts

- Endpoint: GET https://llm-cost-calc.x402tookit.com/llm-cost?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/llm-cost-capacity-calc-per-request-total-cost-eb0708ed
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_NThBJCQAEKLKWCEWIoByZ

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 llm-cost-capacity-calc-per-request-total-cost-eb0708ed
```

Example prompt: Calculate the total and per-request cost for 5000 LLM calls where each request uses 800 input tokens and 400 output tokens, with an input price of $3 per million tokens and an output price of $15 per million tokens.

## When to prefer this

Use this endpoint when you need a quick, deterministic calculation of LLM API cost from known token counts and per-million-token prices — ideal for budget checks, cost breakdowns by input vs output, and per-request vs total spend analysis. Prefer this over the forecast or caching endpoints when you have exact token counts for a defined workload and just need raw cost figures without growth projections or caching logic.

## Known failure modes

- Missing required query parameters (inputTokens, outputTokens, inputPricePerMTok, outputPricePerMTok) returns an error
- Non-numeric token counts or prices cause validation failure
- requests value outside 1–1,000,000,000 range rejected
- Payment of $0.02 USDC not fulfilled causes 402 error

## How this service works

Cost of LLM API calls from input and output tokens and your per-million-token prices, per request and in total.

## Output

Returns a structured breakdown including cost per request, total cost for all requests, input cost per request, output cost per request, total input and output tokens, blended price per million tokens, and the output share of total cost as a percentage, along with optional summary and disclaimer fields.

## Request schema (JSON Schema)

```json
{
 "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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "inputTokens",
      "outputTokens",
      "inputPricePerMTok",
      "outputPricePerMTok"
     ],
     "properties": {
      "requests": {
       "type": "integer",
       "description": "Number of requests, 1 to 1e9 (default 1)"
      },
      "inputTokens": {
       "type": "number",
       "description": "Input (prompt) tokens per request"
      },
      "outputTokens": {
       "type": "number",
       "description": "Output (completion) tokens per request"
      },
      "inputPricePerMTok": {
       "type": "number",
       "description": "Price per million input tokens, in your currency"
      },
      "outputPricePerMTok": {
       "type": "number",
       "description": "Price per million output tokens"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "requests": {
       "type": [
        "null",
        "number"
       ]
      },
      "totalCost": {
       "type": [
        "null",
        "number"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "costPerRequest": {
       "type": [
        "null",
        "number"
       ]
      },
   
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/llm-cost-capacity-calc-per-request-total-cost-eb0708ed/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from llm-cost-calc.x402tookit.com](https://www.zero.xyz/host/llm-cost-calc.x402tookit.com/llms.txt)
