Prompt CostSee how many tokens a prompt will use, and what it will cost, before you send it. Prompt Cost is a VS Code and Cursor sidebar. You pick a model, type or paste a prompt, and get a local token count and a list-price estimate. Attach a document, image, video, or audio file when the prompt depends on one. Compare two versions when you are trying to make a prompt shorter or cheaper. Counts run on your machine. An API key is not required. Use it
Analyze Current Document and Analyze Selected Text copy the open file or the selection into the prompt. The status bar shows the same sidebar count. The count is the prompt you typed and the files you attached. A chat assistant also adds system instructions, rules, and tool definitions. Include that text in the prompt when you want it in the count. Changing the model recounts an open comparison. While the comparison charts are open, the single-prompt cost charts stay hidden. What the numbers meanEach result is labeled:
Prices are public list prices. They leave out cache discounts, batch rates, and separate media rates. Images, audio, video, and unparsed documents use the provider's published size rules and are priced like text input. Output cost assumes the completion length in settings, because the prompt does not decide how long the reply will be. A model with no official price stays at zero until you set a rate. Claude 4.7 and later can use more tokens than the local Claude count. Use the provider API count when that difference matters. PrivacyTokenizers run locally and do not use the network. Prompt text is not saved to extension state, logs, or the secret store. API keys stay in the editor secret store and are not shown in the sidebar. Provider API counting is off until you enable it and confirm a send. Commands
Settings
MCPPrompt Cost can run a local MCP server so an agent can count tokens, estimate cost, compare two texts, list models, or measure tool definitions. The server does not listen on a port, does not call a model provider, and does not store the text it receives. Run Prompt Cost: Configure MCP Server to add it to the workspace. The tools are DevelopNode.js 20 or newer.
Press F5 and choose Run Prompt Cost. In the new window, open Prompt Cost from the activity bar.
LicenseMIT. See LICENSE. |