Claude Cost Reconciliation
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-explorerget_cost_for_period— the "Claude Enterprise" service total (the invoice line), MONTHLY granularity.@webframp/anthropic/analyticscollect_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), orUNVERIFIABLE(a precondition failed — a trust failure is not a billing discrepancy, so it is a distinct state, never folded into MISMATCH).finality:FINAL(settled) orPROVISIONAL(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 --json2026.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.
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
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.
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 amonth(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-explorerget_cost_for_periodfiltered to the "Claude Enterprise" service (MONTHLY).@webframp/anthropic/analyticscollect_cost_by_modelfor the same window.
Model instance names are inputs (
awsModeldefaultaws-costs,anthropicModeldefaultclaude-analytics) — never hardcoded. Tolerances are inputs (toleranceUsddefault 50,tolerancePctdefault 0.5, bothminimum: 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=falseorreconciliationChecked=false(fail-closed on trust) → UNVERIFIABLE; either sidetruncated→ 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 }withverdict: "UNVERIFIABLE"anddegraded: 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.1and@webframp/anthropic/analytics@2026.10.07.1.
Release Notes — @webframp/claude-cost-reconciliation
2026.10.07.1
Initial release.
Added
Workflow
@webframp/claude-cost-reconciliation— takes amonth(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-explorerget_cost_for_periodfiltered to the "Claude Enterprise" service (MONTHLY).@webframp/anthropic/analyticscollect_cost_by_modelfor the same window.
Model instance names are inputs (
awsModeldefaultaws-costs,anthropicModeldefaultclaude-analytics) — never hardcoded. Tolerances are inputs (toleranceUsddefault 50,tolerancePctdefault 0.5, bothminimum: 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=falseorreconciliationChecked=false(fail-closed on trust) → UNVERIFIABLE; either sidetruncated→ 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 }withverdict: "UNVERIFIABLE"anddegraded: 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.1and@webframp/anthropic/analytics@2026.10.07.1.
- 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