Pre-1.0 · one maintainer · Stripe and cards only · no SDKs (client libraries) yet · no production users yet. Docs describe v0.9.1 (29 Oct 2026) · What’s new →
Hardcount docs
New here? Run the quick start, then read How it works.
Try it
Section titled “Try it”- Quick start: start Hardcount on your computer with git, Docker and a bash shell, run the demo, and see one month of token usage become an invoice, its PDF and a margin report.
- What’s in the box: every feature, with what it does for you.
- How Hardcount compares with four open-source billing engines, with sources, and why Hardcount exists.
- Roadmap: what is being built now, next and later, and what Hardcount will not build. Every change, by date: CHANGELOG.
- Versioning before 1.0: what a release can break, and where each breaking change is written down.
Understand it
Section titled “Understand it”- How Hardcount works: one picture and six steps, from a usage event to a paid invoice.
- Glossary: the words you will meet, plain meaning first.
- How much traffic Hardcount handles: what was measured, and where one Postgres stops being enough.
- Card payment failure handling: declines, ambiguous results, crashes mid-charge, duplicate webhooks, refunds, and the known gaps.
Connect your product
Section titled “Connect your product”- Send usage and get your first invoice: create a customer, send token usage with curl or LiteLLM, and open the invoice. Start here.
- AI pricing reference: the models each recipe prices, pricing your own model, prepaid credit, and margin.
- API surface: the core routes. The full reference is API endpoints.
- API keys: get a key, send it, test and live mode, and rotation.
- Webhooks: events, signatures, and retries.
- Stop usage when credit runs out: poll a prepaid customer’s live credit balance and gate in your own code.
- LiteLLM integration: send token usage from a LiteLLM proxy with a few lines of proxy config.
Run it for real
Section titled “Run it for real”- Self-host: what you need and how the pieces fit.
- Production on one VM: install with Docker Compose, then HTTPS, email, Stripe, nightly backups and a go-live checklist.
- High availability: run two or more copies behind a load balancer, with health checks, shutdown and rolling upgrades.
- Postgres requirements, email setup, backups and tax calculation.
- When something breaks: the operations runbook. Find what you see, then follow its steps.
Engineering
Section titled “Engineering”- How Hardcount is engineered: the rules, with the proof for each.
- Measured runs: correctness under failure and sustained throughput.
Changing Hardcount itself? Contributor docs, design notes and records are in docs/dev/.