Skip to content

Cline reports incorrect pricing for Gemini 3 flash preview #10314

@dirac-run

Description

@dirac-run

Plugin Type

VSCode Extension

Cline Version

3.79

What happened?

The current configuration in src/shared/api.ts for both vertex and gemini has incorrect config which causes it to report incorrect pricing . The json portions copied below from the api.ts have 4 bugs:

  1. It uses cacheWritesPrice: 0.05 in vertex and skips cacheReadsPrice entirely which in later API cost calculations causes the cacheReadPrice to be inferred as 0 hence the cacheRead cost is not reported
  2. cacheWritesPrice: 0.05 is also wrong because cache writes are free on these models
  3. In gemini config, it uses 2 pricing tiers, which is incorrect. This model does not have context tiered pricing
  4. The actual cacheReadsPrice in those tiers is also wrong. Should be 0.05, not 0.03.

vertex:
"gemini-3-flash-preview": {
maxTokens: 65536,
contextWindow: 1_048_576,
supportsImages: true,
supportsPromptCache: true,
supportsGlobalEndpoint: true,
inputPrice: 0.5,
outputPrice: 3.0,
cacheWritesPrice: 0.05,
temperature: 1.0,
supportsReasoning: true,
thinkingConfig: {
geminiThinkingLevel: "high",
supportsThinkingLevel: true,
},
},
gemini:
"gemini-3-flash-preview": {
maxTokens: 65536,
contextWindow: 1_048_576,
supportsImages: true,
supportsPromptCache: true,
supportsGlobalEndpoint: true,
inputPrice: 0.5,
outputPrice: 3.0,
cacheWritesPrice: 0.05,
supportsReasoning: true,
thinkingConfig: {
geminiThinkingLevel: "low",
supportsThinkingLevel: true,
},
tiers: [
{
contextWindow: 200000,
inputPrice: 0.3,
outputPrice: 2.5,
cacheReadsPrice: 0.03,
},
{
contextWindow: Number.POSITIVE_INFINITY,
inputPrice: 0.3,
outputPrice: 2.5,
cacheReadsPrice: 0.03,
},
],
},

Steps to reproduce

Run this model and compare the API costs

Provider/Model

gemini:gemini-3-flash-preview,vertex:gemini-3-flash-preview

System Information

Not Applicable

Metadata

Metadata

Assignees

No one assigned

    Labels

    VS CodeIssues specific to VS Code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions