<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lisa_AI</title>
    <description>The latest articles on DEV Community by Lisa_AI (@lisa_ai).</description>
    <link>https://dev.to/lisa_ai</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4111406%2F101854a5-1ad9-48cc-9cc0-5bcc765c4ddd.jpg</url>
      <title>DEV Community: Lisa_AI</title>
      <link>https://dev.to/lisa_ai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lisa_ai"/>
    <language>en</language>
    <item>
      <title>The math behind a $19 AI plan: why flat-rate token pricing quietly loses money</title>
      <dc:creator>Lisa_AI</dc:creator>
      <pubDate>Sun, 20 Sep 2026 16:26:31 +0000</pubDate>
      <link>https://dev.to/lisa_ai/the-math-behind-a-19-ai-plan-why-flat-rate-token-pricing-quietly-loses-money-33k6</link>
      <guid>https://dev.to/lisa_ai/the-math-behind-a-19-ai-plan-why-flat-rate-token-pricing-quietly-loses-money-33k6</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw8e85rjv3ajipmgamjde.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw8e85rjv3ajipmgamjde.png" alt="AI SaaS token pricing calculator showing a SAFE verdict with the max safe token count and profit curve" width="462" height="412"&gt;&lt;/a&gt;&lt;br&gt;
A pattern keeps showing up in AI product pricing pages: a plan priced at "$19/mo includes 10M tokens" that looks reasonable on the surface — until the actual cost math is run.&lt;/p&gt;

&lt;p&gt;Three weeks later, the founder is looking at an LLM bill larger than their MRR, trying to figure out which power user is responsible.&lt;/p&gt;

&lt;p&gt;Here is the math that catches it before a price goes live.&lt;/p&gt;
&lt;h2&gt;
  
  
  Three ways AI plans lose money
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Blended cost is higher than assumed.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Input and output tokens do not cost the same. Output is typically 3–8x more expensive. Pricing based on a vendor's headline number means the real cost per token is already wrong.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Overage is priced below cost.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A plan that includes 5M tokens and charges "$0.50 per additional 1M" looks generous — until the actual blended cost is $3.60/1M. Every heavy user then costs more than they pay.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Payment fees eat low-priced plans.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Stripe takes 2.9% + $0.30. On a $19 plan, that is $0.85 — 4.5% of revenue gone before a single token is used. Platform fees (Creem, Gumroad, Lemon Squeezy take 5–10%) can erase the margin on a low-priced plan entirely.&lt;/p&gt;
&lt;h2&gt;
  
  
  The formulas
&lt;/h2&gt;

&lt;p&gt;The core number is &lt;strong&gt;blended cost per 1M tokens&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;blended_cost_per_M = 0.8 * input_price + 0.2 * output_price
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The 4:1 ratio is a reasonable default for chat-style products. Summarization-heavy products should use closer to 10:1; generation-heavy products closer to 1:1. The ratio should match actual traffic.&lt;/p&gt;

&lt;p&gt;Run that on 2026 model prices and the spread is significant:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Routing&lt;/th&gt;
&lt;th&gt;Blended cost per 1M&lt;/th&gt;
&lt;th&gt;A $19 plan safely includes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Budget (Flash/Lite tier)&lt;/td&gt;
&lt;td&gt;~$0.40&lt;/td&gt;
&lt;td&gt;~45M tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Smart mid-route&lt;/td&gt;
&lt;td&gt;~$1.00&lt;/td&gt;
&lt;td&gt;~18M tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sonnet-tier&lt;/td&gt;
&lt;td&gt;~$3.60&lt;/td&gt;
&lt;td&gt;~1.5M tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flagship Opus-tier&lt;/td&gt;
&lt;td&gt;~$9.00+&lt;/td&gt;
&lt;td&gt;~0.6M tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That is a &lt;strong&gt;30x difference&lt;/strong&gt; between the cheapest and most expensive routing. A single "$19 = 10M tokens" plan cannot cover all of them. Pricing as if everyone uses the budget model while users route everything to the flagship means losing money on every sale.&lt;/p&gt;

&lt;p&gt;The SAFE/UNSAFE check adds payment fees and a minimum margin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;net_revenue = price - payment_fees
cost_of_included_quota = included_tokens * blended_cost
margin = (net_revenue - cost_of_included_quota) / net_revenue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A plan is flagged UNSAFE when margin falls below 15%, or when the overage price is below 1.6x blended cost.&lt;/p&gt;

&lt;h2&gt;
  
  
  A zero-dependency way to check this
&lt;/h2&gt;

&lt;p&gt;The math above can be run by hand in a spreadsheet, but it is easy to get subtly wrong — especially the Decimal handling. A per-token price like $0.28/1M is &lt;code&gt;0.00000028&lt;/code&gt;; round it to cents and it becomes &lt;code&gt;$0.00&lt;/code&gt;. That is a silent revenue leak.&lt;/p&gt;

&lt;p&gt;There is a small zero-dependency Python library that packages this check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;ai-token-pricing
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;ai_token_pricing&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;validate_plan_economics&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;PLAN_CATALOG&lt;/span&gt;

&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;validate_plan_economics&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;PLAN_CATALOG&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;budget-pro&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;blended_cost_per_m&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.40&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;                    &lt;span class="c1"&gt;# SAFE
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;max_safe_included_tokens&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;  &lt;span class="c1"&gt;# the real ceiling
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;break_even_overage_price&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;  &lt;span class="c1"&gt;# the floor for overage
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Point it at a bad plan and it returns &lt;code&gt;UNSAFE&lt;/code&gt; instead of quietly allowing a loss leader. The CLI exits non-zero on UNSAFE, so a bad price change can fail a deploy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ai-token-pricing check &lt;span class="nt"&gt;--plan&lt;/span&gt; flagship-pro &lt;span class="nt"&gt;--blended-cost&lt;/span&gt; 9.00
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Money math uses &lt;code&gt;Decimal&lt;/code&gt;, not floats. The library handles the conversion so the string does not have to be hand-typed.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this does not cover
&lt;/h2&gt;

&lt;p&gt;This checks &lt;strong&gt;token economics only&lt;/strong&gt;. It does not account for infrastructure, support, retries, refunds, chargebacks, or other overhead. A SAFE verdict is a necessary-but-not-sufficient condition for profitability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Further reading
&lt;/h2&gt;

&lt;p&gt;The billing implementation layer — Stripe metered billing, weighted quotas, usage caps, and the edge cases the Stripe docs skip — is covered in a separate write-up: &lt;em&gt;Usage-based billing for AI SaaS: what the Stripe docs don't tell you&lt;/em&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>ai</category>
      <category>saas</category>
    </item>
  </channel>
</rss>
