# AgentTools LLM Cost Calculator

> AgentTools LLM Cost Calculator is a paid API for AI agents from agenttools-hub.vercel.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-02).

Calculates the USD cost of an LLM API call by multiplying input and output token counts by published per-million-token prices for 15 current models across OpenAI, Anthropic, Google, DeepSeek, xAI, and Meta.

## Facts

- Endpoint: GET https://agenttools-hub.vercel.app/api/v1/dev/llm-cost-calculator?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agenttools-llm-cost-calculator-3c2a7dd8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Uy6CXxUHlKMh1_7rlbywq

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 agenttools-llm-cost-calculator-3c2a7dd8
```

Example prompt: How much would 500 calls to gpt-4o cost if each call uses 800 input tokens and 300 output tokens? Give me the total in USD.

## When to prefer this

Use this endpoint when an agent needs to compute or estimate the monetary cost of LLM API calls using official published pricing for specific named models. Prefer it over manual lookups when you need a quick, accurate cost figure for budgeting, billing estimation, or model comparison across the 15 supported models (OpenAI, Anthropic, Google, DeepSeek, xAI, Meta).

## Known failure modes

- Missing required inputTokens parameter returns a 400 error
- Unsupported model name not in the enum list returns a validation error
- Non-numeric token or call count values cause a bad request error
- Network timeout or service unavailability on the Vercel deployment

## How this service works

Calculate the API cost of an LLM call: input and output tokens × published per-million prices for 15 current models (OpenAI, Anthropic, Google, DeepSeek, xAI, Meta). Batch multiplier included for monthly estimates. Use this when an agent needs to tokens × current per-model prices = USD.

## Output

Returns the calculated USD cost for the specified LLM model call, based on published per-million-token prices for input and output tokens respectively. Includes the per-call cost and, when a call count is provided, the estimated total cost across all calls.

## 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"
     ],
     "properties": {
      "calls": {
       "type": "number",
       "description": "Number of calls"
      },
      "model": {
       "enum": [
        "gpt-5",
        "gpt-5-mini",
        "gpt-4.1",
        "gpt-4.1-mini",
        "gpt-4o",
        "o4-mini",
        "claude-opus-4",
        "claude-sonnet-4",
        "claude-haiku-4",
        "gemini-2.5-pro",
        "gemini-2.5-flash",
        "gemini-2.0-flash",
        "deepseek-v3",
        "grok-3",
        "llama-4-maverick"
       ],
       "type": "string",
       "description": "Model"
      },
      "inputTokens": {
       "type": "number",
       "description": "Input tokens"
      },
      "outputTokens": {
       "type": "number",
       "description": "Output tokens"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agenttools-llm-cost-calculator-3c2a7dd8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agenttools-hub.vercel.app](https://www.zero.xyz/host/agenttools-hub.vercel.app/llms.txt)
