Key takeaways
- Token-specific pricing: Providers price input, output and cached tokens separately.
- Higher output rates: Generated tokens commonly cost more than input tokens.
- Variable effective rates: Model tier, context, caching, batch processing and speed affect pricing.
- List vs actual cost: Compare public prices with the company’s effective rate per million tokens.
Track your AI token spend in one place
AI token spend can originate across employees, automated workflows and multiple providers, while Finance often only gains visibility after the money has been spent. To tackle this issue, we built Moss AI Token Cost Tracker: a free dashboard anyone can run locally to bring all AI spend into one view tailored to Finance. It allows you to trace costs to the provider, model, team, person, API key or workflow behind them.
Try it yourself by following the video tutorial and step-by-step instructions for your system below:
Getting started
Works with Claude Code, OpenAI's Codex, and other terminal-based AI coding agents. Copy this prompt and paste it into your agent - it will clone the repo, install dependencies, and start the app for you.
Clone and set up the moss-ai-token-cost-tracker tool for me. Act as my setup assistant using your file system and terminal access: 1. First check whether the current folder (or a `moss-ai-token-cost-tracker` subfolder) already contains this tool (look for server.mjs and index.html). If it's already there, run `git pull` inside that folder to get the latest changes, then skip straight to step 3. 2. Otherwise, clone the repo: git clone https://github.com/getmoss/moss-ai-token-cost-tracker then work from inside that folder, and check whether Git, nvm, and the Node.js version this repo's README requires are installed, installing or switching to whatever is missing. 3. Ask me whether I want to run it in production mode (connecting my real accounts with API keys) or demo mode (mocked data, so I can just see how it looks without any API keys). Wait for my answer before continuing. 4. Double check that everything needed is set up correctly, and then run `npm start` for production mode, or `npm run demo` for demo mode, based on my answer. 5. Watch the terminal output for errors. If something fails, diagnose the root cause, explain it to me in plain language, and either fix it or tell me exactly what to run. 6. Tell me the URL to open in my browser once the server is running. 7. Later, if I ask you to stop or restart the tool, do that for me. Important: never read, print, or send the contents of my .env file, and never share any API keys or company data outside this terminal session.
What are AI tokens?
AI models don’t read words, they read tokens: small chunks of text that can be a whole word, part of a longer word, a number or a punctuation mark. “Invoice” is one token, “reconciliation” is likely three or four. As a rough guide, 1,000 tokens is around 750 words of English.
Tokens matter to finance because they are the billing unit. Everything sent to the model (the prompt, any documents attached, the conversation so far) is counted as input tokens. Everything the model writes back is counted as output tokens. Providers charge a separate rate for each, usually quoted per million tokens, and output is normally the more expensive side.
The rest of this guide covers the seven things that move that bill.
1. The basic token-cost calculation
Providers commonly quote prices per one million tokens (Mtok), and clarifying what is Mtok helps teams understand these invoices. The basic calculation adds up each billable category under token based pricing:
Token cost =
(input tokens /1,000,000 x input rate)
+ (output tokens /1,000,000 x output rate)
+ cached-token charges
+ other usage charges
Every model has its own rates. Two teams can process the same token volume with one provider and still pay different amounts if they use different model tiers.
Tokenizers add another wrinkle. Models can convert identical text into different token counts. A lower advertised price per token does not guarantee a lower workload cost.
2. Input, output, and cached tokens
Input tokens in AI cover everything sent to the model: user instructions, system prompts, conversation history, retrieved documents, and other context. Longer prompts and documents increase the bill. So does repeatedly sending the same conversation history.
Output tokens are the content the model generates. Providers usually charge a higher rate for them. A short prompt asking for a long report can therefore cost more through the answer than through the visible request.
Cached tokens are repeated parts of an input that the provider can reuse. Cache reads may receive a lower rate, while cache creation or storage can have separate terms. When checking the invoice, keep the three categories separate. A rising total can hide a fall in cached usage and a rise in output.
3. Why output usually costs more
The model can process much of an input in parallel. It generates output one token at a time, with each new token depending on what came before it. This takes longer and keeps hardware resources occupied throughout the response.
Long answers add more billable output at what is often the higher rate. Some reasoning models also use internal reasoning tokens before returning the visible answer. Where the provider bills them, a brief response can still involve substantial processing.
4. Model tier and context length
Lightweight models are intended for simpler work at a lower rate. Premium models support harder tasks at a higher price, reflecting how AI pricing models vary. Moving a workflow between tiers can change the bill while request volume stays flat.
Context length is the amount of information sent with one request. Large system prompts, full documents, and long conversation histories all increase input volume. Some providers also use higher rate bands when context crosses a stated threshold.
The cheapest model on a price sheet is not always the cheapest per successful task. A weaker model may need more instructions or retries, directly impacting overall LLM pricing. Finance should compare the cost of a completed outcome, then ask whether the current model tier and context size are necessary.
5. Caching and batch pricing
Caching and batch pricing can reduce the cost of API-based workloads, but they are primarily configured by engineering. Employees using standard AI applications generally cannot choose when prompts are cached or submit their work for batch processing.
Prompt caching lowers the cost of repeated input when many API requests share the same system instructions, reference material, or other stable content. The saving depends on the provider's cache-read rate, any cache-write or storage charges, and minimum input requirements.
Batch pricing offers a lower rate for API work that does not need an immediate response. Overnight document processing, reporting, or bulk analysis can be submitted asynchronously where the provider supports it. The trade-off is longer processing time.
Both mechanisms change the effective rate. Finance should track cached and batch usage separately, while engineering determines where these options can be applied.
6. Faster processing and additional charges
Priority or fast processing can raise the price in return for lower latency or more reliable capacity. Some enterprise services use committed or provisioned capacity instead of pure token billing. The company then pays for reserved throughput, even when usage is lower than expected.
Token charges may also sit beside fees for tool calls, web search, code execution, file or vector storage, and regional processing. Taxes can affect the invoice as well. AI coding tools can add another layer by combining a monthly subscription with a usage pool and metered overages.
7. List price versus effective rate
The list price is the public rate for a stated model and token category. The effective rate is what the company paid across its actual mix of input, output, cached tokens, models, and processing modes.
Finance can calculate the true cost per token by dividing the relevant token spend by the number of tokens processed, then scaling the result to one million tokens.
Effective rate per Mtok = (spend for the period ÷ tokens processed) × 1,000,000
The comparison must use like-for-like data. A blended rate across several models should not be compared with the input-only list price of one model.
Contract terms, volume commitments, caching, batch work, and model mix can all pull the effective rate away from the public price. That is why two companies using the same provider may pay very different amounts for a similar token total.
Current rates need a date
Provider rates and model names change frequently. A pricing comparison should record the model and version, provider, region, input rate, output rate, cached-input terms, batch or priority rates, contract adjustments, source, and effective date.
Check those details again before publishing a rate comparison or approving a new budget. A static table copied into a forecast can become wrong without a new procurement event. The provider may reprice a model, release a replacement, or change the default used by a tool.
What finance should ask when reviewing AI prices
- Which model processed the workload?
- How many input, output, and cached tokens were billed?
- Did the request use standard, batch, or priority processing?
- Did usage change, did the rate change, or did the model mix change?
- Does the workflow need its current model tier, context length, and response speed?
Once finance can answer those questions, it can explain why the bill moved and who should own the next conversation: the team, for model choice and prompt habits, or engineering, for caching, batching and agent limits.
