← All guides

Locus product guide · Updated

Build vs buy: metering and billing agent API usage

Build in-house only if your customers' agents call one or two providers at high volume and you already run billing; otherwise buy. Building means an account and key at every provider, a price table you keep current, a usage event per call tagged with the customer, a balance check before each call, refunds for failed calls, and reconciliation against provider invoices. Stripe, Metronome or Orb sell the metering and invoicing. Locus Pro also supplies the APIs and charges each customer's prepaid balance per call.

What are the build vs buy options for agent API billing?

There are four ways to bill customers for the paid API calls their agents make. They differ in how much you still build, in who holds the provider accounts and in what you pay for.

What are the build vs buy options for agent API billing?
OptionWhat you still build or runProvider accountsHow you pay
Build it all in-houseMetering, price table, balances, checkout, ledger and reconciliationYours, one per providerEngineering time, each provider's invoices and card processing on customer payments
Self-hosted open-source meterServers, upgrades, balance checks and provider integrationsYours, one per APINo license fee for Lago (AGPLv3) or OpenMeter (Apache 2.0); you pay for hosting and each provider
Hosted billing engineUsage events, balance checks and provider integrationsYours, at each providerA share of billing volume, often with a fee per event, plus each provider's invoices
Locus Pro EnterpriseThe X-Locus-End-User header on each call, and your markup settingsLocus supplies themA monthly plan, plus each call's catalog price from prepaid credits

What does in-house metering of agent API calls involve?

Each item below is code or a process someone has to own. A billing engine removes the invoicing work, not the rest.

  • Provider access: an account, API key and payment method at each provider, stored in a secret manager and rotated.
  • A price for every endpoint. Providers bill differently: Brave charges per request, Perplexity charges for every successful search even when it returns no results, and Tavily charges credits that vary by request type.
  • Attribution: every call tagged with the customer and the agent that caused it.
  • A balance check before the call, with a hold when the price depends on the response, released if the call fails.
  • Idempotent retries, so a retried call is metered once. Stripe uses an identifier on each meter event to avoid counting it twice.
  • Usage events within your billing tool's limits. Stripe accepts 1,000 meter event calls a second per account and one concurrent call per customer per meter, with timestamps up to 35 days old.
  • Top-up checkout, low-balance alerts and receipts for customers.
  • Monthly reconciliation of provider invoices against customer charges, to find your margin per customer.
  • Provider terms for customer-facing use. Apollo's standard plans, for example, are for internal business use only, and powering external products needs a separate agreement.

How do I resell search and enrichment APIs to my users' agents with a markup?

The common answer is to sign up with providers such as Tavily and People Data Labs, call them from your server and bill through Stripe. That is the build path, and every item in the list above applies again to each provider you add.

Through Locus Pro you call the same kinds of endpoints from one workspace and set your markup for all of them, for one provider or for one endpoint. Locus Pro does not change what a provider allows you to do with its data, so check each API's terms before you put it in front of customers.

How you pay differs too. Provider accounts often come with plans, minimums or paid tiers for the data you need. Through Locus Pro there is no provider account, plan or minimum: each call is charged to one prepaid credit balance shared across providers.

How do I resell search and enrichment APIs to my users' agents with a markup?
CallThrough Locus ProWithout Locus Pro
Tavily searchPer call from prepaid credits, priced by requestA Tavily account and API key, paid in Tavily credits
People Data Labs person enrichmentPer call from prepaid credits; an x402 listing Locus has not reviewedA People Data Labs account; contact data needs the paid Pro plan, since the free plan hides it

Where do in-house agent billing systems go wrong?

Agents retry, run in loops and call tools in parallel, so billing edge cases happen daily rather than rarely. Metering that runs after the call also lags: Stripe processes meter events asynchronously, and Metronome evaluates balance thresholds at least once every three minutes. The table shows each case and what Locus Pro does, from its billing docs.

Where do in-house agent billing systems go wrong?
CaseTypical in-house riskLocus Pro behavior
Agent retries a callBilled twice unless every event carries a stable IDThe same Idempotency-Key replays the stored result with no second charge
Customer balance reaches zeroCalls continue until the meter catches upHTTP 402 before the provider is called
Provider errors or times outCharged unless you release itThe hold is released and nothing is charged
Price depends on the responseYou estimate, then correct the billHeld at the maximum, then settled to measured usage
Search finds nothingYour own refund ruleNo blanket refund: fixed-price calls are charged when the provider succeeds
Agent loops on an expensive toolSpend grows until someone noticesAgent keys cap the allowed tools, the charge per call and the run budget

Is building cheaper than Locus Pro?

Per call, often yes: search APIs such as Brave can cost less with your own Brave account and API key, especially at high volume on one or two providers. What building costs instead is work: most of the build column below is code or upkeep your team owns.

The balance tips toward Locus Pro as the number of providers grows and the volume at each one falls, because every provider adds an account, a key, a price table, terms to review and an invoice to reconcile. Weigh the per-call difference at your own volume against the engineering and on-call time that building takes.

Is building cheaper than Locus Pro?
What you pay forBuild with your own accountsLocus Pro Enterprise
Each API callThe provider's own rate, on its invoiceThe call's catalog price, from the customer's prepaid credits
BillingA billing engine's fee, or the upkeep of your own systemIncluded with the Enterprise plan
Accounts and contractsOne per provider, each with its own terms to reviewOne Locus workspace
Code to buildMetering, balances, holds, refunds, checkout and reconciliationOne header per call and your markup settings
Ongoing workPrice table updates, key rotation and billing on-callFunding or allocating credits and reading the ledger

When should you build agent usage billing yourself?

Build when the provider list is short and a team can own billing.

  • One or two providers carry almost all the volume, so there are few accounts and integrations to run.
  • You already hold provider contracts with negotiated rates or data terms you need to keep.
  • You already run a billing system and have a team that owns it.
  • Most of the usage is your own product, and third-party calls are a small share.

When should you buy a billing engine instead?

Buy a billing engine when invoicing, not provider access, is the hard part.

  • You bill subscriptions, seats or your own product's usage: Stripe Billing, or Metronome for prepaid drawdown and commits.
  • You collect payments through Adyen, or want to model a price change before launch: Orb, which Adyen now owns.
  • Billing data must stay on your own servers: Lago or OpenMeter, self-hosted.

When does Locus Pro fit?

Locus Pro fits when the usage is paid third-party API calls by your customers' agents and each customer should prepay for their own. You integrate once through the SDK, hosted MCP or CLI, and test with sandbox keys that call no provider and charge nothing.

You can keep the providers you already contract with. Enterprise Custom APIs add your HTTP service with your own credential and a price, and those calls bill to customers through the same ledger as catalog calls.

Customer billing comes with Enterprise, $200 a month with $30 of credits included, or Enterprise Plus, $1,000 a month with $100 of credits and a higher call limit.

Frequently asked questions

What is the minimum to build for billing customers' agent API calls?

A provider account per API, a price per endpoint, a customer ID on every call, a balance check before the call, idempotent retries, and a ledger you can reconcile against provider invoices. Checkout and alerts come next.

Is open-source billing software free?

Lago and OpenMeter have no license fee to self-host. You run the servers and upgrades yourself, and OpenMeter says its releases are beta and can include breaking changes.

Can I keep my existing provider contracts with Locus Pro?

Yes, on Enterprise. Add the provider as a Custom API with your own credential and set its price. Calls bill to your customers through the same ledger as catalog calls.

Does Locus Pro refund calls that return no results?

Not as a rule. Fixed-price calls are charged when the provider succeeds. Calls priced by the records they return settle lower, and calls that fail before success release their hold.

Do I still need Stripe if I use Locus Pro?

Only for what you bill yourself, such as subscriptions. Customers can buy Locus credits at Stripe-hosted checkout run by Locus, or you can bill them in your own system and allocate credits.

Implementation references

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

Sources

Third-party details were checked on November 10, 2026. Vendors change pricing and features often, so confirm on their site before you decide.

Related guides