Commet
  • Pricing
Log InTry out

What is Token-Based Billing?

Token-based billing charges customers per token their AI product consumes — input, output, and cached. Learn how it works and how to price it for margin.


Token-based billing is a pricing model where customers pay for each token their AI product consumes instead of a flat fee or a per-seat price. It is the standard way to charge for LLM and generative-AI products, because the token is the unit that maps directly to the cost of running a model.

How token-based billing works

A token is the smallest unit a language model processes — roughly a few characters of text. Every request to a model consumes input tokens for the prompt and output tokens for the response, and many providers also bill cached tokens at a reduced rate.

Token-based billing meters each of these separately, because they have different underlying costs. The product records the token counts per request, multiplies them by a per-token rate, and adds a margin to cover infrastructure and turn a profit.

For example, if a model costs $3 per million input tokens and $15 per million output tokens, a product might charge $5 and $20 respectively — passing the cost through and keeping the spread.

Difference from seat-based and flat pricing

Token-based billing is a form of usage-based billing, and it behaves differently from the two models it usually replaces.

Seat-based pricing charges per user, so revenue is decoupled from how much the product is actually used. A team of five that runs millions of tokens pays the same as a team of five that barely touches the product — which loses money on heavy users and overcharges light ones.

Flat pricing charges one price regardless of consumption. It is simple, but for an AI product it means eating the cost when a customer's usage spikes. Token-based billing keeps your revenue aligned with your model costs at every level of usage.

Real-world examples

AI writing assistants, chatbots, coding agents, and RAG applications all bill on tokens. A coding agent charges for the tokens spent reasoning over a repository. A support bot charges for the tokens in each conversation. A document-analysis tool charges for the tokens it reads and the summary it writes.

The pattern is the same: the customer pays in proportion to the model work their request triggered, so a light user and a heavy user are billed fairly for what each consumed.

When to use token-based billing

Use token-based billing when your product's cost scales with model usage and that usage varies a lot between customers. If one account can generate 100× the tokens of another, a flat or per-seat price will either bankrupt you on the heavy accounts or price out the light ones.

It is less suitable when usage is uniform and predictable across customers, where a flat plan is simpler for both sides.

How to protect your margin

Because your cost is the model's token price, your margin is the spread between what the model charges you and what you charge the customer. Two things protect that spread: pricing input, output, and cached tokens separately so you never undercharge the expensive ones, and applying a consistent margin on top of each model's real rate.

Prompt caching and routing cheaper models for simpler tasks lower your cost per request, which widens the spread without raising the customer's price.

How Commet handles token-based billing

Commet tracks AI token usage through the @commet/ai-sdk and prices it with the balance consumption model. Its model catalog carries per-million-token rates, and you set a configurable margin per feature so every charge passes the model cost through plus your spread.

Input, output, and cached tokens are metered separately, and usage across multiple models aggregates into one balance the customer draws down.

Start with the usage tracking docs, or read the guide on usage-based billing for AI products.

Frequently Asked Questions

Token-based billing is a form of usage-based billing where the unit of consumption is the token. It applies to AI and LLM products; other usage-based products meter API calls, storage, or compute instead.

Each token type has a different underlying cost, so they are metered and priced separately. Output tokens usually cost more than input tokens, and cached tokens cost the least. You apply a margin on top of each model's rate.

Track each model's token usage separately with its own per-million-token rate, then aggregate the cost across models into a single balance deduction or invoice line at the end of the period.

Developers

  • Documentation
  • Templates
  • GitHub

Frameworks

  • Next.js
  • Remix
  • Nuxt
  • SvelteKit
  • Astro
  • Express
  • Hono
  • Django
  • FastAPI

Resources

  • Blog
  • Changelog
  • Pricing

AI

  • Agents
  • MCP Server
  • Agent Skills
  • Claude Code
  • Codex
  • Cursor

Learn

  • Guides
  • Glossary
  • Solutions
  • Billing for AI Models
  • Comparison

Compare

  • Stripe alternative
  • Orb alternative
  • Recurly alternative
  • Paddle alternative
  • Chargebee alternative
  • Lago alternative

Company

  • About
  • Open Source
  • Terms
  • Privacy

Countries

  • Mexico
  • Argentina
  • Colombia
  • Chile
  • Peru
  • Ecuador
  • Uruguay
  • Paraguay
  • Bolivia
  • Panama
  • El Salvador
  • Brazil
System statusXLinkedInGitHub