The bill got bigger, but you cannot see what it paid to build

As AI coding-tool costs rise, it is tempting to start with model-level spend or rankings by user. But that table alone makes it hard to explain how much went to a payments overhaul, or how much was spent on incident response and cancelled experiments.

The “$150,000 a month” in the title is not a verified Navigara customer bill or savings result. It is an anecdote introduced by a Navigara co-founder, who said that as a CTO, a CFO asked, “Is Claude creating nearly $150,000 in real value every month?” The company, period, user count, and billing evidence have not been disclosed, so treat it only as a question illustrating the scale of the problem.

Still, the direction of the question is sound. You need to show not which model received the money, but which product goal it flowed toward and what outcome it produced before deciding whether to increase or cut the budget, or change how work gets done.

First, retrieve a full month of usage cost without gaps

Your first deliverable is not a giant dashboard. It is a ledger that retrieves a full month of Claude Platform costs end to end. The process below is limited to the path that uses an organization Admin API key and the x-api-key header. Organizations using OAuth tokens have different authentication headers and must not use these commands as-is. The same API endpoint also does not apply to personal accounts, Claude Enterprise, or Claude Platform on AWS.

  1. Confirm that this is the right account type in the official documentation. Open the Usage and Cost API documentation and first verify that your current organization and credentials are supported.
  2. Prepare curl, jq, and Python 3. Run the checks below in a terminal. If anything is missing, install it using your managed device’s approved software route or the package manager appropriate for your operating system, then confirm all three commands print version information.
curl --version
jq --version
python3 --version
  1. Load your organization’s Admin API key into the current shell. Obtain an Admin API key issued by the organization administrator in Claude Console, and use the organization-approved secret-management tool to inject it into the ANTHROPIC_ADMIN_KEY environment variable. Do not write the key directly in scripts, ledgers, or shared documents.
  2. Set the UTC period and storage folder to the actual reconciliation scope. The values below are illustrative inputs for querying August 2026. This article did not run the commands in an authenticated organization or reproduce a response.
  3. Run the script to preserve every page as a uniquely named file. The Cost API default limit is 7 buckets and its maximum is 31. The script requests limit=31 and automatically passes next_page when has_more=true.
set -eu
: "${ANTHROPIC_ADMIN_KEY:?Load an Anthropic Admin API key first}"

STARTING_AT='2026-08-01T00:00:00Z'
ENDING_AT='2026-09-01T00:00:00Z'
REPORT_DIR='./claude-cost-2026-08'
mkdir -p "$REPORT_DIR"

page=''
page_number=1
while :; do
  output_file=$(printf '%s/page-%03d.json' "$REPORT_DIR" "$page_number")
  if [ -n "$page" ]; then
    curl --fail-with-body --silent --show-error --get \
      'https://api.anthropic.com/v1/organizations/cost_report' \
      -H "x-api-key: ${ANTHROPIC_ADMIN_KEY}" \
      -H 'anthropic-version: 2023-06-01' \
      --data-urlencode "starting_at=${STARTING_AT}" \
      --data-urlencode "ending_at=${ENDING_AT}" \
      --data-urlencode 'limit=31' \
      --data-urlencode 'group_by[]=workspace_id' \
      --data-urlencode 'group_by[]=description' \
      --data-urlencode "page=${page}" > "$output_file"
  else
    curl --fail-with-body --silent --show-error --get \
      'https://api.anthropic.com/v1/organizations/cost_report' \
      -H "x-api-key: ${ANTHROPIC_ADMIN_KEY}" \
      -H 'anthropic-version: 2023-06-01' \
      --data-urlencode "starting_at=${STARTING_AT}" \
      --data-urlencode "ending_at=${ENDING_AT}" \
      --data-urlencode 'limit=31' \
      --data-urlencode 'group_by[]=workspace_id' \
      --data-urlencode 'group_by[]=description' > "$output_file"
  fi

  jq -e '.data and (.has_more | type == "boolean")' "$output_file" >/dev/null
  has_more=$(jq -r '.has_more' "$output_file")
  [ "$has_more" = 'true' ] || break
  page=$(jq -r '.next_page // empty' "$output_file")
  [ -n "$page" ] || { echo 'has_more=true but next_page is missing' >&2; exit 1; }
  page_number=$((page_number + 1))
done

python3 - "$REPORT_DIR" <<'PY'
from decimal import Decimal
from pathlib import Path
import json, sys

files = sorted(Path(sys.argv[1]).glob('page-*.json'))
amount_cents = Decimal('0')
buckets = []
for path in files:
    payload = json.loads(path.read_text())
    for bucket in payload['data']:
        buckets.append((bucket['starting_at'], bucket['ending_at']))
        for result in bucket['results']:
            if result['currency'] != 'USD':
                raise SystemExit(f"Unexpected currency: {result['currency']}")
            amount_cents += Decimal(result['amount'])
print(f'pages={len(files)}')
print(f'buckets={len(buckets)}')
if buckets:
    print(f'range={min(x[0] for x in buckets)}..{max(x[1] for x in buckets)}')
print(f'amount_cents={amount_cents}')
print(f'amount_usd={amount_cents / Decimal("100")}')
PY

Success means the request finishes without errors, the final response has has_more set to false, and the printed bucket range covers the intended UTC period. Each page should remain separately, such as page-001.json, and both amount_cents and amount_usd should be printed. Do not move on to cost allocation if you encounter authentication errors, invalid JSON, a missing next_page, or an unexpected currency.

The Cost API’s amount is not dollars. It is a decimal string in USD cents, and fractional cents can occur. That is why the script totals values with Python’s Decimal rather than binary floating point, then divides by 100. If the total cents are 18420, the usage cost is USD 184.20. Priority Tier costs are not included in this API and must be kept as separate cost rows.

Card payments and usage costs belong in different ledgers

For prepaid Claude accounts, do not directly reconcile that month’s Cost API total with that month’s card payment total. Most Claude Console organizations buy usage credits first and can enable auto-reload when the balance falls below a chosen threshold. An August card payment may be a purchase of credits to use later, not the cost used in August.

Account modelValue to compare with the Cost API firstHow to handle payment records
Prepaid creditsConsole Usage/Cost records for the same UTC periodRecord manual and automatic reloads separately as credit purchases
Monthly postpaid contractUsage-charge statement or invoice for the same periodSeparate taxes, discounts, credits, and adjustments into individual rows

For prepaid accounts, validate the flow with opening credit balance + purchases during the period ± adjustments − usage during the period = closing credit balance. Compare Cost API usage to Console Usage/Cost records for the same period first, and keep card payments, manual reloads, and auto-reloads as purchase rows. If a difference remains, check UTC period boundaries, API exclusions such as Priority Tier, credit expiration, discounts, taxes, and other adjustments.

The signal that cost retrieval is complete is not that card payments and the API total happen to match. It is that every page was preserved, cents were converted correctly, usage cost can be explained against Console records for the same period, and credit purchases and usage appear as separate rows.

Separate source costs from per-PR allocations

Once supplier costs are reconciled, build a ledger with the following columns.

Source cost row ID · period · supplier · product · source amount · allocated amount · workspace · repository · PR · issue · initiative · link evidence · attribution status · release status · quality outcome

The Claude Platform Cost API retrieves costs daily and can group them by workspace_id and description, but it does not provide PR, issue, or roadmap identifiers. A supplier API is the starting point for billing reconciliation, not a finished roadmap cost sheet.

Source dataWhat it can establishRecords to link in addition
Supplier costsUsage cost by product and workspaceCoding-tool session or repository
Repository · PRActual code changesIssue key in branch or PR body
Issue · epicWork purpose and scope of responsibilityInitiative · roadmap
Roadmap itemAllocated cost by goalRelease · rework · incident outcomes

If an approval record shows that a specific workspace was used only for a payments overhaul, its cost can be directly attributed at the initiative level. That does not mean you can label all monthly workspace cost as a direct cost for a single PR. Creating PR-level costs requires session costs recorded alongside session IDs, or an additional allocation basis agreed in advance.

Navigara also presents a product concept that classifies AI spend by work type and roadmap alignment, then links it to initiatives, epics, tickets, and code changes. However, its public pages do not sufficiently explain rules for joining individual supplier cost events to sessions and PRs, or how it handles conflicts in sessions covering multiple issues. Nor should the spend figures and savings rates on screen be interpreted as independently verified customer outcomes.

Do not mix verified costs with estimated costs

A useful cost sheet is not one that merely looks sophisticated. It is one that shows what has been verified and where estimation begins.

  • Direct attribution: costs supported by explicit evidence, such as a workspace dedicated to a particular initiative or session IDs recorded with their costs
  • Estimated attribution: costs divided by user, repository, time window, changed files, or similar criteria without a direct cost identifier
  • Shared cost: costs such as shared seats and common infrastructure that are difficult to place directly under one initiative
  • Unclassified: costs with neither link evidence nor an agreed allocation basis

The following numbers are all illustrative inputs showing the calculation method, not actual customer costs or performance. If a source cost is USD 184.20 and a dedicated-workspace record links it to a payments overhaul, you can record it as “initiative-level direct attribution” while leaving the PR blank.

If that amount is split under an agreed changed-file ratio into USD 110.52 for PR #842 and USD 73.68 for #857, the two rows are “estimated allocations.” Preserve the same source cost row ID and check that their allocated total does not exceed USD 184.20. Without supporting evidence, it is more accurate to leave the PR column blank and retain the cost at the initiative level.

Do not immediately classify roadmap-unlinked costs as waste. Security patches, incident response, refactoring, and exploratory experiments can be necessary while falling outside a planned feature list. Navigara also presents a concept distinguishing roadmap-aligned work from legitimate non-roadmap work. Unlinked items are not deletion candidates; they are a review queue for confirming purpose.

Include release and quality in the denominator of cost

If you calculate cost productivity from only PR or commit counts, you may mistake increased activity for increased value. Navigara likewise raises the issue that a PR is not itself a unit of value, but the product’s own scores should not be treated as independently verified standard metrics.

DORA explains that you should select a framework that fits the purpose of measurement and interpret both what system logs and self-reported data reveal and their limits. Your roadmap cost sheet should therefore place outcomes, quality, and attribution confidence alongside monetary amounts.

Cost
Direct · allocated · unclassified
Outcome
Released or not · timing versus plan
Quality
Rework · incidents · review time
Confidence
Direct · estimated · shared · unclassified

Record the scope when adding GitHub Copilot data too. GitHub provides usage metrics and PR activity at organization, enterprise, repository, and user levels, but seat information is available through a separate API. Organization figures may be attributed by membership rather than the actual location of work, so one user’s activity can appear in multiple organizations, and different Copilot API resources must not be compared directly.

A report saying “$20,000 for the payments overhaul” is less useful than one saying “$14,000 initiative-level direct attribution, $4,000 shared-cost allocation, $2,000 PR-level estimates, deployed two weeks ahead of plan, three rework items.” These figures are illustrative as well. The key is not to turn off the most expensive model first, but to find workflows where both the unclassified rate and rework are high.

  1. Reconcile supplier usage costs. Verify all pages, period coverage, and cent conversion, then compare with Console Usage/Cost records for the same UTC period.
  2. Separate purchases from usage. Put prepaid credit purchases in rows separate from usage costs, and connect opening and closing balances with purchases, adjustments, and usage.
  3. Apply an attribution status to every cost. Mark each as direct attribution, estimated, shared cost, or unclassified, and retain the linking evidence.
  4. Check for allocation overages. Confirm that child rows with the same source cost row ID do not total more than the source amount.
  5. Look at release and quality together. Do not conclude that AI caused an effect merely because cost changes moved together with release timing, rework, or incidents.

You do not need to force every cost down to the PR level. Link only as far as you can verify, and honestly retain the rest as estimated or unclassified. That is how a frightening monthly total becomes cost data that reveals workflows to improve.

If you want to go deeper

Usage and Cost API - Claude Platform Docs — Check supported organizations and authentication methods, cost units, and exclusions. platform.claude.com

Get Cost Report - Claude API Reference — Check request parameters and limits, plus the has_more and next_page response structure. platform.claude.com

How do I pay for my Claude API usage? — Explains the difference between prepaid usage credits and auto-reload, and monthly postpaid contracts. support.claude.com

DORA | Choosing measurement frameworks to fit your organizational goals — Explore the limitations to consider when interpreting cost, delivery, and quality data. dora.dev