Introducing our new Usage Billing Engine

Integrate Polar

From one prompt to production billing

MCP

✻ Claude Code~/acme · Polar MCP connected
>
01MCP

Agents included

Polar as a tool your agent can call

A remote MCP server with OAuth, so there are no keys to paste. Three meta-tools keep the context small, so the agent only loads the operations it needs.

Polar MCP server

Connect

OAuth

claude mcp add --transport http polar https://mcp.polar.sh/mcp/polar-mcp

Claude Code

Cursor

ChatGPT

Claude Desktop

Your browser opens to sign in and authorize. No API key to copy into the agent.

~/acme
>

search_tools

Search

The agent describes what it wants to do and gets back the operations that fit.

describe_tools

Inspect

It loads the exact inputs for the best matches, and nothing else.

execute_tool

Execute

It runs the operation with validated arguments and reads the result.

100 operations

Everything underneath

Products, customers, subscriptions, orders, benefits, refunds and metrics.

zsh

claude mcp add --transport http polar https://mcp.polar.sh/mcp/polar-mcp
02SDK

Built for your framework

Typed clients underneath

Start with an adapter for your framework. Underneath sit the typed TypeScript and Python clients for everything else.

Adapters

One file in your framework gives you a checkout route, a customer portal and verified webhooks. Pick yours to see the checkout handler.

app/checkout/route.ts

import { Checkout } from '@polar-sh/nextjs'

export const GET = Checkout({
accessToken: process.env.POLAR_ACCESS_TOKEN,
successUrl: 'https://myapp.com/welcome',
})

Clients

The adapters are built on these. Reach for them when you need the rest of the API.

TypeScript

For Node, Bun, Deno and the browser. The import path pins your API version and everything after that is autocomplete.

npm install @polar-sh/sdk

index.ts

import { createPolar } from '@polar-sh/sdk/2026-10'

const polar = createPolar({
accessToken: process.env.POLAR_ACCESS_TOKEN,
})

// every entitlement and balance, one call
const state = await polar.customers.getStateExternal('acme')

Python

Sync and async clients for Django, Flask and FastAPI, typed end to end.

pip install polar-sdk

main.py

from polar.v2026_10 import Polar

polar = Polar(os.environ["POLAR_ACCESS_TOKEN"])

# every entitlement and balance, one call
state = polar.customers.get_state_external("acme")
03CLI

Localhost, wired in

The whole API from the terminal

Sign in, tunnel webhooks, fire events and call any endpoint without leaving the terminal. Every command can speak JSON.

zsh

% curl -fsSL https://polar.sh/install.sh | bash

% polar webhook listen http://localhost:3000/api/webhooks

● Connected Acme
Forwarding http://localhost:3000/api/webhooks
Waiting for events...

% polar webhook trigger order.paid --seed 7

order.paid 200 12ms

% polar auth whoami --json

{ "source": "session", "organization": { "slug": "acme", ... } }

--json

Built for agents

Auth, webhook and the API commands print JSON on request, so a coding agent can drive the CLI.

webhook trigger --list

Every event

The full webhook catalog with descriptions. Pick one interactively or pass it by name.

--override --seed

Shaped fixtures

Change any field in the payload and get the same IDs on every run.

21 resources

The API, as commands

Customers, products, subscriptions, orders, meters and more, generated from the OpenAPI spec.

04API

One REST API

Everything the dashboard can do

Every resource the dashboard touches, behind versioned endpoints and organization tokens.

From usage to revenue

Integrate in an afternoon