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 →

Price AI usage per model and token type

One meter counts tokens. Each usage event carries labels such as model and token type, and each label combination gets its own price. Ready-made prices for Anthropic-, OpenAI- and Replicate-style pricing are one call away.

AI pricing reference → · Your first invoice →

Sell prepaid credit

Sell "pay $9k, get $10k of usage". Later invoices use the credit up, free credit first. Your app can read the live balance and stop serving a customer whose credit has run out.

Prepaid credit → · Stop usage when credit runs out →

See your margin per customer and model

Enter what each AI provider charges you per token, once. Hardcount shows each customer's usage revenue next to what it cost you, per model. Usage only: base fees, credits and taxes are left out.

See your margin →

The Margin card for the demo customer: $5.73 usage billed, $2.76 provider cost and 51.9% margin, with claude-sonnet-4.5 at 67.1% and claude-haiku-4.5 at 20.0%.The Margin card for the demo customer: $5.73 usage billed, $2.76 provider cost and 51.9% margin, with claude-sonnet-4.5 at 67.1% and claude-haiku-4.5 at 20.0%.

Invoices your customers can read

One line per model and token type, a PDF, a hosted invoice page the customer opens from a secure link, credit notes, and tax through Stripe Tax or a flat rate you set.

How invoices are made → · Tax →

The lines of the demo invoice in the Hardcount dashboard, for the period Oct 29 to Nov 28, 2026: input, output and cache_read tokens for claude-sonnet-4.5, input and output tokens for claude-haiku-4.5, each priced per 1M tokens, with $5.73 due.The lines of the demo invoice in the Hardcount dashboard, for the period Oct 29 to Nov 28, 2026: input, output and cache_read tokens for claude-sonnet-4.5, input and output tokens for claude-haiku-4.5, each priced per 1M tokens, with $5.73 due.

Get paid, and retry when a card fails

Stripe charges the saved card. When a charge fails, Hardcount retries on your schedule and, once email is set up, emails the customer. When Stripe's answer is unclear, it checks Stripe for the payment before charging again.

Payments and retries →

Subscriptions and plans

A subscription puts a customer on a plan. Around it:

  • Free trials, which you can extend.
  • Pausing collection: new invoices stay drafts until you resume.
  • Cancelling now, at the end of the period, or at a date you set.
  • Plan changes with proration: the customer pays only for the part of the period each price was active.
  • A different price for one customer (a price override), or credit. There are no coupons.
  • Billing thresholds: an invoice made early once the period's usage reaches a level you set.
  • A usage and cost figure your app can show each customer.
  • A team: invite people by email. Every member has full access; there are no roles yet.
  • Test and live API keys, with test and live data kept apart.

Subscriptions in the API → · API keys → · The usage figure →

Test a change before customers see it

Move a test customer's clock forward and a month of billing happens in seconds: the invoice, the charge, the retries. Preview the next invoice. Everything runs in test mode until you switch to live.

Test clocks → · Your first invoice →

Built for developers

A REST API, usage events that count once even when resent, signed webhooks kept in the database and retried, LiteLLM support with no SDK, CSV exports, and an audit log that Hardcount’s own database user cannot change or delete.

API reference → · LiteLLM →

One usage event, sent with curl:

curl -X POST http://localhost:8080/v1/usage-events \
  -H "Authorization: Bearer $HARDCOUNT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"event_name": "tokens",
       "external_customer_id": "acme-1",
       "quantity": 1200,
       "dimensions": {"model": "claude-sonnet-4.5", "token_type": "input"},
       "idempotency_key": "req-42:input"}'

Run it yourself

One Go program and Postgres, plus Redis for rate limits; the ready-made Docker Compose setup runs five small containers. Your billing data stays in your own database. MIT, with no paid edition and no telemetry.

Self-host → · Pricing →

Every feature

Every route the API has, with what each one does: The Hardcount API →

Everything shipped, by date: Changelog → · What Hardcount does not do: Is it right for you? →

Try it on your computer

Start Hardcount in test mode and run its demo. Found something rough? Open an issue or a Discussion.