Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .audit/model-cost-accounting.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ts phase decision why evidence result
2026-09-19T16:12:50Z isolation resumed feat/model-cost-accounting-20260907 in its dedicated T3 worktree kept the primary checkout and unrelated worktrees untouched git worktree list --porcelain isolated dirty feature branch confirmed
2026-09-19T16:12:50Z revalidation will rebase the accounting work onto current main before release main now routes inference through OpenRouter and changed both AI handlers origin/main 99c2b53, PR #43 old provider-specific implementation cannot ship unchanged
2026-09-19T16:16:50Z pricing refreshed all three official pricing captures with exact tsx 4.19.2 under Node 22 the September 7 unfinished capture was stale for this run docs/pricing-snapshots/metadata.json 11 normalized entries found and gemini-3.1-flash-lite-preview remains unknown
2026-09-19T16:38:03Z integration rebased onto current main and kept the OpenRouter-only handlers PR 43 replaced the plan's direct-provider runtime after the plan was written origin/main 99c2b53 accounting requirements applied to current architecture
2026-09-19T16:38:03Z verification ran the focused, Edge, Vitest, coverage, build, and Chromium gates under Node 22 required fresh evidence before opening the PR local command output 181 Edge, 161 Supabase Vitest, 1026 coverage, and 134 Chromium tests passed
2026-09-19T16:38:03Z browser recorded desktop and Pixel 7 admin accounting proof with isolated fixture data show importer volume while excluding it from model and feature cost rows https://github.com/user-attachments/assets/1e833f00-8163-41e1-a4ee-ca8d0bb28fa2 video attached to PR 46
2026-09-19T16:49:00Z review fixed all three release-review blockers with focused regressions abort-after-finish, historical stored costs, and API row caps needed explicit coverage supabase/functions/ai-stream/index_test.ts, supabase/functions/_shared/admin-cost.test.ts reviewer confirmed no remaining P1 issue
2026-09-19T16:57:59Z staging deployed the three changed functions and ran protected authenticated staging exercise the real account, provider, persistence, and cleanup path before review https://github.com/Programcode/DebateLab/actions/runs/35456451358 ai v18, ai-stream v18, admin v13, protected browser run passed
2026-09-19T16:57:59Z database inspected the staging request written by the protected run prove deployed OpenRouter accounting stored audit metadata and a real charge staging ai_requests at 2026-09-19T16:56:33Z 785 input, 70 output, 0.00015275 USD, raw usage and audit version present
2026-09-19T17:57:28Z review made every stream exception fail closed and corrected the admin unknown-cost label provider errors after a finish reason must never retain a billable cost; unknown cost is broader than missing token data supabase/functions/ai-stream/index_test.ts, src/test/pages/AdminPage.test.tsx regression added; 181 Edge, 161 Supabase Vitest, 1026 coverage, and 134 Chromium tests passed
62 changes: 34 additions & 28 deletions docs/pricing-snapshots/anthropic.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,27 @@ For the most current pricing information, visit [claude.com/pricing](https://cla

The following table shows pricing for all Claude models:

| Model | Base Input Tokens | 5m Cache Writes | 1h Cache Writes | Cache Hits & Refreshes | Output Tokens |
| ------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | --------------- | --------------- | ---------------------- | ------------- |
| Claude Fable 5 | $10 / MTok | $12.50 / MTok | $20 / MTok | $1 / MTok | $50 / MTok |
| Claude Mythos 5 ([limited availability](https://anthropic.com/glasswing)) | $10 / MTok | $12.50 / MTok | $20 / MTok | $1 / MTok | $50 / MTok |
| Claude Opus 5 | $5 / MTok | $6.25 / MTok | $10 / MTok | $0.50 / MTok | $25 / MTok |
| Claude Opus 4.8 | $5 / MTok | $6.25 / MTok | $10 / MTok | $0.50 / MTok | $25 / MTok |
| Claude Opus 4.7 | $5 / MTok | $6.25 / MTok | $10 / MTok | $0.50 / MTok | $25 / MTok |
| Claude Opus 4.6 | $5 / MTok | $6.25 / MTok | $10 / MTok | $0.50 / MTok | $25 / MTok |
| Claude Opus 4.5 | $5 / MTok | $6.25 / MTok | $10 / MTok | $0.50 / MTok | $25 / MTok |
| Claude Opus 4.1 ([retired, except on Bedrock and Google Cloud](https://platform.claude.com/docs/en/about-claude/model-deprecations)) | $15 / MTok | $18.75 / MTok | $30 / MTok | $1.50 / MTok | $75 / MTok |
| Claude Opus 4 ([retired, except on Google Cloud](https://platform.claude.com/docs/en/about-claude/model-deprecations)) | $15 / MTok | $18.75 / MTok | $30 / MTok | $1.50 / MTok | $75 / MTok |
| Claude Sonnet 5 | $2 / MTok | $2.50 / MTok | $4 / MTok | $0.20 / MTok | $10 / MTok |
| Claude Sonnet 4.6 | $3 / MTok | $3.75 / MTok | $6 / MTok | $0.30 / MTok | $15 / MTok |
| Claude Sonnet 4.5 | $3 / MTok | $3.75 / MTok | $6 / MTok | $0.30 / MTok | $15 / MTok |
| Claude Sonnet 4 ([retired, except on Bedrock and Google Cloud](https://platform.claude.com/docs/en/about-claude/model-deprecations)) | $3 / MTok | $3.75 / MTok | $6 / MTok | $0.30 / MTok | $15 / MTok |
| Claude Haiku 4.5 | $1 / MTok | $1.25 / MTok | $2 / MTok | $0.10 / MTok | $5 / MTok |
| Claude Haiku 3.5 ([retired, except on Bedrock and Google Cloud](https://platform.claude.com/docs/en/about-claude/model-deprecations)) | $0.80 / MTok | $1 / MTok | $1.60 / MTok | $0.08 / MTok | $4 / MTok |
| Model | Base input tokens | 5m cache writes | 1h cache writes | Cache hits and refreshes | Output tokens |
| :------------------------------------------------------------------------------------------------------------------------------------ | :---------------- | :-------------- | :-------------- | :----------------------- | :------------ |
| Claude Fable 5.1 | $10 / MTok | $12.50 / MTok | $20 / MTok | $0.25 / MTok<sup>1</sup> | $50 / MTok |
| Claude Mythos 5.1 ([limited availability](https://anthropic.com/glasswing)) | $10 / MTok | $12.50 / MTok | $20 / MTok | $0.25 / MTok<sup>1</sup> | $50 / MTok |
| Claude Fable 5 | $10 / MTok | $12.50 / MTok | $20 / MTok | $1 / MTok | $50 / MTok |
| Claude Mythos 5 ([limited availability](https://anthropic.com/glasswing)) | $10 / MTok | $12.50 / MTok | $20 / MTok | $1 / MTok | $50 / MTok |
| Claude Opus 5 | $5 / MTok | $6.25 / MTok | $10 / MTok | $0.50 / MTok | $25 / MTok |
| Claude Opus 4.8 | $5 / MTok | $6.25 / MTok | $10 / MTok | $0.50 / MTok | $25 / MTok |
| Claude Opus 4.7 | $5 / MTok | $6.25 / MTok | $10 / MTok | $0.50 / MTok | $25 / MTok |
| Claude Opus 4.6 | $5 / MTok | $6.25 / MTok | $10 / MTok | $0.50 / MTok | $25 / MTok |
| Claude Opus 4.5 | $5 / MTok | $6.25 / MTok | $10 / MTok | $0.50 / MTok | $25 / MTok |
| Claude Opus 4.1 ([retired, except on Bedrock and Google Cloud](https://platform.claude.com/docs/en/about-claude/model-deprecations)) | $15 / MTok | $18.75 / MTok | $30 / MTok | $1.50 / MTok | $75 / MTok |
| Claude Opus 4 ([retired, except on Google Cloud](https://platform.claude.com/docs/en/about-claude/model-deprecations)) | $15 / MTok | $18.75 / MTok | $30 / MTok | $1.50 / MTok | $75 / MTok |
| Claude Sonnet 5 | $2 / MTok | $2.50 / MTok | $4 / MTok | $0.20 / MTok | $10 / MTok |
| Claude Sonnet 4.6 | $3 / MTok | $3.75 / MTok | $6 / MTok | $0.30 / MTok | $15 / MTok |
| Claude Sonnet 4.5 | $3 / MTok | $3.75 / MTok | $6 / MTok | $0.30 / MTok | $15 / MTok |
| Claude Sonnet 4 ([retired, except on Bedrock and Google Cloud](https://platform.claude.com/docs/en/about-claude/model-deprecations)) | $3 / MTok | $3.75 / MTok | $6 / MTok | $0.30 / MTok | $15 / MTok |
| Claude Haiku 4.5 | $1 / MTok | $1.25 / MTok | $2 / MTok | $0.10 / MTok | $5 / MTok |
| Claude Haiku 3.5 ([retired, except on Bedrock and Google Cloud](https://platform.claude.com/docs/en/about-claude/model-deprecations)) | $0.80 / MTok | $1 / MTok | $1.60 / MTok | $0.08 / MTok | $4 / MTok |

*<sup>1 Cache hits and refreshes on Claude Fable 5.1 and Claude Mythos 5.1 are priced at 0.025x the base input price. All other models use the standard 0.1x multiplier.</sup>*

<Note id="claude-sonnet-5-introductory-pricing">
The $2/$10 per million input/output token pricing for Claude Sonnet 5, announced at launch as introductory pricing through August 31, 2026, is now the standard price. The previously scheduled increase to $3/$15 per million input/output tokens on September 1, 2026 will not occur.
Expand Down Expand Up @@ -138,13 +142,13 @@ There are two ways to enable prompt caching:

Prompt caching uses the following pricing multipliers relative to base input token rates:

| Cache operation | Multiplier | Duration |
| -------------------- | ---------------------- | ------------------------------------ |
| 5-minute cache write | 1.25x base input price | Cache valid for 5 minutes |
| 1-hour cache write | 2x base input price | Cache valid for 1 hour |
| Cache read (hit) | 0.1x base input price | Same duration as the preceding write |
| Cache operation | Multiplier | Duration |
| -------------------- | ------------------------------------------------------------------------ | ------------------------------------ |
| 5-minute cache write | 1.25x base input price | Cache valid for 5 minutes |
| 1-hour cache write | 2x base input price | Cache valid for 1 hour |
| Cache read (hit) | 0.1x base input price (0.025x on Claude Fable 5.1 and Claude Mythos 5.1) | Same duration as the preceding write |

Cache write tokens are charged when content is first stored. Cache read tokens are charged when a subsequent request retrieves the cached content. A cache hit costs 10% of the standard input price, which means caching pays off after one cache read for the 5-minute duration (1.25x write), or after two cache reads for the 1-hour duration (2x write).
Cache write tokens are charged when content is first stored. Cache read tokens are charged when a subsequent request retrieves the cached content. A cache hit costs 10% of the standard input price, which means caching pays off after one cache read for the 5-minute duration (1.25x write), or after two cache reads for the 1-hour duration (2x write). On Claude Fable 5.1 and Claude Mythos 5.1, a cache hit costs 2.5% of the standard input price ($0.25 USD per million tokens).

These multipliers stack with other pricing modifiers, including the Batch API discount and data residency.

Expand Down Expand Up @@ -182,7 +186,9 @@ For more information, see [Fast mode](https://platform.claude.com/docs/en/build-
The Batch API allows asynchronous processing of large volumes of requests with a 50% discount on both input and output tokens.

| Model | Batch input | Batch output |
| ------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------- |
| :------------------------------------------------------------------------------------------------------------------------------------ | :----------- | :------------ |
| Claude Fable 5.1 | $5 / MTok | $25 / MTok |
| Claude Mythos 5.1 ([limited availability](https://anthropic.com/glasswing)) | $5 / MTok | $25 / MTok |
| Claude Fable 5 | $5 / MTok | $25 / MTok |
| Claude Mythos 5 ([limited availability](https://anthropic.com/glasswing)) | $5 / MTok | $25 / MTok |
| Claude Opus 5 | $2.50 / MTok | $12.50 / MTok |
Expand Down Expand Up @@ -501,19 +507,19 @@ Contact the sales team at [sales@anthropic.com](mailto:sales@anthropic.com) or t

## Frequently asked questions

**How is token usage calculated?**
### How is token usage calculated?

Tokens are pieces of text that models process. As a rough estimate, 1 token is approximately 4 characters or 0.75 words in English. The exact count varies by language and content type.

**Are there free tiers or trials?**
### Are there free tiers or trials?

New users receive a small amount of free credits to test the API. [Contact sales](mailto:sales@anthropic.com) for information about extended trials for enterprise evaluation.

**How do discounts stack?**
### How do discounts stack?

Batch API and prompt caching discounts can be combined. For example, using both features together provides significant cost savings compared to standard API calls. See [prompt caching pricing](https://platform.claude.com/docs/en/about-claude/pricing#prompt-caching) for how the multipliers interact.

**What payment methods are accepted?**
### What payment methods are accepted?

Major credit cards are accepted for standard accounts. Enterprise customers can arrange invoicing and other payment methods.

Expand Down
Loading
Loading