DevOps & Cloud Topic
FinOps for Beginners: Understand Cloud and AI Costs
Your cloud bill rises. Before switching machines off, find what the money paid for and who needs it. FinOps brings engineering, finance and business people together to make better decisions about technology spending.
The aim is useful value, not the smallest bill at any price. A cheap app that loses orders or cannot recover data is not a good saving. The 2026 State of FinOps report highlights AI cost skills and cost management as important needs among its respondents. That makes cost awareness useful alongside deployment and reliability skills.
Make the bill understandable
Start with a billing export or an approved cost report. Group spend by owner, service and environment. Labels or tags can help, but their support and billing behaviour differ by provider. Shared costs need an agreed allocation method. Keep unallocated spend visible rather than hiding it.
Check the time period, currency, credits, tax and any amortised commitments before comparing two reports. A daily estimate and a final invoice may not match exactly.
Try a small local example
This is invented data in US dollars, not a real provider price list. Save it as costs.csv:
service,team,cost_usd
compute,learning,12.50
storage,learning,3.00
logs,learning,4.50
ai-inference,learning,8.00
compute,website,10.00
This script adds the rows by team. Decimal avoids the small rounding surprises that binary floating-point arithmetic can introduce with money. Real billing systems also need more careful currency, rounding and adjustment rules.
"""Summarise made-up costs; this is not a cloud billing integration."""
import csv
import json
from collections import defaultdict
from decimal import Decimal
def summarise(path):
totals = defaultdict(Decimal)
with open(path, newline="", encoding="utf-8") as file:
for row in csv.DictReader(file):
amount = Decimal(row["cost_usd"])
if not amount.is_finite() or amount < 0:
raise ValueError("Costs must be finite, non-negative numbers")
totals[row["team"]] += amount
return {team: str(amount) for team, amount in sorted(totals.items())}
if __name__ == "__main__":
print(json.dumps(summarise("costs.csv"), indent=2))
python cost_report.py
The result should be learning: 28.00 and website: 10.00. The total is 38.00. This is a local file calculation; it does not connect to a cloud account. Add a second day's file and compare like-for-like periods before claiming a trend.
Measure cost per useful result
A larger bill may be reasonable if useful work grows faster. Compare a suitable unit such as cost per completed order or cost per successful lesson request. State what costs and results you included. Ten thousand failed requests should not make a cost-per-request chart look like success.
For an AI feature, track cost per accepted useful task as well as requests or tokens. A task may make several model and tool calls. Include retries, retrieval, storage and supporting infrastructure where relevant. Model price, input size and output size can all matter; use the provider's current published terms for actual estimates.
Choose a few safe improvements
- Remove a resource only after checking its owner, purpose and retention needs.
- Schedule temporary test environments when nobody needs them.
- Right-size compute after measuring load and leaving suitable headroom.
- Review log retention without losing required incident or audit evidence.
- Check data transfer, storage copies and idle resources.
- Consider commitments only when usage is understood and stable enough.
Test performance and recovery after a change. A smaller machine that causes retries and incidents may cost more overall.
Control AI usage carefully
Set application limits on request size, output and repeated tool calls. Use timeouts and bounded retries. Route a simple task to an appropriate smaller model only after evaluating quality. Caching can reduce repeat work, but private data, stale results and cache keys need care.
Budget alerts usually notify people; they are not automatically hard spending caps. Provider quotas, application limits and billing alerts solve different problems. Decide who receives an alert and what action is safe. Do not cut off a critical service without an agreed policy.
A weekly review that stays useful
- Compare spend and useful work for the same period.
- Find the largest unexplained change.
- Ask the owner whether it is expected.
- Choose one action with a person responsible.
- Check the saving, quality and reliability after the change.
Practice by adding a fake duplicate row and a new team to costs.csv. Explain why the script cannot know whether the duplicate is valid. Good data checks and clear ownership matter as much as a chart. Continue with reliability so cost decisions support the service's goals.
Official references and further reading
Reviewed on 25 October 2026. Tools change, so check the official documentation for the version you use.
Comments (0)
No comments yet. Be the first to comment!