GUIDE深度 · Deep dive

How to Calculate LLM Cost

LLM cost is not a price per million tokens. Input vs output, cache hit rate, retries, tool calls, embeddings and fine-tuning change true cost; use real requests for per-user margin.

更新 2026-11-01 · 公式可核验

Formula

Per-call cost = input tokens x input price + output tokens x output price + extras.

Monthly cost = requests x average cost + fixed/platform fees.

Margin = revenue - monthly cost; split by user/task.

Often missed

Retries and failures consume tokens.

Tool calls/long context amplify input.

Cache hit rate is not 100%.

FAQ

Why is output more expensive?

Most providers price output tokens higher than input; long answers add cost.

How do I reduce cost?

Shorten context, cache, batch, choose the right model, cap retries and output length.

Sources

More guides

LLM Production Cost ChecklistRead guide
KEEP READING

继续读

按顺序读,或跳到同主题的其他指南。

全部指南 →

None