x402 Starter Kit

Stack Basics · Module 4 of 5

Module 4 — What this all costs, and the cost hacks that actually work

Hosting is cheap — Modules 1–2 run on about $6–12 a month plus $10 a year. The real money question in an AI stack is model usage: what you pay every time an AI writes code for you or powers a feature in your product. Here's how the costs actually behave, and the hacks people use — with the tradeoffs the hype posts skip.

Where the money goes: tokens

Every AI call is billed in tokens (roughly ¾ of a word each). You pay for what goes in (your prompt, your files) and what comes out (the answer). Coding agents are token-hungry — they read big chunks of your repo, think, retry. That's why the same model can cost pennies in a chat window and real dollars in an agent loop.

Two ways to pay:

The rough shape across every provider: frontier models cost 10–30× more per token than small models. That gap is the whole cost game.

Hack 1: model routing — the one that actually matters

Not every job needs the frontier model. Summarizing, classifying, formatting, drafting boilerplate — small cheap models do this fine. Architecture, gnarly debugging, code your income depends on — that's frontier-model work.

The practice: default cheap, escalate on failure. My own pipelines route almost everything to lower-cost models and only reach for a premium model when the cheap one demonstrably fails. That single habit routinely cuts model spend by 10× or more, with almost no quality loss — because most jobs weren't hard.

Hack 2: OpenRouter and free models — real, with a real tradeoff

OpenRouter gives you one API key for hundreds of models across providers, which alone is worth having: swap models by changing one string, compare prices in one dashboard.

It also lists genuinely free models — usually open-source models someone is hosting at zero cost, often rate-limited. Here's the honest version of the tradeoff:

Rule of thumb: free models to learn and tinker, paid models where your name is on the output. A subtle bug in production costs more than the tokens you saved.

Hack 3: local LLMs — your hardware, zero per-token cost

Run open models on your own machine with Ollama (one install, then ollama run <model>). Truly free per token, fully private, works offline.

The catch is hardware physics:

The honest summary: local models are ~1–2 years behind frontier hosted ones. Fantastic for private/bulk/background work and as a free tier inside your own product. Not what you want architecting your business logic.

A sane starter budget

Item Monthly
VPS ~$6–12
Domain ~$1 (annualized)
One agent subscription (Claude Pro / Cursor / ChatGPT) ~$20
API budget for experiments (OpenRouter, capped) $5–10
Total ~$32–43/mo

That's the real entry price of a full AI build-and-host stack — less than most people's streaming subscriptions. Scale spending after something works, not before.

Next module: the decisions nobody can make for you — the pre-launch checklist, my own comfort-threshold story, and why all of this matters whether or not you ever charge a bot a cent.

📬 Optional: get the course by email

The whole course is free right here, no email needed — that stays true. But if you want it in your inbox, plus updates when modules are added or prices/tools shift, drop your email.


Disclosure: some links in this course are affiliate links (including Amazon). They help fund the free course — your price never changes, and every product here is one we'd recommend anyway.