Cloud & AI spend

What will this cost me to run per month?

Software costs money in two currencies: dollars on an invoice and engineering capacity you have to plan around. Both are here — the monthly bill for a cloud instance, the real cost of an LLM API at your call volume, which image plan is worth it, plus the sizing questions that decide whether the bill stays sane: database connections, algorithmic cost at scale, and what a codebase of this size actually represents in person-months.

All money in US dollars, entered at prices you control Token costs computed per million tokens, the unit providers actually bill in Effort from the basic COCOMO organic model Replaces 6 single-purpose calculators

Your situation

What are you costing out?

Pick the question. Only the fields that case needs get read — the rest are ignored.

That's not my case

Fine-tune the estimate

Your rates and volumes

Prices change constantly, so every rate below is editable — put your provider’s current numbers in. Only the fields your case needs get read.

$

From your provider’s current on-demand pricing page.

hours
days
$

Per MILLION tokens, the unit providers bill in — not per thousand.

$

Usually several times the input price. This is what drives the bill.

$

Salary plus benefits, taxes and overhead. Put your own figure in.

Informational estimate. Actual rates, fees and terms depend on the provider and your contract; compare official pricing documents before deciding. Cloud and AI list prices change frequently — the price fields here are editable on purpose, so put your own current figures in them.

How the total adds up

Line by line

Every figure derives from the rate you entered, so changing a price changes the whole column rather than being hidden in a constant.

The composition behind the result — input tokens against output tokens, on-demand cost against what a reservation would save, effort against calendar time.

    Quick answer

    What applies to you

    Monthly cost = hourly rate × hours per day × days per month. A $0.10/hour instance running continuously is about $73 a month, or $876 a year. Monthly and annual cost at your hourly rate

    Deadline:

    Frequently asked questions

    How much does a cloud server cost per month?

    Multiply the hourly rate by the hours per day and the days per month. A modest instance at $0.10 an hour running continuously is roughly $73 a month, or $876 a year. That covers compute only — storage, snapshots, load balancers and especially outbound data transfer are billed on top, and egress is where most unexpectedly large invoices come from.

    How much do reserved instances actually save?

    Typically 40–60% against on-demand, with the deepest discounts on three-year commitments paid up front. The catch is that you pay for the reservation whether the instance runs or not, so it only makes sense for baseline capacity you are confident about. Keep the variable portion on-demand or on spot pricing.

    What is the easiest way to cut a cloud bill?

    Turn off what nobody is using. Development and staging environments that run around the clock but are used forty hours a week are about 76% waste, and scheduling them off outside working hours is nearly free to implement. After that, look at unattached storage volumes, old snapshots, idle load balancers and NAT gateways — all of them bill continuously and none of them are visible in normal use.

    How do I calculate the cost of an LLM API call?

    Multiply input tokens by the input price and output tokens by the output price, then divide by a million, because that is the unit providers bill in. At $3 per million input and $15 per million output, a call with 2,000 input and 500 output tokens costs $0.0135 — which at a thousand calls a day is about $405 a month.

    Why is my LLM bill higher than I estimated?

    Almost always output tokens. They typically cost around five times what input tokens cost, so a model that answers at length dominates the bill even when the prompt is short. Conversational systems compound this by resending the whole history as input on every turn, which grows quadratically over a long session. Measure real token counts from the API responses rather than estimating them.

    What is the cheapest way to reduce LLM costs?

    Ask for shorter answers, and check whether your provider offers prompt caching and batch endpoints — caching a long shared system prompt can cut input cost by an order of magnitude, and batch processing is typically half price for anything that does not need to be real time. Routing simple steps to a smaller model usually saves more than any prompt tuning.

    Which image-generation plan is worth it?

    The mid tier at around $30 a month is the usual answer, because it is the cheapest one that includes unlimited relax-mode generation. That removes the hard ceiling entirely: you wait longer per image but never run out. The cheapest tier caps you at a fixed number of images, which most people exhaust in the first week and then find themselves paying for extra time anyway.

    How many database connections should my pool have?

    Roughly one to three per CPU core, depending on how much the workload waits on I/O. More is usually worse: past that point the database spends its time context-switching and contending rather than answering queries. Critically, the pool size is per application instance, so ten containers with 20 connections each is 200 connections at the server.

    When do I need PgBouncer or another connection pooler?

    Once the total across all your application instances approaches a couple of hundred connections, or as soon as you are running serverless functions that each open their own. An external pooler multiplexes many client connections onto a small number of real database sessions, which is far cheaper than raising the server’s connection limit and buying RAM to support the idle ones.

    How long does an O(n²) algorithm take on a million items?

    About 16 minutes at a billion operations per second, against roughly 20 milliseconds for an O(n log n) approach on the same data. That factor of fifty thousand is why complexity class matters far more than micro-optimisation at scale — and why the same code that felt instant on a thousand test records becomes unusable in production.

    Is Big-O a reliable predictor of real runtime?

    It predicts how cost grows, not how fast something runs. Constant factors hidden inside the notation can differ by a hundredfold, cache behaviour often matters more than operation count, and at small n a "worse" algorithm frequently wins — which is why production sort implementations switch to insertion sort below a threshold. Use it to choose an approach, then profile the real thing.

    How many person-months does 50,000 lines of code represent?

    Around 150 person-months by the basic COCOMO organic model, which is 2.4 × KLOC^1.05. With a team of four that is roughly 37 months of calendar time. The exponent above one is the interesting part: effort grows faster than size, because coordination cost rises as the system grows.

    Is lines of code a useful measure at all?

    Only as a rough scale indicator, and never as a measure of anyone’s productivity. Identical functionality can differ fivefold in line count between languages, the best solution is often the one that deletes code, and any team measured on lines written will reliably produce more lines. Use it to tell a 5,000-line project from a 500,000-line one, and nothing finer than that.