Token counting & multi-model LLM cost estimates: GPT-4o, Claude, Gemini, 25+. No API key.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
One-click editor setup isnβt available for this listing yet β we donβt have a confirmed install command, and weβd rather show nothing than point your editor at the wrong package or host. Follow the projectβs own setup instructions, linked above.
See how many tokens your prompt uses β and what it'll cost on GPT-4o vs. Claude vs. Gemini β right inside VS Code. No API key, no billing dashboard, no guessing.
When you're building an LLM-powered app, two questions come up constantly: how many tokens is this prompt? and what will this call cost? Today you either guess, paste into a web tokenizer, or check the provider's billing console after the fact β all of which pull you out of your editor.
This extension answers both questions inline, and it answers them for several models at once, so you can make a real price/quality trade-off ("~$X on GPT-4o, ~$Y on Claude Sonnet, ~$Z on Claude Haiku") without leaving the file you're working in. It's local-first and works with zero configuration β no API key required.

Hover any prompt (or select text) to see its token count and cost across your models, side by side β cheapest first. Same comparison powers the CodeLens, the live status bar, and the Comparison Panel. (animated version)
Estimate Selection, Estimate Clipboard, Open Comparison Panel, and Select Models to Compare.β appears when a prompt exceeds a model's
context window.o200k_base for the GPT-4o
family, cl100k_base for GPT-4 / GPT-3.5) via
js-tiktoken.~ and a disclaimer in
the UI. They're great for ballpark cost comparison, not for exact billing. (An
optional API-based accurate mode is a candidate for a future release.)This repo also ships an MCP server that exposes the same
tokenizer + pricing engine as tools (estimate_cost, count_tokens,
list_models) to Claude Desktop, Claude Code, Cursor, or any MCP client β so you
can ask "what does this prompt cost on GPT-4o vs Claude vs Gemini?" right in
your chat. See mcp-server/README.md for setup. Same
local-first, no-API-key core β just a different front end.
From the Marketplace (once published):
Ctrl+Shift+X / Cmd+Shift+X).From a .vsix:
From source (for development): see Contributing.
N tokens Β· ~$X Β· compare lens sits above each one. Click it for the full breakdown.Ctrl+Shift+P):
How "total" is calculated: cost = input tokens + an assumed number of output tokens (output pricing is usually higher than input, so it matters). The assumption is configurable and always shown in the tooltip.
All settings live under llmCostEstimator.*:
| Setting | Type | Default | Description |
|---|---|---|---|
llmCostEstimator.models | string[] | ["gpt-4o", "claude-sonnet", "claude-haiku"] | Models to compare. Each entry must be a key in pricing.json. |
llmCostEstimator.outputTokenAssumption | number | 500 | Assumed output (completion) tokens used for the total-cost calculation. |
llmCostEstimator.currency | string | "USD" | Currency label shown next to costs. Display only β does not convert (pricing is in USD). |
llmCostEstimator.enableHover | boolean | true | Show the hover tooltip. |
llmCostEstimator.enableCodeLens | boolean | true | Show a CodeLens above detected prompt strings (JS/TS/Python). |
llmCostEstimator.enableStatusBarSelection | boolean | true | Show the live token count + cost of the current selection in the status bar. |
llmCostEstimator.customModels | object | {} | Add or override models without editing pricing.json (see Custom models). |
llmCostEstimator.refreshPricingOnStartup | boolean | false | Fetch current prices from the web on startup (cached; falls back to bundled prices offline). See Live pricing. |
llmCostEstimator.pricingSourceUrl | string | LiteLLM data | URL of the live pricing source (LiteLLM-compatible JSON). |
Available model keys (out of the box) β run LLM Cost: Select Models to Compare to pick from these visually:
gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano,
o3, o4-mini, gpt-4-turbo, gpt-4, gpt-3.5-turboclaude-opus, claude-sonnet, claude-haiku,
claude-3.7-sonnet, claude-3.5-sonnet, claude-3-opusgemini-2.5-pro, gemini-2.5-flash, gemini-2.0-flash,
gemini-1.5-pro, gemini-1.5-flashdeepseek-chat, deepseek-reasoner, mistral-large,
mistral-small, llama-3.3-70b, llama-3.1-405b, grok-2Example settings.json:
Add your own models β or override a built-in price with a negotiated rate β
without touching the bundled files, via llmCostEstimator.customModels:
Then add the key to llmCostEstimator.models (or pick it via Select Models to
Compare). Invalid entries are reported and skipped, not silently dropped.
The bundled prices are representative placeholders. Run LLM Cost: Refresh
Pricing from the Web (or enable llmCostEstimator.refreshPricingOnStartup) to
pull current prices from a maintained source β by default
LiteLLM's pricing data. The result is
cached, so it keeps working offline and falls back to bundled prices on error.
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/llm-cost-estimator)<a href="https://allmcps.com/mcp/llm-cost-estimator"><img src="https://allmcps.com/api/badge/llm-cost-estimator?style=directory" alt="Llm Cost Estimator on AllMCPs" /></a>