← 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.

Start with who funds each call

Choose the money flow before adding a markup. The same tool can support internal usage or a customer-facing feature, but those flows create different balances and earnings.

Start with who funds each 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

Work through one customer price

For a hypothetical operation with a $0.05 base cost, a 20% markup and $0.002 flat markup produce a $0.062 customer price: $0.05 + $0.01 + $0.002. The $0.012 difference is the configured margin for that example. These numbers are illustrative, not a quote for any provider or a prediction of net profit.

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

Keep authorization, execution, and accounting connected

Identify the customer before execution, verify the credential can use the operation, and authorize its price against the intended balance. Preserve the operation identifier and idempotency key with your own request record. This makes later investigation possible when a browser disconnects or an upstream operation takes longer than expected.

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

Model failure states accurately

A non-streaming request that fails before success releases its reservation. Streaming is different: after the provider accepts a stream, a later client disconnect can remain charged. Response-priced and live-quoted tools also need explicit handling for reserved maxima and final receipts.

Show the customer the supported final price and balance, keep provider base costs in trusted management surfaces, and reconcile against activity and ledger records. Test the intended 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