# AgentTools LLM Cost Calculator

> AgentTools LLM Cost Calculator is a paid API for AI agents from agentstoolshub.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-12).

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://agentstoolshub.com/api/v1/dev/llm-cost-calculator?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agenttools-llm-cost-calculator-48527df9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Os2UFA9tRRREYXnVg-Ek1

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-48527df9
```

Example prompt: How much would it cost to call claude-sonnet-4 with 3000 input tokens and 800 output tokens? I want to know the USD price for a single call.

## When to prefer this

Use this endpoint when you need a fast, accurate USD cost estimate for a specific LLM model call using current published pricing. It covers 15 models across all major providers (OpenAI, Anthropic, Google, DeepSeek, xAI, Meta) in a single call, making it ideal for cost-aware agents, budget planning tools, or monthly spend estimators — without having to hardcode or maintain pricing tables yourself.

## Known failure modes

- Missing required inputTokens parameter returns a validation error
- Unsupported or misspelled model name returns an enum validation error
- Negative or non-numeric token counts may cause a 400 bad request
- Network or upstream pricing data unavailability returns a 5xx error

## 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 call, broken down by input token cost, output token cost, and total cost, based on current published per-million-token prices for the selected model. If multiple calls are specified, includes a total estimate.

## 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-48527df9/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agentstoolshub.com](https://www.zero.xyz/host/agentstoolshub.com/llms.txt)
