Writing

Blog

Long-form on AI cost tracking, the math of LLM bills, and how to keep an AI SaaS profitable. New posts ship as they get written.

Complete guide

The Complete 2026 Guide to AI Cost and Margin for SaaS

The full playbook, start to finish: measure cost per user, price against variable cost, reduce spend, and cap the worst case. Each step links to a deep-dive. Start here.

Read post →

Bill emergency

My API Bill Is Too High. What to Do Right Now

You just saw a scary number. A calm triage to find the worst offender fast, the three quickest fixes, and how to make sure it never ambushes you again.

Read post →

OpenAI cost

Why Is My OpenAI Bill So High?

The five most common reasons an OpenAI bill blows up, ranked by how often they are the culprit, plus a fast way to tell which one is yours.

Read post →

Agent cost

Your AI Agent Is Burning Through Your Budget

Autonomous agents can fire hundreds of calls in minutes. The real cost per minute, a circuit breaker you can paste in tonight, and the automated version.

Read post →

Margin

When One User Costs More Than They Pay

On a flat plan one power user can cost more in tokens than they pay you. How to check right now, and the three sane things to do when you find one.

Read post →

Prevention

How to Never Get Surprised by an AI Bill Again

You fixed one bill shock and never want another. The four habits that stop surprise AI bills before they form, three of which you can automate.

Read post →

Spending caps

Per User Spending Caps for LLMs

Account level limits do not stop one user draining your margin. Why caps belong at the user level, how to build one, and when to block versus downgrade.

Read post →

Model cost

Model Downgrade on a Budget

When a user hits their cap, downgrade the model instead of blocking. A real cost comparison, when it fits, and how to automate the swap with no code.

Read post →

Model cost

Model Routing for LLMs

Send each request to the cheapest model that can handle it. Three routing strategies, a real architecture, and why most teams over or under build it.

Read post →

Unit economics

LLM Unit Economics for AI SaaS

AI inference cost breaks the classic SaaS unit economics model. Build a real per user model for one AI feature, and see why the average lies.

Read post →

Agent cost

AI Agent Cost Control

Even a healthy agent fires many calls per task. Track cost per run, budget per task, alert before you kill, and how it complements loop detection.

Read post →

Claude billing

Anthropic Billing Explained

How the Claude API charges you: per token, input versus output, per model, with real 2026 prices. What the Anthropic console shows, what it hides, and how to get cost per user.

Read post →

Cost calculator

Claude API Cost Calculator and Formula

The exact formula to turn Claude token counts into dollars, worked on Haiku, Sonnet, and Opus with real numbers, plus how to estimate your monthly Anthropic bill.

Read post →

Usage tracking

How to Track Claude API Usage Per User

The Anthropic usage API reports organization totals, not per customer. Read the usage object on every Claude response and attribute cost to your own user ids, with Python and TypeScript examples.

Read post →

Provider costs

Anthropic vs OpenAI Billing Compared

Anthropic and OpenAI both bill per token, but the rates, usage fields, caching, and batch discounts differ. A side by side comparison and which one wins for which workload.

Read post →

Cost reduction

Claude API Cost Optimization, 6 Real Levers

Six ranked levers to cut your Claude API bill: right model per task, prompt caching, leaner system prompts, capped output, the Batch API, and per user caps. With the savings math.

Read post →

Benchmark

The Real Cost Per User of an AI Feature in 2026

How much does one AI user actually cost you per month? A transparent benchmark modeled from public 2026 pricing across three usage profiles, with the margin math against a $29 plan.

Read post →

Vercel AI SDK

How to Track AI Costs Per User with the Vercel AI SDK

The Vercel AI SDK gives you token usage but not per-user cost or margin. How to capture usage from generateText and streamText (including the streaming gotcha) and attribute it to a userId.

Read post →

Provider costs

How to Track Claude API Costs Per User

The Anthropic console only shows an account total. How to get Claude cost per user from the usage object, with 2026 Claude pricing and the per-user margin math.

Read post →

Cost tracking

How to Track AI Costs Per User (And Why the OpenAI Total Lies to You)

Your OpenAI bill came in at $4,200 this month. That single number tells you almost nothing. Here is how to track per-user cost, why the manual approach breaks at scale, and the two-line wrapper that automates it.

Read post →

Cost reduction

How to Reduce OpenAI Costs Without Breaking Your Product

Microsoft cut Claude Code for 100k engineers. Uber burned their 2026 AI budget in 4 months. Three real causes of a runaway OpenAI bill, and three fixes that do not degrade output quality.

Read post →

Unit economics

Why Power Users Hurt Your AI SaaS Margins

Traditional SaaS runs at 80-90% gross margin. AI SaaS is structurally closer to 50-60%. Why power users hurt you, how to calculate margin per user, and what healthy AI SaaS margins actually look like.

Read post →

Agent loops

How to Detect and Stop AI Agent Reasoning Loops

A runaway agent can burn $100 in minutes. Here is what a reasoning loop is, why it is financially dangerous, how to detect it with token velocity, and how to get a Slack alert before it costs you thousands.

Read post →

Spending caps

How to Set Spending Caps on LLM API Calls Per User

Flat subscription, variable per-token cost. Set a monthly cap per user so heavy users do not blow your budget: block the call or silently downgrade to a cheaper model. The naive approach, its failure modes, and the fix.

Read post →

Unit economics

How to Calculate Gross Margin Per User for AI SaaS Products

Margin per user equals plan revenue minus AI cost. Here is the formula, how to calculate it manually from usage logs, why it breaks at scale, and how to see it live per user without the spreadsheet.

Read post →

Cost attribution

How to Get OpenAI API Cost Per User (Not Just Total Bill)

OpenAI only shows account-level totals. It has no idea who your users are. Here is how to attribute cost to each user, tag calls with a userId, and turn the total bill into a per-user breakdown.

Read post →

Model selection

GPT-5 vs GPT-4o-mini for Your SaaS in 2026

GPT-4o-mini is often 10x cheaper than GPT-5. Here are the real 2026 prices, what mini is genuinely good enough for, when GPT-5 earns its cost, and how to route each feature to the right model automatically.

Read post →

Pricing

Why Flat Subscription Pricing Breaks for AI SaaS in 2026

Traditional SaaS runs 80-90% gross margin. AI-first products sit near 52%. Fixed revenue against variable per-token cost is why flat plans break, and the three fixes that actually hold your margin.

Read post →

Provider costs

DeepSeek vs OpenAI vs Gemini API Costs Compared in 2026

The spread from cheapest to frontier models is more than 200x on input tokens. The real 2026 price table, why output tokens dominate, and how to compare providers on your actual usage instead of a spec sheet.

Read post →

AI cost strategy

What Uber and Microsoft Learned About AI Costs the Hard Way

Uber burned its entire 2026 AI budget in four months. Microsoft cancelled Claude Code for thousands of engineers. Same mistake, and the lesson for any SaaS reselling AI on a flat plan.

Read post →

Agentic AI

How to Build Profitable AI Agents Without Runaway Costs

One agent task fans out into dozens of model calls, so cost per run is variable and spikes fast. How to track cost per agent run, budget each task, route sub-steps to cheaper models, and cap the outliers.

Read post →

See the dashboard with real data on the live demo (no signup needed).