Cost math
Self-hosted GPU vs hosted image API: where the break-even actually is
Every image your product generates is a line item. A hosted API charges a fixed price per image. Your own serverless GPU charges for seconds of compute — and it doesn't care how many images you fit into those seconds. That single difference flips at a specific point, and this page is about finding your point.
The two cost shapes
Hosted API — priced per output
Image generation lists in the range of a few cents per image, depending on provider, model and quality. Simple, predictable, no ops. The per-image price never gets worse — there is just more of it as you grow, and the bill scales in a straight line with your success.
Self-hosted serverless GPU — priced per second
A 24 GB-class serverless GPU runs roughly $0.69–$1.10 per hour, billed per second, and scales to zero when idle. Your cost per image is arithmetic:
cost per image = seconds per image × hourly rate ÷ 3600
Which means cutting the seconds makes every future image cheaper — an optimization a hosted API gives you no way to make.
Everything else — database, app hosting, storage — you pay either way, so it cancels out of the comparison. What differs is only the generation itself.
The honest case for renting
Hosted API vendors argue that self-hosting costs more, and for a large and legitimate set of products they are right:
- Low or spiky volume. A GPU kept warm for traffic that never arrives is pure loss. Per-image billing is strictly better here.
- Your own time has a price. Self-hosting has an ops surface: images to build, workers to keep healthy, a cold-start problem to engineer around. If that time is billable, it belongs in the comparison — which is why the calculator we link to has a field for it.
- Time-to-first-image beats cost-per-image. Prototypes, demos, internal tools. Rent it.
If that is your situation, rent the API. Self-host for control, not for cost — and you just saved yourself a migration.
The three conditions that flip it
The case reverses when all three are true at once: sustained volume, short seconds per image, and an ops cost you can actually absorb.
Sustained volume is what makes a warm worker cheap instead of wasteful. Short seconds per image is the lever only self-hosting gives you: on a rented API a second pass is a second charge, while on hardware you are already renting by the second it is just a few more seconds.
That has a specific consequence worth naming. A pipeline that edits from a reference image — producing each scene from an image you generated earlier, rather than from text alone — spends more than one billable generation per finished image on a hosted API, because every pass is its own call. If your product renders the same subject over and over (a character, a product, a mascot), you are in that class of workload by definition, and the meter runs faster than a naive per-image estimate suggests.
The tax we won't hide: cold starts
A worker that has to boot and load model weights before the first image costs you real money and real user-perceived latency. It is the single thing that most often makes a self-hosted setup lose a comparison it should have won. It is an engineering problem rather than a law of physics — weights can be baked into the image, workers can be kept from re-downloading them — but if nobody does that engineering, the math above does not hold.
Run your own numbers
We built a calculator instead of publishing a verdict, because the verdict depends on five inputs only you have: images per month, seconds per image, your GPU hourly rate, the hosted price per image, and your own ops time. It reports the crossover point in images per month, and when renting wins at every volume it says that instead.
Two habits are worth keeping either way. Measure your seconds per image rather than assuming them — it is the input with the widest spread and the one you control. And re-check list prices before you decide: both sides move, so treat the linked pricing pages as the truth and this page as arithmetic.
Five inputs, your numbers, no verdict from us.
If the math says self-host
Then the cost question is settled and an engineering question opens: baking model weights into the image so workers don't download them at boot, keeping cold starts survivable, running an async job queue so your web server never blocks on a GPU, and serving results without exposing your storage.
That is the part that takes weeks and shows up in no pricing table. It is also exactly what OwnStack is — a production starter kit and written course for building an AI character app on infrastructure you own, including the cost chapter this page summarizes and the 26 traps we hit ourselves getting there.
That demo is the kit, deployed as-is.
Related: Why most AI starter kits rent the model · Character consistency: LoRA vs reference editing
List prices behind the numbers on this page, checked 5 August 2026: RunPod serverless — 24 GB class $0.69/hr (L4, A5000, 3090) and $1.10/hr (RTX 4090), billed per second from worker start to full stop · Replicate — $0.025–$0.09 per output image depending on model (Flux Dev $0.025, Flux 1.1 Pro $0.04, Ideogram v3 Quality $0.09). Providers price differently and change often: OpenAI now bills its image models by tokens and points you to its own estimator rather than a flat per-image rate. Take the figure from your provider's current page and put it into the calculator; this page is only the arithmetic.