feat(cost): add gemini-3.1-flash-image-preview pricing#5617
Open
nspady wants to merge 2 commits intoHelicone:mainfrom
Open
feat(cost): add gemini-3.1-flash-image-preview pricing#5617nspady wants to merge 2 commits intoHelicone:mainfrom
nspady wants to merge 2 commits intoHelicone:mainfrom
Conversation
Add cost entry for Google's Gemini 3.1 Flash Image Preview model. Pricing per Google AI Developer docs (https://ai.google.dev/gemini-api/docs/pricing): - Input: $0.25/1M tokens - Text output: $1.50/1M tokens - Image output: $60.00/1M tokens (not representable in current cost model) Note: The completion_token rate uses the text output price ($1.50/1M). Image output tokens are priced at $60/1M by Google, but the current ModelRow interface has a single completion_token rate. This means image generation costs will be underestimated. A future enhancement to support separate image_output_token pricing would improve accuracy for image generation models. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@nspady is attempting to deploy a commit to the Helicone Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Add full model registry entry with proper image output pricing: - model.ts: Model config with text+image input/output modality - endpoints.ts: google-ai-studio, vertex, and openrouter endpoints with separate image pricing using the ModalityPricing interface Pricing per Google AI Developer docs: - Input: $0.25/1M tokens - Text output: $1.50/1M tokens - Image output: $60.00/1M tokens ($0.067 per 1K image at 1120 tokens) The new registry's image.output field correctly captures the $60/1M image output rate, unlike the legacy providers/ entry which can only use a single completion_token rate. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds cost tracking for Google's Gemini 3.1 Flash Image Preview model (
gemini-3.1-flash-image-preview) across both the legacy cost system and the new model registry.Pricing per Google AI Developer docs:
Changes
1. Legacy cost entry (
providers/google/index.ts)Added
ModelRowwith text token rates (consistent with existing image models likegemini-2.5-flash-image).2. New model registry (
models/authors/google/gemini-3.1-flash-image-preview/)text+imageinput/output modalityimage.outputpricing using theModalityPricinginterfaceThe new registry correctly captures the $60/1M image output rate via the
image.outputfield, matching the pattern established bygemini-3-pro-imagein #5496.Pricing Details