Skip to main content

LiteLLM Customer Management

Monetize your AI agent

Keep every customer's model cost under what they pay you.

Agent requestsMeters cost · Enforces capsPrepaid creditsAcme$100 credit packCustomer pays$100Model cost$39cap $6061%marginRequests flowingPer seatGlobex12 seats × $100Customer pays$1,200Model cost$430cap $72064%marginRequests flowingUsage-basedInitechModel cost × 1.3Customer pays$390Model cost$300cap $50023%marginRequests flowingIllustrative customers and amounts · margin before other expenses

Illustrative agent traffic flows through LiteLLM. Three customers on prepaid credits, per-seat, and usage plans each show what they paid, their model cost, and their margin. The prepaid customer reaches a $60 cap and its requests pause.

If you sell an AI agent to other companies, each request from your customers costs you money at the model provider. To monetize the agent, each customer must pay you more than the model cost of that customer. This post gives five frequent ways to charge for an agent. For each way, it shows the LiteLLM Customer Management controls that keep model spend below what the customer pays.

Request cost for the member, the team, and the organization​

It is easy to set a price for your AI agent service. But oftentimes, teams find it difficult to track the cost of each customer request along with the assigned budgets. One customer sends short prompts to a small model. Another customer runs long agent loops on a frontier model. In a large account, one power user can spend more than all the other users together. If you do not know the cost of each customer, you find an underpriced plan only when the provider invoice arrives.

LiteLLM Customer Management shows you the cost of each customer. Your agent sends two headers with each request. The headers give the organization alias and the member ID of the customer. LiteLLM records the cost of the request for the member, the team, and the organization. Before the request goes to the model, LiteLLM checks the budgets at all three levels.

extra_headers={
"x-litellm-customer-org-alias": "Acme",
"x-litellm-customer-member-id": "acme-alice",
}

LiteLLM and your billing system do different tasks. LiteLLM records the cost of each customer and enforces the limits that you set. Your product sets the prices, the credit balances, and the plans. Your billing system collects the payment.

Use case 1: Prepaid credits​

Some companies offer credit packs to their customers. For example, coding agents or AI app builders let customers pay first for a credit pack and then use the AI coding agent. If a member buys $100 in credits, chances are that $60 to $70 of it is set as the budget for model spend. The remaining amount is the margin for the company. Now, if the usage is not tracked properly, the risk is that the customer exceeds the allowed budget and consumes part of the margin.

LiteLLM allows you to monitor this spend and stops new requests from that customer when the spend limit is reached.

Prepaid credits · one memberLiteLLM
  1. $40 stays as marginModel spend cannot go past the cap
  2. Spend reaches $60LiteLLM pauses new requests
  3. Requests flowLiteLLM records the cost of each request
  4. Customer buys $100 in creditsYou set a $60 cap on model spend
Credits $100Spend $0Margin 100%
Illustrative amounts. Grey is unspent credit, blue is model spend, and the bright line is the $60 cap. Your product sells the credits; LiteLLM enforces the cap.

Use case 2: Per-seat plans with an allowance​

Some companies offer AI agents as assistants or researchers, with a price per seat.

Now, even though the price is the same for each seat, the usage of each seat could be quite different. A power-user tends to have significantly higher usage than a default-user.

A default-user template could have a $60 monthly cap, sufficient for most seats in the company. A power-user template with a $90 cap could be for the analysts who use the agent all day. When a new member sends their first request, LiteLLM applies the default template of the organization, and you do not have to configure each seat manually.

Per-seat plan · $100 per seatLiteLLM
SeatTemplateModel spend vs capSeat margin
Anadefault-user · $60
$18
$82
Bendefault-user · $60
$30
$70
Chenpower-user · $90
$40
$60
Danadefault-user · $60
$10
$90
Elipower-user · $90
$25
$75
Firm pays $500Model cost $123Margin 75%
Illustrative seats and prices. The default-user template caps a seat at $60 and power-user at $90; a capped seat pauses while the rest of the firm keeps working.

Also set an organization cap above the templates. This cap limits the total spend of one company to the amount that the company pays you. The cap stays in effect when the company adds seats. If the contract is annual, budget_limits can hold a monthly window and a yearly window on the same budget. Each window resets on its own schedule.

Use case 3: Usage-based billing with a markup​

A platform for customer support agents can bill each client company monthly for its usage. At the end of the period, the platform must have an accurate cost for each client. Then it adds its markup to that cost. The usage API gives the full totals for one organization over a date range. The totals include total_spend, total_tokens, and total_api_requests.

Usage plan · Initech · NovemberLiteLLM
Model cost from usage API
$0.00
Your markup
× 1.3
Invoice
$0.00
Margin
23%
Hard cap $500Day 1 of 30
Illustrative daily spend and markup. LiteLLM reports the model cost; your billing system applies the markup and sends the invoice.
curl --get "$LITELLM_BASE_URL/management/v1/customer_organizations/daily/activity/aggregated" \
--header "Authorization: Bearer $LITELLM_ADMIN_KEY" \
--data-urlencode "customer_org_ids=org-acme" \
--data-urlencode "start_date=2026-11-01" \
--data-urlencode "end_date=2026-11-30"

Your billing system multiplies that spend by your markup and sends the invoice. Also set a hard cap on usage-based plans. If an agent loop does not stop, or if a key leaks, the cost can increase quickly. The hard cap limits that cost before a person reads the invoice.

Use case 4: Upgrades at the cap​

Some sales or marketing content agents have Starter and Pro plans. When a customer reaches the Starter limit, that customer is a possible Pro customer. Customer Management gives you two signals at that time. If you set a soft_budget below the cap, LiteLLM sends a soft_budget_crossed event to your budget webhook. Use this event to show an upgrade prompt before LiteLLM blocks the customer. At the cap, LiteLLM sends a budget_crossed event and refuses new requests with a budget error.

Plan upgrade · cap_policy: pause_allow_increaseLiteLLM
StarterMember spend $12 of $60
  1. soft_budget_crossedShow an upgrade prompt
  2. budget_crossedRequests pause · member asks for more
  3. increase approvedCustomer is on Pro · cap $90
Illustrative plan limits. LiteLLM sends the events to your budget webhook; your app shows the prompt, takes the upgrade, and approves the increase.

The next step depends on the cap_policy of the member. With pause_until_reset, the member waits for the next budget period. This policy is good for a free tier. With pause_allow_increase, the member can send a budget increase request. You approve the request in your own review flow after the customer upgrades or buys more credits.

Webhook delivery is best effort. Thus, also read the usage data to make sure that your records agree with LiteLLM.

Use case 5: Plan tiers with a lower-cost fallback​

A research or analytics agent can offer a premium model only on higher tiers. Frontier models have the highest cost for each request, so they use your margin fastest. When the premium allowance of a customer is empty, the customer can continue to work. To do this, give the virtual key of the customer a per-model budget for the premium model and a fallback to a lower-cost model. The customer then uses the lower-cost model until the overall budget is empty. The organization, team, and member caps still apply.

Premium tier · per-model allowanceLiteLLM
Premium allowance $14 / $40
Customer hard cap $14 / $60
Illustrative amounts. The per-model allowance triggers the switch; the customer's hard cap still applies. Per-model key budgets require LiteLLM Enterprise.

Per-model key budgets and budget fallbacks are available only with LiteLLM Enterprise.

Which control fits which plan​

How you chargeExample use caseCustomer Management control
Prepaid creditsCoding agent, app builderMember cap below the credit value
Per seatLegal or finance assistantBudget templates per seat type, organization cap
Usage-basedSupport agent platformUsage aggregate API per organization, hard cap as a safety limit
Tiered plansContent or sales agentsoft_budget webhook for upgrade prompts, cap_policy and increase requests
Premium model tiersResearch or analytics agentPer-model key budget with a lower-cost fallback (Enterprise)

You can use these controls together. For example, a per-seat plan with credit top-ups uses the same headers and the same budget hierarchy. A usage plan with a premium model tier also uses them.

Show customers their own usage​

Your backend uses the usage and budget APIs for billing. You can also use the same APIs for a usage page in your product. Then the customer sees the same spend that you charge for, next to their credits and upgrade options. Keep the admin key on your backend. Give each customer access to the data of their own organization only.

Get started​

To import a customer, send a request with their identity, and read their usage, follow the Track customer spend walkthrough. The API reference gives the details of templates, overrides, cap policies, and webhooks. Without an Enterprise license, Customer Management is free. The limit is 5 customer organizations, 5 teams for each organization, and 5 members for each team.

The customer APIs are on main. We did not yet verify that a published release contains the full flow. Before you deploy, check the availability.

If you build an agent for your customers and want help with budgets for your prices, complete the form. We will contact you within 24 hours.