Overview
costestimate is a developer SDK and CLI tool that answers one question before you run any AI job: what will this cost?
It counts tokens using a character-count approximation, looks up the current model pricing, and returns the estimated cost in cents — along with alternative models ranked by cost.
Built as a standalone SDK and an OpenClaw skill, costestimate integrates into any development workflow: a developer’s local machine, a CI/CD pipeline, a cron job definition, or an OpenClaw agent’s pre-flight check.
The Core Problem: “We Didn’t Know What It Would Cost”
Here’s the most common failure mode in AI product development:
A developer builds a feature. They test it. It works. They ship it. Three months later, the AI bill is $4,000/month — three times what anyone estimated. The feature was priced at $2/customer/month. At 500 customers, the margin is negative.
The failure isn’t greed or incompetence. The failure is invisibility. AI APIs bill per token, but no developer tool shows the meter running while you’re building. You find out what it costs when the bill arrives.
costestimate makes the meter visible before you build.
How It Works
The Core Functions
estimate(prompt, model, options?) — Returns token count and cost for a specific prompt on a specific model.
compare(prompt, models?) — Compares cost across specified models, or all available models.
suggest(requirement, minContext?) — Given a requirement (reasoning, fast, balanced, vision, cheap), returns the cheapest model that meets it.
listModels() — Returns all 16 supported models with current pricing.
Pricing Table — 16 Supported Models
| Model | Provider | Input /1M | Output /1M | Context |
|---|---|---|---|---|
| GPT-5.3 | OpenAI | $5.00 | $20.00 | 256K |
| GPT-4o | OpenAI | $2.50 | $10.00 | 128K |
| GPT-4o Mini | OpenAI | $0.15 | $0.60 | 128K |
| Claude Opus 4 | Anthropic | $15.00 | $75.00 | 200K |
| Claude Sonnet 4 | Anthropic | $3.00 | $15.00 | 200K |
| Claude Haiku 4 | Anthropic | $0.80 | $4.00 | 200K |
| Gemini 2.5 Pro | $1.25 | $5.00 | 1M | |
| Gemini 2.5 Flash | $0.075 | $0.30 | 1M | |
| DeepSeek Chat v3 | DeepSeek | $0.27 | $1.10 | 64K |
| Grok-3 | xAI | $3.00 | $15.00 | 131K |
| Grok-3 Mini | xAI | $0.30 | $1.50 | 131K |
| MiniMax M2.7 | MiniMax | $0.05 | $0.20 | 1M |
Use Cases
Developer Scoping a New Feature
Sarah is building a customer support summarization feature. She needs to know if it can be priced at $3/month per customer or if it needs to be $8/month.
Running costestimate --prompt "Summarize this support ticket in 2-3 sentences" --model gpt-4o --alternatives:
- GPT-4o = $0.0014/call
- GPT-4o Mini = $0.0003/call
She calculates: 50 calls/customer/month × $0.0003 = $0.015/month. She can price at $3/month and still have healthy margin. Without costestimate, she prices at $3 using GPT-4o estimates, actual cost is $0.07/call × 50 = $3.50/month — losing money on every customer.
CTO Building an AI Cost Budget
Marcus is the CTO at a 12-person startup. He’s building 6 AI features and needs to give the CFO a realistic AI cost forecast. Running costestimate across all 6 features, he presents:
- Estimated AI cost at 500 customers: $2,400/month
- With Haiku optimization: $890/month
- Savings from model selection: $1,510/month
CFO approves with the optimized model plan. The team ships with the right model from day one.
Integration
CLI
npm install -g @signalloom/costestimate
signalloom estimate --prompt "Summarize this" --model gpt-4o --alternatives
SDK
npm install @signalloom/costestimate
import { estimate, compare } from '@signalloom/costestimate'
const result = estimate({ prompt: '...', model: 'gpt-4o' })
Pricing
- Free: 100 estimates/month
- Loom Partner ($19/mo): 100,000 estimates/month + 25% rev-share on routed calls
- Loom Elite ($99/mo): Unlimited estimates + 25% rev-share + priority support
Part of the Signalloom Developer Toolbox. Install: npm install -g @signalloom/costestimate