Forecasting AI spend 12 months ahead: a driver model and three scenarios, not a curve
Whoever asks you how much AI will cost next year does not want a number: they want to know within what range the budget must stay and what would push it out. A spreadsheet with the last six invoices and a straight line drawn forward answers with false precision, because AI spend is not a series that extends itself: it depends on four quantities that you can observe and discuss separately (users, requests per user, tokens per request, price per token) and it is moved by events that no curve knows about, such as the launch of a feature or a change in a price list. This article builds the method in five listings that were run: a driver model, three forecasting methods checked with a retrospective test, three scenarios, an honest measure of which driver matters most, and a monthly check with thresholds. The series and the prices are invented; the results serve as an illustration of the method and not as forecasts.
It is the fourth article of the series. It rests on the map of the cost items, on the methods for reducing tokens (which move two drivers) and on the comparison between your own server and an API (which moves the third). The day-by-day control within the month, with burndown and anomalies, is the subject of the article on monthly cost forecasting; tracking per function is in the article on tracking architecture.
The four-driver model
The monthly cost of a pay-per-use AI feature is the product of four factors: active users, requests per user per day, tokens per request (input and output together) and average price per million tokens, where the price is the weighted average of the models in use. Writing the formula has a practical value: each driver has a different owner, a different unit of measure and a different way of changing, so it is projected separately. Users follow the growth of the product, requests per user settle after onboarding, tokens go down with the techniques of article 2, the price changes with the choice of models. The first listing builds the model and moves one driver at a time by 20%.
# Monthly cost as the product of four drivers. INVENTED figures.
from dataclasses import dataclass, replace
@dataclass(frozen=True)
class Drivers:
active_users: float
requests_user_day: float
tokens_request: float
eur_per_mtok: float # weighted average price of the models in use
def monthly_cost(self):
tokens_month = self.active_users * self.requests_user_day * 30 * self.tokens_request
return tokens_month / 1_000_000 * self.eur_per_mtok
def average_price(expensive_share, cheap=0.50, expensive=6.00):
return (1 - expensive_share) * cheap + expensive_share * expensive
base = Drivers(1000, 2.0, 1200, average_price(0.20))
c0 = base.monthly_cost()
print(f"base: {c0:.2f} EUR/month (average price {base.eur_per_mtok:.2f} EUR/Mtok)")
for name in ("active_users", "requests_user_day", "tokens_request"):
c = replace(base, **{name: getattr(base, name) * 1.2}).monthly_cost()
print(f"{name:24s} +20% -> cost {c / c0 - 1:+.1%}")
c = replace(base, eur_per_mtok=average_price(0.30)).monthly_cost()
print(f"expensive model share 20% -> 30%: average price +{average_price(0.30) / average_price(0.20) - 1:.1%}, cost {c / c0 - 1:+.1%}")
# Output:
# base: 115.20 EUR/month (average price 1.60 EUR/Mtok)
# active_users +20% -> cost +20.0%
# requests_user_day +20% -> cost +20.0%
# tokens_request +20% -> cost +20.0%
# expensive model share 20% -> 30%: average price +34.4%, cost +34.4%
The listing uses an immutable dataclass (frozen=True) and replace to derive variants without modifying the original. The result shows a property of the product: each of the three volume drivers, increased by 20%, increases the cost by 20%, no more and no less. The fourth driver holds a surprise. If the share of requests that goes to the expensive model moves from 20% to 30%, the average price rises by 34.4%, and the cost with it: a change of ten points of «mix» weighs more than +20% of users. This is why the average price must be modeled as a mix and the share of each model must be tracked: the drift toward the expensive model shows up in the bill only afterwards.
Three forecasting methods and a retrospective test
Many methods exist to project cost from its history; the way to choose is to try them on the past. The standard procedure for time series is rolling-origin evaluation: you train on an initial part of the series, forecast a short horizon, compare with what happened, then move the origin forward and repeat; the mean error is the average over all origins. It is described in the chapter on time series cross-validation in Hyndman's online textbook, Forecasting: Principles and Practice. The second listing applies it to an invented series of twelve monthly costs, with a jump at the seventh month (the launch of a feature), and to three elementary methods: the last value, the linear trend and the recent compound growth.
# Three simple methods compared with a rolling-origin check.
# INVENTED series of monthly costs: at month 7 a new feature is launched.
import statistics as st
COSTS = [310, 335, 352, 380, 402, 431, 640, 668, 690, 721, 748, 783]
def last_value(h, k):
return [h[-1]] * k
def linear_trend(h, k):
slope, intercept = st.linear_regression(range(len(h)), h)
return [intercept + slope * (len(h) + i) for i in range(k)]
def compound_growth(h, k, window=3):
g = (h[-1] / h[-1 - window]) ** (1 / window) - 1 # recent average monthly growth
return [h[-1] * (1 + g) ** (i + 1) for i in range(k)]
METHODS = {"last value": last_value, "linear trend": linear_trend,
"compound growth": compound_growth}
def mape(actual, predicted):
return sum(abs(r - p) / r for r, p in zip(actual, predicted)) / len(actual)
HORIZON = 3
print("3-month MAPE by origin (months of history available)")
means = {name: [] for name in METHODS}
for origin in range(6, 10):
row = []
for name, f in METHODS.items():
e = mape(COSTS[origin:origin + HORIZON], f(COSTS[:origin], HORIZON))
means[name].append(e)
row.append(f"{name} {e:5.1%}")
print(f" origin {origin}: " + " | ".join(row))
print("mean: " + " | ".join(f"{n} {sum(v) / len(v):5.1%}" for n, v in means.items()))
print("12-month forecast from the last data point:")
for name, f in METHODS.items():
print(f" {name:18s} {f(COSTS, 12)[-1]:7.0f} EUR/month")
# Output:
# 3-month MAPE by origin (months of history available)
# origin 6: last value 35.2% | linear trend 28.6% | compound growth 25.9%
# origin 7: last value 7.6% | linear trend 9.6% | compound growth 31.6%
# origin 8: last value 7.1% | linear trend 2.1% | compound growth 31.0%
# origin 9: last value 8.0% | linear trend 4.1% | compound growth 26.4%
# mean: last value 14.5% | linear trend 11.1% | compound growth 28.7%
# 12-month forecast from the last data point:
# last value 783 EUR/month
# linear trend 1399 EUR/month
# compound growth 1298 EUR/month
Three things can be read in the output. At the first origin (six months of history) all three methods are wrong by 26-35%, because the jump of the seventh month was not in the data and no method could know it. At the following origins the linear trend and the last value settle below 10%, while compound growth stays around 30%, because it extrapolates the rate of the jump as if it were normal growth. Finally, at twelve months the three methods say 783, 1,298 and 1,399 euros a month: the difference between the methods is larger than the error of each, and that is why a single number is not enough. The mean error (11.1% for the linear trend) holds for this series and for this horizon: it is not a «typical» accuracy you can reuse elsewhere.
Tools such as Prophet or ARIMA are capable of doing better, but I did not run them here and they must be chosen with care. Prophet's documentation says the method works best with series that have strong seasonal effects and several seasons of history, and that its uncertainty intervals assume that future trend changes will have the same frequency and magnitude as those observed in the past. With twelve monthly points and a single jump there are no seasons to learn: a simple method, tried with the procedure above, is a more defensible choice than a sophisticated one on the little data you have.
Three scenarios from the observed growth
A budget is approved on a range. The simplest way to build it is to compute the observed monthly growth rates of a driver, take the minimum, the median and the maximum as cautious, median and optimistic scenarios, and propagate them through the model. The third listing does it for users, with an invented average revenue per user to compute the share of cost over revenue.
# Three scenarios from the historical growth of users. INVENTED figures.
import statistics as st
USERS = [800, 860, 925, 990, 1060, 1150, 1240, 1330, 1420, 1500, 1590, 1690]
REQUESTS, TOKENS, EUR_MTOK, ARPU = 2.0, 1200, 1.60, 3.50 # per user per month: ARPU = average revenue
growths = [b / a - 1 for a, b in zip(USERS, USERS[1:])]
SCENARIOS = {"cautious": min(growths), "median": st.median(growths), "optimistic": max(growths)}
print(f"{len(growths)} observed monthly growth rates, from {min(growths):.1%} to {max(growths):.1%}")
def cost(users):
return users * REQUESTS * 30 * TOKENS / 1_000_000 * EUR_MTOK
for name, g in SCENARIOS.items():
u12 = USERS[-1] * (1 + g) ** 12
print(f"{name:10s} growth {g:5.1%}/month -> users at 12 months {u12:6.0f}, "
f"cost {cost(u12):6.0f} EUR/month, {cost(u12) / (u12 * ARPU):5.1%} of revenue")
# The share of revenue does not move because cost and revenue both grow with users.
# To see it change you have to move another driver: tokens per request +2% per month (assumption).
u12 = USERS[-1] * (1 + SCENARIOS["optimistic"]) ** 12
c = cost(u12) * 1.02 ** 12
print(f"optimistic with tokens +2%/month: cost {c:6.0f} EUR/month, {c / (u12 * ARPU):5.1%} of revenue")
# Output:
# 11 observed monthly growth rates, from 5.6% to 8.5%
# cautious growth 5.6%/month -> users at 12 months 3262, cost 376 EUR/month, 3.3% of revenue
# median growth 7.1%/month -> users at 12 months 3836, cost 442 EUR/month, 3.3% of revenue
# optimistic growth 8.5%/month -> users at 12 months 4494, cost 518 EUR/month, 3.3% of revenue
# optimistic with tokens +2%/month: cost 657 EUR/month, 4.2% of revenue
With eleven observed growth rates between 5.6% and 8.5% a month, at twelve months users range from 3,262 to 4,494 and the cost from 376 to 518 euros a month. The share of revenue stays at 3.3% everywhere, and that is informative: if cost and revenue both grow with users, growth alone does not change the share. It changes when another driver moves, as in the last row (tokens per request rising 2% a month), where the share goes up to 4.2%. The scenarios that matter for the budget are therefore the ones that combine several drivers, not the ones that vary only users. A warning about the numbers: with eleven observations the minimum and the maximum are not the 5th and 95th percentile of a distribution, they are two cases. Calling them a «confidence interval» would be an exaggeration.
Which driver matters most: it depends on how uncertain it is
A frequent question is which driver to optimize first. The fourth listing tackles it with a fixed-seed Monte Carlo simulation: it samples each driver within a range and computes how much of the variation of the logarithm of the cost is explained by each one. The logarithm is used because the cost is a product; in the logarithm the drivers add up and the shares read as percentages.
# Which driver moves the cost the most? It depends on how uncertain each one is, not on the formula.
import math, random, statistics as st
def variance_share(ranges, n=20_000, seed=5):
rng = random.Random(seed)
samples = {k: [rng.uniform(1 - w, 1 + w) for _ in range(n)] for k, w in ranges.items()}
log_cost = [sum(math.log(samples[k][i]) for k in ranges) for i in range(n)]
r2 = {k: st.correlation([math.log(x) for x in samples[k]], log_cost) ** 2 for k in ranges}
return r2
EQUAL = {"users": 0.30, "requests": 0.30, "tokens": 0.30, "price": 0.30}
REALISTIC = {"users": 0.40, "requests": 0.15, "tokens": 0.30, "price": 0.10} # illustrative ranges
for name, ranges in (("equal uncertainty (+-30% for all)", EQUAL), ("different uncertainties", REALISTIC)):
print(name)
for k, v in sorted(variance_share(ranges).items(), key=lambda kv: -kv[1]):
print(f" {k:10s} +-{ranges[k]:.0%} share of the variance of the log of the cost: {v:5.1%}")
# Output:
# equal uncertainty (+-30% for all)
# price +-30% share of the variance of the log of the cost: 25.2%
# tokens +-30% share of the variance of the log of the cost: 25.0%
# users +-30% share of the variance of the log of the cost: 24.7%
# requests +-30% share of the variance of the log of the cost: 24.3%
# different uncertainties
# users +-40% share of the variance of the log of the cost: 57.6%
# tokens +-30% share of the variance of the log of the cost: 31.2%
# requests +-15% share of the variance of the log of the cost: 7.1%
# price +-10% share of the variance of the log of the cost: 3.4%
With the same uncertainty (plus or minus 30%) for all drivers, each explains a quarter of the variation: the formula, by itself, favors no driver, because it is a product. With different uncertainties, chosen by me as an example, users explain 57.6% of the variation and price 3.4%. The result depends entirely on the ranges you enter, so the answer to the question is «the one you are most in doubt about». Statements like «tokens per request always dominate the cost» do not follow from the formula: they follow from your data and your uncertainties. And there is a distinction to make between the most uncertain driver and the easiest driver to reduce: tokens per request can be reduced by an intervention of your own, user growth cannot.
From forecast to monthly control
The forecast is useful if someone compares it with the actual figure. The last listing is the simplest monthly comparison: three states based on budget usage (green below 95%, yellow up to 120%, red above; example thresholds to be chosen with whoever approves the spend) and the deviation from the forecast. Sending a message or opening a ticket is the easy part: it requires an external service and your credentials, and I do not include it.
# Monthly comparison of actual cost, forecast and budget, with three states. Example thresholds.
def status(actual, budget, yellow=0.95, red=1.20):
usage = actual / budget
return "green" if usage < yellow else "yellow" if usage <= red else "red"
MONTHS = [("2026-07", 520.0, 505.0, 600.0), ("2026-08", 585.0, 540.0, 600.0),
("2026-09", 640.0, 575.0, 600.0), ("2026-10", 760.0, 610.0, 600.0)] # month, actual, forecast, budget
for month, actual, forecast, budget in MONTHS:
print(f"{month}: actual {actual:.0f}, forecast {forecast:.0f} ({actual / forecast - 1:+.1%}), "
f"budget {budget:.0f} ({actual / budget:.0%}) -> {status(actual, budget)}")
# Output:
# 2026-07: actual 520, forecast 505 (+3.0%), budget 600 (87%) -> green
# 2026-08: actual 585, forecast 540 (+8.3%), budget 600 (98%) -> yellow
# 2026-09: actual 640, forecast 575 (+11.3%), budget 600 (107%) -> yellow
# 2026-10: actual 760, forecast 610 (+24.6%), budget 600 (127%) -> red
Reading the output is more useful than the colors. In July the actual cost is below the budget and close to the forecast. In August and September the deviation from the forecast rises to 8% and 11% and the state is yellow: the model is underestimating, even before the budget is breached. In October the gap is 25% and the budget is exceeded by 27%: the growth of the deviation month over month is the signal that the model must be revised, not just that too much was spent. Record every month the data that allow you to redo the comparison.
- Actual cost of the month, with the forecast that had been made for that month.
- The four observed drivers: active users, requests, tokens per request, average price.
- The share of requests per model, to see the drift of the mix.
- The events that moved the numbers (launch, price list change, model change).
With these four pieces of data you can say not only by how much you were wrong but why: if the deviation comes from the volume drivers, the user forecast was optimistic; if it comes from the average price, there is a mix drift or a price list change; if it comes from an event, the model could not know it and a scenario must be added. Without the last line the error remains a number without an explanation.
Frequently asked questions
What data do I need to forecast AI spend?
Four drivers per month: active users, requests per user, tokens per request and average price per million tokens, with the share of requests per model. You also need the events that moved the numbers, such as launches and price list changes.
Prophet or ARIMA to forecast cost?
It depends on the data. Prophet's documentation says it works best with strong seasonal effects and several seasons of history: with a few months of data a simple method tried with a retrospective check is more defensible. Always compare the methods on the past.
Which driver should I optimize first?
The one that explains the most variation in cost and that you can reduce with an intervention of your own. In the example, with uncertainties chosen by me, users explain 57.6% of the variation but cannot be reduced: among the drivers you can act on, tokens per request and the model mix.
What you can do now
You can write the AI cost as the product of four drivers and see that the model mix can weigh more than user growth. You can compare forecasting methods with a rolling-origin test instead of trusting a number, and you can recognize that the difference between the methods at twelve months is larger than the error of each. You can build three scenarios from the observed growth, stating that with little data they are cases and not percentiles, and you know that the useful scenarios move several drivers together. You can answer «which driver do I optimize» with the uncertainties of your own data, and set up a monthly control with thresholds and the information to record. The series and prices in the listings are examples: replace them with your own data. The next step is to control the spend within the month, in the article on monthly cost and anomalies; to understand why actuals overrun the budget, read first the article on FinOps for AI.
Sources
- Prophet - Forecasting at scale - the method works best with strong seasonal effects and several seasons of history; consulted on 2026-11-12 (the previous address, facebook.github.io/prophet, redirects here)
- Uncertainty Intervals (Prophet) - the intervals assume future trend changes with frequency and magnitude equal to the historical ones; default width 80%; consulted on 2026-11-12
- Forecasting: Principles and Practice, section «Time series cross-validation» (Hyndman) - rolling-origin evaluation and multi-step forecasting; consulted on 2026-11-12
- Tests run locally:
python3 -Ion the five listings (standard library,statisticsmodule), each one twice with identical output; series, prices and ranges invented for the example. Prophet and ARIMA were not run

Commenti
Caricamento commenti...
Sign in to comment