# Metrx > Metrx is the scorecard for your AI workforce. Track what every AI agent costs, identify waste, optimize model selection, and prove ROI — in under 60 seconds via MCP server. Free tier, no credit card required. ## What Metrx Does - Tracks per-agent, per-model LLM costs in real-time (OpenAI, Anthropic, Google, Cohere, Mistral) - Generates cost optimization recommendations (model switching, token reduction, provider arbitrage) - Runs A/B experiments comparing models with statistical significance testing - Detects cost leaks: idle agents, model overprovisioning, missing caching, retry storms - Links agent actions to business outcomes (revenue attribution, ROI calculation) - Provides budget governance with hard/soft spending limits and auto-pause enforcement - Publishes anonymized LLM cost benchmarks from the Metrx network ## What Metrx Does NOT Do - Metrx is NOT an LLM gateway or proxy — it observes and analyzes, it does not route API traffic - Metrx is NOT a prompt management tool — use Langfuse or PromptLayer for prompt versioning - Metrx is NOT an agent hosting platform — it works with your existing infrastructure - Metrx does NOT store prompt/completion content — only metadata, cost signals, and performance metrics ## For AI Agents (MCP Server) Install (stdio): `npx @metrxbot/mcp-server` Remote (HTTP): `https://metrxbot.com/api/mcp` 23 tools across 10 domains: ### Cost Tracking - `metrx_get_cost_summary` — Get fleet-wide cost summary with spend, call counts, error rates, agent breakdown - `metrx_list_agents` — List all agents with status, category, cost metrics - `metrx_get_agent_detail` — Get detailed cost history and performance for one agent ### Optimization - `metrx_get_optimization_recommendations` — AI-powered savings recommendations (model switch, token guardrails, arbitrage) - `metrx_apply_optimization` — Apply one-click optimization fix to an agent - `metrx_route_model` — Get optimal model recommendation based on task complexity - `metrx_compare_models` — Compare LLM pricing across providers (works Day 0, no data needed) ### Budget Governance - `metrx_get_budget_status` — View all budget configurations and spending vs limits - `metrx_set_budget` — Create/update budget with spending limit and enforcement mode - `metrx_update_budget_mode` — Change enforcement mode or pause/resume budget ### Alerts & Monitoring - `metrx_get_alerts` — Get active cost spikes, error rate, budget warnings - `metrx_acknowledge_alert` — Mark alerts as read - `metrx_get_failure_predictions` — Predictive failure analysis before problems happen - `metrx_configure_alert_threshold` — Set thresholds that trigger email, webhook, or auto-pause ### Experiments - `metrx_create_model_experiment` — Start A/B test comparing two LLM models - `metrx_get_experiment_results` — Get experiment results with statistical significance - `metrx_stop_experiment` — Stop experiment, optionally promote winner ### Cost Leak Detection - `metrx_run_cost_leak_scan` — Comprehensive audit: idle agents, overprovisioning, missing caching, error waste, context bloat, missing budgets, arbitrage opportunities ### Revenue Attribution - `metrx_attribute_task` — Link agent action to business outcome (revenue, cost saving, efficiency) - `metrx_get_task_roi` — Calculate ROI for a specific agent - `metrx_get_attribution_report` — Full attribution report with confidence scores ### Upgrade Analysis - `metrx_get_upgrade_justification` — ROI report for tier upgrades (Free → Lite/Pro) based on usage patterns ### Audit & Compliance - `metrx_generate_roi_audit` — Board-ready ROI audit with per-agent breakdown and methodology ## MCP Configuration ```json { "mcpServers": { "metrx": { "command": "npx", "args": ["@metrxbot/mcp-server"], "env": { "METRX_API_KEY": "sk_metrx_..." } } } } ``` ## For Developers (REST API & SDKs) - REST API: https://metrxbot.com/api/v1/ - OpenTelemetry: Send OTLP traces to https://gateway.metrxbot.com/v1/traces - Python SDK: `pip install metrx` - TypeScript SDK: `npm install @metrx/sdk` ## Quick Start 1. Sign up at https://metrxbot.com (free, no credit card) 2. Get API key from Settings → Security 3. Install MCP server or SDK 4. See cost data in under 5 minutes ## Links - Documentation: https://docs.metrxbot.com - API Reference: https://docs.metrxbot.com/api-reference - Agent Quickstart: https://metrxbot.com/agent-quickstart - MCP Server (npm): https://www.npmjs.com/package/@metrxbot/mcp-server - Cost Benchmarks: https://metrxbot.com/benchmarks - Pricing: https://metrxbot.com/pricing - Full Documentation: https://metrxbot.com/llms-full.txt