← klaro.services
SentinelConsentraKlaroShieldBundlesPricing
@klaroshield/sdk — MIT licensed

Everything every AI application needs.
Nothing you have to rebuild.

Wrap your existing OpenAI, Anthropic, or Vercel AI SDK call in one line and instantly get retries, cost controls, validation, privacy, diagnostics and observability.

$ npm install @klaroshield/sdk
Install SDK →Interactive Playground
View on GitHub →Read the docs →Klaro Studio →
localhost:3456
Health Score
92/100
Total Calls
47
Retries Saved
3
Secrets Removed
1
PII Removed
2
Spend (month)
$0.34
TimeStatusLatencyRedactions
4:06:49 PMok220msPII
4:06:49 PMok500ms
4:06:48 PMfailed430ms

Illustration matching the real dashboard's layout, card labels, and table columns — run it yourself to see your own data.

Your AI runtime, visualized.

Run one command. Open a browser. Watch every AI request as it happens.

$ npx klaro dashboard
Browser opens automatically
http://localhost:3456
Interactive Dashboard
📡
Live Request Stream
Every AI request — timestamp, status, latency, redaction badges. Refreshes every 3 seconds, no refresh button needed.
🛡️
Redaction Activity
A badge on any request where secrets() or pii() actually matched something — not a raw diff, since the whole point is that the raw value never gets persisted anywhere, including here.
💰
Cost Analytics
Spend by day as a live bar chart, month-to-date total, and your budget cap — the same numbers klaro stats prints, visualized.
🩺
AI Health Score
The identical score klaro doctor computes — reliability and redaction activity weighted, not just raw call volume.
See before you buy.
You don't need an account. You don't need our cloud. Run your own AI application and watch KlaroShield work in real time — the entire dashboard is one command, reading local files it already owns.
$ klaro doctor
────────────────────────────
AI Runtime Health
────────────────────────────

✓ Node.js version          v22.23.1
✓ OpenAI Connected         authenticated
✓ Claude Connected         authenticated
⚠ Gemini Connected         GEMINI_API_KEY not set
✓ Retry Policy             4% of calls needed a retry — healthy
✓ .klaro/ local storage    exists

⚠ gpt-4-turbo costs 98% more than gpt-4o-mini for comparable output
  Potential savings: $0.98 based on your recorded usage

Health Score: 92/100

This is real. Every terminal capture on this page comes from an actual execution of the SDK.

Every AI developer eventually builds the same infrastructure.

retry.ts
provider.ts
budget.ts
logging.ts
validation.ts
redaction.ts
monitoring.ts
...thousands of lines later.
Install KlaroShield instead.

Why teams keep KlaroShield installed.

🔁
AI requests stop failing
Automatic retries with exponential backoff — only for what's actually transient (429/5xx). A momentary provider blip never becomes a support ticket.
🔒
Sensitive data stays protected
API keys, JWTs, emails, SSNs, cards — detected and masked before they ever leave your process, let alone reach an LLM.
💰
AI costs stay predictable
Real cost estimated from your provider's own usage response, tracked locally, capped if you want. No more surprise invoices.
🔭
Your AI runtime becomes observable
doctor, benchmark, stats, and explain give you the visibility into AI calls that you'd otherwise have to build yourself, command by command.

A CLI that answers real questions

Every command below, every line of output — captured from an actual verified run.

klaro doctor
Checks provider connectivity for real, flags an unhealthy retry rate, and recommends a cheaper model — backed by your own recorded usage, not a guess.
Know your AI integration is actually healthy before a customer finds out it isn't.
────────────────────────────
AI Runtime Health
────────────────────────────

✓ Node.js version          v22.23.1
✓ OpenAI Connected         authenticated
✓ Claude Connected         authenticated
⚠ Gemini Connected         GEMINI_API_KEY not set
✓ Retry Policy             4% of calls needed a retry — healthy
✓ .klaro/ local storage    exists

⚠ gpt-4-turbo costs 98% more than gpt-4o-mini for comparable output
  Potential savings: $0.98 based on your recorded usage

Health Score: 92/100
klaro stats
"Today's AI health" at a glance -- retries saved, secrets/PII removed, spend, latency, and budget remaining, computed from what actually happened, not estimated.
One command instead of grepping your own logs to answer "is AI usage under control today?"
────────────────────────────
Today's AI Health
────────────────────────────

✓ Retries Saved       1
✓ Secrets Removed     1
✓ PII Removed         2
✓ Cost Today          $0.07
✓ Average Latency     491 ms
✓ Budget Remaining    $49.93

Health Score: 80/100

(4 calls, 1 failed, all-time spend $0.07)
klaro explain
Narrates a single call's full attempt history -- every retry, every redaction, in order -- instead of reconstructing it from scattered log lines.
When a call misbehaves in production, you get the story, not a stack trace.
klaro explain — call bbb22222 (8/7/2026, 4:06:49 PM)

  Failed after 430ms — 429 rate limited
  ↓
  Retry triggered — attempt 2
  ↓
  Succeeded in 500ms

2 attempts, 930ms total, succeeded in the end.
klaro simulate
Runs rate limits, server errors, timeouts, bad JSON, prompt injection, and oversized prompts through YOUR configured pipeline -- before they happen in production.
Find out your retry policy doesn't cover 500s on a laptop, not on-call at 2am.
klaro simulate — testing your configured pipeline against common failure modes

✓ 429 Rate Limit       Completed after 2 attempts (351ms)
✗ 500 Server Error     Failed after 3 attempts -- Service unavailable (1286ms)
✗ Timeout              Failed after 3 attempts -- Request timed out (756ms)
✓ Bad JSON             Returned unvalidated: "{not valid json" -- add validation() to catch this (0ms)
✓ Prompt Injection     Completed after 1 attempt (0ms)
✓ Huge Prompt          Completed after 1 attempt (2ms)

This ran real synthetic calls through your actual retries()/budget()/secrets()/pii()/validation() config.
klaro benchmark
Sends a real test call to every provider you have a key for and compares latency, cost, and reliability -- a markdown table you can paste straight into a PR.
Pick a model with real numbers from your own environment, not a vendor's marketing page.
Benchmarking Providers

| Provider | Model | Latency | Cost | Status |
|---|---|---|---|---|
| OpenAI | gpt-4o-mini | — | — | ⚠ OPENAI_API_KEY not set |
| Claude | claude-3-5-haiku-latest | — | — | ⚠ ANTHROPIC_API_KEY not set |
| Gemini | gemini-1.5-flash | — | — | ⚠ GEMINI_API_KEY not set |
| Ollama | llama3.2 | — | — | ⚠ not running locally (expected on :11434) |

No provider with both a configured key and known pricing responded successfully -- nothing to recommend.
klaro dashboard
A local web dashboard -- request stream, spend over time, redaction activity, health score -- reading .klaro/ directly. No account, nothing leaves your machine.
See what your AI calls are actually doing without shipping usage data anywhere.
See it above ↑ — the dashboard is worth a full section, not a table row. Full docs: klaroshield/docs/dashboard

Why not build it yourself?

Without KlaroShield
  • ×Retry library
  • ×Budget tracker
  • ×Cost estimation
  • ×Validation
  • ×Secret scanning
  • ×PII masking
  • ×Structured logging
  • ×Diagnostics
  • ×A dashboard to see any of it
Thousands of lines of maintenance, forever.
With KlaroShield
One SDK.
One install.
One middleware pipeline.

Recipes

Copy-paste ready. Real code, checked against the shipped SDK -- not invented.

OpenAI + exponential backoff
Wrap chat.completions.create with retries({ max: 3, backoff: "exponential" }) so transient 429s never bubble up to your users.
Claude fallback when GPT-5 is rate limited
Wrap each provider in its own Klaro instance, then catch a retry-exhausted OpenAI call and fail over to Claude.
Handle a budget cap without crashing
budget() throws once the monthly cap is hit by default -- pass onExceeded to decide what happens instead (log it, alert, degrade gracefully).
Mask PII in a Next.js server action
Wrap a server action's model call with pii({ mode: "mask" }) so request logs never contain a real email or phone number.
Block a call outright if it contains a secret
secrets({ mode: "block" }) throws instead of masking -- for pipelines where a leaked key means the call should never go out at all.
Force structured JSON output with Zod
validation() re-runs the whole call (not just re-parsing) when the model's output fails your schema -- LLM non-determinism is often fixed by a fresh attempt.
Ship structured logs to your own observability stack
logging({ format: "json" }) prints one JSON object per call instead of the pretty-printed default -- pipe it straight into your log aggregator.
Wrap an Express route handler
klaro.wrap() works on any async function -- it doesn't care whether the caller is a server action, a route handler, or a plain script.
Browse all 27 recipes →

Pricing

Annual plans are billed once, not monthly — 11 months' price for 12 months of service.

Community
Free
For individual developers -- unlimited local execution, forever
  • Full SDK, all middleware
  • klaro doctor / stats / inspect / explain
  • klaro simulate / benchmark
  • klaro dashboard (local)
Install now
Developer
$30/mo · $330/yr
For solo developers managing multiple AI applications
  • Everything in Community
  • Cloud sync + cost insights
  • Remote configuration
  • 90-day history
Klaro Cloud: Early Access
Team
$90/mo · $990/yr
Shared visibility, policies and analytics for a team
  • Everything in Developer
  • Team policies + Slack alerts
  • Audit history
  • Team analytics
Klaro Cloud: Early Access
Startup
$200/mo · $2,200/yr
Organization-wide AI operations
  • Everything in Team
  • Advanced routing insights
  • Org-wide analytics
  • Priority support
Klaro Cloud: Early Access
Works completely offline today.
Connect to Klaro Cloud later for team dashboards, shared policies, remote configuration, and cross-project analytics. An upgrade, not a requirement.

The SDK sends anonymous product telemetry by default — no prompts, responses, secrets or PII, ever. See exactly what's collected →