Skip to main content

Claude Cost Reconciliation

@webframp/claude-cost-reconciliationv2026.10.21.1· Apache-2.0· 5d agoWORKFLOWSREPORTS
01README

Monthly reconciliation of the AWS Marketplace "Claude Enterprise" invoice line against Anthropic's own post-discount paid total for the same calendar month. Ships a workflow that collects both sides in parallel and a workflow-scope report that joins them into a verdict.

What it answers

Does what AWS billed us for Claude Enterprise match what Anthropic's usage API says we were charged, for the same month?

The AWS Marketplace carries Claude Enterprise as a single private-offer passthrough line. This extension turns a previously manual investigation into a parameterized, repeatable pipeline: one swamp workflow run produces the reconciliation.

Workflow — @webframp/claude-cost-reconciliation

Input month (YYYY-MM). Derives the window [<month>-01, next-month-01) (end exclusive; December rolls the year over). Two independent, read-only steps run concurrently:

  • @webframp/aws/cost-explorer get_cost_for_period — the "Claude Enterprise" service total (the invoice line), MONTHLY granularity.
  • @webframp/anthropic/analytics collect_cost_by_model — the post-discount paid total, carrying the trust/finality flags (reconciliationChecked, rangeExceedsWatermark, collected, truncated) the verdict depends on.

Model instance names are workflow inputs (awsModel, anthropicModel) with defaults, never hardcoded. Tolerances are workflow inputs (toleranceUsd default 50, tolerancePct default 0.5) overridable per run.

Report — @webframp/claude-cost-reconciliation (workflow scope)

Reads both steps' data handles, applies trust and finality gates, then computes the verdict:

  • verdict: MATCH (within tolerance), MISMATCH (outside tolerance), or UNVERIFIABLE (a precondition failed — a trust failure is not a billing discrepancy, so it is a distinct state, never folded into MISMATCH).
  • finality: FINAL (settled) or PROVISIONAL (rangeExceedsWatermark — verdict is still computed but flagged as not yet settled).

Tolerance passes on EITHER the absolute dollar floor OR the percentage, so a large invoice with a sub-percent delta and a small invoice with a few dollars of delta both pass. The report DEGRADES, NEVER THROWS: an absent handle, a parse failure, a disagreeing window, or any unexpected error yields a valid { markdown, json } with verdict: "UNVERIFIABLE" and degraded: true.

Per-model showback is intentionally out of scope: the AWS Marketplace line is a single rollup and cannot be split by model, so a per-model table would not serve reconciliation. Amazon Bedrock usage is a separate cost center and is excluded.

Usage

swamp workflow run @webframp/claude-cost-reconciliation --input month=2026-09
# tighter tolerance for one run:
swamp workflow run @webframp/claude-cost-reconciliation \
  --input month=2026-09 --input toleranceUsd=25 --input tolerancePct=0.25

swamp report get @webframp/claude-cost-reconciliation \
  --workflow claude-cost-reconciliation --json
02Release Notes

2026.10.21.1

Changed: Documentation only: the README now shows how to create the two model instances the workflow needs. The Cost Explorer instance uses an AWS SSO or named profile, and the Anthropic Analytics key is stored with swamp vault put anthropic ANALYTICS_KEY and wired with ${{ vault.get("anthropic", "ANALYTICS_KEY") }}. Earlier docs named the instances but never said how to supply the credentials.

Upgrade note: No code, workflow, report, or behavioral changes.

03Workflows1
@webframp/claude-cost-reconciliation2d6f9c4a-7b1e-4a3c-9f20-5c8e1d4b6a90

Reconcile the monthly AWS Marketplace "Claude Enterprise" invoice line against Anthropic's own post-discount paid total for the same calendar month. Two independent read-only observations run in parallel — AWS Cost Explorer (get_cost_for_period, filtered to the Claude Enterprise service) and the Anthropic Analytics cost API (collect_cost_by_model) — then the attached workflow-scope report joins them into a verdict (MATCH / MISMATCH / UNVERIFIABLE) with a FINAL / PROVISIONAL finality label, gated

reconcileCollect both sides of the Claude Enterprise bill for the target month. The two steps are independent (different models, no data dependency) and run concurrently; the attached workflow-scope report joins them afterward.
1.aws_cost${{ inputs.awsModel }}.get_cost_for_period— AWS Marketplace "Claude Enterprise" monthly total via Cost Explorer.
2.anthropic_cost${{ inputs.anthropicModel }}.collect_cost_by_model— Anthropic post-discount paid total via the Enterprise Analytics cost API, carrying the trust/finality flags the verdict depends on.
04Reports1
@webframp/claude-cost-reconciliationworkflow
reconciliation.ts

Reconcile the monthly AWS Marketplace Claude Enterprise invoice line against Anthropic's own post-discount paid total: MATCH / MISMATCH / UNVERIFIABLE with a FINAL / PROVISIONAL finality label, gated on upstream trust and settlement flags.

costfinopsreconciliationanthropicaws
05Previous Versions2
2026.10.14.1Apache-2.0(was none)

2026.10.14.1

Added: The manifest now declares license: Apache-2.0 (SPDX). The registry quality rubric scores a declared license separately from the bundled LICENSE.md.

Upgrade note: Metadata only. No code, schema, or behavioral changes.

Release Notes — @webframp/claude-cost-reconciliation

2026.10.07.1

Initial release.

Added

  • Workflow @webframp/claude-cost-reconciliation — takes a month (YYYY-MM) input, derives the window [<month>-01, next-month-01) (end exclusive; December rolls the year over), and runs two independent read-only observations in parallel:

    • @webframp/aws/cost-explorer get_cost_for_period filtered to the "Claude Enterprise" service (MONTHLY).
    • @webframp/anthropic/analytics collect_cost_by_model for the same window.

    Model instance names are inputs (awsModel default aws-costs, anthropicModel default claude-analytics) — never hardcoded. Tolerances are inputs (toleranceUsd default 50, tolerancePct default 0.5, both minimum: 0), overridable per run.

  • Workflow-scope report @webframp/claude-cost-reconciliation — joins both steps' resources into a reconciliation verdict:

    • verdict: MATCH / MISMATCH / UNVERIFIABLE.
    • finality: FINAL / PROVISIONAL.
    • Tolerance passes on EITHER the dollar floor OR the percentage.
    • Trust/finality gates: collected=false or reconciliationChecked=false (fail-closed on trust) → UNVERIFIABLE; either side truncated → UNVERIFIABLE; rangeExceedsWatermark → verdict still computed but labeled PROVISIONAL (fail-open on finality). A disagreeing window between the two sides → UNVERIFIABLE.
    • Reads tolerances from the workflow run inputs; falls back to the defaults when run standalone.
    • DEGRADES, NEVER THROWS: an absent/expired handle, a parse failure, or any unexpected error yields a valid { markdown, json } with verdict: "UNVERIFIABLE" and degraded: true.

Notes

  • Per-model showback is intentionally out of scope: the AWS Marketplace line is a single rollup and cannot be split by model. Amazon Bedrock usage is a separate cost center and is excluded.
  • Depends on @webframp/aws/cost-explorer@2026.10.07.1 and @webframp/anthropic/analytics@2026.10.07.1.
2026.10.07.1

Release Notes — @webframp/claude-cost-reconciliation

2026.10.07.1

Initial release.

Added

  • Workflow @webframp/claude-cost-reconciliation — takes a month (YYYY-MM) input, derives the window [<month>-01, next-month-01) (end exclusive; December rolls the year over), and runs two independent read-only observations in parallel:

    • @webframp/aws/cost-explorer get_cost_for_period filtered to the "Claude Enterprise" service (MONTHLY).
    • @webframp/anthropic/analytics collect_cost_by_model for the same window.

    Model instance names are inputs (awsModel default aws-costs, anthropicModel default claude-analytics) — never hardcoded. Tolerances are inputs (toleranceUsd default 50, tolerancePct default 0.5, both minimum: 0), overridable per run.

  • Workflow-scope report @webframp/claude-cost-reconciliation — joins both steps' resources into a reconciliation verdict:

    • verdict: MATCH / MISMATCH / UNVERIFIABLE.
    • finality: FINAL / PROVISIONAL.
    • Tolerance passes on EITHER the dollar floor OR the percentage.
    • Trust/finality gates: collected=false or reconciliationChecked=false (fail-closed on trust) → UNVERIFIABLE; either side truncated → UNVERIFIABLE; rangeExceedsWatermark → verdict still computed but labeled PROVISIONAL (fail-open on finality). A disagreeing window between the two sides → UNVERIFIABLE.
    • Reads tolerances from the workflow run inputs; falls back to the defaults when run standalone.
    • DEGRADES, NEVER THROWS: an absent/expired handle, a parse failure, or any unexpected error yields a valid { markdown, json } with verdict: "UNVERIFIABLE" and degraded: true.

Notes

  • Per-model showback is intentionally out of scope: the AWS Marketplace line is a single rollup and cannot be split by model. Amazon Bedrock usage is a separate cost center and is excluded.
  • Depends on @webframp/aws/cost-explorer@2026.10.07.1 and @webframp/anthropic/analytics@2026.10.07.1.
06Stats
A
100 / 100
Downloads
21
Archive size
15.9 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned
07Platforms
08Labels