Formula: Coding Assistant API Cost Calculator
- Inputs: All units, rates, and allowances are entered by the user.
Rounding: Displayed values are rounded for readability; package and item quantities round upward.
Forecast code-assistant token spend by developer seat.
Rounding: Displayed values are rounded for readability; package and item quantities round upward.
It is input and output tokens added together for the whole month. In the default, 2,640 sessions generate 39,600,000 modeled tokens: 31.68 million input and 7.92 million output. Cached input is still counted in that total, because caching changes the price of a token, not the number sent. Compare this figure with the token totals on your provider's usage report.
Only if you put them into input tokens per session. Coding tools usually send hidden instructions, tool schemas and file context with every request, and the provider bills all of it as input. Those hidden parts can be several thousand tokens on their own. If you measure input from what developers type, the estimate will be far too low.
It depends on whether the tool reuses a stable prefix, such as the same system prompt and repository context, across turns. Long conversations with a fixed prefix cache well; one-off completions with changing context cache poorly. There is no universal figure, so the 40% default is a placeholder. Your provider's usage report usually shows cached and uncached input separately, which gives you the real share.
The page accepts it, and it then charges cached tokens more than normal input. That can stand in for a provider that charges a premium to write context into the cache, but it applies the premium to every cached token, not just the first write. For a careful estimate, price cache writes separately and keep this field for the read price.
Enter the days the assistant is actually used. The default of 22 matches a five-day week. If developers rarely use it on Fridays, or if a scheduled job runs reviews every day of the month, change it. In the default setup, going from 22 to 30 days adds $41.47 to the monthly cost because the formula scales directly with days.
Common reasons are hidden context counted as input, agent loops making several calls per visible session, retries after errors, and cache writes that this page does not price. Different models used for different tasks also matter, since the page uses one rate pair. Compare the invoice's token totals with the modeled tokens line to see which side is off.
Run the page once for each model with the share of sessions that goes to it, then add the totals. For example, split the ten default developers into two groups or reduce sessions per developer to the share each model gets. The page uses a single input rate and output rate, so mixing models inside one run is not possible.
No. The formula counts only token charges: sessions times tokens times rates. A flat per-seat plan, a platform fee or a minimum monthly commitment has to be added on top. The per-seat token cost from the default, about $11.40, is useful for comparing usage billing against a flat plan, but the plan's own terms decide which is cheaper.
The page rejects it and asks for a percentage of input tokens from 0 to 100, because more input cannot be cached than was sent. A share of exactly 100 means every input token is billed at the cached rate. On the default rates that brings the month down to $95.04, the lowest the cache fields can take it at a fraction of 0.5.
It is everything the model generates, which includes code, explanations and, for some models, internal reasoning tokens billed as output, depending on how the provider counts them. A short visible answer can carry a much longer billed output. If your model bills reasoning, the usage log is the only reliable source for this field, and it can easily exceed the default of 3,000 tokens.
Start with the default team. Ten developers each open 12 assistant sessions a day for 22 working days. That is 2,640 sessions in the month, the first figure in the result line.
Each session is assumed to send 12,000 input tokens and get 3,000 output tokens back. Multiply through and the team moves 31.68 million input tokens and 7.92 million output tokens, which is the 39.6 million modeled tokens the page reports. At an input rate of 2 and an output rate of 8 per million tokens, with 40% of input billed at half price, the month comes to $114.05.
Split that total and the shape of the bill becomes clearer. Output costs $63.36. Uncached input costs about $38.02. Cached input costs about $12.67. Output is only a fifth of the tokens but more than half of the money, because its rate is four times the input rate.
Two other ways to read the same number are often more useful than the monthly total. Per seat, $114.05 across ten people is about $11.40 a developer. Per session it is a little over four cents. A per-session figure is the one to compare against how much time a session saves, and the per-seat figure is the one to compare against a flat subscription if your team is weighing both.
Developers, sessions per day and work days are simply multiplied together. Nothing else in the formula depends on them, so the cost moves in exact proportion. Six seats gives 1,584 sessions and $68.43. Fifteen seats gives 3,960 sessions and $171.07. Each seat adds the same $11.40 or so.
That straight line is the honest model for token billing: there is no volume discount in the formula and no fixed platform fee. If your provider offers tiered or committed-use pricing, the real curve bends at some point and this page will overstate the larger team. If you pay a fixed amount per seat on top of usage, add that separately, because there is no field for it.
Work days are the input people forget to change. The default of 22 assumes a five-day week with no holidays. A team that uses the assistant on weekends, or an agent that runs on a schedule every day, needs 30. Moving the default to 30 days adds $41.47 to the month, which is more than three extra seats would.
Doubling output per session, from 3,000 tokens to twice that, adds $63.36 to the default $114.05 month. Doubling input from 12,000 tokens instead adds about $50.69. The input change is four times as many extra tokens, yet it costs less.
That is the rate ratio at work. In the default, a million output tokens costs 8 and a million input tokens costs 2, and part of the input is discounted further by the cache. So any habit that makes the assistant write more, such as asking for full files instead of a diff, long explanations, or several alternative versions, costs disproportionately more than sending it extra context.
Input still matters, especially for coding tools. A session often carries the open file, nearby files, the conversation so far and tool results, and that context is resent on every turn. 12,000 tokens is a modest figure for an agent that reads a repository. If you are not sure, measure a few real sessions from your provider's usage logs rather than guessing, because input per session is the number most likely to be off by a large factor.
Two fields describe caching. Cached input share is the percentage of input tokens that hit a cache. Cached input rate fraction is what a cached token costs as a fraction of the normal input rate. The default is 40% of input at 0.5 of the rate.
The formula bills uncached input at the full rate and cached input at the reduced rate. With the defaults, which produce $114.05, cached input saves about $12.67 compared with no caching at all. Turning caching off, a share of 0, raises the bill by exactly that amount. Raising the share to 80% saves the same amount again, because the saving is linear in the share.
The fraction has a similar effect. Keeping the share at 40% but setting the fraction to 0.1 cuts the default bill by about $10.14. Setting it to 1 means cached tokens cost the same as normal ones, and the result is identical to having no cache.
What the model does not include is any charge for writing to the cache. Some providers bill the first time a block of context is stored, sometimes at more than the normal input rate. If yours does, the share of input that is written rather than read should be priced separately, outside this page.
The rate fields expect a price per one million tokens. Most API pricing pages already quote prices that way, but some quote per thousand tokens. A per-thousand price has to be multiplied by a thousand before it goes in here, and missing that step makes the result a thousandth of the truth.
Look for three separate numbers on the provider's page: the input or prompt price, the output or completion price, and a cached input or cache read price. Enter the first two directly. For the cache field, divide the cached price by the normal input price to get the fraction. If cached input is listed at a tenth of the normal input price, enter 0.1.
Check which model and which tier the price belongs to. Pricing pages often list a batch rate, a priority rate, a regional rate or a long-prompt rate next to the standard one. An interactive coding assistant usually runs at the standard interactive rate, so the batch discount does not apply to it.
The display currency only changes the symbol. Rates are entered in whatever currency the provider bills in, and the page does no conversion. If you bill in one currency and report in another, convert the rates yourself first.
A quick sanity check helps here. After entering your rates, look at the per-session cost implied by the result: the default works out to $114.05 over 2,640 sessions. If your own figure is a thousand times larger or smaller than what a single request shows in the provider's usage log, the rate unit is almost certainly wrong.
The default of 12 sessions a day is a placeholder. A session here means one request cycle with the averages you entered, so the right number depends on how your tool counts. An inline completion tool may make dozens of small requests an hour. A chat or agent tool may make a few large ones, each of which loops through several model calls.
If your tool runs an agent loop, count each model call as a session, or raise the input tokens per session to cover the whole loop. Agent turns tend to resend growing context, so a ten-step task can cost far more than ten times a single question. Treating the whole task as one 12,000 token session is the most common way this estimate comes out too low.
Usage is also uneven across a team. One heavy user can account for more tokens than several light ones. Averages are fine for a budget, but if you set a per-seat limit from this page, set it from the busy end of the team, not the middle.
Once you have a better session count, the arithmetic is simple to adjust by hand. In the default, 2,640 sessions cost $114.05, so each extra session a day per developer across ten people and 22 days adds roughly a twelfth to the bill. That is a useful way to explain to a team lead why a small change in habits shows up clearly on the invoice.
A reasonable way to use the default result is as a floor. $114.05 is what ten developers cost if every input matches the averages exactly. Real months vary with release cycles, onboarding and large refactors, and a refactor that sends whole directories to the model can blow past the input average for days.
Run the page three times: once with your measured averages, once with input and output doubled, and once with caching switched off. The spread between those runs is a better guide to the budget alert you need than the single default number.
Then compare the per-session cost with what the time is worth. At a little over four cents a session, the question is rarely whether a single session pays for itself. It is whether usage stays near the modeled level once people get used to the tool, which is why measuring again after the first month matters more than refining the first estimate.