DEV Community

Cover image for A Client Asked Me to Add AI. I Spent 2 Weeks Researching the Costs. Here's What I Found.
Arbythecoder
Arbythecoder

Posted on

A Client Asked Me to Add AI. I Spent 2 Weeks Researching the Costs. Here's What I Found.

The math that changed how I think about AI features


The Request

A client messaged me about adding ChatGPT to their invoicing app:

"Can we add AI to help users write invoice descriptions? Budget is $15K."

They have 500 users paying $20/month. Seemed straightforward.

I started prototyping. The code was simple:

const response = await openai.chat.completions.create({
  model: "gpt-4",
  messages: [{ role: "user", content: userPrompt }]
});
Enter fullscreen mode Exit fullscreen mode

But before quoting, I decided to calculate the real long-term costs. What I found surprised me.

The Research

I spent two weeks diving into AI economics. Not because I'm some expert, but because I couldn't find clear information anywhere about what it actually costs to run AI features at scale.

Quick note: I built a simple calculator while researching this. If you want to run your own numbers:

👉 AI Feature Cost Calculator

It's free, no signup. Just helps you see the real costs.


What I Thought It Would Cost

My initial estimate:

  • 500 users
  • Each uses AI maybe 25 times per month
  • 12,500 total API calls
  • GPT-4 at roughly $0.011 per call

Monthly cost: $137

Not bad, right? This seemed totally manageable.

What I Actually Found

The basic calculation was correct, but I was missing a lot:

1. Power Users

Research shows about 10% of users will use AI way more than average. If 50 users make 500 calls each instead of 25:

  • 50 users × 500 calls = 25,000 extra calls
  • Additional cost: $275/month

Now we're at $412/month.

2. Error Retries

API calls fail. Networks drop. Standard retry rate is around 15%:

  • Extra calls: ~1,875
  • Additional cost: $21/month

3. Context Windows

Users expect AI to remember previous conversations. This means storing history and sending more tokens each time. This typically multiplies usage by 3 to 5 times.

If we go with 3X:

  • $412 × 3 = $1,236/month

4. Infrastructure

You also need:

  • Database storage for conversations: ~$50/month
  • Redis for rate limiting: ~$30/month
  • Logging and monitoring: ~$100/month

Total infrastructure: $180/month


The Real Monthly Cost

$1,417 per month

Or $17,004 per year to operate.

For context:

  • Client's monthly revenue: $10,000
  • AI cost as percentage of revenue: 14.2%
  • Current gross margin: 75%
  • New margin with AI: 60.8%

That's a 14 point margin compression for one feature.


Why This Matters

I looked at how AI companies themselves are doing:

OpenAI (2024):

  • Revenue: Around $4B
  • Reported losses: Around $5B

Anthropic (2024):

  • Reported losses: Around $5.3B

Perplexity AI:

  • Revenue: $20M
  • AI costs: $23M

Even the companies building these models are losing money on them.


What I Recommended

I showed my client three options:

Option 1: Build AI now

  • Development: $15,000
  • Year 1 operating: $17,000+
  • Total Year 1: $32,000+
  • Risk: Costs scale with usage

Option 2: Build with safeguards

  • Charge separately ($5/month AI add-on)
  • Hard usage caps (10 calls per user max)
  • Start with 50 beta users
  • Use cheaper models (GPT-3.5 or Claude Haiku)

Option 3: Template system

  • Pre-written invoice descriptions
  • Smart autocomplete
  • Keyword suggestions
  • Cost: $2,000 development, $0/month operating

They chose Option 3.


Three Months Later

The template system is working well. Users haven't complained about missing AI. More importantly, the business is still profitable.

Could they add AI later? Sure. When:

  • Revenue grows 3X
  • They can charge for it separately
  • Models get cheaper
  • Usage patterns are clearer

My Takeaways

For developers:

Before building AI features:

  1. Calculate costs at real usage, not prototype scale
  2. Factor in power users (10% can use 10X the resources)
  3. Include infrastructure costs (storage, monitoring, rate limiting)
  4. Show clients the margin impact, not just development cost
  5. Consider non-AI alternatives first

For founders:

Before asking for AI features:

  1. Understand it's recurring cost that scales with usage
  2. Know it will compress margins by 15-30 percentage points
  3. One power user can cost as much as 10 regular users
  4. Ask if it moves real metrics (revenue, retention, conversion)
  5. Consider if charging separately makes sense

The Calculator

I turned this research into a tool you can use:

👉 AI Feature Cost Calculator

Input your numbers:

  • User count
  • Expected usage
  • Model choice

Get realistic estimates:

  • Monthly/annual costs
  • Infrastructure needs
  • Margin impact
  • Sustainability warnings

Takes 2 minutes. Might save you from expensive mistakes.


Additional Resources

I'm working on a more complete guide for managing client projects (contracts, budgets, security checklists, etc.). It'll be ready soon. Want me to share it when it's done? Drop a comment or follow me here.


Your Experience?

Have you built AI features? What surprised you about the costs?

Are you considering adding AI? What questions do you have?

Let me know in the comments.


Note: I'm @arbythecoder on most platforms. I write about software development, Devops, client work, and the honest economics behind tech decisions. All the numbers in this article are based on publicly available data and standard API pricing as of November 2025.

Tags: #ai #webdev #openai #costs #saas #cloudcosts #gpt4

Top comments (0)