Skip to main content
Glama

OptimToken: AI and Compute Economics

Estimate LLM Cost

estimate-llm-cost
Read-only

Cost a workload with EXACT numbers the caller supplies: arbitrary token counts per request and any monthly volume, not just the 10k/100k/1m presets the other cost tools use. Use this for 'about 800 in and 200 out, 4 million calls a month', or to price one named model across every use-case profile. To compare 2-4 named models like for like at a preset volume, use compare-models-side-by-side instead. Provide a model name to get detailed cost breakdowns, or compare costs across all use case presets. Each figure comes twice: list price, and the optimized price achievable with prompt caching and the batch API. The presets carry their own cache-hit and batch assumptions; a custom token shape carries none unless cacheHitRate and/or batchEligible are passed with it, and each cost entry states which applied in optimizationBasis. Cost figures are final as returned: rounded server-side and dated by provenance, with the lever behind each saving, or the reason there is none, named in the text.

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": "estimate-llm-cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelNameNoModel name, e.g. 'GPT-4o'. A partial name matches up to 5 models and ALL of them are costed. If omitted, the first 8 catalogue entries are used — that is catalogue order, not a quality ranking.
cacheHitRateNoShare of input tokens served from the prompt cache, 0 to 1: for example 0.6 for a stable system prompt and tool definitions re-sent on every call. Only valid with customInputTokens and customOutputTokens; the presets carry their own and cannot be overridden. Omitting it means no caching is assumed, not that none is achievable.
batchEligibleNoWhether this workload is asynchronous and can go through the batch API. Only valid with customInputTokens and customOutputTokens; the presets carry their own. Omitting it means no batch discount is assumed, not that the workload is ineligible.
monthlyVolumeNoExact monthly request count, any integer (default 100,000). This tool does not take the 10k/100k/1m presets the other cost tools use.
useCasePresetNoWorkload shape, which sets tokens per request: supportTicket (1.5k in / 500 out), knowledgeQA (2k / 800), meetingSummary (10k / 1.2k, batch-eligible), marketingContent (2.5k / 1.8k), codingTask (3k / 2k), invoiceProcessing (1.5k / 600, batch-eligible), callSummary (2k / 700, batch-eligible), agentWorkflow (6k / 3k). Default: every preset.
customInputTokensNoCustom input tokens per request. Must be supplied TOGETHER with customOutputTokens — either alone is ignored and the preset is used. A custom shape assumes no cacheable prefix and no batch eligibility unless cacheHitRate / batchEligible say otherwise, so without them its optimized cost equals its list cost.
customOutputTokensNoCustom output tokens per request. Must be supplied TOGETHER with customInputTokens — either alone is ignored and the preset is used.

Output Schema

NameRequiredDescriptionDefault
errorNo
sourceYes
volumeYes
eloAsOfYes
dataAsOfNo
modelCostsYes
provenanceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / modelCosts / items / properties / model / properties / deprecation
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "replacement": {
      +      "type": "string"
      +    },
      +    "shutdown": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedOutput schema / properties / provenance / properties / deprecationsVerifiedAt
      Added value: +{
      +  "type": "string"
      +}
  2. Changed1 schema field changed
    • addedOutput schema / properties / provenance / properties / hostPricingAsOf
      Added value: +{
      +  "type": "string"
      +}
  3. Changed9 schema fields changed
    • addedInput schema / properties / batchEligible
      Added value: +{
      +  "description": "Whether this workload is asynchronous and can go through the batch API. Only valid with customInputTokens and customOutputTokens; the presets carry their own. Omitting it means no batch discount is assumed, not that the workload is ineligible.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / cacheHitRate
      Added value: +{
      +  "description": "Share of input tokens served from the prompt cache, 0 to 1: for example 0.6 for a stable system prompt and tool definitions re-sent on every call. Only valid with customInputTokens and customOutputTokens; the presets carry their own and cannot be overridden. Omitting it means no caching is assumed, not that none is achievable.",
      +  "maximum": 1,
      +  "minimum": 0,
      +  "type": "number"
      +}
    • changedInput schema / properties / customInputTokens / description
      Previous value: -"Custom input tokens per request. Must be supplied TOGETHER with customOutputTokens — either alone is ignored and the preset is used. A custom shape assumes no cacheable prefix and no batch eligibility, so its optimized cost equals its list cost."New value: +"Custom input tokens per request. Must be supplied TOGETHER with customOutputTokens — either alone is ignored and the preset is used. A custom shape assumes no cacheable prefix and no batch eligibility unless cacheHitRate / batchEligible say otherwise, so without them its optimized cost equals its list cost."
    • addedOutput schema / properties / modelCosts / items / properties / costs / items / properties / cacheHitRate
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / modelCosts / items / properties / costs / items / properties / optimizationBasis
      Added value: +{
      +  "enum": [
      +    "preset",
      +    "caller-supplied",
      +    "none-supplied"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / properties / modelCosts / items / properties / costs / items / required
      Previous value: -[
      -  "useCase",
      -  "inputTokens",
      -  "outputTokens",
      -  "perRequest",
      -  "monthly",
      -  "perRequestOptimized",
      -  "monthlyOptimized",
      -  "savingsPct",
      -  "batchEligible",
      -  "cacheEligible",
      -  "batchApplied",
      -  "cacheApplied"
      -]New value: +[
      +  "useCase",
      +  "inputTokens",
      +  "outputTokens",
      +  "perRequest",
      +  "monthly",
      +  "perRequestOptimized",
      +  "monthlyOptimized",
      +  "savingsPct",
      +  "batchEligible",
      +  "cacheEligible",
      +  "batchApplied",
      +  "cacheApplied",
      +  "cacheHitRate",
      +  "optimizationBasis"
      +]
    • addedOutput schema / properties / modelCosts / items / properties / model / properties / cacheWritePricePer1M
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / modelCosts / items / properties / model / properties / outlierListing
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / modelCosts / items / properties / model / properties / promotionalListing
      Added value: +{
      +  "type": "boolean"
      +}
  4. Changed11 schema fields changed
    • changedInput schema / properties / customInputTokens / description
      Previous value: -"Custom input tokens per request (overrides preset)"New value: +"Custom input tokens per request. Must be supplied TOGETHER with customOutputTokens — either alone is ignored and the preset is used. A custom shape assumes no cacheable prefix and no batch eligibility, so its optimized cost equals its list cost."
    • changedInput schema / properties / customOutputTokens / description
      Previous value: -"Custom output tokens per request (overrides preset)"New value: +"Custom output tokens per request. Must be supplied TOGETHER with customInputTokens — either alone is ignored and the preset is used."
    • changedInput schema / properties / modelName / description
      Previous value: -"Model name to estimate costs for (e.g. 'GPT-4o', 'Claude Sonnet 4'). If omitted, shows top models."New value: +"Model name, e.g. 'GPT-4o'. A partial name matches up to 5 models and ALL of them are costed. If omitted, the first 8 catalogue entries are used — that is catalogue order, not a quality ranking."
    • changedInput schema / properties / monthlyVolume / description
      Previous value: -"Custom monthly volume (default: 100,000)"New value: +"Exact monthly request count, any integer (default 100,000). This tool does not take the 10k/100k/1m presets the other cost tools use."
    • changedInput schema / properties / useCasePreset / description
      Previous value: -"Use case preset. Default: all presets."New value: +"Workload shape, which sets tokens per request: supportTicket (1.5k in / 500 out), knowledgeQA (2k / 800), meetingSummary (10k / 1.2k, batch-eligible), marketingContent (2.5k / 1.8k), codingTask (3k / 2k), invoiceProcessing (1.5k / 600, batch-eligible), callSummary (2k / 700, batch-eligible), agentWorkflow (6k / 3k). Default: every preset."
    • addedOutput schema / properties / modelCosts / items / properties / costs / items / properties / batchApplied
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / modelCosts / items / properties / costs / items / properties / batchEligible
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / modelCosts / items / properties / costs / items / properties / cacheApplied
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / modelCosts / items / properties / costs / items / properties / cacheEligible
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / modelCosts / items / properties / costs / items / properties / savingsPct
      Added value: +{
      +  "type": "number"
      +}
    • changedOutput schema / properties / modelCosts / items / properties / costs / items / required
      Previous value: -[
      -  "useCase",
      -  "inputTokens",
      -  "outputTokens",
      -  "perRequest",
      -  "monthly",
      -  "perRequestOptimized",
      -  "monthlyOptimized"
      -]New value: +[
      +  "useCase",
      +  "inputTokens",
      +  "outputTokens",
      +  "perRequest",
      +  "monthly",
      +  "perRequestOptimized",
      +  "monthlyOptimized",
      +  "savingsPct",
      +  "batchEligible",
      +  "cacheEligible",
      +  "batchApplied",
      +  "cacheApplied"
      +]
  5. Changed2 schema fields changed
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / properties / provenance
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "catalogTotal": {
      +      "type": "number"
      +    },
      +    "dataAsOf": {
      +      "type": "string"
      +    },
      +    "eloAsOf": {
      +      "type": "string"
      +    },
      +    "label": {
      +      "type": "string"
      +    },
      +    "notice": {
      +      "type": "string"
      +    },
      +    "pricesVerified": {
      +      "type": "boolean"
      +    },
      +    "source": {
      +      "type": "string"
      +    },
      +    "tier": {
      +      "type": "number"
      +    },
      +    "upstreamSchemaVersion": {
      +      "type": "string"
      +    },
      +    "upstreamSource": {
      +      "type": "string"
      +    },
      +    "upstreamTimestamp": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "tier",
      +    "source",
      +    "label",
      +    "pricesVerified",
      +    "eloAsOf"
      +  ],
      +  "type": "object"
      +}
  6. Changed2 schema fields changed
    • changedOutput schema / $schema
      Previous value: -"https://json-schema.org/draft/2020-12/schema"New value: +"http://json-schema.org/draft-07/schema#"
    • removedOutput schema / properties / provenance
      Removed value: -{
      -  "additionalProperties": false,
      -  "properties": {
      -    "catalogTotal": {
      -      "type": "number"
      -    },
      -    "dataAsOf": {
      -      "type": "string"
      -    },
      -    "eloAsOf": {
      -      "type": "string"
      -    },
      -    "label": {
      -      "type": "string"
      -    },
      -    "notice": {
      -      "type": "string"
      -    },
      -    "pricesVerified": {
      -      "type": "boolean"
      -    },
      -    "source": {
      -      "type": "string"
      -    },
      -    "tier": {
      -      "type": "number"
      -    },
      -    "upstreamSchemaVersion": {
      -      "type": "string"
      -    },
      -    "upstreamSource": {
      -      "type": "string"
      -    },
      -    "upstreamTimestamp": {
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "tier",
      -    "source",
      -    "label",
      -    "pricesVerified",
      -    "eloAsOf"
      -  ],
      -  "type": "object"
      -}
  7. Changed2 schema fields changed
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / properties / provenance
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "catalogTotal": {
      +      "type": "number"
      +    },
      +    "dataAsOf": {
      +      "type": "string"
      +    },
      +    "eloAsOf": {
      +      "type": "string"
      +    },
      +    "label": {
      +      "type": "string"
      +    },
      +    "notice": {
      +      "type": "string"
      +    },
      +    "pricesVerified": {
      +      "type": "boolean"
      +    },
      +    "source": {
      +      "type": "string"
      +    },
      +    "tier": {
      +      "type": "number"
      +    },
      +    "upstreamSchemaVersion": {
      +      "type": "string"
      +    },
      +    "upstreamSource": {
      +      "type": "string"
      +    },
      +    "upstreamTimestamp": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "tier",
      +    "source",
      +    "label",
      +    "pricesVerified",
      +    "eloAsOf"
      +  ],
      +  "type": "object"
      +}
  8. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Beyond the readOnly/openWorld/non-destructive annotations, the description discloses that every figure is returned twice (list and optimized), that presets carry their own cache-hit and batch assumptions while custom shapes carry none unless parameters are passed, and that rounding is server-side with `provenance` dating. This is substantial behavioural context. It stops short of stating any rate limit or failure mode, so it is strong but not exhaustive.

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?

The differentiator and the sibling exclusion are front-loaded in the first two sentences, and the density of information per sentence is high. There is some redundancy: the middle sentence about providing a model name vs. comparing across presets partly repeats what the schema parameters already say, and the closing sentences spend words on output fields that exist in the output schema.

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 zero-required-parameter, seven-parameter costing tool with full schema coverage and a present output schema, the description covers the decision-relevant parts: what makes it distinct, which sibling to use instead, and how custom vs. preset assumptions affect results. It is slightly over-complete on return-value detail (`provenance`, rounding) that the output schema already defines, but nothing an agent needs to call it correctly is missing.

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 each of the seven parameters, including the custom-token pairing rule and the preset token shapes. The description mostly restates schema-level facts (pairing of customInputTokens/customOutputTokens, presets owning their cache/batch assumptions) rather than adding interpretation. Its only real addition is pointing to `optimizationBasis` as the place to see which assumptions applied.

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 gives a specific verb and resource ('Cost a workload') and immediately states the differentiator: exact caller-supplied token counts and arbitrary monthly volume rather than the 10k/100k/1m presets. It explicitly contrasts itself with 'the other cost tools', so an agent can separate it from siblings without opening a schema.

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

Usage Guidelines5/5

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

It provides a concrete usage example ('about 800 in and 200 out, 4 million calls a month'), a when-not rule, and the named alternative with its selecting condition ('To compare 2-4 named models like for like at a preset volume, use compare-models-side-by-side instead'). It also states the two intra-tool modes (single named model breakdown vs. all use-case presets).

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.