Published 2026-05-21 · NextModel Research

The four variables that drive AI API cost

AI API cost is usually a simple multiplication problem before it becomes an operations problem. Estimate average input tokens, average output tokens, request count, and the model's input/output price per 1M tokens. Then repeat the calculation for a low-cost model and a high-quality model so product owners can see the tradeoff.

VariableExample
Input tokens1,000,000
Output tokens1,000,000
Requests1
Doubao estimate¥2.20

Use the same formula in code

The pricing API returns the same estimate used by the calculator, so teams can build internal planning tools without duplicating price tables.

curl
curl https://nextmodel.app/api/pricing/estimate \
  -H "Content-Type: application/json" \
  -d '{"model":"doubao-seed-2-0-mini","input_tokens":1000000,"output_tokens":1000000,"requests":1}'