# Limitr: The monetization layer for usage-based billing > Limitr is a managed monetization platform for usage-based billing. It prices, gates, and meters usage inside your app in real time, so unit economics hold across every plan, contract, and customer. This file contains links to documentation sections following the llmstxt.org standard. ## Table of Contents - [Limitr overview](https://limitr.dev/docs/marketing-overview.md): Limitr is the monetization layer for usage-based billing. Limitr Cloud is a managed platform for pricing, contracts, billing, and live margin, pair... - [Usage-based billing, limits, and feature flags in your app](https://limitr.dev/docs/docs/introduction.md): Limitr is an open-source engine for usage-based billing, limits, and feature flags. One policy decides access, cost, and price on every call, in-pr... - [Quickstart: usage-based billing in a few minutes](https://limitr.dev/docs/docs/quickstart.md): Install @formata/limitr, write a policy with two plans, and gate your first calls: feature flags, daily and monthly limits, and AI tokens billed pa... - [How Limitr works: the policy, the engine, and each call](https://limitr.dev/docs/docs/how-it-works.md): The pieces of a Limitr policy (credits, plans, entitlements, customers, grants, caps), how the engine decides each call, and the events it sends. - [Live demo: the Limitr engine in your browser](https://limitr.dev/docs/docs/demo.md): The Limitr engine running live in your browser. Change prices, costs, limits, and modes, and watch usage, revenue, cost, and margin move call by call. - [Limitr tutorial: usage-based billing in 15 programs](https://limitr.dev/docs/docs/tutorial/index.md): A short book on usage-based billing with Limitr: 15 chapters, each one a small program you can run, from a first policy to AI calls, org budgets, a... - [Limitr tutorial 1: Why Limitr](https://limitr.dev/docs/docs/tutorial/why-limitr.md): Where usage-based billing gets hard, and what Limitr does about it: one policy, and an engine that runs inside your app. - [Limitr tutorial 2: Your first policy](https://limitr.dev/docs/docs/tutorial/first-policy.md): Credits, plans, and entitlements, the allow call, and how a Stof policy is written. - [Limitr tutorial 3: Customers and plans](https://limitr.dev/docs/docs/tutorial/customers-and-plans.md): Default plans, orgs and their users through refs, plan changes, and alt IDs. - [Limitr tutorial 4: Limits and resets](https://limitr.dev/docs/docs/tutorial/limits-and-resets.md): Units like 1GB and 1day, rolling and calendar periods, and resets that need no cron jobs. - [Limitr tutorial 5: Hard, soft, and observe](https://limitr.dev/docs/docs/tutorial/hard-soft-observe.md): Deny the call, allow it and bill the overage, or just watch: limit modes and the events they send. - [Limitr tutorial 6: Pricing and margins](https://limitr.dev/docs/docs/tutorial/pricing-and-margins.md): Prices, costs, and tiers, and the margin of every call as it happens. - [Limitr tutorial 7: AI calls: reserve and settle](https://limitr.dev/docs/docs/tutorial/reserve-and-settle.md): Costs that change per call, usage you only know afterwards, and predicting the size of a call before it runs. - [Limitr tutorial 8: Stacking entitlements](https://limitr.dev/docs/docs/tutorial/stacking-entitlements.md): One action, several meters: check them all, then count them all. - [Limitr tutorial 9: Control and monetize](https://limitr.dev/docs/docs/tutorial/control-and-monetize.md): Rate limits that protect you, next to the usage you sell, with governors. - [Limitr tutorial 10: Seats, top-ups, and spend caps](https://limitr.dev/docs/docs/tutorial/seats-topups-caps.md): Org seats, prepaid credit packs, and budgets shared across an org. - [Limitr tutorial 11: Running it in your app](https://limitr.dev/docs/docs/tutorial/running-in-your-app.md): One engine per server, gating requests in one place, and saving customer state. - [Limitr tutorial 12: Validation and errors](https://limitr.dev/docs/docs/tutorial/validation-and-errors.md): Policy formats, validation, and what happens when something is wrong. - [Limitr tutorial 13: Going to Cloud](https://limitr.dev/docs/docs/tutorial/going-to-cloud.md): The same code with Limitr Cloud: managed policies, shared customer state, billing, and analytics. - [Limitr tutorial 14: The language underneath: Stof](https://limitr.dev/docs/docs/tutorial/stof.md): Reading the policy document from your app, asking it questions, and why Limitr is built on Stof. - [Limitr tutorial 15: Feature flags and custom deals](https://limitr.dev/docs/docs/tutorial/feature-flags.md): Rollouts, kill switches, per-call rules, and giving or taking features per customer. - [Map your pricing model to a policy](https://limitr.dev/docs/docs/how-to/map-your-pricing.md): Turn a pricing page into a Limitr policy, line by line, for usage-based, seat-based, credit-based, flat, and hybrid pricing. - [Price AI tokens per model, with margin per call](https://limitr.dev/docs/docs/how-to/ai-token-costs.md): Price AI calls per model and per input and output token, with a credit per model or a cost function. Bill line items that match your provider, and ... - [Reserve and settle LLM calls](https://limitr.dev/docs/docs/how-to/reserve-llm-calls.md): Gate LLM calls whose size you only know afterwards: reserve room first, settle what the call used, and keep concurrent calls from overspending toge... - [Predict LLM output tokens before the call](https://limitr.dev/docs/docs/how-to/predict-output-tokens.md): Predict how long an AI answer will be before the call, from its input tokens, per model. Use it to set max_tokens, quote a price, or pick a model. - [Feature flags, rollouts, and experiments](https://limitr.dev/docs/docs/how-to/feature-flags.md): Kill switches, percentage rollouts that widen cleanly, beta lists, rules per request, features for the front end, and measuring a rollout or A/B test. - [Trials and custom deals without a plan per customer](https://limitr.dev/docs/docs/how-to/custom-deals.md): Give one customer a feature their plan doesn't have, trial a higher plan's feature with an expiry, raise limits with overrides, or pause a feature. - [Seat-based pricing on the org](https://limitr.dev/docs/docs/how-to/seats.md): Count seats on the org whichever user invites someone. Included seats, billing extra seats, hard seat limits, removing members, and what to bill ea... - [Budgets and spend limits for customers and orgs](https://limitr.dev/docs/docs/how-to/budgets.md): Let customers set a monthly spend limit, warn them before they reach it, share a budget across an org, and cap what a customer can cost you. - [Prepaid credits and credit packs](https://limitr.dev/docs/docs/how-to/prepaid-credits.md): Sell credits that every feature spends at its own rate. Monthly included credits, credit packs, balances, and features that stop when credits run out. - [Rate limits next to paid usage](https://limitr.dev/docs/docs/how-to/rate-limits.md): Protect your infrastructure with rate limits (governors) that sit next to the usage customers pay for, never lifted by credit packs, with a Retry-A... - [Bill usage from events](https://limitr.dev/docs/docs/how-to/bill-from-events.md): Turn Limitr's events into invoice lines: plan fees, overage, extra seats, and credit packs, with what credits covered already taken off. - [Save customer state in your database](https://limitr.dev/docs/docs/how-to/save-customer-state.md): Keep Limitr's customer state in your own database: save changed customers from events, load them on start or first use, and run more than one server. - [Change plans: upgrades, downgrades, and credit packs](https://limitr.dev/docs/docs/how-to/change-plans.md): Upgrade and downgrade customers mid-period: keep usage counted so far, carry credit packs to the new plan, keep deal features, and handle customers... - [Test a pricing policy like code](https://limitr.dev/docs/docs/how-to/test-a-policy.md): Test pricing like code. Validate a policy in CI, write tests for what each plan allows and bills, test time-based behavior, and test policies in St... - [Extend Limitr: your own rules, tools, and services](https://limitr.dev/docs/docs/how-to/extend-limitr.md): A Limitr policy can carry its own logic: cost functions, feature rules, event handlers, your own functions, capabilities, and connections to your a... - [Write policies in Stof](https://limitr.dev/docs/docs/how-to/write-stof-policies.md): The Stof you need for Limitr policies: syntax and units, functions for costs, rules, and notifications, shared types, null handling, and flat memory. - [Call your app from a policy](https://limitr.dev/docs/docs/how-to/call-your-app.md): Let policy functions call your application: register host functions with doc.lib, call them from notifications and handlers, and allow HTTP from a ... - [Give AI agents tools, gated by plan](https://limitr.dev/docs/docs/how-to/ai-tools.md): Define capabilities in a Limitr policy and hand them to Claude as tools, filtered by each customer's plan. Tool definitions, running a tool_use blo... - [Policy document reference](https://limitr.dev/docs/docs/reference/policy.md): The shape of a Limitr policy, the formats it can be written in (Stof, JSON, YAML, TOML), its top-level fields, and how the engine validates it. - [Credits, prices, and pricing models](https://limitr.dev/docs/docs/reference/credits.md): Credits are the units Limitr counts. Each has a price, an overhead cost, units, and a pricing model: flat, tiered, volume, or stairstep. - [Cost functions and margin per call](https://limitr.dev/docs/docs/reference/cost-and-margin.md): How Limitr records what each call costs you (fixed, per-call cost functions, or the provider's actual cost), its list price, and margin per call, c... - [Exchange: convert any credit into any other](https://limitr.dev/docs/docs/reference/exchange.md): The exchange converts any credit into any other through runes: abstract credits like AI credits that pay for the credits you meter, prices set in c... - [Plans, the default plan, and plan fees](https://limitr.dev/docs/docs/reference/plans.md): Plans group entitlements and credit packs. Plan fields, the default plan, how customers get a plan (directly or through refs), plan changes, and su... - [Entitlements, limits, and resets](https://limitr.dev/docs/docs/reference/entitlements.md): What a plan allows: entitlement and limit fields, hard, soft, and observe modes, resets and calendar schedules, rate limits, and org scope. - [Feature rules: rollouts, kill switches, and tracking](https://limitr.dev/docs/docs/reference/feature-rules.md): An entitlement's enabled rule for kill switches, rollouts, and per-call rules; customer.bucket for percentage rollouts; features() for the front en... - [Customers: IDs, refs, overrides, and state](https://limitr.dev/docs/docs/reference/customers.md): Customers hold Limitr's state. Creating customers, IDs, users and orgs through refs, alt IDs, overrides, giving and taking entitlements, and saved ... - [Grants and topups: credit packs and balances](https://limitr.dev/docs/docs/reference/grants-and-topups.md): Topups are credit packs on a plan, and grants are the balances they give a customer. Fields, included packs, expiry, resets, rollover, spend order,... - [Spend caps: budgets across features and credits](https://limitr.dev/docs/docs/reference/spend-caps.md): Budgets across calls, entitlements, and credits, in any currency: adding caps, shared org budgets, overage-only and cost caps, warnings, resets, an... - [Reservations and estimates](https://limitr.dev/docs/docs/reference/reservations.md): Reserve room before a call whose size you only know afterwards, settle what it used, and predict how big a call will be: reserve, settle, release, ... - [Events reference: usage, billing, and customer events](https://limitr.dev/docs/docs/reference/events.md): Every event the Limitr engine sends and its payload: meter events with cost and price per call, caps, customers, plans, and features, and which to ... - [Notifications: rules on engine events](https://limitr.dev/docs/docs/reference/notifications.md): Rules in the policy that watch Limitr's events: matches and fire, adding notifications at runtime, Stof event handlers, and common alert conditions. - [Capabilities: compose and extend a policy](https://limitr.dev/docs/docs/reference/capabilities.md): Capabilities are named, access-controlled functions in a Limitr policy. Run them from your app, connect services, load data from APIs, and hand the... - [Engine functions reference](https://limitr.dev/docs/docs/reference/engine-functions.md): Every function the Limitr engine exposes on the policy, with signatures and return values: metering, reservations, reads, customers, caps, and plans. - [TypeScript SDK reference (@formata/limitr)](https://limitr.dev/docs/docs/reference/typescript-sdk.md): Reference for @formata/limitr, the TypeScript and JavaScript SDK: creating the engine, every method with arguments and defaults, events, and Cloud ... - [Runtime and sandbox](https://limitr.dev/docs/docs/reference/runtime.md): How the Limitr engine runs in your process: where it runs, the sandbox, the time limit on policy calls, flat memory, reading the policy document, a... - [Notifications & Alerting](https://limitr.dev/docs/guides/cloud/notifications.md): Configure subscriptions, scope alerts with segments and event conditions, and route notifications to email or the SDK. - [Cloud Quick Start](https://limitr.dev/docs/guides/cloud/quickstart.md): Connect to Limitr Cloud, understand what changes, and migrate from local enforcement in one step. - [Managing Customer Segments](https://limitr.dev/docs/guides/cloud/segments.md): Define dynamic customer segments using Stof conditions, use them to scope notifications and pricing rules, and filter your dashboard view. - [How to Design a Pricing Model That's Flexible and Scalable for AI Products](https://limitr.dev/blog/design-a-flexible-pricing-model-for-ai.md): A practical playbook for AI startups to design a flexible and scalable pricing strategy. - [AI Pricing Strategy Guide for 2026: How to Cut Engineering Costs and Drive Revenue Growth](https://limitr.dev/blog/ai-pricing-strategy-guide.md): A practical playbook for AI startups navigating pricing complexity, margin pressure, and the shift to hybrid monetization. - [We Mean Runtime Literally](https://limitr.dev/blog/we-mean-runtime-literally.md): Everyone in usage-based pricing says enforcement has to happen at runtime. Limitr means runtime as a noun — an execution environment embedded in yo... - [How to Control Overhead Cost for AI Products](https://limitr.dev/blog/how-to-control-ai-overhead-costs.md): Cost-to-deliver isn't enough. Here's how to measure margin-to-deliver per account, feature, and vendor — then control it with enforcement limits an... - [Customer Story: The Regis Company](https://limitr.dev/blog/regis-case-study.md): How The Regis Company, an enterprise learning platform, used Limitr to meter and enforce real-time AI avatar usage ahead of a fixed-price Fortune 5... - [Limitr 0.7: Real Costs, Predicted Usage, and Feature Flags in the Open-Source Engine](https://limitr.dev/blog/limitr-engine-0-7-0.md): Limitr 0.7 is the biggest release of the open-source engine yet. Costs that change on every call, reservations that predict a call's usage before i...