惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
Jina AI
Jina AI
J
Java Code Geeks
Microsoft Security Blog
Microsoft Security Blog
Recent Announcements
Recent Announcements
I
InfoQ
L
LangChain Blog
The Cloudflare Blog
IT之家
IT之家
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Last Week in AI
Last Week in AI
Blog — PlanetScale
Blog — PlanetScale
罗磊的独立博客
云风的 BLOG
云风的 BLOG
Microsoft Azure Blog
Microsoft Azure Blog
Engineering at Meta
Engineering at Meta
F
Fortinet All Blogs
博客园 - 聂微东
美团技术团队
博客园_首页

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
We tracked 200K AI requests. Here's where the money actua...
Joao Romao · 2026-05-17 · via DEV Community

Joao Romao

Six months ago I posted here about CostLens — a tool to reduce OpenAI costs. Since then, we've completely rebuilt it based on one question a VP asked our team:

"How much faster are we delivering with AI? What's the number?"

Nobody could answer. We had cost dashboards, but no way to connect spend to output. So we built that.

What CostLens does now

It's not just cost tracking anymore. It's three things:

  1. Cost attribution — not "you spent $4,200 on OpenAI" but "code review costs $340/mo, customer support costs $89/mo, and classification costs $12/mo." Per-feature, per-developer.

  2. Smart routing — simple prompts automatically go to cheaper models. No code changes. We're seeing 30-40% savings on teams that were sending everything to GPT-5.4.

  3. Productivity tracking via MCP — works inside Claude Code, Kiro, and Cursor. Tracks sessions, commits, PRs, and time-to-ship. Generates weekly reports your VP can forward to justify the AI budget.

CostLens weekly engineering report showing AI cost per commit ($4.36), per PR ($12.80), session trends, and deliverables — the numbers your VP needs to justify AI spend.

The setup is still one line

import { CostLens } from 'costlens';
const costlens = new CostLens({ apiKey: 'cl_...' });
const openai = costlens.wrapOpenAI(new OpenAI());
// Done. Every request is tracked and optimized.

Enter fullscreen mode Exit fullscreen mode

For coding agents (Claude Code, Kiro, Cursor):

{
  "mcpServers": {
    "costlens": {
      "command": "npx",
      "args": ["-y", "@costlens/mcp-server"],
      "env": { "COSTLENS_MCP_KEY": "your_key" }
    }
  }
}

Enter fullscreen mode Exit fullscreen mode

What we learned from tracking 200K requests

  • 52% of requests were simple tasks running on expensive models (classification, extraction, yes/no questions)
  • Smart routing cut our own bill from $4,100 to $2,337/month
  • The "code review" feature was 3x more expensive than we thought
  • Sessions with no output (abandoned/looping) accounted for 15% of spend

Kill switch

One thing we added after a background agent burned $50 in a weekend: a Slack kill switch. When spend velocity spikes, you get a message with a "Pause" button. One click stops that specific agent session. Auto-
resumes after 30 min.

Free for individuals

The SDK and MCP server are free. Team features (reports, routing, budgets) start at $99/month.

Would love feedback — especially from teams spending $1K+/month on AI. What would make you try this?