Skip to content

chore(cost-map): backfill anthropic batch api prices from the pricing page - #43171

Closed
berriai-litellm-provider-info-sync[bot] wants to merge 1 commit into
mainfrom
litellm-providers/price-sync-anthropic
Closed

berriai-litellm-provider-info-sync[bot] wants to merge 1 commit into
mainfrom
litellm-providers/price-sync-anthropic

Conversation

@berriai-litellm-provider-info-sync

@berriai-litellm-provider-info-sync berriai-litellm-provider-info-sync Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Backfills Batch API prices on every priced anthropic row, per ruling anthropic-batch-prices-backfill (apply_value). Source: the Batch API table on https://platform.claude.com/docs/en/about-claude/pricing fetched raw ("The Batch API allows asynchronous processing of large volumes of requests with a 50% discount on both input and output tokens"). Kind page for every row, mode merge, no other field touched

key input_cost_per_token_batches output_cost_per_token_batches table cell
claude-haiku-4-5-20251001 5e-07 ($0.5 / MTok) 2.5e-06 ($2.5 / MTok) | Claude Haiku 4.5 | $0.50 / MTok | $2.50 / MTok |
claude-haiku-4-5 5e-07 ($0.5 / MTok) 2.5e-06 ($2.5 / MTok) | Claude Haiku 4.5 | $0.50 / MTok | $2.50 / MTok |
claude-sonnet-4-5 1.5e-06 ($1.5 / MTok) 7.5e-06 ($7.5 / MTok) | Claude Sonnet 4.5 | $1.50 / MTok | $7.50 / MTok |
claude-sonnet-4-5-20250929 1.5e-06 ($1.5 / MTok) 7.5e-06 ($7.5 / MTok) | Claude Sonnet 4.5 | $1.50 / MTok | $7.50 / MTok |
claude-sonnet-5 1e-06 ($1 / MTok) 5e-06 ($5 / MTok) | Claude Sonnet 5 | $1 / MTok | $5 / MTok |
claude-sonnet-4-6 1.5e-06 ($1.5 / MTok) 7.5e-06 ($7.5 / MTok) | Claude Sonnet 4.6 | $1.50 / MTok | $7.50 / MTok |
claude-opus-4-5-20251101 2.5e-06 ($2.5 / MTok) 1.25e-05 ($12.5 / MTok) | Claude Opus 4.5 | $2.50 / MTok | $12.50 / MTok |
claude-opus-4-5 2.5e-06 ($2.5 / MTok) 1.25e-05 ($12.5 / MTok) | Claude Opus 4.5 | $2.50 / MTok | $12.50 / MTok |
claude-opus-4-6 2.5e-06 ($2.5 / MTok) 1.25e-05 ($12.5 / MTok) | Claude Opus 4.6 | $2.50 / MTok | $12.50 / MTok |
claude-opus-4-6-20260205 2.5e-06 ($2.5 / MTok) 1.25e-05 ($12.5 / MTok) | Claude Opus 4.6 | $2.50 / MTok | $12.50 / MTok |
claude-opus-4-7 2.5e-06 ($2.5 / MTok) 1.25e-05 ($12.5 / MTok) | Claude Opus 4.7 | $2.50 / MTok | $12.50 / MTok |
claude-opus-4-7-20260416 2.5e-06 ($2.5 / MTok) 1.25e-05 ($12.5 / MTok) | Claude Opus 4.7 | $2.50 / MTok | $12.50 / MTok |
claude-fable-5 5e-06 ($5 / MTok) 2.5e-05 ($25 / MTok) | Claude Fable 5 | $5 / MTok | $25 / MTok |
claude-fable-5-1 5e-06 ($5 / MTok) 2.5e-05 ($25 / MTok) | Claude Fable 5.1 | $5 / MTok | $25 / MTok |
claude-opus-5-5 2e-06 ($2 / MTok) 1e-05 ($10 / MTok) | Claude Opus 5.5 | $2 / MTok | $10 / MTok |
claude-opus-5 2.5e-06 ($2.5 / MTok) 1.25e-05 ($12.5 / MTok) | Claude Opus 5 | $2.50 / MTok | $12.50 / MTok |
claude-opus-4-8 2.5e-06 ($2.5 / MTok) 1.25e-05 ($12.5 / MTok) | Claude Opus 4.8 | $2.50 / MTok | $12.50 / MTok |
claude-mythos-5 5e-06 ($5 / MTok) 2.5e-05 ($25 / MTok) | Claude Mythos 5 (limited availability) | $5 / MTok | $25 / MTok |
claude-mythos-5-1 5e-06 ($5 / MTok) 2.5e-05 ($25 / MTok) | Claude Mythos 5.1 (limited availability) | $5 / MTok | $25 / MTok |

claude-mythos-preview is left out: the Batch API table has no row for it

Delisted by the provider (informational, rows unchanged): claude-haiku-4-5, claude-opus-4-5, claude-sonnet-4-5 are undated alias keys whose dated forms are Active; claude-mythos-5 and claude-mythos-5-1 stay flagged per ruling anthropic-mythos-gated-flag-delisted; claude-mythos-preview already carries deprecation_date 2026-06-09

Cache and long-context batch rates (Greptile review): the page states "These multipliers stack with other pricing modifiers, including the Batch API discount and data residency" for the cache write and read multipliers, and "Prompt caching and batch processing discounts apply at standard rates across the full context window", so each row also gets a _batches field at half the standard rate for every cache and above-200k field it already carries (same field names as the gemini and openai rows that carry cache_read_input_token_cost_batches and *_above_272k_tokens_batches). No 1h cache write batch field is added, the catalog has no such convention

key derived batch fields (per token, half of the row value)
claude-haiku-4-5-20251001 cache_read_input_token_cost_batches=5e-08, cache_creation_input_token_cost_batches=6.25e-07
claude-haiku-4-5 cache_read_input_token_cost_batches=5e-08, cache_creation_input_token_cost_batches=6.25e-07
claude-sonnet-4-5 cache_read_input_token_cost_batches=1.5e-07, cache_creation_input_token_cost_batches=1.875e-06, input_cost_per_token_above_200k_tokens_batches=3e-06, output_cost_per_token_above_200k_tokens_batches=1.125e-05, cache_read_input_token_cost_above_200k_tokens_batches=3e-07, cache_creation_input_token_cost_above_200k_tokens_batches=3.75e-06
claude-sonnet-4-5-20250929 cache_read_input_token_cost_batches=1.5e-07, cache_creation_input_token_cost_batches=1.875e-06, input_cost_per_token_above_200k_tokens_batches=3e-06, output_cost_per_token_above_200k_tokens_batches=1.125e-05, cache_read_input_token_cost_above_200k_tokens_batches=3e-07, cache_creation_input_token_cost_above_200k_tokens_batches=3.75e-06
claude-sonnet-5 cache_read_input_token_cost_batches=1e-07, cache_creation_input_token_cost_batches=1.25e-06
claude-sonnet-4-6 cache_read_input_token_cost_batches=1.5e-07, cache_creation_input_token_cost_batches=1.875e-06
claude-opus-4-5-20251101 cache_read_input_token_cost_batches=2.5e-07, cache_creation_input_token_cost_batches=3.125e-06
claude-opus-4-5 cache_read_input_token_cost_batches=2.5e-07, cache_creation_input_token_cost_batches=3.125e-06
claude-opus-4-6 cache_read_input_token_cost_batches=2.5e-07, cache_creation_input_token_cost_batches=3.125e-06
claude-opus-4-6-20260205 cache_read_input_token_cost_batches=2.5e-07, cache_creation_input_token_cost_batches=3.125e-06
claude-opus-4-7 cache_read_input_token_cost_batches=2.5e-07, cache_creation_input_token_cost_batches=3.125e-06
claude-opus-4-7-20260416 cache_read_input_token_cost_batches=2.5e-07, cache_creation_input_token_cost_batches=3.125e-06
claude-fable-5 cache_read_input_token_cost_batches=5e-07, cache_creation_input_token_cost_batches=6.25e-06
claude-fable-5-1 cache_read_input_token_cost_batches=1.25e-07, cache_creation_input_token_cost_batches=6.25e-06
claude-opus-5-5 cache_read_input_token_cost_batches=1e-07, cache_creation_input_token_cost_batches=2.5e-06
claude-opus-5 cache_read_input_token_cost_batches=2.5e-07, cache_creation_input_token_cost_batches=3.125e-06
claude-opus-4-8 cache_read_input_token_cost_batches=2.5e-07, cache_creation_input_token_cost_batches=3.125e-06
claude-mythos-5 cache_read_input_token_cost_batches=5e-07, cache_creation_input_token_cost_batches=6.25e-06
claude-mythos-5-1 cache_read_input_token_cost_batches=1.25e-07, cache_creation_input_token_cost_batches=6.25e-06

Note

Low Risk
Catalog-only pricing metadata used for cost estimation; incorrect values could skew batch spend reporting but does not change runtime API behavior.

Overview
Adds Batch API token rates (input_cost_per_token_batches, output_cost_per_token_batches, and matching cache_*_batches fields) to priced Anthropic Claude rows in model_prices_and_context_window.json and its backup, using the 50% Batch discount from Anthropic’s pricing page. Sonnet 4.5 rows also get long-context (above_200k_tokens) batch variants where those tiers already exist.

Several entries gain or refresh a source URL pointing at platform.claude.com (replacing the older docs.anthropic.com link on claude-sonnet-4-5-20250929). The JSON schema documents the new *_above_200k_tokens_batches cost properties.

Reviewed by Cursor Bugbot for commit 794c2e5. Bugbot is set up for automated code reviews on this repo. Configure here.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps

greptile-apps Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 3/5

[Medium risk] Updates pricing data for Anthropic batch API models.

The PR should not merge until long-context and cached Anthropic batch requests are priced correctly.

Findings

  1. P1 Long-context batches underpriced ▶
  2. P1 Cached batch tokens mispriced ▶

Summary

The PR adds 50%-of-standard input and output batch prices to Anthropic model entries in both cost maps and updates several pricing-source URLs.

  • The new flat prices do not account for Sonnet 4.5’s above-200k tier.
  • The new input prices change how cached tokens are charged in batch results.

Reviews (1) · Last reviewed commit: "chore(cost-map): backfill anthropic batc..."

"output_cost_per_token_above_200k_tokens": 2.25e-05,
"cache_creation_input_token_cost_above_200k_tokens": 7.5e-06,
"cache_read_input_token_cost_above_200k_tokens": 6e-07,
"input_cost_per_token_batches": 1.5e-06,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Long-context batches underpriced
For a Sonnet 4.5 batch request above 200k input tokens, this flat rate is used even though the model has higher prices above 200k. Batch pricing only recognizes tier prices with a _batches suffix, so it charges half the base price instead of half the long-context price and understates spend. The dated Sonnet 4.5 entry has the same gap.

"output_cost_per_token_above_200k_tokens": 2.25e-05,
"cache_creation_input_token_cost_above_200k_tokens": 7.5e-06,
"cache_read_input_token_cost_above_200k_tokens": 6e-07,
"input_cost_per_token_batches": 1.5e-06,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Cached batch tokens mispriced
When an Anthropic batch result contains cache-read or cache-creation tokens, adding this input batch rate switches the cost calculation away from the previous path, which charged those tokens at separate cache rates. Because this entry has no cache batch rates, the new path charges them all at the plain batch input rate, making the reported spend incorrect.

@codspeed

codspeed Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm-providers/price-sync-anthropic (794c2e5) with main (d33d36c)

Open in CodSpeed

@codecov

codecov Bot commented Sep 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Rolled into the rolling registry PR #42951 after re-verifying every value against the official source. Closing as superseded

@berriai-litellm-provider-info-sync
berriai-litellm-provider-info-sync Bot deleted the litellm-providers/price-sync-anthropic branch September 28, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant