Skip to content
FossShelf
Home / Categories / For AI Engineers

cost-xray

Understand API costs and context for AI coding agents

Replaces Portkey, Helicone

5.81K starsMITlast commit 12 Nov 2026

Who it's for

Developers

Gain insights into API usage and costs while developing with Claude Code or Codex.

Not using Claude Code or Codex.

Data Analysts

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

Cost Attribution

Trace every token's cost down to the individual call, providing detailed insights.

Window Occupancy

Visualize what occupies the context window, including system prompts and tool schemas.

Unused MCP Waste

Identify configured servers and tools that are never called, optimizing your setup.

Tokenization Accuracy

Ensure accurate token counts using a calibrated approach.

Self-Healing Capture

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

Languages
Python, Shell, Makefile
Frameworks
—
Databases
—
Tooling
—

FAQ

What agents does cost-xray support?

cost-xray supports Claude Code and Codex.

How do I install cost-xray?

Run the command: curl -fsSL https://raw.githubusercontent.com/tigerless-labs/cost-xray/master/install.sh | bash.

Does cost-xray require API keys?

No, it does not require API keys or account configurations.

Similar tools

More in AI Engineers