Skip to main content
Glama

LLM API Cost Calculator

dev_llm_cost_calculator

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. x402 price $0.01/call (USDC, eip155:8453).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
callsYesNumber of calls
modelYesModel
inputTokensYesInput tokens
outputTokensYesOutput tokens

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral burden. It usefully discloses pricing source (published per-million prices for 15 models), a batch multiplier, and x402 payment cost ($0.01/call, USDC, eip155:8453). However, it omits return format, rounding, or any rate-limit/auth behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is reasonably short and front-loads the core purpose, but the broken sentence about token × price = USD is wasted and confusing. Payment details are useful but could be more cleanly separated.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 4-parameter calculator with no output schema and no annotations, the description should say more about what the tool returns (e.g., total cost, per-call breakdown). It mentions pricing and payment but leaves the output contract unspecified.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all four parameters, setting a baseline of 3. The description adds context about model pricing and a batch multiplier, but does not clarify the meaning of inputTokens, outputTokens, or calls beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool calculates LLM API cost from input/output tokens and per-million model prices across 15 named providers. It is specific about the resource and operation, though it does not explicitly distinguish itself from a sibling like dev_token_estimator.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The only usage guidance is the malformed sentence 'Use this when an agent needs to tokens × current per-model prices = USD.' It implies a cost-estimation context but is grammatically broken and gives no when-not-use or alternative-tool guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources