Skip to main content

7 posts tagged with "Cost Management"

Cloud Cost Management, Budgets, and Optimization

View All Tags

How to Get the Token Usage and Cost of a Microsoft Agent Framework Agent Run in C#

· 12 min read
Jagdish Kumawat
Founder @ Dewiride

Every call to a model is paid for by the token, and Microsoft Agent Framework tells you how many each run used: AgentResponse.Usage holds the run's input, cached, output and reasoning tokens. This guide reads them in a small C# agent, turns them into a cost in dollars, and gets the same numbers when the answer is streamed.

How to Look Up Azure OpenAI Model Prices with the Azure Retail Prices API

· 12 min read
Jagdish Kumawat
Founder @ Dewiride

A cost estimate is only as good as the price in it, and model prices change. Microsoft publishes every Azure price, including what each Azure OpenAI model costs per million tokens, through the Azure Retail Prices API: a public web address that needs no Azure account. This guide finds one model's prices, decodes the meter names, narrows the list to one deployment type and converts it to another currency, with curl and jq or with PowerShell.