The classifier reads the prompt and assigns a complexity tier —
nano,
standard, or
advanced —
based on length, token estimate, reasoning signals, and caller-supplied constraints like
requiresTools or
minContextWindow.
Product 04 · Router / API / Dashboard · Local Slice
Agent Cost Router
Route agent work to the cheapest capable model. Classify complexity, pick the best fit, log every decision.
Every task goes to the same expensive model.
Agent workloads are not uniform. A prompt that asks "what is the capital of France?" does not need the same model as one that asks to redesign a production authentication architecture. But most agent pipelines route everything to a single model — usually the most capable one available — regardless of what the task actually requires.
The result is unnecessary spend, slower latency on tasks that a cheaper model would handle equally well, and no record of what each routing decision cost or why it was made. Teams have no visibility into how much agent work actually costs, which tasks consumed the budget, or whether the model choice was justified.
Agent Cost Router adds a classification and routing layer before each prompt reaches a provider. Simple tasks go to nano-tier models. Complex reasoning goes to the tier it needs. Every decision is logged with cost estimate, savings, and alternatives considered.
Classify → Route → Log
The router filters the model catalog by tier, provider constraints, tool and vision
support, context window, and budget cap. The selected
budget_mode —
cheapest, balanced, or performance —
controls how the winner is chosen from the filtered set.
Dry-run mode returns the routing decision and cost estimate without calling a provider. Run mode executes the prompt, records actual tokens and cost, and appends the result to the persistent local history with savings vs. the claude-sonnet baseline.
Built-in model catalog
The router ships with a static catalog of known models. Additional models can be synced
live from OpenRouter with the sync_models tool or
agent-cost-router models sync CLI command.
| Model ID | Provider | Tier | Input / 1M tokens | Output / 1M tokens | Context |
|---|---|---|---|---|---|
| gpt-4o-mini | openai | nano | $0.15 | $0.60 | 128k |
| claude-haiku-4-5-20251001 | anthropic | nano | $0.80 | $4.00 | 200k |
| gpt-4o | openai | standard | $2.50 | $10.00 | 128k |
| claude-sonnet-4-6 | anthropic | standard | $3.00 | $15.00 | 200k |
| claude-opus-4-7 | anthropic | advanced | $15.00 | $75.00 | 200k |
Savings are calculated against the claude-sonnet-4-6 baseline.
Live pricing from OpenRouter requires OPENROUTER_API_KEY.
Static catalog pricing reflects the values in src/models.ts.
Three budget modes. One consistent interface.
Every route call takes a budget_mode.
The classifier determines the minimum capable tier. The budget mode controls how the winner
is selected from that tier and above.
Picks the lowest-cost model that meets the minimum tier requirement. Free models always win over paid; among free models, the one with the largest context window is preferred. Best for high-volume workloads where cost minimization is the primary goal.
Prefers the minimum capable tier at lowest cost, but applies a mild penalty for over-provisioning to a higher tier unnecessarily. A sensible default for mixed workloads where some tasks need room to grow.
Picks the highest-tier model available before considering cost. Use this for critical reasoning tasks, production analysis, or any work where capability matters more than spend.
CLI, MCP server, and local dashboard
Agent Cost Router ships as a local CLI tool and MCP server. Once installed, use the CLI for dry-run routing and one-off prompts, or wire the MCP tools into any MCP-compatible agent runtime.
The local dashboard starts on
http://127.0.0.1:4317/dashboard
after running
agent-cost-router serve.
# Install locally for MCP config
npm install @certaworks/agent-cost-router
# Optional: install globally for direct CLI commands
npm install -g @certaworks/agent-cost-router
# Dry-run: classify and pick model, no execution
agent-cost-router route \
--prompt "Summarize this paragraph briefly"
# Run: route and execute, log result
agent-cost-router run \
--prompt "Analyze this architecture design" \
--provider anthropic \
--budget-mode balanced
# View cost history and savings ledger
agent-cost-router history list --project demo
agent-cost-router budget summary \
--project demo --budget-id q2
# Start local dashboard + HTTP API
agent-cost-router serve --port 4317
{
"mcpServers": {
"agent-cost-router": {
"command": "node",
"args": ["./node_modules/@certaworks/agent-cost-router/dist/mcp/server.js"]
}
}
}
Available MCP tools
Agent Cost Router exposes the following tools to any MCP-compatible agent runtime.
OPENROUTER_API_KEY.Local dashboard — prototype status
Agent Cost Router includes a local HTTP API and HTML dashboard for reviewing routing decisions, model selections, cost history, and savings ledger. The dashboard starts alongside the local server and requires no cloud connection.
Route history is persisted to
~/.agent-cost-router-history.json
by default. The store records sanitized prompt previews, SHA-256 prompt hashes, model,
tier, complexity, estimated and actual cost, savings, and alternatives considered.
Full prompts are never stored.
Hosted SaaS dashboard, team accounts, persistent cloud history, managed budget alerts, and shared savings ledgers are roadmap items. They are not currently built or available. What is available today is the local CLI, MCP server, local HTTP API, and local prototype dashboard.
What Agent Cost Router does and does not do
- Classify prompt complexity into nano, standard, or advanced tier
- Route to the cheapest capable model given provider, budget, and constraint filters
- Estimate and record cost, savings, and alternatives considered per routing decision
- Expose CLI, MCP tools, and local HTTP API for integration into agent pipelines
- Sync live model pricing from OpenRouter when an API key is present
- Guarantee pricing accuracy — static catalog and OpenRouter sync may lag provider changes
- Execute prompts without a valid API key for the selected provider
- Provide hosted SaaS, team accounts, or managed cloud history (roadmap)
- Evaluate action safety or replace Confidence Gate for pre-action review
- Intercept or route requests made directly through provider SDKs
Related Products
Get early access to hosted Agent Cost Router
The local CLI and MCP server are available now for private testing. Hosted beta with cloud history, shared budget ledgers, and team dashboards is in development. Leave your details and we will reach out when hosted access opens.