costzeraDOCS
Documentation

Costzera docs

Costzera is an AI-agent cost-intelligence platform. It ingests your agents' execution traces, finds where they overspend, ships fixes to your codebase, and measures the realized savings against a baseline — nothing is estimated after the fact.

Overview

Point Costzera at your agents' traces and code. It continuously analyzes every run for cost inefficiencies, writes recommendations grounded in your actual code, and — once you apply a fix — tracks the change against a baseline to prove the delta.

The loop is Connect → Analyze → Implement → Measure, and it runs on autopilot or with a human in the approval seat.

How it works

01
Connect
Link LangSmith (traces) and GitHub (code), or plug Costzera into your coding agent — Claude Code, Codex, Copilot — via our MCP.
02
Analyze
The optimizer reads every trace, grounds each finding in a knowledge bank of known cost patterns, and writes a recommendation with the supporting evidence, a visible savings calculation, and a confidence score.
03
Implement
Apply the fix through your coding agent (copy the generated prompt) or a one-click flow, reviewed like any pull request.
04
Measure
Every applied change is tracked for 7 days against a baseline. Savings are measured, not promised.

Connect your data

LangSmith

In onboarding, paste a LangSmith Personal Access Token to auto-discover your workspaces. For each workspace you want synced, add a scoped service key (or fall back to the token). Production workspaces ingest daily; test/staging workspaces are registered but stay off until you enable them.

GitHub

Install the Costzera GitHub App (read-only) on the repositories your agents live in. This lets Costzera ground its recommendations in your real code and attribute cost changes to commits. See Savings & measurement for how commits map to measured savings.

What we detect

Costzera classifies inefficiency into three layers:

Overprovisioning
Paying for more intelligence or context than the task needs — oversized models, bloated context. The EC2 right-sizing of AI.
Waste
Paying for computation that produces nothing — duplicate calls, wasted loops, spend on failed runs. Pure burn.
Anti-patterns
Structural flaws in the agent's code that generate cost systematically — bad tool schemas, missing caching, unbounded histories, no early exits. The causal layer: overprovisioning and waste are symptoms, anti-patterns are the disease.

Using the platform

Operations
Your home base. Run an analysis, review recommendations through their lifecycle (awaiting approval → implementing → measuring → verified), and watch savings land.
Cost tracking
Spend over time — hourly, daily, weekly, or monthly — segmented by team, plus totals, est. savings, and cost per run.
Agents
Every agent with its spend, run volume, error rate, models used, and monthly budget.
Teams
Spend grouped by workspace / department.

Recommendations

Each recommendation carries the evidence pulled from your traces (model, token profile, duplicate-input rate, cost share…), a visible savings calculation, and a confidence score. Three ways to act on one:

  • Copy prompthands a ready-to-paste implementation prompt to your coding agent (Claude Code, Copilot, ChatGPT), assembled from the fix, the relevant code, and the evidence.
  • Generate fixproduces a before/after code diff you can review.
  • Approve / Reject / Mark implementedmoves the recommendation through its lifecycle.

Savings & measurement

When you ship a Costzera fix, record it in a costzera.json manifest at your repo root, committed in the same change. Each entry ties a recommendation to the commit that implemented it:

{
  "version": 1,
  "applied": [
    {
      "recommendation_id": "b1f2…-…-…",
      "agent": "billing_assistant",
      "pattern": "tool_pruning",
      "commit": "abc1234",
      "applied_at": "2026-07-16T02:14:00Z"
    }
  ]
}

Costzera then measures the change: it takes the agent's cost-per-run in the window before the commit as the baseline, watches the next 7 days, normalizes for traffic volume, and records the realized monthly saving — but only if quality (success rate) holds. That measured number is what shows up as verified savings.

Update costzera.json in every commit that implements a Costzera recommendation — that manifest is how each fix gets attributed to a commit and measured against its baseline.

Security & data handling

Costzera is built on a simple principle: we analyze your agent's behaviour without taking custody of your data. We never store your prompts, completions, tool payloads, or source code.

Traces: metadata only
When we read your LangSmith traces, we persist only derived metadata: token counts, costs, latencies, call structure, and one-way hashes used for duplicate detection. The content of your messages is read in flight and never written to our database.
Code: never at rest
We keep no mirror or clone of your repository. Code is fetched on demand from GitHub at a specific commit through a short-lived, repo-scoped GitHub App token that expires within the hour, analyzed in memory, and discarded. The only code that persists is the handful of lines cited as evidence inside a recommendation, visible to you in your own dashboard.
Secrets
Your LangSmith key is encrypted at rest. Costzera API keys are stored only as hashes and shown once at creation. GitHub access uses App installation tokens, never standing personal access tokens.
Tenant isolation
Every record is scoped to your tenant, resolved server-side from your session or API key. Tenant identity is never accepted from client input, and no query crosses tenants.
Transport & infrastructure
All traffic runs over TLS on hardened cloud infrastructure, with strict security headers on every response.
The result: Costzera can tell you exactly where your agent wastes money, while your IP, your customers' data, and your code never leave your control.

MCP server

Use Costzera from any MCP client — Claude, Claude Code, ChatGPT connectors, GitHub Copilot — right alongside the dashboard.

  • EndpointPOST https://costzera.com/api/mcp
  • Authcreate a key in Settings → API keys, then send Authorization: Bearer czk_…

Tools

Read (any key): get_cost_summary, list_agents, list_recommendations, get_recommendation, get_verified_savings, get_sync_status, list_analysis_runs, get_analysis_run.

Write (read+write key only): run_analysis, approve_recommendation, reject_recommendation, implement_recommendation, set_agent_budget.

Prompts (ready-made workflows): cost_review, triage_recommendations, investigate_spike.

Connect

Claude Code:

claude mcp add --transport http costzera \
  https://costzera.com/api/mcp \
  --header "Authorization: Bearer czk_your_key"

GitHub Copilot — .vscode/mcp.json:

{
  "servers": {
    "costzera": {
      "type": "http",
      "url": "https://costzera.com/api/mcp",
      "headers": { "Authorization": "Bearer czk_your_key" }
    }
  }
}

ChatGPT — add an MCP connector with the same URL and bearer header.

Skills

The Costzera Skill teaches your agent to drive these tools into higher-level flows — a weekly cost review, triaging open recommendations, investigating a spend spike, or implementing a fix — with guardrails: never invent numbers, always confirm before a write action.

Drop the skills/costzera folder into .claude/skills/ (Claude Code) or upload it as a Skill in the Claude apps.