Hosted auth (Auth0, Clerk and similar) is usually the cheaper choice until your monthly active users grow past the free tier, or until a single feature you need (SSO, MFA, organizations) sits behind a much more expensive plan. Self-hosting (Better Auth in your own app, or Keycloak as a separate service) is cheaper in invoices but costs engineering time and on-call risk. The break-even is rarely a MAU count; it is the moment one gated feature forces a plan jump.
This post is about the decision, not a price list. Auth vendors change plans often, so I describe pricing models and tell you which numbers to pull from your own invoice. Everything below is as of late 2026; check current pricing pages before acting.
How do hosted auth vendors actually charge?
Almost all of them combine three levers, and the bill surprises come from the second and third, not the first:
- Monthly active users (MAU). Free up to a threshold, then a per-user rate that usually declines with volume.
- Feature gating by plan. Enterprise SSO (SAML/OIDC connections), custom domains, advanced MFA, organizations/roles, and log retention are commonly reserved for higher tiers or sold as add-ons.
- Per-connection or per-seat add-ons. Enterprise SSO is often priced per customer connection, which scales with your customers' IT departments, not your user count.
Takeaway: a flat MAU estimate understates the bill whenever your first enterprise customer asks for SSO.
What are the real "cliffs" to watch for?
In my experience reviewing auth bills for small SaaS products, these are the moments cost jumps non-linearly:
- Free tier exit. The jump from zero to a first invoice is psychologically big, though usually small in absolute terms.
- B2C-to-B2B transition. Your first customer who says "we need SAML" can move you to a different plan tier entirely.
- MAU definition quirks. Some vendors count anyone who authenticates or refreshes a token in the month. Bots, abandoned signups, and credential-stuffing traffic can inflate it. Check how your vendor defines "active" before you trust your own user numbers.
- Machine-to-machine tokens. If the vendor meters M2M or API tokens separately, a chatty background service can create a line item you didn't plan for.
Takeaway: read the MAU definition and the SSO pricing line before you compare headline rates.
What does self-hosting really cost?
Invoices go to zero; other costs show up.
| Cost | Hosted (Auth0, Clerk) | Library in your app (Better Auth) | Standalone server (Keycloak) |
|---|---|---|---|
| Invoice | Per MAU + gated features | Your existing DB/hosting | Extra VM or containers plus DB |
| Setup time | Hours | Hours to days | Days |
| Security patching | Vendor | You (dependency updates) | You (server + realm config) |
| Enterprise SSO | Gated or per-connection | You build or integrate | Built in (SAML/OIDC brokering) |
| Incident risk | Vendor outage | Your app's uptime | A separate service to keep alive |
| Main drawback | Pricing cliffs, lock-in | Smaller ecosystem than the big vendors; you own the edge cases | Heavy operationally; Java service, upgrade and theming effort |
Better Auth is an open-source TypeScript auth library that stores users and sessions in your own database, so there is no extra service to run, but password reset emails, rate limiting, and abuse handling become your responsibility. Keycloak is an open-source identity server with SAML, OIDC, and identity brokering built in; the price of that completeness is operating another stateful service and learning its realm/client model.
Takeaway: self-hosting swaps a variable invoice for a fixed tax of engineering attention, and that tax is paid at the worst moments, like a CVE on a Friday.
When is hosted auth worth paying for?
Pay for hosted auth when at least one of these is true:
- You have no one who wants to own security-sensitive code, and your team is under roughly a handful of engineers.
- Your users are mostly B2C, and your MAU is below the point where the invoice is a meaningful share of revenue.
- You need passkeys, MFA, bot protection, and breach-password checks working this week, not this quarter.
If you want the managed version with prebuilt UI components for React and Next.js apps, Clerk is the one that gets you to a working sign-in flow fastest; its drawback is that your user model and components are tightly coupled to their SDK, which makes leaving more work than it looks. If your priority is a mature enterprise feature set (many connection types, rules and hooks, a long track record with compliance-minded buyers), Auth0 is the established choice, and its drawback is that it is the vendor most often cited when teams hit those plan-tier jumps.
Takeaway: hosted auth is worth it while the invoice is smaller than the engineering time you'd spend on ownership.
When should you move to self-hosting?
Move when the shape of your bill, not just the size, stops matching your revenue. Concrete triggers:
- A large share of your MAU is free-plan users generating no revenue.
- You need SSO for many small customers and per-connection pricing exceeds what those customers pay you.
- You already run Postgres and a Node service, so a library like Better Auth adds almost no operational surface.
- Data residency or audit requirements make a third-party user store a liability.
If you need self-hosted SAML and OIDC brokering for B2B customers, Keycloak is the one that includes it out of the box without per-connection fees; plan for real operational work.
The migration detail that decides feasibility is password hashes. Some vendors only export them on request through support, and some don't export them at all, in which case you must force a password reset or migrate users lazily at next login. Ask this question before you sign up, not when leaving.
Takeaway: the exit cost of auth is set on day one by whether you can export password hashes.
How do you calculate the break-even?
Fill in the placeholders from your own invoice and quotes. The numbers below are made up for illustration only.
from dataclasses import dataclass @dataclass class HostedPlan: base: float # monthly platform fee included_mau: int # MAU covered by base per_extra_mau: float sso_connections: int per_sso_connection: float def hosted_monthly(plan: HostedPlan, mau: int) -> float: extra = max(0, mau - plan.included_mau) return ( plan.base + extra * plan.per_extra_mau + plan.sso_connections * plan.per_sso_connection ) def self_hosted_monthly(infra: float, eng_hours: float, hourly: float) -> float: # eng_hours: realistic monthly upkeep (patches, incidents, support tickets) return infra + eng_hours * hourly if __name__ == "__main__": plan = HostedPlan(base=100, included_mau=10_000, per_extra_mau=0.02, sso_connections=5, per_sso_connection=75) own = self_hosted_monthly(infra=60, eng_hours=6, hourly=90) for mau in (5_000, 20_000, 50_000, 100_000): h = hosted_monthly(plan, mau) print(f"MAU {mau:>7,}: hosted {h:>9,.0f} self-hosted {own:>7,.0f} " f"-> {'self-host' if own < h else 'hosted'}") The honest part is eng_hours. Most teams guess zero, which makes self-hosting look free. Count patch reviews, upgrades, and the occasional incident, and multiply by what an engineer hour costs your company.
Takeaway: if you can't defend your eng_hours estimate, you can't claim self-hosting is cheaper.
FAQ
Is Auth0 or Clerk cheaper than self-hosting?
At low MAU, usually yes, because the free tiers cover you and you avoid engineering hours. Self-hosting becomes cheaper when MAU is high, many users are non-paying, or SSO per-connection fees exceed what those customers pay.
Can I migrate away from a hosted auth provider later?
Yes, but only smoothly if you can export password hashes and your own user IDs. If hashes aren't exportable, plan for forced password resets or lazy migration at next login.
Is Keycloak or Better Auth better for a small SaaS?
Better Auth fits a TypeScript app that already has a database and mostly needs email/password, social login, and sessions. Keycloak fits when you need SAML, OIDC brokering, or a central identity server shared across several apps.
Bottom line
Start with hosted auth if you're small, B2C-leaning, or short on people who want to own security code, and revisit the decision when SSO requests arrive or the invoice grows faster than revenue. Choose Better Auth when you're already on TypeScript and Postgres and want auth inside your own deployment. Choose Keycloak when B2B SSO is the product requirement and someone on the team can run a Java service. Whichever you pick, store your own stable user ID and confirm hash export now, because that is what keeps the next migration affordable.
