Skip to main content
Glama

LLM model price lookup, token cost calculator and cheapest-model finder

llm_model_prices

Use when an agent must price an LLM call or pick the cheapest model. Input: model (up to 5, comma list) plus optional input_tokens, output_tokens, requests; or no model plus mode, provider, min_context, capabilities (vision, function_calling...). Output: JSON USD per 1M input/output tokens, cached/batch prices, context window, provider, capabilities, cost estimate or cheapest ranking, as_of + source commit. Example: ?model=gpt-4o&input_tokens=12000&output_tokens=800 Price: $0.004 USDC (Base or Solana) via x402.

Input Schema

NameRequiredDescriptionDefault
modeNoModel type for the cheapest search (default chat; chat includes responses-API models). Ignored when model is given
limitNoMax rows per model or in the ranking (default 10)
modelNoModel name(s), up to 5 comma-separated (gpt-4o, claude-sonnet-4-5, gemini/gemini-2.5-flash). Also lists the same model at other providers. Omit to rank the cheapest models. Unknown → 400 with suggestions (not charged)
providerNoLiteLLM provider id filter: openai, anthropic, gemini, vertex_ai, bedrock, azure, groq, deepseek, mistral...
requestsNoNumber of requests to multiply the estimate by (default 1)
min_contextNoMinimum context window (max input tokens)
capabilitiesNoComma-separated required capabilities: vision, function_calling, reasoning, prompt_caching, response_schema, pdf_input, audio_input, audio_output, web_search, computer_use, video_input
input_tokensNoInput (prompt) tokens per request, for the cost estimate and ranking
output_tokensNoOutput (completion) tokens per request
include_deprecatedNoInclude models past their deprecation date in the cheapest search (default false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose meaningful behavior: output shape (per-1M input/output, cached/batch, context window, as_of + source commit) and the payment mechanism (x402, $0.004 USDC on Base or Solana). It omits auth/rate-limit details and whether failed calls are billed beyond the 'not charged' note that lives in the schema.

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

Conciseness4/5

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

Front-loaded with the usage trigger, then inputs, outputs, example, and price in a compact sequence. It is dense and slightly run-on in the output enumeration, but every clause carries information.

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

Completeness4/5

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

For a 10-parameter tool with no output schema and no annotations, the description covers both input modes and enumerates return fields plus the billing model. Remaining gaps (auth requirements, pagination/limit behavior nuances) are minor.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description adds real meaning: the mutual exclusivity of the two parameter groups (model vs. mode/provider/min_context/capabilities) and a concrete example query string. That interplay is not spelled out in the schema descriptions.

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

Purpose5/5

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

States specific verbs and resources: pricing an LLM call, calculating token cost, and ranking the cheapest model. The scope (USD per 1M tokens, provider, capabilities) is precise, and no sibling tool in the list overlaps with model pricing, so disambiguation is trivially clear.

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

Usage Guidelines4/5

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

Opens with an explicit trigger: 'Use when an agent must price an LLM call or pick the cheapest model,' then splits the two invocation modes (model given vs. no model + filters). No explicit when-not guidance or named alternative, but the context is unambiguous for this tool.

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