Skip to main content
Glama

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

llm_model_prices
Read-onlyIdempotent

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 per call, paid in USDC (Base, Monad, Polygon, Arbitrum or Solana) via x402.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "llm_model_prices"
  }
}

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. Changed1 schema field changed
    • removedInput schema / additionalProperties
      Removed value: -false
  2. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  3. Changed1 schema field changed
    • removedInput schema / additionalProperties
      Removed value: -false
  4. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent and non-destructive, so the bar is lower; the description earns credit by adding traits annotations cannot express, notably that the call is paid in USDC on Base, Monad, Polygon, Arbitrum or Solana via x402, and that responses carry an as_of timestamp and source commit. It does not discuss caching, freshness windows or rate/payment failure handling beyond that.

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 use case, then input contract, then output contract, then an example — a sensible order for scanning. It is dense but nearly every clause carries information; the example and the payment sentence make it longer than strictly necessary.

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?

With no output schema, the description carries the return-value burden and does so: JSON with per-1M input/output USD, cached/batch prices, context window, provider, capabilities, cost estimate or cheapest ranking, plus as_of and source commit. Ten parameters are fully covered by the schema, so what remains thin is only payment/error edge cases.

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 every parameter, including mode being ignored when model is given and the unknown-model 400 behavior. The description mostly restates the parameter grouping and adds a concrete query-string example, which is mildly useful but not new semantic depth; baseline 3 applies.

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?

The opening sentence names the two concrete jobs: pricing an LLM call and picking the cheapest model. Combined with the input/output summary (USD per 1M tokens, cheapest ranking), an agent can tell this apart from the crypto/onchain price siblings without opening the schema.

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?

It explicitly routes between the two call modes: supply 'model (up to 5, comma list)' to price or compare a specific model, or omit model and use mode/provider/min_context/capabilities to rank cheapest. That is clear when-to-use guidance, but it never states when-not to use it or names any alternative tool for related questions.

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