Optera docs
↗ optera.dev Open dashboard →
/ 01 — Introduction

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:

Optera fails open. If any optimization step errors or exceeds its time budget, the request is forwarded unchanged — p99 added latency is under ~15 ms, or the proxy gets out of the way. See Errors & fail-open.
/ 02 — Quickstart

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

python · openai sdkproxy.optera.dev
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

typescript · openai sdkproxy.optera.dev
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

python · anthropic sdkproxy.optera.dev
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 · openai-styleproxy.optera.dev
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:

HeaderPurpose
x-feature-tagWhich feature or product surface made the call (e.g. autocomplete, support-bot). Powers per-feature analytics, budgets, and leak detection.
x-team-tagOwning team, for cost attribution.
x-user-tagYour end-user identifier, for per-user attribution.
anthropic-versionPassed through to Anthropic unchanged.
/ 03 — Shadow vs live

Measure first. Then flip.

Every new workspace starts in shadow mode, and shadow mode is free.

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.

Shadow mode still makes your real provider call on your key — that spend is yours and appears as cost in the dashboard. What shadow mode never does is change the call.
/ 04 — The levers

Lossless by default. Opt-in beyond that.

LeverDefaultHow its saving is computed
Exact-match cacheon · losslessMeasured — the avoided call's full reconciled cost
Provider prompt-cache injectionon · losslessMeasured — from the provider's reported cached tokens
Semantic cacheopt-inMeasured — the avoided call's full reconciled cost
Model routingopt-in · eval-gatedMeasured — original-vs-routed price delta on real tokens
Compression & response shapingopt-in · off by defaultEstimated — 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.

/ 05 — Savings & headers

Measured vs estimated — and the headers that report it.

Savings come in two kinds, and Optera never blends them:

Every proxied response carries the split in its headers:

HeaderMeaning
X-Savings-Measured-USDInvoice-checkable savings on this request: cache, routing, provider prompt-cache.
X-Savings-Estimated-USDEstimated savings on this request: compression and response shaping. Labeled, never merged into measured.
X-Cache-HitThe response was served from the exact-match cache — no provider call was made.
X-Semantic-Cache-HitThe response was served from the semantic cache.
X-Model-RoutedThe request was routed to a cheaper model under an eval-gated rule.
X-Provider-Cache-HitThe provider reported cached prompt tokens on this request.
X-Provider-Cache-Savings-USDThe 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.

In shadow mode the same headers report the would-have values — a cache that would have hit, the routing delta that would have applied — so you can verify per-request before going live.
/ 06 — Pricing

Pay for outcomes, not requests.

There are no request-quota tiers. Shadow mode is free — you see the number before you pay anything.

PlanYou payFor
Performance25% of proven savingsA 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 optimizedUsage-billed on the value lever, not a request count. All levers, full dashboard.
EnterpriseSelf-host / BYO-VPCRun 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.

/ 07 — Providers & translation

OpenAI and Anthropic today. Translated automatically.

Optera fronts both providers and speaks both API shapes:

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.

/ 08 — Errors & fail-open

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.

StatusMeaningWhat to do
200Success — from your provider, or served from cache (see X-Cache-Hit).
400Missing provider API key — Optera needs your key to forward the call.Send your provider key in Authorization: Bearer (or x-api-key for Anthropic).
401Missing or invalid x-proxy-key.Create or copy a key in the dashboard under Settings.
402Your workspace's own monthly spend cap was reached.Raise or remove the cap in Settings — this is your safety rail, not a plan limit.
429Allowance 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.
5xxYour provider errored — passed through unchanged, body intact.Handle as you would the provider's own error; Optera adds nothing.
Provider 4xx/5xx responses pass through with their original status and body, so your existing retry and error handling keeps working unmodified.
/ 09 — Security & privacy

Keys in memory. Prompts on your terms.

Data-handling details live in the privacy policy.

/ 10 — FAQ

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