← All guides

Locus product guide · Updated

Usage-Based Billing for AI Agents and APIs

Usage-based billing for an AI product connects each tool call to the customer who caused it, calculates an effective price, checks available funds, and records a charge or release. Locus Pro Enterprise combines the supplied tool catalog with customer balances, markup, and billing records, so a platform can meter the APIs it offers.

Who pays for each tool call?

Either your workspace pays, or your customer does, through credits you allocate or credits they buy through hosted checkout. Choose the flow before adding a markup, since each creates different balances and earnings.

Who pays for each tool call?
ModelFundingHow margin is handled
Internal agentsThe workspace buys credits and absorbs usagePool calls use the applicable base cost
Your own customer billingCollect payment, then allocate existing pool creditsConfigured markup returns to the pool as credits are used; you already hold the cash
Locus-hosted fundingEnd users buy credits through supported hosted checkoutEligible markup accrues as earnings subject to payout terms and review

How is a customer price calculated?

Customer price is base cost plus a percentage markup plus any flat markup. For a hypothetical $0.05 operation, a 20% markup and a $0.002 flat markup give $0.062: $0.05 + $0.01 + $0.002. The $0.012 difference is the configured margin. These numbers are illustrative, not a provider quote or a profit forecast.

Processing charges, commercial fees, refunds, disputes, and payout terms affect your economics separately. Enterprise prices use exact decimals and the documented rounding rules. Endpoint overrides take precedence over provider settings and workspace defaults for the same pricing field. Read the resulting effective price instead of recomputing it from dashboard labels.

How do I tie each charge to the right customer?

Identify the customer before execution, confirm the credential can use the operation, and authorize the price against that customer’s balance. Store the operation identifier and idempotency key with your own request record. That lets you investigate later when a browser disconnects or an upstream call runs long.

Retry the same logical request with the same idempotency key. For an operation that changes upstream state, check that state after a timeout before starting a new one. Billing idempotency does not undo an external side effect.

What happens to charges when a call fails?

A non-streaming request that fails before success releases its reservation. After a provider accepts a stream, a later client disconnect can stay charged. Response-priced and live-quoted tools also need handling for reserved maximums and final receipts.

Show customers the final price and balance. Keep provider base costs in trusted admin views, and reconcile against activity and ledger records. Test the paid path with known-positive data before turning a feature on for customers.

Frequently asked questions

Is Locus Pro just a usage meter?

It supplies an API tool catalog as well as usage metering and billing for supported calls. A general usage-metering product typically measures events from a product you already operate; evaluate which responsibilities your architecture needs.

Does allocating credits charge a customer card?

No. Allocation moves existing workspace credits to an end-user balance. Collecting payment through your own billing or a hosted checkout is a separate step.

Implementation references

Use these first-party references for current request contracts and account requirements. Tool availability, prices, and negotiated terms can change.

Related guides