
cost-xray
Understand API costs and context for AI coding agents
Replaces Portkey, Helicone
Who it's for
Gain insights into API usage and costs while developing with Claude Code or Codex.
Not using Claude Code or Codex.
Analyze the cost structure of AI interactions to optimize spending.
Not interested in cost analysis.
The problem
The project helps users understand the detailed costs and context of API calls made by AI coding agents, which are often obscured in traditional logging.
How it works
Trace every token's cost down to the individual call, providing detailed insights.
Visualize what occupies the context window, including system prompts and tool schemas.
Identify configured servers and tools that are never called, optimizing your setup.
Ensure accurate token counts using a calibrated approach.
Automatically restarts if the proxy fails, ensuring uninterrupted monitoring.
Features
- Cost Attribution
- Window Occupancy
- Unused MCP Waste
- Tokenization Accuracy
- Self-Healing Capture
How to install
curl -fsSL https://raw.githubusercontent.com/tigerless-labs/cost-xray/master/install.sh | bash
Recommended for this setup
Strengths
- Detailed Cost Insights: Provides granular visibility into API costs, helping users optimize spending.
- No Configuration Changes: Captures API traffic transparently without requiring changes to existing setups.
Trade-offs
- Limited to Supported Agents: Currently only supports Claude Code and Codex.
- Requires Local Setup: Needs installation and local environment configuration.
Tech stack
FAQ
cost-xray supports Claude Code and Codex.
Run the command: curl -fsSL https://raw.githubusercontent.com/tigerless-labs/cost-xray/master/install.sh | bash.
No, it does not require API keys or account configurations.