[guide]
AI API Cost Guide
AI API costs are driven by request volume, token volume, output length, cache hit rate, retries, and exchange rate. Small prototype costs can become material after product usage grows.
Core formula
Monthly requests = daily requests times 30 times retry factor. Token cost is calculated separately for regular input, cached input, and output tokens using model prices per 1M tokens.
Cost per user
Divide monthly AI API cost by paid users to estimate the AI cost embedded in each subscription. Compare that value with revenue after payment fees.
Ways to reduce cost
Reduce prompt size, cache reusable context, route simple tasks to cheaper models, cap output length, and watch retry behavior.
Limit
Provider prices change. Check the official provider pricing page before purchasing or setting customer prices.
Worked example
Consider 10,000 requests per day, 1,200 input tokens and 500 output tokens per request, a 30% cached-input
share, and a 5% retry rate. Over 30 days that becomes 315,000 requests, 378 million input tokens, and 157.5
million output tokens. Of the input total, 113.4 million tokens are cached and 264.6 million are billed as
regular input.
At $0.75 per million regular input tokens, $0.075 per million cached input tokens, and $4.50 per million
output tokens, the estimate is $915.71 per month. At 1,380 KRW per USD, that is about 1,263,673 KRW. With
1,000 paying users, AI cost is about 1,264 KRW per user, or 12.8% of a 9,900 KRW monthly price before payment
fees and other operating costs.
What to verify before using the result
Measure production tokens
Use request logs or provider usage exports when available. Prompt templates, tool results, system messages, and reasoning tokens can make a production request larger than a test prompt.
Separate cached input
Only apply a cached-input price to tokens that meet the provider's cache rules. A repeated prompt does not automatically qualify for discounted billing.
Include failed work
Retries, timeouts, moderation calls, evaluations, and background jobs may be billed even when the user never sees a successful answer.
Model the whole margin
AI cost per user is only one expense. Compare it with net revenue after payment fees, hosting, support, storage, and any minimum provider commitments.
Open the AI API cost calculator