On this page · 12 sections
- LLM cost measurement is three problems, not one
- Category 1 · Pre-flight token counters (free, deterministic, offline-capable)
- Category 2 · Production observability with usable free tiers
- Category 3 · Cross-provider comparison and calculators
- Verified LLM API pricing snapshot — 11 August 2026
- The two structural discounts every finance model should assume
- How to actually run a cost benchmark — a 5-step method
- When free stops being enough
- Frequently asked questions
- How eCorpIT can help
- Closing note
- References
Summary. LLM cost measurement in August 2026 is three separate problems solved by three separate categories of free tooling, and confusing them is why most teams over-spend by two-to-five times what they need to. Pre-flight, you count tokens before you send the request with OpenAI's tiktoken (open-source Python + gpt-tokenizer JS port), Anthropic's free `count_tokens` SDK endpoint (does not consume rate limit), Google's `google-generativeai` count_tokens method, or a browser-side calculator that covers all providers side-by-side like eCorpIT's LLM Token Counter which supports 25+ models with 100% client-side counting (no text leaves the browser). In production, you trace every call with an open-source observability platform — Langfuse (MIT, 50,000 free units/month, self-hostable), Helicone (Apache 2.0, 50,000 free logs/month, acquired by Mintlify March 2026), or OpenLLMetry (vendor-neutral OpenTelemetry SDK, fully open-source). Cross-provider, you compare rates with free web calculators before you commit to a model. Verified Anthropic August 2026 pricing: Claude Opus 5 $5/$25 per million tokens (input/output), Sonnet 5 $2/$10 (introductory rate through August 31, 2026), Haiku 4.5 $1/$5, Fable 5 $10/$50; cache hits at 10% of standard input; Batch API 50% off. Verified OpenAI: GPT-5.5 $5/$30 (cached input $0.50), GPT-5 baseline ~$1.25/$10, GPT-5-nano tier ~$0.05/$0.40. Verified Google: Gemini 2.5 Pro $1.25/$10 for prompts ≤200K tokens (higher tier above), 2.5 Flash $0.30/$2.50; Flash deprecates October 16, 2026. Stacked, the two structural discounts — Batch API 50% + prompt caching (Anthropic 90% off cached input; OpenAI 90%) — reach ~95% savings on the repeatable portion of a workload. This guide covers the eight tools worth actually using, the free-tier limits on each, and the five-step benchmark that turns "we should measure this" into a number your finance team can plan around.
LLM cost measurement is three problems, not one
Most engineering teams ask "how do I measure LLM costs?" and buy a single tool to do it. That is why the tool then sits half-configured six weeks later. The answer is that cost measurement runs across three distinct time horizons, and the free tooling that solves each is different.
Pre-flight answers "what will this prompt cost, before I send it?" It is a counting problem, solved deterministically by tokenizer libraries. The right answer here is free, offline, and takes minutes to set up.
In-flight and post-flight answer "what did the last hour, day, week of production traffic actually cost, and where is the spend concentrated?" It is a logging and aggregation problem, solved by observability platforms with generous free tiers or full open-source distributions you can self-host.
Cross-provider comparison answers "should we be on Claude Opus 5 or GPT-5.5 or Gemini 2.5 Pro for this workload?" It is a pricing-lookup and benchmarking problem, solved by static calculators, provider dashboards, and side-by-side comparison tools.
The eight tools below are grouped by which problem they solve. Pick one from each category and you have coverage; pick one that promises to do all three and you get a leaky version of each.
Category 1 · Pre-flight token counters (free, deterministic, offline-capable)
Every LLM uses a different tokenizer, which is a ruleset that splits your text into numeric IDs the model actually charges for. A 100-word prompt is not "100 tokens" — it can be 130 tokens in one model and 155 in another, and that difference compounds fast at scale. The good news is that every major provider ships its tokenizer as open source, free, and callable without hitting the paid API.
1. OpenAI tiktoken (Python) + gpt-tokenizer (JavaScript / TypeScript)
OpenAI's official tokenizer, tiktoken, is open-source Python that runs entirely locally. gpt-tokenizer is the production-grade JavaScript / TypeScript port widely adopted in enterprise applications. Both count matches what the OpenAI API will charge, exactly, to the token. Set-up is one pip install tiktoken or one npm install gpt-tokenizer.
Use it for: every OpenAI model (GPT-5 family, o3 family, embeddings). Not useful for Claude or Gemini — different tokenizer.
2. Anthropic count_tokens SDK endpoint
Anthropic's SDK exposes a count_tokens endpoint that returns the exact billed token count for any Claude message. It is free, it does not consume your rate limit, and it works for every current Claude model (Opus 5, Sonnet 5, Haiku 4.5, Fable 5). Call it from your existing Anthropic client before you fire the real request if you want a definitive number.
3. Google google-generativeai count_tokens method
Google's official SDK for the Gemini family exposes count_tokens, which calls Google's SentencePiece tokenizer. Free, official, and the only accurate way to count Gemini tokens — tiktoken gives the wrong answer for Gemini because the tokenizers are different.
4. eCorpIT LLM Token Counter (browser, 25+ models, all providers)
If you want a single free tool that covers every major provider without three separate SDK installs, the eCorpIT LLM Token Counter is a real-time browser calculator that supports 25+ models across OpenAI, Anthropic, Google Gemini, Meta Llama, DeepSeek and others. Two properties matter for engineering-team use:
- 100% client-side. Text is tokenized in your browser via WebAssembly ports of the official tokenizers. Nothing is sent to a server. That matters when the prompt you are pricing contains customer data, internal specs, unreleased code, or anything that would fail a security review to paste into a random web tool.
- Side-by-side pricing. The same text is counted and priced against every model at the same time, with current per-model rates, so you can see immediately that a 3,500-token prompt costs $0.0175 on Claude Opus 5 input but $0.0035 on Haiku 4.5 input — the answer to whether you can drop a tier for this workflow is visible in one screen instead of three spreadsheet tabs.
Use it for: quick pre-flight pricing across providers, prompt-optimization comparisons, and any scenario where you want a token count without integrating an SDK. Deeper context on the tool's model coverage: LLM Token Counter for 25+ Models: GPT-5, Claude, Gemini Cost (2026).
Pre-flight counter comparison
| Tool | Providers covered | Free | Offline | Client-side (private) | Best for |
|---|---|---|---|---|---|
| tiktoken / gpt-tokenizer | OpenAI only | ✓ | ✓ | ✓ | Server-side Python or Node pipelines |
| Anthropic count_tokens SDK | Claude only | ✓ | ✗ (API call) | ✗ | Exact Claude accounting inside your existing client |
| Google count_tokens SDK | Gemini only | ✓ | ✗ (API call) | ✗ | Exact Gemini accounting |
| eCorpIT LLM Token Counter | 25+ across all providers | ✓ | ✓ (browser) | ✓ | Cross-provider comparison, sensitive text |
Category 2 · Production observability with usable free tiers
Once you are in production, the question changes. It is no longer "what will this prompt cost?" It is "what did last week actually cost, which endpoint is bleeding, and is the retry loop we shipped Tuesday responsible for the 40% spend jump?" That is a tracing and aggregation job, and three open-source platforms dominate the free tier in 2026.
5. Langfuse — the open-source default
Langfuse Cloud offers 50,000 units per month free, and the whole platform is MIT-licensed and self-hostable if you would rather run it inside your own VPC. Traces cover prompt / completion / cost / latency per call, prompt management with version diffing, evals, and a session view that groups calls into user-level flows. The free tier is enough for a single-team production workload; the self-hosted version has no unit cap. Detailed tracing, prompt management and prompt versioning are the strengths.
Use it when: you want a single tool that covers observability + prompt management + evals, and are comfortable running Postgres and ClickHouse (or paying for the cloud version at higher volume).
6. Helicone — logging in minutes via proxy
Helicone provides 50,000 monthly logs free and is open-source under the Apache 2.0 License. Its distinguishing property is a proxy-based integration — change your OpenAI (or other provider) base URL to Helicone's endpoint and every call is logged automatically without touching your client code. That "logging in minutes" trade-off is real: the fastest observability setup in the category, though it means Helicone sits in your critical path unless you self-host. In March 2026, Mintlify acquired Helicone, so watch the roadmap; nothing has broken yet, but ownership changes matter for tooling you build a workflow around.
Use it when: you want the lowest-friction path to production LLM logging and are comfortable with the proxy pattern.
7. OpenLLMetry — vendor-neutral OpenTelemetry for LLMs
OpenLLMetry is Traceloop's open-source SDK that provides vendor-neutral OpenTelemetry instrumentation for LLMs. It is fully open-source, ships nothing to a hosted backend by default, and exports OTel-standard traces to whatever observability stack you already run — Datadog, Honeycomb, Grafana Tempo, Jaeger, self-hosted Tempo, or any OTel-compatible backend. There is no free-tier limit because there is no hosted product to gate.
Use it when: you already have a mature observability stack and want LLM traces to land in the same place as the rest of your traces, rather than in a separate LLM-specific dashboard.
Free-tier observability comparison
| Tool | Free tier | Licence | Self-host | Integration | Sweet spot |
|---|---|---|---|---|---|
| Langfuse | 50k units / month (Cloud); unlimited self-hosted | MIT | ✓ | SDK wrapper | Detailed tracing + prompt management + evals |
| Helicone | 50k logs / month (Cloud); unlimited self-hosted | Apache 2.0 | ✓ | Proxy (fastest setup) | Fastest logging, automatic cost tracking |
| OpenLLMetry | Unlimited (no hosted service) | Apache 2.0 | ✓ (there is nothing to host) | OpenTelemetry SDK | Sending LLM traces to your existing OTel stack |
Category 3 · Cross-provider comparison and calculators
Before you commit to a model, and periodically after you have, it pays to see what the same workload would cost on every alternative provider. Static calculators and side-by-side pricing pages solve this — none of them require an account.
8. Free web calculators and pricing indexes
The eCorpIT LLM Token Counter doubles as a calculator — enter your text, see the tokenized cost across 25+ models at once. Beyond that, independent pricing indexes at benchlm.ai, cloudzero.com, pricepertoken.com and morphllm.com track the same rates for reference. Every major provider also has its own official pricing page (anthropic.com/pricing, openai.com/api/pricing, ai.google.dev/pricing), and those are the canonical source when a number in a third-party page and a provider page disagree — providers change rates without notice and third-party trackers lag.
Verified LLM API pricing snapshot — 11 August 2026
The rates below are verified against provider pricing pages and consolidated third-party indexes as of 11 August 2026. Re-verify before budgeting; LLM pricing changes quarterly.
| Model | Input / M tokens | Output / M tokens | Cache discount | Batch discount |
|---|---|---|---|---|
| Anthropic Claude Opus 5 | $5.00 | $25.00 | Cached input at 10% of standard (90% off) | 50% off |
| Anthropic Claude Sonnet 5 | $2.00 (intro through Aug 31, 2026) | $10.00 | 90% off cached input | 50% off |
| Anthropic Claude Haiku 4.5 | $1.00 | $5.00 | 90% off cached input | 50% off |
| Anthropic Claude Fable 5 | $10.00 | $50.00 | 90% off cached input | 50% off |
| OpenAI GPT-5.5 (flagship) | $5.00 | $30.00 | Cached input $0.50 (~90% off) | 50% off |
| OpenAI GPT-5 (baseline) | ~$1.25 | ~$10.00 | 90% off cached input | 50% off |
| OpenAI GPT-5-nano tier | ~$0.05 | ~$0.40 | 90% off cached input | 50% off |
| Google Gemini 2.5 Pro (≤200K) | $1.25 | $10.00 | Cached tier available | Batch available |
| Google Gemini 2.5 Pro (>200K) | Higher tier | Higher tier | Cached tier available | Batch available |
| Google Gemini 2.5 Flash | $0.30 | $2.50 | Cached tier available | Batch available |
Two industry facts to factor in:
- Gemini 2.5 Flash deprecates on October 16, 2026. If your production workload runs on Flash today, plan the migration to the successor model before that date.
- Anthropic's Sonnet 5 $2 / $10 rate is explicitly labelled as an introductory rate through 31 August 2026. The published post-introductory rate is $3 / $15 per million tokens (batch $1.50 / $7.50), effective 1 September 2026.
The two structural discounts every finance model should assume
The single largest cost lever in an LLM budget is not choosing a cheaper model. It is applying the two discount mechanisms every major provider now ships, both of which are opt-in and both of which are free to enable.
Batch API — 50% off. OpenAI and Anthropic both offer a Batch API with a 50% discount on all models for requests that can wait up to 24 hours for a response. For asynchronous workloads — batch classification, offline content generation, data enrichment pipelines, evaluation runs, nightly re-scoring — this is the single biggest saving available. If half your usage is patient, half your bill is on the wrong pricing tier.
Prompt caching — up to 90% off cached input. Anthropic caches prefixes so cached input runs at 10% of standard rate (i.e., 90% off). OpenAI's GPT-5-family prompt caching runs at approximately 90% off cached input. For any workflow with a large stable prefix — system prompts, few-shot examples, retrieved documents, agent context — this is a structural saving with no output-quality trade-off, because the model's output is unchanged.
Stacked, Batch × Cache reaches approximately 95% savings on the repeatable portion of a workload. That is not a wishful blended number — it is the multiplication of two independent discounts, both of which apply to the same tokens. Any cost-projection spreadsheet that assumes headline API rates for a workload that could use either discount is wrong by a factor of two to twenty.
How to actually run a cost benchmark — a 5-step method
The pattern that works — refined across engineering teams eCorpIT has helped price out — is deliberately un-clever. Each step is cheap; the discipline is in doing all five before you commit to a model.
Step 1 · Sample. Pull a representative slice of real production traffic (or the closest proxy you have if you are pre-launch) — 200 to 1,000 requests covering peak, off-peak and edge-case prompt shapes. Do not benchmark against synthetic data; the token distribution will lie.
Step 2 · Count. Run every prompt through the eCorpIT LLM Token Counter or the provider tokenizers directly for the models on your shortlist. Record input tokens, expected output tokens (use a reasonable ceiling — actual outputs are always shorter than you fear), and prompt-prefix length if you plan to cache.
Step 3 · Price. Multiply against the table above. Then multiply again against the Batch and Cache scenarios that apply to your workload, honestly. If 60% of your traffic is asynchronous, the Batch discount applies to 60% of your bill.
Step 4 · Instrument. Wire Langfuse, Helicone or OpenLLMetry into a staging deployment before you flip production traffic. Ship the model change with observability on day one, not month three. If the projected cost and the actual cost diverge by more than 20% in the first week, your Step 1 sample was not representative — go back and fix the sample, not the model choice.
Step 5 · Re-benchmark quarterly. Pricing changes. Providers ship new tiers, deprecate old ones, adjust introductory rates. The Sonnet 5 introductory window closing on 31 August 2026 is a live example. Put "re-benchmark LLM costs" on a quarterly calendar, not a "when someone notices the bill spike" trigger.
When free stops being enough
The free tools above cover most engineering teams comfortably up to roughly $5,000 per month of LLM spend, or approximately 100,000 daily user-facing LLM calls, whichever comes first. Beyond that, the failure modes look like this:
- Observability free tier exhausted mid-month. 50,000 units at Langfuse or 50,000 logs at Helicone go quickly at scale. Self-hosting removes the cap but adds Postgres / ClickHouse operations to your plate.
- No SSO or role-based access. Every free tier gates SSO, audit logs and RBAC behind a paid plan. That gate binds the moment you need to give finance or the security team access.
- No alerting on cost spikes. Free tiers show you last week; paid tiers page you when the current hour is 3× baseline. If a runaway retry loop can burn $2,000 before someone notices, alerting pays for itself in one incident.
- No cross-team chargeback. Splitting LLM spend across product lines, customers or tenants is a paid-tier feature almost everywhere.
The right time to move off free is when the cost of a missed alert or a missing RBAC gate is larger than the paid-tier subscription — usually somewhere between $3K and $8K of monthly LLM spend for a single-product team.
Frequently asked questions
How eCorpIT can help
eCorpIT is a Gurugram technology consultancy founded in 2021, working at CMMI Level 5 and MSME certified, with partnerships including AWS, Microsoft and Google. We build production LLM systems for Indian, US and UK clients — including AI-agent architectures, RAG systems, LLM-cost audits, prompt-optimization sprints, observability stack rollouts (Langfuse, Helicone, OpenLLMetry) and cross-provider migration when the maths says the current model is no longer the right one.
If your LLM spend is climbing faster than your usage — or if you are pricing a new AI feature and want a defensible cost projection before you commit — our engineering team can help. Reach us at ecorpit.com/contact-us/ or contact@ecorpit.com. Start with the free tool: LLM Token Counter.
Related eCorpIT work:
- AI & Machine Learning Services — RAG, agents, ML Ops, LLM systems
- AI Mobile App Development Services — LLM-powered mobile products
- Bedrock Managed Knowledge Base vs self-managed RAG in 2026 — related RAG cost analysis
- Microsoft & Uber Claude Code token-cost analysis — real-world enterprise LLM cost case study
Closing note
LLM cost measurement is a solved problem in 2026. The tokenizers are open-source, the observability platforms are open-source with self-hostable distributions, the calculators run in a browser tab. What is not solved is the discipline of doing all three — pre-flight counting, in-production tracing, cross-provider re-benchmarking — on a schedule, before the finance conversation happens. The teams that pay two-to-five times what they need to are not the ones that lack tools. They are the ones that never quite got around to installing the free ones.
References
- Anthropic — Official API pricing (verified 11 August 2026)
- OpenAI — Official API pricing (verified 11 August 2026)
- Google — Gemini API pricing (verified 11 August 2026)
- BenchLM — Claude API Pricing (August 2026)
- BenchLM — OpenAI API Pricing (August 2026)
- BenchLM — Gemini API Pricing (August 2026)
- Langfuse — Open-source LLM observability
- Helicone — LLM observability with proxy pattern
- Traceloop / OpenLLMetry — OpenTelemetry SDK for LLMs
- OpenAI — tiktoken library on GitHub
gpt-tokenizer— JavaScript port of tiktoken
- Digital Applied — Prompt Caching in 2026: Cut LLM Costs, Keep Quality
Last updated 11 August 2026 by the eCorpIT Editorial team. We will refresh this article when Anthropic publishes post-introductory Sonnet 5 pricing (after 31 August 2026), when Gemini 2.5 Flash reaches its 16 October 2026 deprecation, and quarterly thereafter as provider rates change.