From b00e1025f64ea0838fb745f09bb0e9f1b5d0c9d6 Mon Sep 17 00:00:00 2001 From: Menci Date: Wed, 14 Oct 2026 05:24:46 +0800 Subject: [PATCH] feat(providers): price Gemini 4 Argon on Copilot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gemini 4 Argon reached Copilot GA on 2026-10-13 under the stable `gemini-4-argon` id, and Google's own pricing page publishes the same id. GitHub's changelog bills it at provider list pricing, and the billing reference quotes one Default tier at $2.00 input / $0.10 cached input / $10.00 output — the same promotional card Google runs through 2026-11-30 before doubling on 2026-12-01. models.dev agrees on all three rates. Two properties separate it from the Gemini 3.x rows: Google lists a single band for the 1M-token window instead of repricing above 200k, and its only caching is implicit, so no cache-write rate exists to quote. Google sells Batch/Flex/Priority lanes too, but Copilot's billing surface names no tier for this model, so the entry stays Base-only. Pricing was researched from public sources only; no probe was run, as no account with Argon access was available. Bump the persisted model catalog revision because the static pricing serializes into cached ProviderModel rows. References: https://github.blog/changelog/2026-10-13-gemini-4-argon-in-github-copilot/ https://docs.github.com/en/copilot/reference/copilot-billing/models-and-pricing https://ai.google.dev/gemini-api/docs/pricing#gemini-4-argon --- .../gateway/src/repo/models-cache-contract.ts | 2 +- .../provider-copilot/__tests__/pricing_test.ts | 10 ++++++++++ packages/provider-copilot/src/pricing.ts | 15 +++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/packages/gateway/src/repo/models-cache-contract.ts b/packages/gateway/src/repo/models-cache-contract.ts index 8456399463..3bab5c28cf 100644 --- a/packages/gateway/src/repo/models-cache-contract.ts +++ b/packages/gateway/src/repo/models-cache-contract.ts @@ -3,7 +3,7 @@ import type { UpstreamModelsCache } from '@floway-dev/provider'; // Persisted ProviderModel rows contain code-derived metadata as well as the // upstream response. Increment this whenever that derived catalog contract or // its serialization changes so older rows become cold across deployments. -export const MODEL_CATALOG_REVISION = 16; +export const MODEL_CATALOG_REVISION = 17; const AUTOMATIC_REFRESH_INTERVAL_MS = 10 * 60_000; diff --git a/packages/provider-copilot/__tests__/pricing_test.ts b/packages/provider-copilot/__tests__/pricing_test.ts index afc5926de1..ee629eb90f 100644 --- a/packages/provider-copilot/__tests__/pricing_test.ts +++ b/packages/provider-copilot/__tests__/pricing_test.ts @@ -95,6 +95,16 @@ test('Copilot Gemini 3.6, 3.7 and 3.8 Flash share one rate across every prompt l assertEquals(priceRequest(pricingForCopilotPublicModelId('gemini-3.5-flash'), { inputTokens: 0 }).rates, published({ input_tokens: '1.5', input_cache_read_tokens: '0.15', output_tokens: '9' })); }); +test('Copilot Gemini 4 Argon keeps one band across its whole 1M-token window', () => { + const base = published({ input_tokens: '2', input_cache_read_tokens: '0.1', output_tokens: '10' }); + const pricing = pricingForCopilotPublicModelId('gemini-4-argon'); + assertEquals(priceRequest(pricing, { inputTokens: 0 }).rates, base); + // Google sells Batch, Flex and Priority lanes for this model, but Copilot's + // billing surface names no tier for it; an unserved tier must not invent one. + assertEquals(priceRequest(pricing, { serviceTier: 'priority', inputTokens: 0 }).rates, base); + assertEquals(priceRequest(pricing, { inputTokens: 1048576 }).rates, base); +}); + test('Copilot pricing resolves exact and regex model families', () => { assertEquals(priceRequest(pricingForCopilotPublicModelId('gpt-5.4'), { inputTokens: 0 }).rates, published({ input_tokens: '2.5', input_cache_read_tokens: '0.25', output_tokens: '15' })); assertEquals(priceRequest(pricingForCopilotPublicModelId('gpt-5.3-codex'), { inputTokens: 0 }).rates, published({ input_tokens: '1.75', input_cache_read_tokens: '0.175', output_tokens: '14' })); diff --git a/packages/provider-copilot/src/pricing.ts b/packages/provider-copilot/src/pricing.ts index 6cfa5f524e..4bb4bc12ef 100644 --- a/packages/provider-copilot/src/pricing.ts +++ b/packages/provider-copilot/src/pricing.ts @@ -184,6 +184,21 @@ const COPILOT_MODEL_PRICING: readonly PricingRule[] = [ // https://github.com/github/docs/blob/f067ad0f9840f1b4afb5a801a77f74ef70951189/data/tables/copilot/model-release-status.yml // https://cloud.google.com/vertex-ai/generative-ai/pricing [/^gemini-3\.[678]-flash$/, tokenBasePricing({ input_tokens: '0.75', input_cache_read_tokens: '0.075', output_tokens: '3.75' })], + // Gemini 4 Argon reached Copilot GA on 2026-10-13, billed at Google's list + // price. Google runs the same promotional card in both places — $2.00 input, + // $0.10 cached input, $10.00 output — through 2026-11-30, doubling on + // 2026-12-01; recheck then. GitHub quotes it as a single Default tier and + // models.dev agrees on all three rates. Two properties separate it from the + // 3.x Gemini rows above: Google lists one band for its 1M-token window + // instead of repricing above 200k, and its only caching is implicit, so + // there is no cache-write rate to quote. Google sells Batch/Flex/Priority + // lanes too, but with no published `serviceTier` coordinate for Copilot this + // entry stays Base-only. + // https://github.blog/changelog/2026-10-13-gemini-4-argon-in-github-copilot/ + // https://docs.github.com/en/copilot/reference/copilot-billing/models-and-pricing + // https://ai.google.dev/gemini-api/docs/pricing#gemini-4-argon + // https://github.com/anomalyco/models.dev/blob/03312cc3c02d44bac48abd405d181fcc9c85881d/models/google/gemini-4-argon.toml + ['gemini-4-argon', tokenBasePricing({ input_tokens: '2', input_cache_read_tokens: '0.1', output_tokens: '10' })], // xAI reprices the whole request at 2× once the prompt reaches 200k tokens. // Cached-read is xAI's own published $0.30/$0.60; Copilot's catalog and // LiteLLM both carry $0.50/$1.00 for that metric, which the vendor contradicts.