DEV Community

Cover image for How much does it really cost to use AI models for coding?
christian daniel
christian daniel

Posted on

How much does it really cost to use AI models for coding?

I’ve been reading several posts about the true inference cost of AI models.

But it wasn’t until I ran my own numbers that I was genuinely stunned.

For 14 days, from May 3 to May 16, I used three models classified as Open Weights for a personal project where I’m building both the backend in Nest.js and the frontend in React.

These were my usage numbers:

MoonshotAI: Kimi K2.6
Input: 267,755,276 tokens
Output: 1,941,655 tokens

DeepSeek: DeepSeek V4 Pro
Input: 136,286,132 tokens
Output: 867,593 tokens

Xiaomi: MiMo-V2.5-Pro
Input: 2,791,785 tokens
Output: 59,251 tokens
Enter fullscreen mode Exit fullscreen mode

In total:

Input: 406,833,193 tokens
Output: 2,868,499 tokens
Total: 409,701,692 tokens
Enter fullscreen mode Exit fullscreen mode

More than 400 million tokens.

I’m using an Opencode Go subscription, which cost me USD 5 for the first month. Starting from the second month, it costs USD 10/month.

And in those 14 days, I already hit the monthly rate limits.

But wait…

USD 5 for more than 400M tokens?

Yes. USD 5.

That made me wonder:

How much would this exact same amount of tokens have cost using a traditional inference provider?

So I went to OpenRouter and looked up the average prices of the models I had been using:

DeepSeek: DeepSeek V4 Pro
Input:  USD 0.316 / 1M tokens
Output: USD 1.74 / 1M tokens

MoonshotAI: Kimi K2.6
Input:  USD 0.306 / 1M tokens
Output: USD 3.84 / 1M tokens

Xiaomi: MiMo-V2.5-Pro
Input:  USD 0.470 / 1M tokens
Output: USD 3.07 / 1M tokens
Enter fullscreen mode Exit fullscreen mode

Doing the math, if I had used OpenRouter as the inference provider, the cost for those 14 days would have been approximately:

Model Input Output Total
MoonshotAI: Kimi K2.6 USD 81.93 USD 7.46 USD 89.39
DeepSeek: DeepSeek V4 Pro USD 43.07 USD 1.51 USD 44.58
Xiaomi: MiMo-V2.5-Pro USD 1.31 USD 0.18 USD 1.49

Total: USD 135.46 in 14 days

Extrapolated to a 30-day month:

Model Monthly estimate
MoonshotAI: Kimi K2.6 USD 191.55
DeepSeek: DeepSeek V4 Pro USD 95.52
Xiaomi: MiMo-V2.5-Pro USD 3.20

Estimated monthly total: USD 290.27

But of course, another important factor comes into play here: cache.

Inference providers usually apply discounts when part of the input prompt comes from cache, meaning tokens from the prompt were already processed before and can be reused.

So I ran another calculation assuming:

Cache hit rate: 70%
Cached input cost: 20% of the normal cost
Enter fullscreen mode Exit fullscreen mode

That means the effective input cost becomes:

70% × 20% + 30% × 100% = 44%
Enter fullscreen mode Exit fullscreen mode

In other words, input tokens would cost 56% less, while output tokens would remain the same.

Under that assumption, the cost of my 14 days of usage would have been:

Model Input with cache Output Total
MoonshotAI: Kimi K2.6 USD 36.05 USD 7.46 USD 43.51
DeepSeek: DeepSeek V4 Pro USD 18.95 USD 1.51 USD 20.46
Xiaomi: MiMo-V2.5-Pro USD 0.58 USD 0.18 USD 0.76

Total with cache: USD 64.72 in 14 days

Extrapolated to 30 days:

Model Monthly estimate with cache
MoonshotAI: Kimi K2.6 USD 93.23
DeepSeek: DeepSeek V4 Pro USD 43.84
Xiaomi: MiMo-V2.5-Pro USD 1.63

Estimated monthly total with cache: USD 138.70

That represents approximately 52.2% less than the calculation without cache.

Then I did the same exercise assuming I used GPT-5.4 the entire time, also applying the cache hit discount.

The estimated monthly result was approximately:

USD 690.77/month

So the comparison looks like this:

Opencode Go:
USD 10/month

Estimated cost using the same Open Weights models via OpenRouter with cache:
USD 138.70/month

Estimated cost using GPT-5.4 with cache:
USD 690.77/month
Enter fullscreen mode Exit fullscreen mode

Put another way:

  • with Opencode Go, I’d be paying approximately 7.2% of what it would cost to use those same Open Weights models via OpenRouter;
  • and just 1.4% of what it would cost to use GPT-5.4 under the same usage pattern.

And if I take the first-month promotional price, USD 5, the difference is even more dramatic:

  • 3.6% compared to the estimated cost with Open Weights models;
  • 0.7% compared to the estimated cost with GPT-5.4.

This leaves me with one question:

How are these subscription models actually sustainable?

Do published inference prices reflect the real cost?

Are subscriptions being subsidized?

Or are we at a stage where many companies are absorbing losses to capture users and volume?

I don’t have a definitive answer.

But after running these numbers, it’s clear to me that the real cost of using AI for intensive development is not as obvious as it seems.

And that behind a seemingly simple monthly subscription, there may be a much more complex economy at play.

AI #LLM #SoftwareDevelopment #OpenWeights #AIEngineering #DeveloperTools

Top comments (0)