Skip to content

feat: add custom_pricing (standard/batch/fast) for Claude Opus 4.6/4.7/4.8#720

Open
bhishmendramahala-crypto wants to merge 1 commit into
mainfrom
pricing-update/anthropic-multi-layer
Open

feat: add custom_pricing (standard/batch/fast) for Claude Opus 4.6/4.7/4.8#720
bhishmendramahala-crypto wants to merge 1 commit into
mainfrom
pricing-update/anthropic-multi-layer

Conversation

@bhishmendramahala-crypto

@bhishmendramahala-crypto bhishmendramahala-crypto commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds multidimensional custom_pricing for the three Claude Opus models that support Anthropic Fast modeclaude-opus-4-6, claude-opus-4-7, and claude-opus-4-8.

Structure: custom_pricing.regions.default.execution_modes.{standard,batch,fast}.

  • standard: mirrors base pay_as_you_go (input/output + 5m cache write, cache read, and additional_units.cache_write_1h).
  • batch: 50% of standard input/output rates.
  • fast (Opus only — Fast mode):
    • claude-opus-4-6 / claude-opus-4-7: $30 / MTok input, $150 / MTok output
    • claude-opus-4-8: $10 / MTok input, $50 / MTok output
    • cache multipliers applied on top of fast rates (5m write 1.25x, 1h write 2x, read 0.1x).

regions.default is used (not global/us) because the current Anthropic pricing resolver emits only the service_tier dimension and falls back to regions['default'] when no region is provided. The us/inference_geo 1.1x data-residency tier is intentionally omitted until the resolver emits a region dimension.

The existing top-level pricing_config (pay_as_you_go + batch_config) is preserved as a fallback for older gateway versions.

Source Verification

Source Links:

Checklist

  • Validated the JSON
  • Prices verified in cents per token (not dollars)
  • Source link included above

Related

  • Gateway PR: Portkey-AI/gateway-enterprise-node#1713 (Anthropic multidimensional pricing resolver)

Copilot AI left a comment

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.

Pull request overview

Adds a new custom_pricing structure to Anthropic model pricing to support multi-layer pricing by region and execution mode (while keeping pricing_config as a fallback for older gateway versions).

Changes:

  • Introduces custom_pricing.regions.{global,us}.execution_modes for claude-opus-4-6 (standard/batch/fast) and claude-sonnet-4-6 (standard/batch).
  • Adds cache token pricing entries (cache_write_input_token, cache_read_input_token) to the top-level batch_config for both models.
  • Adds US-region uplifted pricing (10%) and fast-mode pricing for Opus.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pricing/anthropic.json Outdated
"price": 0.0008250000000000001
},
"cache_write_input_token": {
"price": 0.00020625000000000003

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

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

US-region Sonnet batch cache_write_input_token.price is 0.00020625000000000003 (float artifact). Please simplify to 0.00020625 for consistency and readability.

Suggested change
"price": 0.00020625000000000003
"price": 0.00020625

Copilot uses AI. Check for mistakes.
Comment thread pricing/anthropic.json Outdated
Comment thread pricing/anthropic.json
Comment on lines +752 to +754
"request_token": {
"price": 0.0033000000000000004
},

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

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

The US fast-mode request_token price is written as 0.0033000000000000004 (float precision artifact). Please normalize this to 0.0033 (and similarly for any other uplift-derived values) for consistency and to avoid unnecessary diffs.

Copilot uses AI. Check for mistakes.
Comment thread pricing/anthropic.json Outdated
Comment on lines +738 to +742
"price": 0.0013750000000000001
},
"cache_write_input_token": {
"price": 0.00034375000000000003
},

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

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

More US-region batch prices show float precision artifacts (e.g., response_token.price is 0.0013750000000000001). Please normalize these values (e.g., 0.001375) to avoid noisy diffs and improve readability.

Copilot uses AI. Check for mistakes.
Comment thread pricing/anthropic.json Outdated
"price": 0.00034375000000000003
},
"cache_read_input_token": {
"price": 0.000027500000000000004

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

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

cache_read_input_token.price under US batch pricing is 0.000027500000000000004 (float artifact). Please simplify to 0.0000275 (or the intended exact decimal) for consistency.

Suggested change
"price": 0.000027500000000000004
"price": 0.0000275

Copilot uses AI. Check for mistakes.
Comment thread pricing/anthropic.json Outdated
Comment thread pricing/anthropic.json Outdated
"price": 0.0016500000000000002
},
"cache_write_input_token": {
"price": 0.00041250000000000005

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

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

US-region Sonnet cache_write_input_token.price is 0.00041250000000000005 (float artifact). Please simplify to 0.0004125 (or the intended exact decimal) for consistency.

Suggested change
"price": 0.00041250000000000005
"price": 0.0004125

Copilot uses AI. Check for mistakes.
Comment thread pricing/anthropic.json Outdated
Comment on lines +720 to +724
"price": 0.0027500000000000003
},
"cache_write_input_token": {
"price": 0.0006875000000000001
},

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

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

US-region prices contain floating-point precision artifacts (e.g., response_token.price is 0.0027500000000000003). Please normalize these numeric literals to their intended decimal forms (e.g., 0.00275) to keep the JSON readable and reduce downstream stringify/diff churn.

Copilot uses AI. Check for mistakes.
Comment thread pricing/anthropic.json Outdated
"price": 0.0006875000000000001
},
"cache_read_input_token": {
"price": 0.00005500000000000001

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

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

cache_read_input_token.price is written as 0.00005500000000000001 (float artifact). Please simplify this to the exact decimal value (e.g., 0.000055) for consistency with the rest of the file.

Suggested change
"price": 0.00005500000000000001
"price": 0.000055

Copilot uses AI. Check for mistakes.
Comment thread pricing/anthropic.json Outdated
"price": 0.000165
},
"response_token": {
"price": 0.0008250000000000001

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

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

US-region Sonnet batch response_token.price is 0.0008250000000000001 (float artifact). Please normalize this to 0.000825 to keep numeric formatting consistent.

Suggested change
"price": 0.0008250000000000001
"price": 0.000825

Copilot uses AI. Check for mistakes.
@bhishmendramahala-crypto bhishmendramahala-crypto force-pushed the pricing-update/anthropic-multi-layer branch from 8bce4f4 to 2f9ccfc Compare April 16, 2026 12:29
@narengogi narengogi marked this pull request as draft April 16, 2026 19:46
…7/4.8

Adds multidimensional custom_pricing under regions.default with standard,
batch, and fast execution_modes for claude-opus-4-6, claude-opus-4-7, and
claude-opus-4-8. Fast-mode rates per Anthropic pricing docs (Opus 4.6/4.7:
$30/$150 per MTok; Opus 4.8: $10/$50 per MTok), with 5m/1h cache-write and
cache-read multipliers applied.

Source: https://docs.claude.com/en/docs/about-claude/pricing
@bhishmendramahala-crypto bhishmendramahala-crypto force-pushed the pricing-update/anthropic-multi-layer branch from 2f9ccfc to 685e09a Compare June 24, 2026 18:15
@bhishmendramahala-crypto bhishmendramahala-crypto changed the title feat: add multi-layer custom_pricing for Anthropic models feat: add custom_pricing (standard/batch/fast) for Claude Opus 4.6/4.7/4.8 Jun 24, 2026
@bhishmendramahala-crypto bhishmendramahala-crypto marked this pull request as ready for review June 26, 2026 06:54
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.

2 participants