| Project | Reqs | Cost | Tokens |
|---|---|---|---|
Lumenware | 3,482 | $2.87 | 1.02M |
Northwind | 1,536 | $1.23 | 437K |
Contoso | 1,221 | $1.14 | 389K |
Aerodrone Labs | 1,105 | $0.86 | 301K |
Independent / other | 897 | $0.70 | 248K |
| Provider | Model | Reqs | Cost |
|---|---|---|---|
| Anthropic | claude-opus-4-7 | 3,614 | $3.78 |
| Anthropic | claude-sonnet-4-6 | 2,901 | $2.11 |
| OpenAI | gpt-4-turbo | 1,423 | $0.91 |
| Azure | gpt-4-32k | 302 | $0.00 |
| Ollama | llama-3-70b | 1 | $0.00 |
| Model | Reqs | Cost | Avg Latency | Δ 7d |
|---|---|---|---|---|
claude-opus-4-7 | 25,298 | $26.46 | 1.4s | +12% |
claude-sonnet-4-6 | 20,307 | $14.77 | 0.9s | +18% |
gpt-4-turbo | 9,961 | $6.37 | 1.2s | +3% |
gpt-4-32k | 2,114 | $0.00 | 0.8s | -6% |
llama-3-70b | 7 | $0.00 | 0.4s | new |
| Time | Project | Provider | Model | In | Out | Cost | Latency | Status |
|---|
| Alias | Provider | Model |
|---|---|---|
opus | Anthropic | claude-opus-4-7 |
sonnet | Anthropic | claude-sonnet-4-6 |
gpt4 | OpenAI | gpt-4-turbo |
gpt4-long | Azure | gpt-4-32k |
local | Ollama | llama-3-70b |
| Priority | Provider | Model | Trigger |
|---|---|---|---|
primary | Anthropic | claude-opus-4-7 | default |
fallback | OpenAI | gpt-4-turbo | primary.down OR 429 |
local | Ollama | llama-3-70b | all cloud down OR budget cap |
| Project | Condition | Target | Fallback |
|---|---|---|---|
Lumenware | budget > 85% | Anthropic / claude-sonnet-4-6 | Ollama / llama-3-70b |
| all | provider.down | OpenAI / gpt-4-turbo | Azure / gpt-4-32k |
Aerodrone Labs | input > 20k tokens | Azure / gpt-4-32k | - |
| Provider | Key | Last used |
|---|---|---|
| Anthropic | sk-ant-··········7f2a | 2s ago |
| OpenAI | sk-··········1e8b | 11s ago |
| Azure | ··········4c3d | 4m ago |
The AI Gateway for Managed, Attributed LLM Spend
One OpenAI-compatible egress for Anthropic, OpenAI, Azure OpenAI, Ollama, and LM Studio. Per-project budgets, alerting, multi-provider failover, full audit trail.
Every request, attributed, inspected, routed, capped, and audited.
Any OpenAI-compatible SDK points at the gateway.
Tagged via header, API key, or session lineage.
Mid-flight DLP scans for secrets, PII, policy violations.
Over budget? Downgrade. Provider down? Failover.
Prompt, tokens, cost, latency persisted to SQLite.
Drop-in proxy. Day-one attribution. Hard caps, not alerts.
Every request tagged to a project via header, API key, or session lineage. Per-project, per-model, per-day, per-token rollups out of the box.
Daily/weekly/monthly budgets per project or per user. When a limit is hit, the gateway downgrades or blocks — apps stay up, costs stay capped.
Anthropic, OpenAI, Azure OpenAI, Ollama, LM Studio behind one OpenAI-compatible egress. Opus → Sonnet → Haiku → GPT-4o → local Llama on failure.
Every outbound prompt can be inspected for DLP violations before it crosses the trust boundary. Cluster-aware circuit breaker for graceful degradation.
Every prompt, completion, cost estimate, and budget event landed in SQLite. CSV export, REST API for FinOps integration, no SaaS dependency.
Cluster-mode workers, graceful shutdown, streaming-tuned timeouts, configurable retry policy. Built for the hot path of production AI traffic.
Eight observers, one pipeline — intake to evaluate.
Every Claude call routes through Cost Observer — one gateway, every provider, keys you never share.
Same SDK. Same call shape. New base URL and a project header. Day-one attribution — zero application code changes.
Swap the base URL and add one header. The gateway handles attribution, budget checks, DLP, routing, failover, and audit — invisibly.
# Point any OpenAI SDK at the gateway. from openai import OpenAI client = OpenAI( base_url="https://cost.observer/v1", api_key=GATEWAY_KEY, default_headers={ "X-Project": "support-assistant", }, ) response = client.chat.completions.create( model="claude-opus-4-7", # routed to Anthropic messages=[...], ) # Attributed. Budget-checked. Logged.
Day-one cost attribution. Budget enforcement, not budget alerts. Multi-provider failover. Self-hosted, SQLite-backed, no SaaS dependency.