Microsoft Mechanics Blog:
Control what you're billed on.
Tokens are the currency of AI, and how you design your app determines how many you spend. Compress conversation history instead of resending it raw, cap output tokens with matching prompt instructions, and cache static context so each reuse costs a fraction of the first request. Route each prompt to the right model by complexity, or set Model Router in Microsoft Foundry to handle that automatically — balanced, quality, or cost mode.Then optimize the whole stack. Run Agent Optimizer to test your prompt, model, and tool configurations together and surface better setups. Use Toolbox to dynamically select only the tools each request needs and cut input token overhead by 90%.
April Gittens, Microsoft Principal Cloud Advocate, joins Jeremy Chapman, Microsoft 365 Director, to share how to seize control of AI token spend through smarter app design.
Cut context window creep.
Summarize conversation history between turns and store state externally. Prompt tokens shrink from unbounded growth to a tight per-turn summary. See how it works in Microsoft.
One endpoint, three routing modes.
Model Router in Microsoft Foundry selects the right model per prompt automatically — frontier models for complex tasks, smaller models for simple ones. Try it now.
Optimize token efficiency.
Agent Optimizer in Microsoft Foundry tests prompts, models, and tools in combination and surfaces better configurations. Check it out.
Read more:










