Price the call for what it costs. Refund the rest, automatically.
Extracta sells document extraction as an API — invoices, contracts, and scanned PDFs turned into structured JSON. A one-page receipt and a forty-page contract cost wildly different amounts to process, so a flat per-call price either overcharges the easy job or eats the loss on the hard one. With Meter, the calling agent signs a spending cap before the call runs, Extracta meters the real pages and compute time against that cap, and the unused difference refunds on-chain the moment the job finishes. The receipt reseals with the true number, not the estimate it started with.
The call closes on what it actually cost, not what it was capped at.
One extraction job, end to end: the agent signs a $0.80 spending cap before the call runs, Extracta's API meters pages processed and compute time against that cap, and the moment the job finishes, the unused balance refunds on-chain. The receipt reseals with the real metered number, not the cap it started with.
- The cap is signed before the call runs — the API can't charge past it
- Real usage, pages processed and compute time, is metered against the cap, not estimated
- The unused difference refunds on-chain the moment the job settles, no invoice, no dispute
Extract line items from a 40-page vendor contract, capped at $0.80.
Signing a $0.80 cap for this job — metering pages processed against it, and refunding whatever's left once the extraction finishes.
The conversation is the easy part.
Usage-based APIs guess. A flat per-call price either overcharges the easy jobs or eats the loss on the hard ones, and nobody finds out which until the invoice runs at month end. Sellers pad the price to cover the worst case; callers pay for capacity they never used; disputing a shortfall is a support ticket, not a protocol.
Price every call flat, padded to cover the worst-case job
The agent signs a spending cap sized to the actual job upfront
Chase a shortfall on the hard jobs with a manual invoice
codespar_meter tracks real usage against the cap as the call runs
Let callers overpay on every easy job to cover the average
The unused difference between cap and real usage refunds on-chain
Reconcile a disputed call by hand against the server logs
The receipt reseals with the metered number, not the estimate
Priced by the call, settled by the machine loop.
codespar_meter signs the spending cap before the call runs, meters the real usage as the API executes, and settles the difference on-chain the moment the job finishes. Meter has no price of its own — it rides inside codespar_pay's settlement, so Extracta pays Gate's same 1% fee on the real metered amount, not on the cap.
Extraction job submitted
codespar_meter$0.80 ceiling signed
Meter40 pages · 61s compute
codespar_meter$0.34 metered against cap
Metercodespar_pay$0.46 refunded on-chain · resealed
Gate settlementThe calling agent opens a session and signs a spending cap before the extraction runs. Extracta's API meters real usage — pages processed, compute time — against that cap as the job executes. When it finishes, codespar_pay settles on the metered amount and refunds the unused balance on-chain automatically; the receipt reseals with the true number under Gate's 1% settlement fee. This machine loop is built end to end and merged, running in beta behind a flag while the final mainnet verification runs complete.
A few lines. The whole loop.
const session = await codespar.sessions.create(); const job = await session.execute("codespar_meter", { cap: 0.80, currency: "USDC", metric: "pages_processed", provider: "extracta", }); const result = await extracta.extract({ file: contractPdf, capToken: job.capToken, }); // Extracta reports real usage back through the same cap await session.execute("codespar_meter", { capToken: job.capToken, usage: { pages: 40, computeSeconds: 61 }, }); // codespar_pay settles on the metered amount, refunds the rest on-chain const receipt = await session.execute("codespar_pay", { capToken: job.capToken }); // receipt.amount === "$0.34" · receipt.refunded === "$0.46" · sealed
codespar_meterSigns the spending cap before the call runs and meters real usage against it as the job executes.
codespar_paySettles on the metered amount and refunds the unused cap on-chain, under Gate's 1% fee.
codespar_ledgerReseals the receipt with the real metered number once usage settles.
Ship it this afternoon.
Open the sandbox, point a session at your providers, and run the whole loop against real rails in minutes — not the quarter it takes to build it by hand.