Our Methodology
Every number on WiseCrewAI comes from a specific formula applied to weekly-verified provider data. This page documents all of them — so you can reproduce any result, spot errors, and understand the limitations.
1. Token counting
Token counts are produced by the o200k_base tokenizer (used by GPT-4o, GPT-5, and most OpenAI models). This is the gpt-tokenizer npm package running entirely in your browser — no text leaves your device.
Anthropic (Claude) and Google (Gemini) use different tokenizers that produce slightly different counts for the same text. As a rule of thumb, Claude token counts are within ±5% of the GPT count for standard English text. We use the GPT tokenizer as the practical standard because it is the most widely available open-source implementation. For production budgeting, verify with each provider's official tokenizer.
2. API cost calculation
All providers charge separately for input tokens and output tokens, denominated in USD per million tokens.
Cost = (input_tokens / 1,000,000) × P_in
+ (output_tokens / 1,000,000) × P_outPrices (P_in, P_out) are pulled from our dataset, which is verified weekly against each provider's official pricing page. Every model entry includes a last_verified date and a direct link to the source.
3. Prompt caching
Provider caching multipliers differ significantly:
Anthropic (5-min TTL): write = 1.25 × P_in, read = 0.10 × P_in Anthropic (1-hour TTL): write = 2.00 × P_in, read = 0.10 × P_in OpenAI: cached read = 0.50 × P_in (automatic, no write cost) Google: storage cost per token-hour + reduced read cost
The break-even number of calls for Anthropic 5-min caching is approximately 1.28 — meaning caching pays off from the second call onward. If the interval between calls exceeds the TTL, every call becomes a cache write and caching costs more than not caching. Our Prompt Caching Calculator surfaces this warning explicitly.
4. GPU VRAM estimation
Weights VRAM
bytes_per_param: FP32 → 4 bytes FP16/BF16 → 2 bytes Q8_0 → 1 byte Q6_K → 0.75 bytes Q5_K → 0.625 Q4_K_M → 0.5 bytes Q3_K → 0.375 Q2_K → 0.25 bytes VRAM_weights = params_billions × 1e9 × bytes_per_param
KV-cache VRAM
VRAM_kv = 2 × n_layers × n_kv_heads × head_dim
× context_length × batch_size × bytes_per_element
bytes_per_element: FP16/BF16 → 2, FP32 → 4, Q8 → 1Total with overhead
VRAM_total = (VRAM_weights + VRAM_kv) × 1.15 (15% activation + overhead)
For models where architecture details (layers, heads, head dim) are not publicly available, we use published community benchmarks and clearly label the estimate as approximate.
5. Agent / agentic loop cost
In an agentic loop, the system prompt and prior context are re-sent on every step. This causes input cost to grow quadratically with the number of steps — a fact that surprises most developers.
Let: S = system_prompt_tokens T₀ = initial_task_tokens A = avg_assistant_output_tokens (per step) R = avg_tool_result_tokens (per step) G = A + R N = number of loop steps Context at step i: I_i = S + T₀ + Σ(j=1..i-1)(A_j + R_j) Total input tokens = N·(S + T₀) + G·N·(N−1)/2 ← quadratic term Total output tokens = N · A ⚠️ Doubling N roughly quadruples input cost (the G·N²/2 term dominates).
With prompt caching on the static prefix (S + T₀):
Cached cost = (S+T₀)/1M × P_write (first step write)
+ (N−1) × (S+T₀)/1M × P_read (subsequent reads)
+ G·N·(N−1)/2 / 1M × P_in (dynamic context, uncached)
+ N·A / 1M × P_out6. GPU cloud pricing
GPU rental prices are verified weekly from provider dashboards. We track on-demand, spot, and reserved (monthly commitment) rates where available. The derived column $ per GB-VRAM-hour is computed as on_demand_per_hr / vram_gb — a normalised value not published by any provider, useful for comparing apples to apples across GPU generations.
Sources: full provider list with last-checked dates.
7. What we do not model
The following costs are real but not included in any calculator:
- Network latency and cold-start overhead for self-hosted models
- Operational cost of running and maintaining a GPU deployment (DevOps hours)
- SLA costs — cloud providers offer no uptime guarantees on spot instances
- Embedding costs when used alongside generation (RAG calculator handles this separately)
- Fine-tuning training cost amortised over inference calls (Fine-Tuning Calculator handles this)
- Taxes, egress fees, and cloud-specific markups beyond compute cost
If you find an error in any formula or a price that is out of date, email contact@wisecrewai.com — corrections are published to the changelog within 48 hours.