Lower your LLM bill. Prove it against your invoice.
Optera is a drop-in proxy that sits between your application and OpenAI or Anthropic. Point your SDK's base_url at it, add your Optera key in one header, and keep your provider key and your code as they are — it cuts the cost of every request, starting in a read-only mode that just measures what it would save.
Three ideas carry the whole product:
- Shadow mode first. New workspaces run read-only: every request passes through to your provider unchanged, and Optera only measures what each lever would have saved on your real traffic. You see the number before anything changes.
- The number reconciles to your invoice. Costs and savings are computed from the provider's own
usageobject — the exact tokens they bill you for, with cached reads at the discounted rate. Your dashboard total matches your provider bill within about a percent. - Lossless wins run first. The levers that cannot change your model's answers are on by default. Anything that could touch output quality is opt-in, eval-gated, and never runs on JSON, code, or tool-call payloads.
One constructor change. That's the integration.
Swap your SDK's base URL for the proxy and pass your Optera workspace key in the x-proxy-key header. Your provider API key keeps flowing exactly as it does today — Optera passes it through in memory and never stores it.
OpenAI — Python
from openai import OpenAI client = OpenAI( api_key="sk-your-openai-key", # unchanged — passes through # base_url="https://api.openai.com/v1" base_url="https://proxy.optera.dev/v1", # ← new base URL default_headers={"x-proxy-key": "opk_your_workspace_key"}, # ← your key, from the dashboard ) resp = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Hello"}], )
OpenAI — Node
import OpenAI from "openai"; const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY, baseURL: "https://proxy.optera.dev/v1", defaultHeaders: { "x-proxy-key": process.env.OPTERA_KEY }, });
Anthropic — Python
from anthropic import Anthropic client = Anthropic( api_key="sk-ant-your-key", # unchanged — passes through base_url="https://proxy.optera.dev", # ← new base URL default_headers={"x-proxy-key": "opk_your_workspace_key"}, # ← your key, from the dashboard ) resp = client.messages.create( model="claude-sonnet-4-6", max_tokens=1024, messages=[{"role": "user", "content": "Hello"}], )
curl
curl https://proxy.optera.dev/v1/chat/completions \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "x-proxy-key: $OPTERA_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gpt-4o","messages":[{"role":"user","content":"Hello"}]}'
Optera also translates between the two API shapes automatically: an OpenAI-style chat/completions call that names a Claude model is rewritten to the Anthropic Messages shape on the way out and back into a chat.completion response on the way in — so existing clients work unchanged. See Providers & translation.
Optional attribution headers
Tag requests so the dashboard can attribute cost and savings by product surface, team, or end user:
| Header | Purpose |
|---|---|
x-feature-tag | Which feature or product surface made the call (e.g. autocomplete, support-bot). Powers per-feature analytics, budgets, and leak detection. |
x-team-tag | Owning team, for cost attribution. |
x-user-tag | Your end-user identifier, for per-user attribution. |
anthropic-version | Passed through to Anthropic unchanged. |
Measure first. Then flip.
Every new workspace starts in shadow mode, and shadow mode is free.
- Shadow (read-only). Requests pass through byte-for-byte: no cache is served, no prompt is rewritten, no output is altered. Optera measures what each lever would have saved on your actual traffic and prices it from the provider's own usage object. The dashboard shows the would-have-saved figure, split into measured and estimated.
- Live (capturing). The levers you've enabled actually run. Savings stop being a projection and start showing up on your provider invoice. The same reconciliation keeps checking the numbers after the flip.
Switching: in the dashboard, the mode banner at the top of every page carries the toggle. Going live requires an active plan; switching back to shadow is always available, instantly. If a plan lapses, the proxy degrades to shadow rather than breaking your integration — requests keep flowing, optimizations stop, and nothing 4xxs because of billing.
Lossless by default. Opt-in beyond that.
| Lever | Default | How its saving is computed |
|---|---|---|
| Exact-match cache | on · lossless | Measured — the avoided call's full reconciled cost |
| Provider prompt-cache injection | on · lossless | Measured — from the provider's reported cached tokens |
| Semantic cache | opt-in | Measured — the avoided call's full reconciled cost |
| Model routing | opt-in · eval-gated | Measured — original-vs-routed price delta on real tokens |
| Compression & response shaping | opt-in · off by default | Estimated — labeled as such, never blended into measured |
Exact-match cache
Identical requests return the stored response instead of a second billed call. The cache key covers the model, the full message content (including images, by content hash), the tool definitions, the response format, and the sampling parameters — two requests that differ in any of these never share an entry. Lossless: the answer served is the answer the model already gave for exactly this request.
Provider prompt-cache injection
OpenAI and Anthropic both discount repeated prompt prefixes — when the cache actually fires. Most teams place Anthropic's cache_control breakpoints wrong or not at all. Optera injects them where they belong (and respects yours if you've set your own), and reorders OpenAI prompts for prefix stability. Lossless: nothing about the content changes, only the caching metadata. Provable from the provider's own cached-token counts.
Semantic cache
Near-duplicate requests (paraphrases of the same question) can reuse a stored answer. Because a fuzzy hit returns a different prompt's answer, this is opt-in and hard-gated: only near-deterministic requests (temperature ≤ 0.3), never with tools or images, scoped to the same model and the same conversation context, above a strict similarity threshold you control.
Model routing
Send classification-grade calls to a cheaper model — only when it holds quality. Routing is opt-in and eval-gated: every routed response is structurally scored (did the JSON parse, did the tool fire), and a route that degrades past the quality bar auto-disables. Rules can be scoped by feature and by source model, and never route across providers.
Compression & response shaping
Trim repeated context, strip filler from outputs. Off by default because it changes what the model sees or returns. It never runs on JSON, code, or tool-call payloads, and it is careful not to break the provider prefix cache it would otherwise invalidate. Its savings are always labeled estimated.
Measured vs estimated — and the headers that report it.
Savings come in two kinds, and Optera never blends them:
- Measured — cache hits, model routing, provider prompt-cache reads. Derived from the provider's reported usage and a maintained price book. These reconcile against your invoice.
- Estimated — compression and response shaping. Token reductions we can count, priced at list rates, clearly labeled as estimates.
Every proxied response carries the split in its headers:
| Header | Meaning |
|---|---|
X-Savings-Measured-USD | Invoice-checkable savings on this request: cache, routing, provider prompt-cache. |
X-Savings-Estimated-USD | Estimated savings on this request: compression and response shaping. Labeled, never merged into measured. |
X-Cache-Hit | The response was served from the exact-match cache — no provider call was made. |
X-Semantic-Cache-Hit | The response was served from the semantic cache. |
X-Model-Routed | The request was routed to a cheaper model under an eval-gated rule. |
X-Provider-Cache-Hit | The provider reported cached prompt tokens on this request. |
X-Provider-Cache-Savings-USD | The discount those cached tokens produced versus full-rate pricing. |
Reconciliation. Cost is computed from the provider's own usage object — the exact token counts they bill, with cache reads and writes at each model's actual discounted rates. That is why the dashboard total matches your provider bill within about a percent, and why a shadow-mode projection is worth believing: it is priced the same way the eventual invoice is.
Pay for outcomes, not requests.
There are no request-quota tiers. Shadow mode is free — you see the number before you pay anything.
| Plan | You pay | For |
|---|---|---|
| Performance | 25% of proven savings | A quarter of what Optera saves, measured against a locked baseline and reconciled to your invoice, plus a $200/mo platform floor. No savings, no fee beyond the floor. |
| Self-serve | $0.50 per 1M tokens optimized | Usage-billed on the value lever, not a request count. All levers, full dashboard. |
| Enterprise | Self-host / BYO-VPC | Run Optera inside your own perimeter — prompts and keys never leave your network. Platform fee + support. |
Plan management lives in the dashboard under Settings → Billing. Going live requires an active plan; a lapsed plan degrades the proxy to shadow mode instead of failing your requests.
OpenAI and Anthropic today. Translated automatically.
Optera fronts both providers and speaks both API shapes:
- Native pass-through. An OpenAI-style call to an OpenAI model, or an Anthropic-style call to a Claude model, flows through in its native shape.
- Automatic translation. An OpenAI-style
chat/completionscall that names a Claude model is translated to the Anthropic Messages API on the way out, and the response (including streaming events) is translated back intochat.completionshape. Your existing client keeps working while you try a different provider's model. - Streaming. Server-sent events stream through with the same translation guarantees; usage is captured for accounting even on streams.
The provider is detected from the endpoint path and the model name. Requests authenticate to the provider with your key exactly as before — Authorization: Bearer for OpenAI-style calls, x-api-key for Anthropic-style calls.
Gemini and Bedrock are next.
The proxy gets out of the way.
Fail-open is the design. Every optimization step runs inside a strict time budget with independent error isolation. A step that throws, times out, or misbehaves is skipped and your request forwards unchanged — an optimization problem is never allowed to become your outage. Total added latency is budgeted at p99 < ~15 ms on the pass-through path.
| Status | Meaning | What to do |
|---|---|---|
| 200 | Success — from your provider, or served from cache (see X-Cache-Hit). | — |
| 400 | Missing provider API key — Optera needs your key to forward the call. | Send your provider key in Authorization: Bearer (or x-api-key for Anthropic). |
| 401 | Missing or invalid x-proxy-key. | Create or copy a key in the dashboard under Settings. |
| 402 | Your workspace's own monthly spend cap was reached. | Raise or remove the cap in Settings — this is your safety rail, not a plan limit. |
| 429 | Allowance reached: the free shadow allowance, or a plan's abuse ceiling. | Shadow allowance resets monthly; subscribe to lift it. Paid ceilings exist only to stop runaway abuse. |
| 5xx | Your provider errored — passed through unchanged, body intact. | Handle as you would the provider's own error; Optera adds nothing. |
Keys in memory. Prompts on your terms.
- Provider keys are never stored. Your OpenAI/Anthropic key passes through in memory to authenticate the forwarded request, and is never written to disk, database, or logs.
- Optera keys are hashed. Workspace keys are stored as salted hashes with only a short display preview.
- Prompt storage is bounded by function. Caching stores what caching needs (hashed keys, cached response bodies with TTLs); analytics stores token counts and dollar figures, not raw prompts.
- Metadata-only mode keeps even prompt hashes out of the database — counts, costs, and savings only.
- Self-host / BYO-VPC runs the entire proxy inside your own network for the strictest environments; nothing leaves your perimeter.
Data-handling details live in the privacy policy.
The honest FAQ.
Will Optera change my model's answers?
Not unless you opt in. The default levers are lossless — an exact-cache hit returns the model's own previous answer to the identical request, and prompt-cache injection changes caching metadata, not content. Response shaping is off by default and never touches JSON, code, or tool calls.
How do I know the savings are real?
Check the invoice. Costs are priced from the provider's own usage object, so the dashboard reconciles against your provider bill within about a percent. Per request, X-Savings-Measured-USD carries only the invoice-checkable part; anything inferred sits in X-Savings-Estimated-USD, labeled.
What happens if Optera goes down?
The proxy fails open: any internal error forwards your request unchanged. For a full outage of the proxy itself, your rollback is one line — point base_url back at the provider. The leftover x-proxy-key header is ignored upstream, so nothing else needs to change.
Does a cache hit still count against my provider rate limits?
No — a cache hit never reaches the provider, which is also why its full cost is saved. Your provider-side rate limits only see the requests that actually forward.
Can I use it with streaming?
Yes. Streams pass through (and translate across API shapes) with usage captured for accounting. Streamed responses aren't served from cache today.
What does it cost to try?
Nothing. Shadow mode is free and read-only — the would-have-saved number is produced on your own traffic before you pay anything or change any behavior.
Questions the docs don't answer: hello@optera.dev