The research question
What actually drives the cost of an AI agent, and how do you model it before going to production?
Why it matters
An agent that solves a task in five steps makes five model calls, each with context, tools, and sometimes a retry. Cost scales not with the number of users but with the number of decisions the agent makes. Without a model, you structurally underestimate the bill.
What the evidence shows
The FinOps Foundation defines token economics as metering, attributing, and connecting token consumption to business outcomes, and identifies system prompt overhead, context and memory, model selection, output length, retries, and orchestration overhead as the major consumption variables. Microsoft Foundry documentation states that cost depends on the Azure services used and that you should estimate it, validate with test workloads, reconcile against meter charges, and monitor with Cost Management. Microsoft 365 Copilot combines per-seat licensing with consumption for agents.
Technical context
Token cost is only one part. A realistic model includes: the token model (input plus output per call), the RAG model (embeddings and searches), tools and workflow (number of steps), storage and data, M365 licensing, and operational cost such as monitoring and networking. Model selection is the strongest lever: a large model per step is often overkill.
Architecture implications
- Route per step: use a small model for simple decisions and escalate only where needed.
- Limit context: memory and system prompt travel with every call and count again each time.
- Cache where answers are repeatable, and set a hard limit on the number of agent steps.
- Measure per outcome, not per call, so a cheap agent that often fails does not count as a win.
Security implications
Cost and security meet at tool scope: an agent with broad rights does more, fails more often, and generates more retries. Tight scopes are cheaper and safer at the same time.
Cost implications
The hidden cost sits in retries, overlong output, and orchestration overhead. Reason with a realistic number of steps per task, not with an average call. Always reconcile your Foundry estimate against real meter charges before scaling.
Adoption implications
Cost management is not a separate finance topic but a design variable. Teams that look at cost only afterward build agents that work technically but do not add up economically. Put the cost question next to the architecture question.
Trade-offs
- Large model versus model routing: more consistent but more expensive versus cheaper with more design work.
- More context versus lower cost: richer prompts give better answers but count on every call.
- Autonomy versus predictability: free-roaming agents solve more but make the bill hard to forecast.
Common mistakes
- Reporting cost per token instead of cost per successful outcome.
- Forgetting retries and orchestration overhead in the estimate.
- Using the largest model everywhere because it gives the best answer.
- Never reconciling the Foundry estimate against real meter charges.
For architects
Treat cost as an architecture dimension alongside security and performance. Build a small cost model per agent with the real variables (steps, model choice, context, retries) and validate it with a test workload before scaling.
Evidence & references
Every claim above traces back to an official source. Verify it yourself.
Methodology & confidence
Primary Microsoft Learn documentation on Foundry cost management and Copilot licensing (tier 1), combined with the FinOps framework for token economics (tier 2). Confidence strong, with the caveat that pricing varies by region, meter, and contract.
Continue across TechExplained
The same research, applied in other ways.
