Gartner: AI Spending Hits $2.67 Trillion in 2026 — Where the Money Goes and How to Spend Your Share
The usual fate of an industry forecast is to be screenshotted, posted, and forgotten. Gartner's September 16, 2026 forecast puts worldwide AI spending at $2.67 trillion for the year, up 49.5%. The headline is big enough on its own. What is actually useful to a developer, though, is the segment table underneath it: which boxes the money flows into, and which boxes are growing abnormally fast. Your budget plan, your tech choices, and your negotiating leverage all end up aligned to that table.
"Worldwide AI spending in 2026: $2.67 trillion"
1. The September 16 Revision: Numbers and Structure
The official release states that worldwide AI spending will total $2.67 trillion in 2026, a 49.5% year-over-year increase, rising to $3.64 trillion in 2027. Gartner attributes the growth to the convergence of two forces: AI infrastructure investment, and AI embedded into software and services. In the segment table, AI infrastructure alone accounts for $1.48 trillion (up from $0.98 trillion in 2025) and dominates the total. AI services reach $576 billion and AI software $462 billion. Those three lines together are close to ninety percent of the whole.
# 1) Attribute spend by feature, not by vendor. Vendor bills hide the truth.
import collections
def attribute(events):
by_feature = collections.defaultdict(float)
for e in events:
by_feature[e["feature"]] += e["cost_usd"]
return dict(sorted(by_feature.items(), key=lambda kv: -kv[1]))
spend = attribute(load_usage_events(days=7))
for feature, usd in spend.items():
print(f"{feature:28s} {usd:8.2f} USD")
# the top line is the one to optimize, not the biggest invoice2. The Fastest Growers Are Not Infrastructure
Infrastructure has the largest base, but the growth rates tell a different story. AI cybersecurity nearly doubles, from $25.9 billion in 2025 to $51.3 billion in 2026. AI agents and assistants go from $16.5 billion to $29.2 billion, with 2027 forecast at $65.5 billion, roughly four times the 2025 figure in two years. AI data jumps from $0.8 billion to $3.1 billion, the steepest percentage move in the table, though from a small base. A separate Gartner release on August 26 unpacks the market for securing AI: $2.835 billion in 2026, up 83%, with AI application security at 82.1% growth, AI usage control at 86.6%, and AI governance platforms at 77.4%. One caveat belongs here. Gartner notes that when scope definitions widen between vintages, cross-vintage comparisons are not meaningful, which is why the May 2026 release put 2026 at $2.59 trillion and 47% while September says $2.67 trillion and 49.5%. Treat the trend as the signal and the exact percentage as an estimate.
# 2) Cache sensitivity: the same context, sent twice, costs ten times more.
PRICE = {"fresh": 10.0, "cached": 1.0, "out": 50.0} # USD per 1M tokens
def cost(in_tok, out_tok, hit):
cached = in_tok * hit
return (in_tok - cached) * PRICE["fresh"] / 1e6 + cached * PRICE["cached"] / 1e6 + out_tok * PRICE["out"] / 1e6
for hit in (0.0, 0.5, 0.8, 0.95):
usd = cost(200_000, 4_000, hit)
print(f"cache hit {hit:>4.0%} -> {usd:.4f} USD / call")3. Lesson One for Builders: Security Is No Longer the Supporting Actor
Stack the two tables and the conclusion is plain: the industry is spending real money to answer one question, namely how to govern an agent once it can act on its own. AI usage control growing 86.6% and AI governance platforms growing 77.4% explain themselves. Buyers want runtime constraints, not pre-deployment reviews. If you build agent products, making permissions, audit, and cost ceilings first-class product features rather than afterthoughts will be more persuasive than any marketing copy, because what you sell maps directly onto the fastest-growing line in the customer's budget.
# 3) Per-agent daily budget with a hard breaker. Alert early, not at 100%.
DAILY_CAP = 25.00 # USD per agent per day
def check(agent_id, spent_usd):
ratio = spent_usd / DAILY_CAP
if ratio >= 1.0:
return {"agent": agent_id, "action": "halt", "reason": "cap reached"}
if ratio >= 0.8:
return {"agent": agent_id, "action": "warn", "at": round(ratio, 2)}
return {"agent": agent_id, "action": "ok"}
print(check("support-triage", 21.4)) # -> warn at 0.864. Lesson Two: You Do Not Buy the Infrastructure, but You Pay for It
The $1.48 trillion in infrastructure spending looks like a hyperscaler problem, but its invoice reaches you as inference unit price. Two consequences follow. First, prices keep falling because supply is expanding quickly. Second, the decline is not uniform: the gaps between cached, batched, small-model, and frontier-model paths will widen. The engineering lever therefore moves from "wait for cheaper tokens" to "use the right tier." Running the same job on a cheaper tier converts directly into gross margin. There is a second-order effect as well. When the fastest-growing line in the industry is governance, vendors bolt governance onto existing products, which means the controls you build in-house may arrive as bundled features within twelve months. Build the policy model, not only the mechanism.
// 4) Route by risk tier. Frontier pricing is a tool, not a default.
const TIERS = [
{ name: "small", model: "gpt-6-mini", maxInput: 32_000, usdPer1kIn: 0.0015 },
{ name: "mid", model: "gpt-6", maxInput: 200_000, usdPer1kIn: 0.0100 },
{ name: "heavy", model: "gpt-6-astra", maxInput: 1_000_000, usdPer1kIn: 0.0100 },
];
function tierFor(req) {
if (req.needsLongChainReasoning || req.touchesRepo) return TIERS[2];
if (req.inputTokens > 8_000 || req.steps > 4) return TIERS[1];
return TIERS[0];
}
const chosen = tierFor({ inputTokens: 12_400, steps: 6 });
console.log("tier:", chosen.name, "model:", chosen.model);5. Turn Your Budget Into Code
A macro forecast tells you the direction; your own ledger is your job. Codify the cost model: attribute spend by feature rather than by vendor, set per-agent daily budgets, treat cache hit rate as a first-class metric, and report weekly on who is using the most expensive tier. Then, when price or volume changes, you can answer immediately where the extra money went. The three samples below cover cost attribution, cache sensitivity, and per-agent daily budget alerting. One more habit pays off here: log the model identifier and the tier on every request. When a bill changes, the first question is always which path got heavier, and a log line answers it in seconds instead of an afternoon of guessing.
# 5) A weekly report anyone can read. One screen, four numbers.
def weekly_report(events):
prev = [e for e in events if e["days_ago"] > 7]
cur = [e for e in events if e["days_ago"] <= 7]
return {
"spend_usd": round(sum(e["cost_usd"] for e in cur), 2),
"wow_change": round(
sum(e["cost_usd"] for e in cur) / max(sum(e["cost_usd"] for e in prev), 1e-9) - 1, 3),
"cache_hit": round(sum(e["cached_tokens"] for e in cur) /
max(sum(e["input_tokens"] for e in cur), 1), 3),
"top_feature": max(((e["feature"], e["cost_usd"]) for e in cur),
key=lambda kv: kv[1], default=(None, 0))[0],
}
print(weekly_report(load_usage_events(days=14)))6. A Spending Checklist
Five rules. First, attribute cost by feature rather than by vendor; otherwise you never learn which feature is losing money. Second, set a daily budget and a hard circuit breaker per agent so one runaway loop cannot burn a month of quota. Third, put cache hit rate on the dashboard; resending the same large context is the most common waste. Fourth, pick models by risk tier, because not every request deserves a frontier model. Fifth, reserve budget for security and audit, since the two fastest-growing lines in the industry are there, and your customers will eventually ask. $2.67 trillion is a macro number. The question you always have to answer is smaller: for every dollar this feature earns, how many cents did it cost? And revisit the model every quarter against the published segment table. Forecasts get revised, and a budget line that assumed 47% growth looks very different at 49.5%.
"Attribute by feature, not by vendor"
"Every agent needs a daily budget breaker"
📌 Frequently Asked Questions
Where does the $2.67 trillion figure come from?
From Gartner's official press release dated September 16, 2026: worldwide AI spending is forecast at $2.67 trillion in 2026, a 49.5% increase year over year, rising to $3.64 trillion in 2027.
Why does infrastructure dominate the total?
In the segment table, AI infrastructure reaches $1.48 trillion in 2026, up from $0.98 trillion in 2025, making it by far the largest line. Gartner attributes growth to the convergence of infrastructure investment and AI embedded into software and services.
Which segments are growing fastest?
AI cybersecurity nearly doubles, from $25.9 billion to $51.3 billion. AI agents and assistants roughly quadruple in two years, from $16.5 billion to $29.2 billion to a forecast $65.5 billion. The market for securing AI reaches $2.835 billion in 2026, up 83%.
What do these macro numbers have to do with my day job?
Unit price. Infrastructure investment reaches you as inference pricing, and the gaps between tiers will widen, so choosing the right tier and raising cache hit rate translate directly into savings.
What is the first capability to build?
Cost attribution by feature plus a per-agent daily budget circuit breaker. Without both, you cannot answer where the money went when price or volume shifts.
🔧 Recommended Tools
📚 Sources
- Gartner — Gartner Forecasts Worldwide AI Spending to Grow 49.5% in 2026 (September 16, 2026)
- Gartner — Gartner Forecasts the Market for Securing AI Will Reach Almost $5 Billion in 2027 (August 26, 2026)
- Gartner — Gartner Forecasts Worldwide AI Spending to Grow 47% in 2026 (May 19, 2026, for vintage comparison)