Polar โ€” Monetize your software with ease | Polar

2 min read Original article โ†—

Turn your software into a business with 6 lines of code

Powering billing for thousands of startups

Framework Adapters

Integrate in under a minute

Next.js Adapter

Payments and Checkouts made dead simple with Next.js

  • Secure & Simple Checkouts

  • Integrated Customer Portal

  • Granular & Reliable Webhook Handler

  • Global Merchant of Record

import { Checkout } from "@polar-sh/nextjs";

export const GET = Checkout({
  accessToken: 'xxx'
});

Ingestion Based Billing

Usage Based Billing on Autopilot

LLM Strategy

Capture your Customer's LLM Usage & bill them for it

  • Automatic Token Consumption Ingestion

  • Prompt & Completion Tokens

  • Vercel AI SDK Support

import { Ingestion } from "@polar-sh/ingestion";
import { LLMStrategy } from "@polar-sh/ingestion/strategies/LLM";
import { generateText } from "ai";
import { openai } from "@ai-sdk/openai";

const llmIngestion = Ingestion({ accessToken: 'xxx' })
  .strategy(new LLMStrategy(openai("gpt-4o")))
  .ingest("openai-usage");

export async function POST(req: Request) {
  const { prompt }: { prompt: string } = await req.json();

  const model = llmIngestion.client({
    externalCustomerId: "<USER_ID_FROM_YOUR_DATABASE>",
  });

  const { text } = await generateText({
    model,
    system: "You are a helpful assistant.",
    prompt,
  });

  return Response.json({ text });
}

Built for simplicity

Powerful Checkouts made simple

Polar as Merchant of Record

Forget all about billing & taxes. We handle it all for you as the merchant of record.

  • Sales Tax, VAT, GST, etc.

  • Withdraw with Stripe Connect

  • Detailed Transactions Ledger

Polar as Merchant of Record

Testimonials

Why people love Polar

Competitive Pricing

Polar is proud to be the cheapest Merchant of Record on the market.

  • 4% + 40ยข per transaction

  • No hidden fees

  • Global Merchant of Record

  • Negotiated Volume Discounts

FeaturePolarStripe
Payment Processing
Subscription Management
Merchant of Record
Global Tax Compliance
Framework Adapters
Payments in 6 lines of code
Flexible Usage Billing