Gemini Embedding 2 (gemini-embedding-2) is the first multimodal embedding model in the Gemini API. It maps text, images, video, audio and PDFs into one embedding space, so a text query can retrieve an image and an image can retrieve the matching document without any conversion step. This guide covers pricing, dimensions, the task-prefix change, and what the November 6, 2026 deprecation of gemini-embedding-2-preview means for existing indexes (as of November 7, 2026).
Update (Nov 6, 2026): gemini-embedding-2-preview now routes to gemini-embedding-2
According to the Gemini API changelog for November 6, 2026, gemini-embedding-2-preview is deprecated. Effective that day, API requests to the preview model are routed to gemini-embedding-2 and billed at Gemini Embedding 2 rates. The deprecations page lists the preview's release date as March 10, 2026 and its shutdown date as November 6, 2026.
Question | Answer from Google's docs |
|---|---|
Will my code using the preview string break? | No. Requests are routed to |
Do I need to re-embed my vectors? | No. Google states the GA model uses the same API schema, pricing and embedding space, so no re-indexing is needed. |
What should I change? | Update the model string in your code to |
This is different from switching between model families: vectors from gemini-embedding-001 and gemini-embedding-2 are not compatible and must never share one index. For the broader Gemini model shutdown happening on December 1, see the Gemini 2.5 Pro and Flash deprecation and migration guide.
Pricing: $0.20 per 1M text tokens, with a free tier
Official pricing (USD per 1M tokens). The free tier makes a proof of concept effectively free, but free-tier data is used to improve Google's products.
Input | Free tier | Paid (standard) | Batch (50% off) |
|---|---|---|---|
Text | Free | $0.20 | $0.10 |
Image | Free | $0.45 ($0.00012 per image) | $0.225 |
Audio | Free | $6.50 ($0.00016 per second) | $3.25 |
Video | Free | $12.00 ($0.00079 per frame) | $6.00 |
If you only need text, gemini-embedding-001 ($0.15 per 1M tokens, $0.075 batch) is still available. Choose by whether you will mix in images or audio, not by the $0.05 difference: if multimodal search is on your roadmap, starting on Embedding 2 avoids a full re-index later.
A quick cost estimate
Indexing 10,000 internal documents of about 1,000 tokens each is roughly 10M tokens, or about $2 for text. You pay once at indexing time; existing vectors are not billed again unless you rebuild them. Audio and video cost one to two orders of magnitude more, so transcribe first or embed only the segments you need.
Dimensions: 3072 by default, 768 with little quality loss
Embedding 2 is trained with Matryoshka Representation Learning (MRL), so the leading part of a vector keeps its meaning. The default is 3072 dimensions; output_dimensionality lets you truncate to 1536 or 768, the three sizes Google recommends.
A practical difference from the older model: Embedding 2 normalizes truncated vectors automatically, while with gemini-embedding-001 you had to normalize them yourself. Forgetting that makes similarity follow vector length instead of direction, and search quality degrades silently with no error. Storage scales with dimensions, so 3072 to 768 cuts vector storage to about a quarter. Start at 768 and go up only if recall is not good enough.
For text, put the task instruction in the prompt
For text with Embedding 2, Google recommends writing a task prefix in the input rather than using the task_type parameter (which remains the method for gemini-embedding-001). For retrieval, format queries and documents differently so each vector points the right way. Embedding questions and documents in exactly the same format is a common mistake and visibly hurts retrieval.
We build internal knowledge search and custom AI systems around exactly these design choices. If that is something you are planning, we would be glad to help.
The fastest way to try it
- Get an API key in Google AI Studio (the free tier is enough to test).
- Send text to
models/gemini-embedding-2:embedContentand confirm a vector comes back. - Set
output_dimensionalityto 768 and check the size versus accuracy trade-off. - Use separate prefixes for queries and documents, then check 20 to 30 real examples by eye: does the thing you want come out on top?
- Once volume grows, index in bulk with the Batch API at half price.
If you would rather not run a vector database, the Gemini API's File Search tool handles ingestion, chunking and indexing for you. It uses gemini-embedding-001 for text and gemini-embedding-2 for images and multimodal content.
Things to check before you ship
- Free-tier data is used for product improvement: switch to the paid tier before indexing confidential documents.
- Changing model families means re-embedding everything: never mix 001 and Embedding 2 vectors in one index. (The preview-to-GA switch above is the exception: same embedding space.)
- Audio and video cost far more per token: transcribing first can cut cost to a thirtieth or less.
- Retrieval needs tuning: if embeddings alone are not accurate enough, try hybrid search with keywords before anything else.
Building search over your own documents
"We have the documents but nobody can find anything" is where many companies see the first real payoff from AI. We can help you decide where to start.
FAQ
Is gemini-embedding-2-preview still available?
It was deprecated on November 6, 2026. Requests to it are now routed to gemini-embedding-2 and billed at Gemini Embedding 2 rates. Update the model string in your code.
Do I need to re-embed vectors created with the preview model?
No. Google says gemini-embedding-2 uses the same API schema, pricing and embedding space as the preview, so no re-indexing is needed.
How much does Gemini Embedding 2 cost?
On the paid tier, per 1M tokens: $0.20 for text, $0.45 for images, $6.50 for audio and $12.00 for video. The Batch API is half price, and a free tier is available.
Can I reduce the vector dimensions?
Yes. It is trained with MRL, so you can truncate from 3072 to 1536 or 768 with little quality loss, and Embedding 2 normalizes truncated vectors automatically.