📐 Mathematical Formula & Derivation
C_{month} = 30 \times R_{day} \times \left[ \frac{T_{in} (1 - r_{cache}) P_{in} + (T_{in} \cdot r_{cache} \cdot 0.25 P_{in}) + (T_{out} \cdot P_{out})}{10^6} \right] 🔬 Engineering Methodology & Benchmark Analysis
In production AI applications, output tokens are typically billed at 3x to 5x the rate of input tokens because autoregressive decoding is memory-bandwidth bound.
However, most RAG and agentic workflows resend identical system instructions, tool definitions, and document context on every turn. Enabling Prompt Caching reduces cached input token fees by up to 75%–90%.
Use this simulator to model both uncached baseline costs and cached production unit economics before committing to a model tier.
🛠️ Step-by-Step Engineering Calculation Guide
- Daily API Requests / Prompts: Configure "Daily API Requests / Prompts" (default benchmark: 5000) or select an industry preset.
- Average Input Tokens per Request (System + Context): Configure "Average Input Tokens per Request (System + Context)" (default benchmark: 2500) or select an industry preset.
- Average Output Tokens per Request (Completion): Configure "Average Output Tokens per Request (Completion)" (default benchmark: 600) or select an industry preset.
- Model Pricing Tier (USD per 1M Input / Output): Configure "Model Pricing Tier (USD per 1M Input / Output)" (default benchmark: 1) or select an industry preset.
- Prompt Cache Hit Ratio (%): Configure "Prompt Cache Hit Ratio (%)" (default benchmark: 50) or select an industry preset.