WP Webhooks/ Tools/ AI cost calculator
Tools

AI Cost Calculator for LLM API Calls

Set the token size of a real request, pick a model, and see what it actually costs — per call, per month, per year.

Rates verified / 36 models / 6 providers
cost = (input_tokens × input_rate + output_tokens × output_rate) ÷ 1,000,000
4,700

$0.00705 — the prompt, system message and tool schemas you send.

390

$0.00293 — billed at 5.0× the input rate on this model. Reasoning tokens count here.

n/a

Google does not publish a flat cache-hit rate for this model.

10,000
Input cost
$0.00705
Output cost
$0.00293
Per-call cost
$0.00997
Output is 7.7% of the tokens but 29% of the cost.
Per month
$99.75
Per year
$1,197
If you resell this as credits

weighted = 4,700 + 5.0 × 390 = 6,650

7 credits at 1,000 weighted tokens each

One credit backs $0.00142 of spend on this model, for any input/output mix.

Cheapest for this call is gpt-5-nano at $0.00039 — 25.5× less than your pick. Over a year that is $1,150 of difference.

The same call, every model

4,700 input and 390 output tokens priced against all 36 models. Cheapest to most expensive — a 540× spread for identical work.

#ModelProviderPer callPer yearvs cheapest
1gpt-5-nanoOpenAI$0.00039$46.92
2GLM-4.7-FlashXZ.ai$0.00049$58.201.2×
3deepseek-v4-flashDeepSeek$0.00077$92.062.0×
4GLM-4.5-AirZ.ai$0.00137$164.283.5×
5gpt-5.4-nanoOpenAI$0.00143$171.303.7×
6Gemini 3.1 Flash-LiteGoogle$0.00176$211.204.5×
7gpt-5-miniOpenAI$0.00196$234.605.0×
8deepseek-v4-proDeepSeek$0.00238$286.066.1×
9Gemini 3.5 Flash-LiteGoogle$0.00238$286.206.1×
10GLM-4.7Z.ai$0.00368$441.369.4×
11gpt-5.4-miniOpenAI$0.00528$633.6013.5×
12GLM-5Z.ai$0.00595$713.7615.2×
13Claude Haiku 4.5Anthropic$0.00665$798.0017.0×
14gpt-5.6-lunaOpenAI$0.00704$844.8018.0×
15GLM-5-TurboZ.ai$0.0072$864.0018.4×
16GLM-5.2Z.ai$0.0083$995.5221.2×
17gpt-5OpenAI$0.00977$1,17325.0×
18gpt-5.1OpenAI$0.00977$1,17325.0×
19Gemini 3.6 FlashGoogle$0.00997$1,19725.5×
20Gemini 3.5 FlashGoogle$0.0106$1,26727.0×
21Claude Sonnet 5 (intro)Anthropic$0.0133$1,59634.0×
22gpt-5.2OpenAI$0.0137$1,64235.0×
23Gemini 3.1 ProGoogle$0.0141$1,69036.0×
24gpt-5.4OpenAI$0.0176$2,11245.0×
25gpt-5.6-terraOpenAI$0.0176$2,11245.0×
26Claude Sonnet 5 (standard)Anthropic$0.0199$2,39451.0×
27Kimi K3Moonshot$0.0199$2,39451.0×
28Claude Opus 5Anthropic$0.0333$3,99085.0×
29gpt-5.5premiumOpenAI$0.0352$4,22490.0×
30gpt-5.6-solpremiumOpenAI$0.0352$4,22490.0×
31Claude Fable 5premiumAnthropic$0.0665$7,980170.1×
32Claude Mythos 5premiumAnthropic$0.0665$7,980170.1×
33gpt-5-propremiumOpenAI$0.1173$14,076300.0×
34gpt-5.2-propremiumOpenAI$0.1642$19,706420.0×
35gpt-5.4-propremiumOpenAI$0.2112$25,344540.2×
36gpt-5.5-propremiumOpenAI$0.2112$25,344540.2×

How to read this. Rates are per million tokens, taken from each provider's own documentation on 2026-07-29. Published pricing changes often — check the source before you budget against it.

  • The default 4,700 / 390 split is a planning or tool-calling request: a large prompt, a short structured answer. Chat workloads invert it, which changes the ranking.
  • Cached input is only applied to models whose provider publishes a flat cache-hit rate. The rest ignore the slider rather than guess.
  • Batch APIs on OpenAI, Google and Anthropic discount both directions by 50% — halve any figure here if the work is not interactive.

The reasoning behind the credit formula, the output-weight ratios, and where each rate came from is written up in what an AI feature actually costs per call.

FAQ

Questions about AI pricing.

Rates come from each provider's own documentation — the full write-up is in the LLM cost article.

How do you calculate the cost of an LLM API call? +
Multiply input tokens by the model input rate, output tokens by the output rate, and divide by 1,000,000. On Gemini 3.6 Flash ($1.50 in / $7.50 out) a 4,700-input, 390-output call is (4,700 × 1.50 + 390 × 7.50) ÷ 1,000,000 = $0.00998. Every provider bills in exactly that shape, so the only hard part is knowing your real token size.
Why does the calculator default to 4,700 input and 390 output tokens? +
That is a measured production request for a planning or tool-calling task: a large system prompt plus tool schemas going in, a short structured decision coming back. It is deliberately not a chat workload, which inverts the ratio and changes which model is cheapest. Move the sliders to match your own traffic — and expect real calls to run 1.5 to 2 times larger than a thin test sample.
Why are output tokens more expensive than input tokens? +
Generating tokens is sequential, while input can be processed in parallel, and providers price accordingly. The ratio is typically 5× on Anthropic, Google Flash and Kimi K3, 6–8× across the OpenAI GPT-5 line, and 2× on DeepSeek V4. Because reasoning tokens are billed as output, a model that always thinks can cost more than its visible answer suggests.
Why is the cached-input slider disabled for some models? +
Because that provider does not publish a flat per-token cache-hit rate. OpenAI, Anthropic, Moonshot and DeepSeek do, so the slider applies their real discount — typically 0.1× the base input rate, and as low as 0.02× on DeepSeek. For Google and Z.ai models the slider is disabled rather than guessing a number that would make the result wrong.
Which LLM API is the cheapest? +
At the default call size, gpt-5-nano ($0.05 / $0.40 per million) and GLM-4.7-FlashX ($0.07 / $0.40) are the cheapest paid options, with DeepSeek V4 Flash ($0.14 / $0.28) close behind. Cheapest only matters if quality holds for your task, so A/B a candidate on real requests before switching. Note that model naming is not a price guide: Kimi K3 costs the same per call as Claude Sonnet 5 at standard pricing.
How should I charge credits if I resell AI usage? +
Charge from the token counts the provider returns, not a flat price per request, because a flat rate always undercharges your largest calls. Weight output tokens by the model output-to-input price ratio, divide by a fixed tokens-per-credit constant, and settle after the call succeeds. One credit then backs a fixed amount of provider cost for any input/output mix.
How current are these prices? +
Every rate was read from the provider's own documentation on 29 July 2026 — never from aggregator sites, which drift. Published pricing changes often, and introductory rates expire: Claude Sonnet 5 moves from $2/$10 to $3/$15 on 1 September 2026. Verify against the provider before you budget against any figure here.
Ready

Your next automation is
one sentence away.

$ wp plugin install flowsystems-webhook-actions --activate