Savings Layer is live on Peerlist — support us  (opens in a new tab)

Advertising cookies. If you accept, Google Ads sets cookies to measure which ads bring sign-ups and for remarketing. It does not load until you choose. Our own visit counts use no cookies.Google Ads, only if you accept: to measure ads and for remarketing. Privacy details

Architecture

From your code to your provider

Savings Layer runs inside your infrastructure: as an SDK in your application's process or as a local gateway in front of it. The content of every request travels to the provider you configure; it does not pass through BiVelio's servers.

Illustration of how it works
  • Content goes to your provider

    Prompts and responses travel from your infrastructure to the provider you configure, with your key. They do not pass through BiVelio's servers.

  • No account, zero telemetry

    The open-source engine runs locally without a BiVelio key and, by default, sends nothing.

  • Cloud receives what Privacy defines

    If you connect Savings Cloud, the dashboard receives only the data listed on the privacy page.

Two ways to install it

SDK in your process or local gateway

They are two different pieces with different scopes. The deciding question is who wrote the code that calls the API.

SDK · in-process

Inside your application

An npm package that wraps the provider call in your own code. It runs in the same process as your application: there is no server in between.

  • For whoever develops the application that calls the API, on Node.js.
  • The package's savings levers run here.
  • Every call returns a SavingsReport, with measured and estimated kept apart.
Install the SDK

Gateway · local proxy

In front of your application or agent

bvsala starts a proxy on your own machine. You point the base URL of the official OpenAI or Anthropic SDK at it, or launch Claude Code through it, without touching your code.

  • For a coding terminal or an application in any language that lets you set its base URL.
  • It meters traffic for models with a list price.
  • The npm package's levers do not run here; the gateway's own apply only to Anthropic traffic, free and with no key. By default it measures: its TTL change only saves when your client pays per token and asks for the one-hour cache.
See the gateway

Your case, in 10 seconds

Four ways of using AI, and what Savings Layer can do in each one.

ChatGPTapp or web, free or paid
Nothing to install

You pay a flat fee (or nothing): there is no per-token bill to reduce, and it's a closed product where nobody can place software between the app and its models. Savings Layer's saving simply doesn't apply here — and no product can honestly promise it there.

Claudeclaude.ai, free or paid
Skill available

Flat subscription: no token invoice to meter — but there are caps (the five-hour window and the weekly one). That is exactly what the savings-mode skill is for: free, uploaded to claude.ai in a minute, attacking the two masses that burn cap. Its effect will be published once measured — never before.

Claude Codeterminal, with an API key
Measuring now

On a subscription the fee is flat, and with the defaults the gateway changes nothing in your traffic: it measures each session's spend on your machine, free, at list price. For the caps there is the savings-mode skill, free, with its effect not measured yet. With an API key there is a real token invoice — and the meter is already running: with no BiVelio key at all, “bvsala claude” launches Claude Code through the local gateway, without touching a line of code. The gateway meters what passes through it on your machine, with the usage your provider reports, and on exit tells you what it spent at list price, what it saved by basis (measured, by reference or estimated), how many requests it metered, which ones it could not, and why. On Anthropic models it also moves cache writes from the one-hour TTL to the five-minute one only on turns where a large part of the prompt is new (a session's first turn, a compaction): a saving computed on your provider's own token count, never on an estimate. That needs Claude Code to ask for the one-hour cache, and on an API key it does not unless you set it: by default the gateway only measures. With a Savings Cloud key you see your spend in the dashboard as well, token by token.

Your applicationyour code + your API key
This is it

The case Savings Layer exists for. Your app calls the API with your key, the provider bills every token, and the layer installs in two steps: package and wrapping the call. From the first request it returns a SavingsReport with the saving, split into measured and estimated.

The instructions skill has a different scope: it changes how the assistant works inside a subscription with caps. It does not meter a bill or apply the SDK or gateway levers. See the skill

Map

The pieces of Savings Layer

A map of pieces, not five stages every request goes through. Pick one to see what it does, where it lives and whether it needs an account.

What it does
Wraps the provider call and applies the package's savings levers.
Where it lives
Inside your application's process.
Account
Not needed.

Estimate vs. measurement

The product has two different numbers, and they shouldn't be mixed.

Before installing
Estimate

Before you install, any figure is an estimate: the public bench shows how each lever behaves on its own traffic, not on yours. No plan needed to start: in the open core every lever is free, with no key and zero telemetry; the free Measure plan adds the dashboard.

Benchmark
After installing
Real measurement

Every call returns a SavingsReport: the calls you never paid for and the net saving per request. Auditable, request by request, on your own infrastructure.

Your data

Illustrative example

Example bill, per month

Without Savings Layer
$100
With Savings Layer
It depends

It depends on how much your traffic repeats. How it was measured

In plain words

What does the SDK actually do?

Four ideas, four eight-second animations.

01

AI charges you per word

Every request to an AI is paid for by the text going in and out. Savings Layer stands in the middle of that path: a request it has already seen and verified is answered without calling the provider again, and whatever you didn't have to pay for drops into your jar.

02

You don't pay twice for the same thing

An AI re-reads everything you already sent it, turn after turn — and the provider charges for it again. Savings Layer prepares every request so the provider applies its discounted price to the repeats. The discount is the provider's; our part is asking for it properly.

03

A receipt you can verify

We don't ask for faith. Measured amounts use provider-reported usage and documented prices and appear in your SavingsReport. Reference-valued and estimated amounts are labelled separately; none is presented as invoice-reconciled.

04

Open core: it saves with no keys

Every lever is included and free, with no key. On by default: exact cache, in-flight deduplication, local resolvers, prompt-cache placement, trimming of superseded tool results and compact serialization of the structured data you pass. The rest you switch on, one line each. Two machines can share a cache for free with a store you run (Redis, for example). Zero telemetry, and a key that is set but invalid still fails closed. The cloud is optional: team dashboard, shared measurement, seats and licences — free on Measure, and on Pro and Team a fixed fee, whether or not you save, with no commission on your savings.

Honest accounting

Every kind of saving, counted separately — so no number gets inflated.

Every SavingsReport splits the saving into four ledgers — calls avoided, text removed, text compressed, and your provider's own cache discount — and never adds them up into one marketing number.

01

avoided_calls

LLM, retrieval and tool calls that never executed at all.

02

eliminated_tokens

Information dropped because it simply wasn't needed.

03

compressed_tokens

Information kept, but encoded with fewer tokens.

04

provider_cached_tokens

Still in the prompt, but billed or processed more cheaply.

On the public bench (2026-09-28), what the installed SDK saved came from the first ledger — repeated requests served without calling the provider — and, on Claude, from the fourth through a descriptive cache-pricing contrast (arm B's cache reads valued against ordinary input pricing), not an independently identified causal effect nor a pre-existing provider discount. The npm package ships no compressor. A ledger with no published figure is described here, not advertised.

SDK · one lever, on your data, before paying

Paste your data. See how many tokens the SDK would send.

This runs the SDK's real format selector in your browser, on your data. Nothing leaves this page and you don't need an account.

Try an example

…or paste your own JSON here. Nothing leaves your browser.

Loading the optimizer and the exact tokenizer…

What this is, and what it isn't: one lever — how structured data is written into the prompt — on the input tokens of this data. It applies only to data you pass to the SDK as structuredData, not to JSON already written inside your messages. It is not your bill: calls avoided, your provider's cache and the output are not in it, and many requests carry no structured data at all. For the whole SDK, the figure we publish is the one in the measurement section, with its note.

The full install, if you build an app

# 1 · the package pnpm add @bivelio/savings-layer # 2 · wrap the call — this is the entire code change const layer = createSavingsLayer({ provider }); const { text, report } = await layer.generate({ model, messages }); console.log(report.cost) // ← the saving, with its basis: measured or estimated

Or let one command tailor it to your stack. init reads your package.json (Next.js, Express, the Vercel AI SDK, Mastra, LangChain.js, the Anthropic or the OpenAI SDK) and prints the install line, the exact code for your adapter and a check that spends no tokens: with no BiVelio key, the layer answers it on your machine, without calling the model. It writes nothing unless you ask it to.

Terminal
npx @bivelio/savings-layer@latest init
dependencies: {}

Zero runtime dependencies

A single ESM bundle. Nothing gets installed next to your code that we did not write; the exact tokenizer is an optional peer.

report.cost.basis

One SavingsReport per call

Four ledgers that are never summed, the cost with its basis (measured or estimated) and traces per stage. It is the same thing your dashboard reads.

app → provider api

Your traffic still goes direct

The SDK wraps the call inside your process. Your prompts never pass through BiVelio: with no key nothing reaches us; with a cloud key, only counts and cost.

layer.generateStream(request)

Streaming, same report

generateStream() hands you the answer as the provider writes it and closes with the same SavingsReport as generate(), under the same basis rules: the provider's final counter is read at the end of the stream, and a stream without it is reported as unmeasured and never counts as measured savings. With an output contract, the answer arrives validated, in one piece.

  • Salesforce
  • HubSpot
  • Odoo
  • Zapier
  • n8n
  • UiPath

Where your automations already live. What gets measured is the call to your provider's API with your key: in a Node.js app, the SDK wraps it; from other code on the official OpenAI or Anthropic SDK, the gateway sits in front and records it for a model with a list price.

Gateway · coding terminals

Claude Code on an API key? See its real spend, token by token.

One command puts a local meter in front of your terminal, with no changes to your code and no key: start your agent through bvsala. Add a service key only if you want the spend in your Savings Cloud dashboard. Your prompts don't pass through BiVelio's servers; they go to the provider you configure, and only counts and cost reach your dashboard.

npm i -g @bivelio/savings-layer
# optional, only for the cloud dashboard:
# export BIVELIO_SERVICE_KEY=bvk_…

bvsala claude

The gateway measures, with your provider's own counter, every request whose usage the provider reports (for models in our price catalog) and starts with no keys at all (COMMUNITY mode): an optional service key adds the dashboard and org entitlements. On Anthropic models it also applies one lever by default, with no license or account: it moves cache writes from the one-hour TTL to the five-minute one only on turns where a large part of the prompt is new — such as a session's first turn or a compaction — and leaves chained turns as they are. That changes the price, never the content the model reads. It only has something to lower when your client pays per token and asks for the one-hour cache: Claude Code on an API key asks for the five-minute one unless you change it, and then the gateway only measures. The other levers stay off until you switch them on. The savings-mode skill is available for your caps, with its effect still to be measured. The gateway also works with Codex CLI, Goose, Qwen Code, opencode, Kilo, Aider and, with your own Anthropic key, GitHub Copilot CLI; for others, such as Cline or Continue, bvsala doctor prints the exact configuration. Cursor works through its OpenAI base-URL override with your own key, and Gemini CLI is wrapped by bvsala gemini.

Python or any other language? Point the official OpenAI or Anthropic SDK at the gateway and every request whose usage the provider reports, for a model with a list price, is metered at that price on your machine, and also in your Savings Cloud dashboard if you add a service key; the gateway's log says when one is not. bvsala doctor prints the base URL for each SDK. For OpenAI streaming, ask for usage in the request (stream_options.include_usage).

savings-mode · free skill

A skill built to stretch your subscription caps — effect not measured yet

No invoice doesn't mean no pain: the five-hour window and the weekly cap. savings-mode is a pure-instructions skill — no proxy, your traffic untouched — that targets the two masses that actually burn cap: model output and tool results. It's free.

01

cache reads

The whole context is re-read every turn — which is why keeping it lean matters.

02

cache writes (one hour)

Every tool result is cache-written at a premium before being re-read.

03

model output

A small share of the tokens, at the highest price per token; the skill attacks it directly.

Where a Claude Code session's spend goes, in this order: cache reads, one-hour cache writes and model output — measured with our meter on our own traffic, against the provider's counters. That report is not published, so we don't show its figures. The skill's own effect will be published once A/B-measured — never before.

npx -y @bivelio/savings-layer skill

One command: installs into ~/.claude/skills and activates by itself when the conversation turns to limits or saving tokens.