Spanlens

A drop-in proxy sits between an app and OpenAI, Anthropic, or Gemini and logs each call's cost, tokens, latency, and full prompt for debugging and spend control. Adoption means changing a base URL or running a CLI wizard that patches existing client calls. A surprise bill? Filter requests by model or key, check per-end-user totals, then open any one to read the messages and the reply, even when it streamed. A slow agent? Its run opens as a waterfall timeline with the critical path marked, or as a node graph for LangChain and LangGraph traces. Spend, latency, and error spikes are measured against a seven-day baseline, and alert rules route breaches to email, Slack, or Discord. Savings recommendations point to cheaper models for simple tasks, with estimated monthly dollars and a simulate button. Detectors flag emails, phone numbers, card numbers, and prompt-injection attempts, and a project can block injections outright. Prompt edits keep versions with diffs and A/B traffic splits, while LLM judges and a human rating queue score the outputs. Workspaces carry admin, editor, and viewer roles, and every invitation or role change is logged with who made it. Cursor or Claude Desktop can query the same data through a bundled MCP server. Running on a dedicated VPS on RepoCloud with guaranteed CPU, RAM, and SSD, full root SSH access, and a browser serial console. MIT licensed.

Spanlens
Spanlens
Spanlens
Spanlens
Spanlens
Spanlens
Spanlens
Spanlens
Spanlens
Spanlens

Benefits

  • Know what every call costs
  • Each request records model, tokens, latency, and dollars, with daily rollups and per-end-user totals. An expensive prompt shows up in the dashboard before it shows up on the invoice.
  • Adopt it with one line
  • Swap the base URL of an existing OpenAI, Anthropic, or Gemini client, or let the CLI wizard patch the calls, and logging begins without an SDK migration.
  • Debug slow agent runs fast
  • Every step of a multi-step run shows its duration, cost, and tokens, so the retrieval call or model hop that slowed a response is visible at a glance.
  • Logs stay in your database
  • Prompts, responses, and AES-256-GCM encrypted provider keys sit in a Supabase project you own, whether on Supabase Cloud or a self-hosted Supabase, instead of a log vendor's servers.

Features

  • Request Log With Full Bodies
  • Filter by model, provider, key, or status, save named views, and open any call to read the complete prompt and response, including reconstructed streams.
  • Agent Trace Timeline and Graph
  • Waterfall span trees mark the critical path, and a node graph maps LangChain and LangGraph runs, showing duration, cost, and tokens for each node.
  • Savings Recommendations
  • Suggests cheaper models for simple tasks, estimates monthly dollars saved, and lets you simulate a swap, with prompt-cache savings reported alongside.
  • Anomaly Detection and Alerts
  • Flags spend, p95 latency, and error-rate spikes against a seven-day baseline, and budget or latency alert rules notify email, Slack, or Discord.
  • Prompt Versions and Evals
  • Version prompts with diffs and A/B traffic splits, then score outputs with LLM judges or a human rating queue and compare judge agreement with human scores.
  • PII and Injection Scanning
  • Regex detectors flag emails, phone numbers, card numbers, and prompt-injection attempts in requests and responses; a project can block injections with a 422.

Apps Similar to Spanlens