
Polar
Merchant of record billing for AI companies, open source
Replaces Lemon Squeezy, Paddle, Stripe, Fastspring, Metronome, Stripe Billing

Who it's for
Teams building AI products where customers pay per token, agent run, or compute second get event metering, credits, subscriptions, and merchant of record compliance from one API. The startup program offers the Scale plan free for a year for early-stage AI companies.
If you bill for access only, with flat monthly subscriptions and no metered consumption, Polar can handle it but you will not use the metering.
Teams that want to read, test and possibly fork their billing layer get the Apache-2.0 repository on GitHub, with a documented local development setup (DEVELOPMENT.md) and the option to contribute upstream.
If you need merchant of record protection and global tax handling, run the hosted service: self-hosting makes you the seller, with the tax obligations that come with it.
Polar acts as merchant of record on its hosted service, as Lemon Squeezy does, and its docs cover digital products, subscriptions, license keys and file downloads. Lemon Squeezy has announced it stops processing payments on 2027-03-31.
If you need a built-in affiliate program, Polar has none and relies on a third-party tool.
The problem
Building usage-based billing for an AI product means solving three interrelated engineering challenges. The metering layer has to record every token, agent run, or GPU second at the moment it happens, with no batch lag and no double-counting of retried calls. The billing layer has to combine that raw usage with prepaid credits and subscription plans on a single invoice that closes at cycle end. And the compliance layer has to handle sales tax and VAT in every market where you have paying customers: registering as a seller, filing returns, and managing refunds and chargebacks. A merchant of record service takes the compliance problem off your hands. Building a custom metering stack on top of a payment processor is well-trodden but time-consuming: instrument events, store them, aggregate into meters, reconcile against invoices, and still handle tax registration separately. For early AI teams, any of these paths takes engineering weeks before the first customer can pay.
How it works
Every token, API call, agent run, or GPU second sent as an event lands on a live meter updated in real time. Polar records the event the moment your model streams it, without batch jobs or processing lag. Meters are per-customer and roll up continuously for billing at cycle end.
A single product can combine a base subscription plan, a prepaid credits bundle, and metered usage. Credits draw down first; any usage beyond the included credits bills as overage. The invoice closes at the end of each cycle with no manual reconciliation required.
Polar acts as the reseller of your product across more than 100 markets, making Polar legally responsible for sales tax calculation, VAT remittance, fraud screening, and chargeback handling. Payments are captured, screened, and settled against your bank account; the tax liability is on Polar, not on you.
Attach your inference cost to the same events you send for billing by including a cost field in the event payload. Polar puts revenue and cost side by side so you can see gross margin per customer and spot accounts where inference cost exceeds revenue, without exporting to a separate analytics tool.
Connect the Polar MCP server to Claude, Cursor, or ChatGPT using OAuth. Your agent can query customer usage, revenue, and billing data, and create products, discounts, or refunds without API keys to paste into the agent context. Authentication is OAuth-based; your browser opens to authorize the connection.
Features
- Event-based usage metering
- Usage, credits, and subscriptions on one invoice
- Merchant of record in 100+ markets
- Gross margin and cost insights per customer
- MCP server for agent-driven billing
Recommended for this setup
Strengths
- Apache-2.0 licensed repository: The polarsource/polar repository is licensed under Apache-2.0. You can read the billing logic, run a fork for development, or contribute changes, with no black box in the payment code you depend on.
- Full tax and fraud liability transfer to Polar: As merchant of record, Polar assumes legal responsibility for sales tax, VAT, fraud, refunds, and chargebacks in every market it covers. This is not a tax calculation add-on wired to your merchant account: Polar is the seller and the tax is its obligation. That distinction matters most for teams expanding to new markets.
- Composable pricing models in one product definition: Usage billing, subscriptions, seat pricing, trials, and prepaid credits can be composed on a single product without custom glue code. A base plan plus a prepaid credits bundle plus metered overage is one product definition, not three separate billing entities to reconcile at cycle end.
Trade-offs
- Self-hosting removes the tax compliance benefit: Polar recommends its hosted service at polar.sh for the full merchant of record benefits, including global tax compliance. If you self-host the code, you are the seller of record and responsible for sales tax and VAT in every jurisdiction where you have customers. The tax-handling benefit transfers to Polar only on the hosted service; self-hosting the open source code does not transfer that liability.
- No built-in affiliate program: Polar has no native affiliate feature. Running an affiliate program requires connecting a third-party tool: Affonso is the one Polar documents in its ecosystem, integrated via a Polar API token. Teams that need affiliate tracking as a first-party feature will need to build and maintain this additional dependency.
- README and marketing focus on AI workloads: The repository README and product site now position Polar as a billing platform for AI companies with usage-based billing. The documentation still covers digital products, license keys and file downloads. If you sell downloads or licenses rather than metered usage, check the docs for the feature you need before you commit.
Tech stack
FAQ
The Starter plan is free with no monthly fee and charges 5% plus 50 cents per transaction. Paid plans reduce the per-transaction rate; see polar.sh/pricing for current pricing. For early-stage AI startups, the Startup Program offers a year on the most generous plan at no cost.
Yes, but only when you use the hosted service at polar.sh. When Polar acts as your merchant of record, it handles tax calculation, VAT remittance, and compliance across its markets. If you self-host the Polar codebase, you are the seller of record and responsible for all tax obligations in your customers' jurisdictions.
No. Polar has no built-in affiliate feature. Running an affiliate program requires a third-party tool; Affonso is the one Polar documents in its ecosystem, integrated via a Polar API token. If affiliate marketing is a core acquisition channel, factor this additional dependency into your evaluation.
Polar supports usage-based billing (tokens, agent runs, GPU seconds, any event-driven metric), subscriptions, seat pricing, prepaid credits, free trials, and discounts. These can be composed on a single product: a base plan with a prepaid credits bundle and metered overage on one invoice is a supported configuration. The README positions the platform primarily for AI workloads; the documentation also covers digital products, license keys, and file downloads.