Imagine your product search indexes documents, images, and audio with gemini-embedding-2-preview. It still answers requests, but the model name no longer tells the whole story. Since November 6, 2026, Google has routed those calls to the stable gemini-embedding-2 model. The required code change is small; mistaking it for a different migration could trigger an unnecessary vector rebuild.
What Google changed
Google's November 6 Gemini API changelog deprecates gemini-embedding-2-preview. Calls made with that identifier now route to gemini-embedding-2 and use stable model rates. Google asks developers to update the model string. It also states that these two identifiers share the API schema, pricing, and embedding space. For this specific transition, no other code change or vector reindexing is required.
Why does the shared space matter? In semantic search or RAG, a query vector must be comparable with the vectors already stored for your documents. A request can succeed while retrieval quality collapses if the two sides use incompatible spaces. Google explicitly rules out that mismatch for the preview-to-stable switch.
A practical migration check
- Find model references in source, environment settings, and indexing jobs:
rg 'gemini-embedding-2-preview|gemini-embedding-001' .. Include configuration stored outside the repository. - If your index was built with
gemini-embedding-2-preview, change both indexing and query generation togemini-embedding-2. Keep the same vector dimensions, collection, and metadata initially. - Run a known search before and after. Check whether the expected document still ranks near the top, then inspect errors, latency, and usage. A successful HTTP response alone does not test retrieval.
- Check the current pricing table before forecasting spend. Standard paid text embedding is listed at USD $0.20 per million input tokens; images, audio, and video have separate rates. A free tier exists with limits.
Here is the basic Python SDK pattern from Google's embedding documentation:
from google import genai
client = genai.Client() # Reads GEMINI_API_KEY from the environment
response = client.models.embed_content(
model="gemini-embedding-2",
contents="How do I cancel my subscription?",
)
vector = response.embeddings[0].values
print(len(vector))
This is a documentation-based example, not a claim that we ran a live request or measured search quality. In production, preserve your index's vector dimension and test on representative data.
For a service with real users, deploy the identifier change behind a configuration flag. Record a handful of representative queries and their expected documents, run them against the existing index, and compare the top results after the change. If quality or latency shifts, roll back the configuration and investigate before touching the stored vectors. Keep the model identifier in your index metadata so the next engineer can tell which embedding space generated it.

Do not confuse it with the 001 migration
The rule changes if your existing vectors came from gemini-embedding-001. Google's migration documentation says its embedding space is incompatible with gemini-embedding-2. A move from the older text-only model to Embedding 2 requires re-embedding your data. Build a separate index, generate new document vectors, switch query generation, compare retrieval quality, and only then retire the old index. Google currently lists gemini-embedding-001 as available for text-only cases.
The decision starts with one question: which model created the vectors already in your database? Preview-to-stable means change the identifier and validate retrieval. Embedding 001-to-2 means plan a proper data migration. Similar model names do not imply compatible vectors.
