“How are we going to make this work with our gross margin targets?” It is the question that comes up most often when I talk to other enterprise software product leaders. Many of us started our journeys with AI in a similar manner and are facing the same challenge now.
Competitive pressures force you to rely on AI in your software products. You either aim to get ahead of the competition, or they are ahead of you. AI is the newfound ‘superpower’ that will make you win, or lose, your market. You need little to no upfront investment to add it to your product. But it does fundamentally change its economics! Healthy SaaS companies traditionally target a 75% to 85% gross margin, but AI-powered SaaS products struggle to achieve those margins.
The big AI vendors and hyperscalers have made AI technologies very accessible. On-demand services and consumption-based cost structures deliver a low barrier to entry. You only pay for what you use. Each new model seems to be more powerful and cost-effective than the previous one. But still, your operating cost is spiralling and your gross margin is under pressure. To know why and adjust, you need to understand the underlying mechanisms.
The cost per token for a given AI model is clear. Your consumption is metered and accurately billed. But why you use a certain number of tokens is often not transparent at all. That is because AI technology is probabilistic. When code performs tasks, the inputs, outputs and processing cost are predictable. When agents perform tasks, there are many factors that influence cost: prompt clarity and completeness, the data that needs to be processed, and the power of the model you use. Agents reason and perform work in loops. One task can be completed in three loops, another may need seven loops. The number of loops and the tokens processed by the models in those loops determine the cost.

I have experienced these cost mechanics first hand. The figures below are illustrative, but they follow a pattern I have seen myself when running real test cases against different models myself. Run the same agent harness and test cases against different models and the results differ widely. Which is best depends on the desired outcome.
- Model A results in successful task completion 33% of the time with $0.12 cost per task.
- Model B results in successful task completion 98% of the time, but at $2.00 per task.
- Model C results in 92% successful task completion, at $0.32 per task.

In my case, I’m aiming for task success. So if the agent fails on the first attempt, it will try again. That means that the cost per completed task for Model A is closer to $0.36 with the invisible cost of longer time to success and user dissatisfaction. Model C is more expensive than A per task, but about the same at $0.35 per completed task and delivers a vastly better user experience. Model B delivers six more points of success than C, but at roughly six times the cost per task of C. And this is before failures cluster on the hardest tasks, which can push costs higher than these averages. This is why the economics of AI-powered features are so different. A pricing model built on averages breaks when the tail is the problem. A small number of users, or tasks, can ruin your margins. So what do you do with this?

Cost per token is not the number that matters. Measure cost per completed task, by task type, at percentiles. Know that not every task is equally complex or expensive and the same task type can vary widely from run to run, which is why averages mislead. Then align pricing with the new cost structure to protect your margin floors as usage scales.
Working with pricing and finance, I have helped install usage-based pricing models, as well as hybrid models where you charge a base fee with usage limits or credits. The direction I personally find most interesting is outcome-based models, where pricing is based on value delivered, which can provide greater decoupling between the price point for the customer and the levers in your cost structure. But you can only price on outcomes if you know what an outcome costs you.
How are you measuring it today? How are you pricing it? I’d love to discuss, so reach out!