update gemini embedding model cost metrics#1010
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d40e1f4dd
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".
| "format": "google", | ||
| "flavor": "embedding", | ||
| "multimodal": true, | ||
| "input_cost_per_mil_tokens": 0.2, |
There was a problem hiding this comment.
Avoid using the text rate for multimodal embeddings
For gemini-embedding-2 this flat $0.20/M rate only matches text inputs, while the same entry is still marked multimodal and Google's pricing page lists higher image/audio/video input rates (https://ai.google.dev/gemini-api/docs/pricing#gemini-embedding-2). Because the schema exposes only one input_cost_per_mil_tokens value and billing/usage records aggregate input tokens, any image, audio, video, or PDF embedding request routed through this model will be costed as text instead of the modality-specific rate, under-reporting cost for those production requests; consider omitting this cost until modality-aware pricing is represented or restricting it to text-only entries.
Useful? React with 👍 / 👎.
Add cost metrics to Gemini embedding models
Adds
input_cost_per_mil_tokensandoutput_cost_per_mil_tokensto the Gemini embedding models inmodel_list.json, covering both the Gemini API entries and the Vertex (publishers/google/models/...) entries:gemini-embedding-001gemini-embedding-2Pricing verified against the official Gemini API pricing page. Embedding models have no billed output tokens, so output cost is set to 0.
Note:
gemini-embedding-2is multimodal with per-modality input pricing (text $0.20/1M, image $0.45/1M, audio $6.50/1M, video $12.00/1M). The schema only supports a single input cost, so these entries reflect the text rate; non-text embedding inputs will be under-costed until per-modality cost fields exist.