Loading...
Loading...
CostLens gives you per-feature, per-developer cost attribution for OpenAI and Anthropic. Know exactly which prompts are burning your budget.
Wrap your OpenAI or Anthropic client. Every request gets tagged with cost, model, latency, and feature attribution. No other code changes needed.
import { CostLens } from 'costlens' import OpenAI from 'openai' const costlens = new CostLens() const openai = costlens.wrapOpenAI(new OpenAI()) // Your code doesn't change. At all. const res = await openai.chat.completions.create({ model: 'gpt-4', messages: [{ role: 'user', content: 'Say hello' }] }) // → Routed to gpt-3.5-turbo (20x cheaper) // → Quality preserved for this prompt
Attribution
Tag prompts by feature, team, or user. Know that "code review" costs $340/mo and "customer support" costs $89/mo. Make informed decisions about where to optimize.
Alerts
Set daily/weekly/monthly caps. Get Slack alerts before you overspend. No surprises on the invoice.
Optimization
Automatically route simple prompts to cheaper models. Save 20-40% without changing your code.
Multi-provider
Unified view across all your AI providers. Compare costs, latency, and quality side by side. One SDK, one dashboard, full picture.
If your team uses OpenAI or Anthropic in production, you need visibility into where that money goes.
Setup
2 min
to set up
Coverage
100%
of requests tracked
Optimization
20-40%
typical savings
Free for small teams. Pay when you need team features.
Free
$0
For individual developers.
Cost tracking
Smart routing
OpenAI + Anthropic
Basic analytics
Team
Popular$99/mo
For engineering teams.
Everything in Free
Full analytics dashboard
Response caching
Budget alerts
Provider configuration
90-day data retention
Business
$299/mo
For scaling organizations.
Everything in Team
Unlimited data retention
Custom routing rules
Dedicated support
Set up in 2 minutes. See your first cost report today.
npm install costlens