Skip to content

Add multi-layer custom_pricing for Vertex AI models#715

Draft
bhishmendramahala-crypto wants to merge 11 commits intomainfrom
pricing-update/vertex-ai-multi-layer
Draft

Add multi-layer custom_pricing for Vertex AI models#715
bhishmendramahala-crypto wants to merge 11 commits intomainfrom
pricing-update/vertex-ai-multi-layer

Conversation

@bhishmendramahala-crypto
Copy link
Copy Markdown
Contributor

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

  • Gemini 2.5 Pro: standard/priority/batch execution modes with <=200K/>200K context tier boundaries and grounding search prices
  • Gemini 2.5 Flash, Flash Lite, Flash Image: standard/priority/batch modes (flat, no context tiers)
  • Gemini 3.x series (3 Pro, 3 Flash, 3.1 Pro, 3.1 Flash-Lite, 3.1 Flash Image): standard/priority/batch with context tiers where applicable
  • Claude models (Opus 4.6, Sonnet 4.6, Haiku 4.5, plus versioned aliases): regional custom_pricing for global, us-east5, europe-west1, asia-southeast1, asia-east1
  • New model entries: gemma-4-26b-it, gpt-oss-20b-maas, grok-4.20-maas, grok-4.1-fast-maas, deepseek-ocr-maas, mistral-ocr-2505, veo-3.1-lite-generate-preview
  • Existing pricing_config + batch_config preserved as default fallback and synced with custom_pricing standard mode values
  • general/vertex-ai.json updated with new model entries

Description

Add multi-layer custom_pricing for Vertex AI models with execution mode support (standard/priority/batch), context tier boundaries, regional pricing, and grounding/search additional units.

  • New model pricing
  • Update existing pricing
  • New model configuration

Source Verification

Source Links:

Important

Please include a link to the official pricing page from the provider. Simple "I heard it from somewhere" or screenshot sources are not accepted.

Checklist

  • I have validated the JSON using jq or an online validator
  • I have verified that prices are in cents per token (not dollars)
  • I have included the source link above
  • I have signed the CLA (if first-time contributor)

Related Issue

N/A

- Gemini 2.5 Pro: standard/priority/batch execution modes with
  <=200K/>200K context tier boundaries and grounding search prices
- Gemini 2.5 Flash, Flash Lite, Flash Image: standard/priority/batch
  modes (flat, no context tiers)
- Gemini 3.x series (3 Pro, 3 Flash, 3.1 Pro, 3.1 Flash-Lite,
  3.1 Flash Image): standard/priority/batch with context tiers
  where applicable
- Claude models (Opus 4.6, Sonnet 4.6, Haiku 4.5, plus versioned
  aliases): regional custom_pricing for global, us-east5,
  europe-west1, asia-southeast1, asia-east1
- New model entries: gemma-4-26b-it, llama-4-scout, llama-4-maverick,
  gpt-oss-20b-maas, grok-4.20-maas, grok-4.1-fast-maas,
  deepseek-ocr-maas, mistral-ocr-2505, veo-3.1-lite-generate-preview
- Existing pricing_config + batch_config preserved as default fallback
- general/vertex-ai.json updated with new model entries
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 layer to Vertex AI model pricing to support region-specific and execution-mode/context-tier pricing, while also extending the Vertex model catalog with several new models.

Changes:

  • Introduces custom_pricing.regions.*.execution_modes (and context tiers where applicable) for multiple Gemini and Claude models.
  • Normalizes many small numeric prices to scientific notation (e.g., 0.000055e-05) across pricing/vertex-ai.json.
  • Adds new model entries to pricing/vertex-ai.json and corresponding model type entries to general/vertex-ai.json.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 9 comments.

File Description
pricing/vertex-ai.json Adds multi-layer custom_pricing (regions/execution modes/context tiers), updates numeric formatting, and appends new model pricing entries.
general/vertex-ai.json Adds general model-type entries for newly introduced Vertex models.

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

Comment thread general/vertex-ai.json
Comment thread pricing/vertex-ai.json
Comment thread pricing/vertex-ai.json
Comment thread pricing/vertex-ai.json Outdated
Comment thread pricing/vertex-ai.json
Comment thread pricing/vertex-ai.json
Comment thread pricing/vertex-ai.json
Comment thread pricing/vertex-ai.json
Comment thread pricing/vertex-ai.json
Comment thread pricing/vertex-ai.json Outdated
Bhishmendra Mahala added 3 commits April 16, 2026 15:29
…_write_input_token rounding

- Convert all 455 scientific notation values to decimal (e.g. 5e-05 → 0.00005)
- Fix batch cache_write_input_token from 0.000188 to 0.0001875 (exact 50% of standard 0.000375)

Addresses PR review comments from sivadurga-d and Copilot.
…e_token in custom_pricing

- Fix 22 floating point rounding artifacts (e.g. 0.00007499999999999999 → 0.000075)
  caused by toFixed(20) during scientific notation conversion
- Add image_token to additional_units in custom_pricing for 4 image models
  (gemini-2.5-flash-image, gemini-3-pro-image-preview, gemini-2.5-flash-image-preview,
  gemini-3.1-flash-image-preview) so billing works via both response_image_token and
  additional_units.image_token paths
- Add asia-east1 region (1.1x multiplier) to 7 Claude models missing it:
  claude-sonnet-4-5-20250929, claude-sonnet-4-5@20250929,
  claude-opus-4-5-20251101, claude-opus-4-5@20251101,
  anthropic.claude-opus-4-6, claude-opus-4-6, claude-sonnet-4-6
- Add cache_write_input_token to 18 custom_pricing blocks where base
  config had it but custom_pricing didn't (gemini-3-pro, gemini-3-flash,
  gemini-3.1-pro, gemini-3.1-flash-lite, and their variants)
- Add image_token to additional_units in 12 custom_pricing blocks
  (gemini-3-pro-preview, gemini-2.5-flash, gemini-3.1-pro-preview,
  gemini-2.5-flash-preview-09-2025; standard/priority get base rate,
  batch gets 50%)
- Fix remaining scientific notation from JSON.stringify
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 4 comments.


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

Comment thread pricing/vertex-ai.json
Comment thread pricing/vertex-ai.json
Comment thread pricing/vertex-ai.json
Comment thread pricing/vertex-ai.json
…ding

- Add cache_write_input_token to 24 context_tier blocks across
  gemini-3-pro-preview, gemini-3-pro-preview-02-05, gemini-3.1-pro-preview,
  gemini-3.1-pro-preview-customtools (all modes × both tiers)
- Add image_token to 12 context_tier blocks for models with base
  image_token pricing (gemini-3-pro-preview, gemini-3.1-pro-preview)
- Fix 45 rounded regional cache_write/cache_read values for Claude models
  to exact 1.1x of default (e.g. 0.000413 → 0.0004125 for Sonnet,
  0.0003438 → 0.00034375 for Opus batch, 0.0000688 → 0.00006875 for Haiku)
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 3 comments.


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

Comment thread pricing/vertex-ai.json Outdated
Comment thread pricing/vertex-ai.json Outdated
Comment thread pricing/vertex-ai.json Outdated
Bhishmendra Mahala added 5 commits April 16, 2026 16:15
Fix cache_write_input_token from 0.0000688 to 0.00006875 in asia-east1
batch pricing for claude-haiku-4-5-20251001 and claude-haiku-4-5@20251001,
matching the exact 1.1x multiplier used in other regions.
Align all veo model pricing with Google's published per-second rates
(in cents/second to match repo convention) and add resolution + audio
dimensions for the pricing gaps PR code:

- veo-3.1: add video_seconds_1080p=20, video_seconds_4k=40, video_audio_seconds=20
- veo-3.1-fast: fix video_seconds from 10/15 to 8 (video-only 720p),
  add 1080p=10, 4k=25, audio=2
- veo-3.1-lite: convert from dollars to cents (0.03→3, 0.05→5),
  fix audio surcharge (0.05→2), remove unused video_audio_seconds_1080p
- veo-3.0: add video_seconds_1080p=20, video_audio_seconds=20
- veo-3.0-fast: fix video_seconds from 10/20 to 8, add 1080p=10, audio=2
- veo-2.0: no change (50 cents/s, 720p only, no audio)

Source: https://cloud.google.com/vertex-ai/generative-ai/pricing
Fixes found during full review pass:

- Fix batch cache_write_input_token to be 50% of standard (not copied from
  base pay_as_you_go) for 5 gemini models across 14 locations:
  gemini-3-pro-preview, gemini-3-pro-preview-02-05, gemini-3-flash-preview,
  gemini-3.1-pro-preview, gemini-3.1-pro-preview-customtools,
  gemini-3.1-flash-lite-preview (also fixes context_tier batch blocks)
- Add missing @-notation aliases to general/vertex-ai.json:
  claude-sonnet-4-5@20250929, claude-haiku-4-5@20251001, claude-opus-4-5@20251101
…tex-ai.json

The @ notation Claude models in general/ use the anthropic. prefix
(e.g. anthropic.claude-sonnet-4-5@20250929) which were already present
on main. The bare-name entries (claude-sonnet-4-5@20250929 etc.) are
pricing routing aliases only and don't belong in general/.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.


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

Comment thread pricing/vertex-ai.json
Comment thread pricing/vertex-ai.json
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 3 comments.


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

Comment thread pricing/vertex-ai.json
Comment thread pricing/vertex-ai.json
Comment thread pricing/vertex-ai.json
Ensures pricing_config (used by older gateways) has correct values matching
custom_pricing standard mode, not stale/incomplete data. Fixes:
- 6 wrong token prices (request, response, cache_read)
- 2 wrong web_search/search prices (3.5 → 1.4)
- 15 missing request_audio_token entries
- 21 missing maps entries
- 7 missing enterprise_web_search entries
- 5 missing cache_read_input_token entries
@bhishmendramahala-crypto bhishmendramahala-crypto force-pushed the pricing-update/vertex-ai-multi-layer branch from 29fd8d1 to 8d31b74 Compare April 16, 2026 12:29
@narengogi narengogi marked this pull request as draft April 16, 2026 19:45
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.

3 participants