RunOfflineTools Logo RunOfflineTools
⚑ Updated with latest models and pricing

LLM Token Counter & API Cost Calculator

Accurately calculate token usage, simulate context window capacity, and compare real-time API call costs across GPT-6 Sol, Claude Sonnet 5, Gemini 3.8 Flash, o4-mini, o3, DeepSeek R1, and 45+ foundation models.

⚑ Updated with latest models and pricing
GPT-6 β€’ Claude 5 β€’ Gemini 3.8 Flash β€’ DeepSeek R1 β€’ o4-mini β€’ 45+ Models
Active Model:
Prompt Input
4 lines β€’ 37 words β€’ 280 chars
Expected Completion Tokens: 500
Short (100)Paragraph (500)Code Module (1.5k)Deep Reasoning (4k)Full Output (8k)
Total Estimated Tokens
559
59 input + 500 output
Context Limit (256k):0.22%
0 tokens2,56,000 tokens
Estimated API Call Cost
Input Cost:$0.000118
Output Cost:$0.005000
Cost / Call:$0.005118
10,000 queries:$51.18
100,000 queries:$511.80
1,000,000 queries:$5118.00

Token Density & Ratios

4.75
Chars / Token
0.63
Words / Token

Cross-Model Cost Comparison

55 models
Sort by:
DeepSeek V3Rock-Bottom Cost
64k ctxβ€’DeepSeek
$0.00015
-97% cheaper
Mistral Small 3Low Latency
128k ctxβ€’Mistral AI
$0.00016
-97% cheaper
GPT-5 nanoLowest OpenAI Cost
200k ctxβ€’OpenAI
$0.00020
-96% cheaper
Gemini 2.5 Flash-LiteSub-$0.50 Flash
1.0M ctxβ€’Google
$0.00021
-96% cheaper
GPT-6 LunaGPT-6 Ultra Cheap
256k ctxβ€’OpenAI
$0.00026
-95% cheaper
Grok Fast / MiniFast Latency
128k ctxβ€’xAI
$0.00026
-95% cheaper
GPT-4o miniBudget Multimodal
128k ctxβ€’OpenAI
$0.00031
-94% cheaper
Qwen 2.5 Coder 32BOpen Code SOTA
128k ctxβ€’Alibaba / Open Weights
$0.00031
-94% cheaper
Llama 3.3 70B (Groq/Hosted)Open Weights
128k ctxβ€’Meta / Open Weights
$0.00043
-92% cheaper
Codestral 256k256k Code SOTA
256k ctxβ€’Mistral AI
$0.00047
-91% cheaper
GPT-5.6 LunaSub-$0.50 Tier
200k ctxβ€’OpenAI
$0.00061
-88% cheaper
GPT-5.4 nanoNano Tier
200k ctxβ€’OpenAI
$0.00064
-88% cheaper
Gemini 3.1 Flash-LiteUltra Cheap
1.0M ctxβ€’Google
$0.00076
-85% cheaper
GPT-4.1 miniFast 4.1 Mini
128k ctxβ€’OpenAI
$0.00082
-84% cheaper
GPT-5 miniBudget GPT-5
200k ctxβ€’OpenAI
$0.00101
-80% cheaper
Llama 3.1 405B (Hosted)405B Heavyweight
128k ctxβ€’Meta / Open Weights
$0.00112
-78% cheaper
DeepSeek R1Open Reasoning SOTA
64k ctxβ€’DeepSeek
$0.00113
-78% cheaper
Gemini 3.5 Flash-LiteHigh-Volume Agentic
1.0M ctxβ€’Google
$0.00127
-75% cheaper
Gemini 2.5 FlashHybrid Reasoning
1.0M ctxβ€’Google
$0.00127
-75% cheaper
Gemini 3.8 FlashLatest SOTA Flash
1.0M ctxβ€’Google
$0.00192
-63% cheaper
Gemini 3.7 FlashCoding & Agents
1.0M ctxβ€’Google
$0.00192
-63% cheaper
Gemini 3.6 FlashMultimodal Flash
1.0M ctxβ€’Google
$0.00192
-63% cheaper
o4-miniLatest o4 Reasoning
200k ctxβ€’OpenAI
$0.00226
-56% cheaper
o3-miniFast Reasoning
200k ctxβ€’OpenAI
$0.00226
-56% cheaper
Gemini 3.8 Live (Voice/Audio)Live Audio & Speech
1.0M ctxβ€’Google
$0.00229
-55% cheaper
GPT-5.4 miniFast & Efficient
200k ctxβ€’OpenAI
$0.00229
-55% cheaper
Claude Haiku 4.5Fast Near-Frontier
200k ctxβ€’Anthropic
$0.00256
-50% cheaper
Mistral Large 2Multilingual SOTA
128k ctxβ€’Mistral AI
$0.00312
-39% cheaper
o3 (Reasoning)Deep o3 Reasoning
200k ctxβ€’OpenAI
$0.00412
-20% cheaper
GPT-4.1GPT-4.1 Refined
128k ctxβ€’OpenAI
$0.00412
-20% cheaper
Gemini 3.5 FlashFoundational Flash
1.0M ctxβ€’Google
$0.00459
-10% cheaper
Gemini 2.5 ProReasoning & Code
2.1M ctxβ€’Google
$0.00507
-1% cheaper
Gemini 2.5 Computer UseComputer Use Agent
1.0M ctxβ€’Google
$0.00507
-1% cheaper
GPT-5GPT-5 Baseline
200k ctxβ€’OpenAI
$0.00507
-1% cheaper
GPT-6 SolGPT-6 Production Flagship
256k ctxβ€’OpenAI
$0.00512
Active
Grok 2xAI Flagship
128k ctxβ€’xAI
$0.00512
+0%
Grok 2 VisionVision
128k ctxβ€’xAI
$0.00512
+0%
Claude Sonnet 5Best Intelligence & Speed
200k ctxβ€’Anthropic
$0.00512
+0%
GPT-4oPopular Multimodal
128k ctxβ€’OpenAI
$0.00515
+1%
Gemini 3.1 Pro (Preview)3rd Gen Pro Frontier
2.1M ctxβ€’Google
$0.00612
+19%
GPT-5.6 TerraBalanced Workhorse
200k ctxβ€’OpenAI
$0.00612
+20%
GPT-5.3 CodexCodex SOTA
200k ctxβ€’OpenAI
$0.00710
+39%
GPT-5.4Production Standard
200k ctxβ€’OpenAI
$0.00765
+49%
Claude Sonnet 4.6Coding SOTA
200k ctxβ€’Anthropic
$0.00769
+50%
Claude 3.7 SonnetHybrid Extended Thinking
200k ctxβ€’Anthropic
$0.00769
+50%
GPT-5.6 SolDaybreak Flagship
200k ctxβ€’OpenAI
$0.01024
+100%
Claude Opus 5.5Agentic Coding SOTA
200k ctxβ€’Anthropic
$0.01025
+100%
Claude Opus 5Heavyweight SOTA
200k ctxβ€’Anthropic
$0.01281
+150%
GPT-5.5Advanced Reasoning
200k ctxβ€’OpenAI
$0.01529
+199%
GPT-6 AstraGPT-6 Frontier Flagship
256k ctxβ€’OpenAI
$0.02559
+400%
Claude Fable 5.1Agentic Reasoning SOTA
200k ctxβ€’Anthropic
$0.02562
+401%
Claude Mythos 5.1Frontier AI
200k ctxβ€’Anthropic
$0.02562
+401%
o1 (Reasoning)Deep Reasoning
200k ctxβ€’OpenAI
$0.03088
+503%
GPT-5.6 CyberCyber Security SOTA
200k ctxβ€’OpenAI
$0.03824
+647%
o3-proMaximum STEM Compute
200k ctxβ€’OpenAI
$0.04118
+705%
πŸ› οΈ

Provider Tools, Prompt Cache Writes (5m / 1h) & Add-On Rates

OpenAI GPT-6 cache writes, Web Search ($10/1k calls), Anthropic prompt caching tiers, Google Search/Maps grounding, and batch discounts.

πŸ“Š Full LLM API Pricing & Specifications Matrix

Comprehensive reference for token rates per 1M tokens, prompt cache discounts, and context windows across major AI providers.

Model & ProviderCategoryContext WindowInput / 1MCache Hit / 1MCache WriteOutput / 1MAction
GPT-6 AstraGPT-6 Frontier Flagship
OpenAI top frontier intelligence for complex reasoning, autonomous engineering, and multimodal synthesis. Cache hits: $1.00/1M.
Flagship256k tokens$10.00$1.00$12.50$50.00
GPT-6 SolGPT-6 Production Flagship
Next-generation flagship combining premier intelligence with high inference speeds. Cache hits: $0.20/1M (90% discount).
Flagship256k tokens$2.00$0.20$2.50$10.00
GPT-6 LunaGPT-6 Ultra Cheap
Ultra-low-cost GPT-6 architecture designed for massive data processing and high-frequency agent loops.
Fast & Budget256k tokens$0.10$0.010$0.13$0.50
GPT-5.6 SolDaybreak Flagship
Daybreak flagship model for high-accuracy reasoning, knowledge retrieval, and software architecture.
Flagship200k tokens$4.00$0.40$5.00$20.00
GPT-5.6 TerraBalanced Workhorse
Balanced performance and efficiency for production enterprise workflows.
Flagship200k tokens$2.00$0.20$2.50$12.00
GPT-5.6 LunaSub-$0.50 Tier
Fast, lightweight intelligence with 90% prompt caching discount.
Fast & Budget200k tokens$0.20$0.020$0.25$1.20
GPT-5.5Advanced Reasoning
Heavyweight reasoning model with 90% prompt cache discounts.
Reasoning200k tokens$5.00$0.50Standard$30.00
GPT-5.4Production Standard
Standard foundation model delivering consistent, high-fidelity multi-domain outputs.
Flagship200k tokens$2.50$0.25Standard$15.00
GPT-5.4 miniFast & Efficient
Optimized mini model for high-throughput automated classification, RAG, and summarization.
Fast & Budget200k tokens$0.75$0.07Standard$4.50
GPT-5.4 nanoNano Tier
Ultra-low-latency nano model for edge routing and structured extraction.
Fast & Budget200k tokens$0.20$0.020Standard$1.25
GPT-5.3 CodexCodex SOTA
Purpose-built OpenAI Codex model for IDE autocompletion, codebase refactoring, and test generation.
Coding200k tokens$1.75$0.17Standard$14.00
GPT-5GPT-5 Baseline
Baseline GPT-5 model offering multi-step tool calling and high reasoning reliability.
Flagship200k tokens$1.25$0.13Standard$10.00
GPT-5 miniBudget GPT-5
Affordable mini tier for agent iterations and customer-facing chat applications.
Fast & Budget200k tokens$0.25$0.025Standard$2.00
GPT-5 nanoLowest OpenAI Cost
Industry-low pricing from OpenAI at 5 cents per 1M input tokens and $0.005 cache hits.
Fast & Budget200k tokens$0.05$0.005Standard$0.40
o4-miniLatest o4 Reasoning
Next-generation cost-efficient reasoning model with 75% prompt cache discount.
Reasoning200k tokens$1.10$0.28Standard$4.40
o3 (Reasoning)Deep o3 Reasoning
Advanced reasoning flagship for STEM, mathematics, logic puzzles, and multi-step verification.
Reasoning200k tokens$2.00$0.50Standard$8.00
o3-miniFast Reasoning
Cost-efficient reasoning model with adjustable reasoning effort and tool-calling support.
Reasoning200k tokens$1.10$0.55Standard$4.40
o3-proMaximum STEM Compute
Massive compute allocation for the hardest scientific and architectural reasoning challenges.
Reasoning200k tokens$20.00$20.00Standard$80.00
o1 (Reasoning)Deep Reasoning
Original reasoning frontier model for STEM and mathematical proofs.
Reasoning200k tokens$15.00$7.50Standard$60.00
GPT-4.1GPT-4.1 Refined
Refined GPT-4 architecture with 75% prompt caching savings.
Flagship128k tokens$2.00$0.50Standard$8.00
GPT-4.1 miniFast 4.1 Mini
Compact high-speed variant with $0.10 cache hits.
Fast & Budget128k tokens$0.40$0.10Standard$1.60
GPT-4oPopular Multimodal
OpenAI versatile multimodal model for text, vision, and real-time structured data.
Flagship128k tokens$2.50$1.25Standard$10.00
GPT-4o miniBudget Multimodal
Extremely popular low-cost model for everyday automation and classification.
Fast & Budget128k tokens$0.15$0.07Standard$0.60
GPT-5.6 CyberCyber Security SOTA
Daybreak cybersecurity model for vulnerability detection, code auditing, and penetration testing defense.
Coding200k tokens$12.50$1.25$15.63$75.00
Claude Fable 5.1Agentic Reasoning SOTA
For demanding reasoning and long-horizon agentic work. Cache hits: $0.25/1M (97.5% discount).
Reasoning200k tokens$10.00$0.25$12.50 / $20.00$50.00
Claude Opus 5.5Agentic Coding SOTA
For long-running agentic coding and knowledge work. Cache hits: $0.20/1M (95% discount).
Coding200k tokens$4.00$0.20$5.00 / $8.00$20.00
Claude Sonnet 5Best Intelligence & Speed
The best combination of speed and intelligence for production systems. Cache hits: $0.20/1M.
Flagship200k tokens$2.00$0.20$2.50 / $4.00$10.00
Claude Haiku 4.5Fast Near-Frontier
The fastest model with near-frontier intelligence. Cache hits: $0.10/1M (90% discount).
Fast & Budget200k tokens$1.00$0.10$1.25 / $2.00$5.00
Claude Mythos 5.1Frontier AI
Maximum capability research and advanced autonomous problem-solving foundation model.
Reasoning200k tokens$10.00$0.25$12.50 / $20.00$50.00
Claude Opus 5Heavyweight SOTA
Opus 5 foundation intelligence for complex systemic evaluation.
Flagship200k tokens$5.00$0.50$6.25 / $10.00$25.00
Claude Sonnet 4.6Coding SOTA
High-capability Sonnet 4.6 release with 90% prompt caching hit rate.
Coding200k tokens$3.00$0.30$3.75 / $6.00$15.00
Claude 3.7 SonnetHybrid Extended Thinking
Hybrid reasoning & coding flagship with configurable extended thinking budgets.
Reasoning200k tokens$3.00$0.30$3.75 / $6.00$15.00
Gemini 3.8 FlashLatest SOTA Flash
Most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and enterprise workflows. Includes thinking tokens.
Flagship1.0M tokens$0.75$0.07Standard$3.75
Gemini 3.7 FlashCoding & Agents
High-speed, efficient Flash model built for everyday coding, agentic tool use, and reliable multi-step execution.
Coding1.0M tokens$0.75$0.07Standard$3.75
Gemini 3.1 Pro (Preview)3rd Gen Pro Frontier
3rd generation Pro model, built for multimodal understanding, agentic capabilities, and vibe-coding with 2,097,152 token window.
Flagship2.1M tokens$2.00$0.20Standard$12.00
Gemini 3.5 Flash-LiteHigh-Volume Agentic
Cost-efficient model optimized for high-volume agentic tasks, translation, and simple data processing.
Fast & Budget1.0M tokens$0.30$0.030Standard$2.50
Gemini 3.1 Flash-LiteUltra Cheap
Ultra-low-cost model optimized for high-throughput batch extraction and agent loops.
Fast & Budget1.0M tokens$0.25$0.025Standard$1.50
Gemini 3.6 FlashMultimodal Flash
Balanced speed and multimodal capabilities across general agentic and everyday tasks.
Fast & Budget1.0M tokens$0.75$0.07Standard$3.75
Gemini 3.5 FlashFoundational Flash
Built for speed and foundational performance across routine, high-throughput workloads.
Fast & Budget1.0M tokens$1.50$0.15Standard$9.00
Gemini 3.8 Live (Voice/Audio)Live Audio & Speech
Low-latency, audio-to-audio model optimized for real-time voice agents and live dialogue with background reasoning.
Reasoning1.0M tokens$0.75$0.07Standard$4.50
Gemini 2.5 ProReasoning & Code
A Pro model which excels at coding and complex reasoning tasks with a massive 2M token context window.
Reasoning2.1M tokens$1.25$0.13Standard$10.00
Gemini 2.5 FlashHybrid Reasoning
First hybrid reasoning model which supports a 1M token context window and configurable thinking budgets.
Reasoning1.0M tokens$0.30$0.030Standard$2.50
Gemini 2.5 Flash-LiteSub-$0.50 Flash
A small and cost effective model, built for at-scale usage with 1M context support.
Fast & Budget1.0M tokens$0.10$0.010Standard$0.40
Gemini 2.5 Computer UseComputer Use Agent
Optimized for building browser control agents, desktop GUI automation, and web scraping agents.
Coding1.0M tokens$1.25$0.13Standard$10.00
DeepSeek V3Rock-Bottom Cost
671B parameter MoE architecture with frontier capability at industry-low token prices.
Fast & Budget64k tokens$0.14$0.014Standard$0.28
DeepSeek R1Open Reasoning SOTA
Open-weights reasoning model with full visible chain-of-thought matching OpenAI o1.
Reasoning64k tokens$0.55$0.14Standard$2.19
Grok 2xAI Flagship
xAI flagship model with strong general reasoning and live web retrieval abilities.
Flagship128k tokens$2.00$1.00Standard$10.00
Grok 2 VisionVision
High-resolution vision model for document OCR, technical charts, and visual reasoning.
Flagship128k tokens$2.00$1.00Standard$10.00
Grok Fast / MiniFast Latency
Low-latency Grok architecture designed for quick responses and agent loop iterations.
Fast & Budget128k tokens$0.20$0.10Standard$0.50
Mistral Large 2Multilingual SOTA
Top-tier enterprise reasoning, multi-language fluency, and strong function calling.
Flagship128k tokens$2.00$0.50Standard$6.00
Codestral 256k256k Code SOTA
Purpose-built generative coding model supporting 80+ programming languages and 256k context.
Coding256k tokens$0.30$0.030Standard$0.90
Mistral Small 3Low Latency
High performance small footprint model with rapid inference and low costs.
Fast & Budget128k tokens$0.10$0.020Standard$0.30
Llama 3.3 70B (Groq/Hosted)Open Weights
Meta premier open-weights 70B model delivering 405B-class performance at fraction of cost.
Open Weights128k tokens$0.59$0.59Standard$0.79
Llama 3.1 405B (Hosted)405B Heavyweight
Massive open foundation model for complex synthetic data generation and distillation.
Open Weights128k tokens$2.00$2.00Standard$2.00
Qwen 2.5 Coder 32BOpen Code SOTA
Alibaba open code powerhouse matching GPT-4o in coding benchmarks at budget rates.
Coding128k tokens$0.20$0.10Standard$0.60
πŸ’‘ Prompt Caching Discounts: OpenAI GPT-6 & GPT-5 (up to 90% cache hits, $0.005–$0.20/1M), Claude 5 & 4 (up to 97.5% hit savings), Google Gemini 3 (90% discount, $0.075/1M), DeepSeek (90%).Showing 55 of 55 models

Why Client-Side Token Counting & Cost Analysis Matters for AI Engineers

In modern generative AI workflows and production agent architectures, context management and inference economics are critical. Every token sent to proprietary foundation models incurs costs, consumes finite context windows, and impacts overall response latency. Calculating exact token density and simulating prompt cache discounts before making live API calls ensures your systems operate reliably without budget overruns, truncation failures, or rate-limit throttles.

Supported AI Providers & Model Architectures

Frequently Asked Questions

How does this token counter estimate token counts for different LLMs?

Our token calculator uses model-specific Byte-Pair Encoding (BPE) ratio algorithms for OpenAI (GPT-6 Astra/Sol/Luna, GPT-5.6, GPT-5, o4-mini, o3, o1), Anthropic (Claude Fable 5.1, Opus 5.5, Sonnet 5, Haiku 4.5, Mythos 5.1, Claude 3.7/3.5), Google (Gemini 3.8 Flash, 3.7 Flash, 3.1 Pro, Gemini 2.5 Pro/Flash), DeepSeek (DeepSeek V3, DeepSeek R1), xAI (Grok 2), Mistral AI (Mistral Large, Codestral), and Meta/Open-Source (Llama 3.3, Qwen 2.5 Coder). It analyzes whitespace, punctuation density, alphanumeric characters, and code indentation to provide highly accurate token estimations.

What are the latest OpenAI GPT-6, GPT-5, and o-series pricing rates?

Under the official OpenAI API pricing, flagship GPT-6 Sol is $2.00 / 1M input and $10.00 / 1M output (cache hit: $0.20), GPT-6 Astra is $10.00 in / $50.00 out (cache hit: $1.00), and GPT-6 Luna is $0.10 in / $0.50 out (cache hit: $0.01). GPT-5 nano starts at just $0.05 / 1M tokens ($0.005 cache hit). Reasoning models include o4-mini ($1.10 in / $4.40 out, 75% cache discount at $0.275), o3 ($2.00 in / $8.00 out), and o3-pro ($20.00 in / $80.00 out). Web search tool calls cost $10/1k calls.

What are the latest Anthropic Claude 5 and Claude 4 pricing and prompt caching rates?

Under the official Anthropic API pricing, Claude Sonnet 5 is $2.00 / 1M input and $10.00 / 1M output, with cache hits costing just $0.20 / 1M (90% discount). Claude Opus 5.5 is $4.00 in / $20.00 out (cache hit: $0.20), Claude Haiku 4.5 is $1.00 in / $5.00 out (cache hit: $0.10), and Claude Fable 5.1 is $10.00 in / $50.00 out (cache hit: $0.25). 5-minute cache writes add +25% and 1-hour cache writes add +100% to input base costs.

What are the latest Google Gemini 3.8 Flash and Gemini 3.x API pricing rates?

Under the official Google Developer API pricing, Gemini 3.8 Flash and Gemini 3.7 Flash are priced at $0.75 per 1M input tokens and $3.75 per 1M output tokens (including thinking tokens) through December 31, 2026 ($1.50 / $7.50 starting January 1, 2027). Context caching is priced at $0.075 per 1M tokens ($0.15 in 2027) with a storage fee of $0.50/1M tokens/hour. Gemini 3.5 Flash-Lite is $0.30 in / $2.50 out, while Gemini 3.1 Pro Preview with a 2M token context window is $2.00 in / $12.00 out (for prompts <= 200k tokens).

How does prompt caching affect API costs across providers?

Leading AI providers offer substantial prompt caching discounts (50% to 97.5% cheaper than standard input token rates) when repeatedly sending identical system prompts, tool schemas, or large RAG context documents. OpenAI offers 90% cache discounts on GPT-6 ($0.01–$0.20/1M), Anthropic offers up to 97.5% discount on cache hits ($0.10–$0.25/1M), Google Gemini 3.8 offers a 90% discount ($0.075/1M vs $0.75), DeepSeek offers 90% ($0.014/1M on V3), and Mistral offers up to 90% ($0.03/1M on Codestral). Toggling 'Prompt Cache Pricing' computes your exact discounted cost.

How do reasoning models like o4-mini, o3, Claude Fable 5.1, and DeepSeek R1 charge for tokens?

Reasoning models generate internal chain-of-thought (thinking) tokens before outputting their final answer. Although thinking tokens may be hidden or collapsed in chat user interfaces, providers bill them at standard output token rates. When estimating budgets for complex reasoning tasks, allocate additional expected completion tokens (typically 1,500 to 4,000+ tokens) to account for reasoning steps.

Which models support 1M to 2M ultra-long context windows?

Google leads in long-context capabilities with Gemini 3.1 Pro Preview and Gemini 2.5 Pro (2,097,152 tokens), and Gemini 3.8 Flash, 3.7 Flash, and 2.5 Flash (1,048,576 tokens). Mistral's Codestral supports 256,000 tokens for massive codebases, OpenAI GPT-6 (Astra, Sol, Luna) supports 256,000 tokens, while Anthropic Claude (Sonnet 5, Opus 5.5, Fable 5.1) supports 200,000 token context windows.

Are my proprietary prompts and API keys uploaded to any server?

No! All token calculations, character analyses, and cost estimations execute 100% locally in your browser memory via client-side JavaScript. Your confidential prompts, sensitive datasets, and code snippets are never transmitted over the internet.