Google - API - verified
Gemini Embedding 2 embeddings
Gemini Embedding 2 is a current embedding model from Google, called by API as gemini-embedding-2. It returns 3,072-dimension vectors by default and accepts up to 8,192 input tokens, for text, image, audio, video and PDF input. The first-party list price is $0.20 per 1M input tokens ($0.10 through the batch API).
CurrentModel id: gemini-embedding-2
- Default dims
- 3,072
- Max input
- 8,192 tok
- Price / 1M
- $0.20
- Inputs
- Text, Image, Audio, Video, PDF
Dimensions
Flexible output size- 3,072default
- 1,536
- 768
Default output: 3,072 dimensions.
Listed sizes: 3,072, 1,536 and 768.
Google documents shorter output vectors for this model (Matryoshka-style), so you can store smaller embeddings by asking for fewer dimensions instead of re-embedding with another model.
Pricing
- Per 1M input tokens
- $0.20
- Batch, per 1M
- $0.10
Gemini API paid tier text input; image $0.45, audio $6.50 and video $12.00 per 1M tokens (Batch is half), free tier available; Vertex AI lists the same rates labelled Preview.
Usage
Copied verbatim from the page linked below. Placeholders such as project ids and API keys are the source's own.
from google import genai
client = genai.Client()
result = client.models.embed_content(
model="gemini-embedding-2",
contents="What is the meaning of life?"
)
print(result.embeddings)Worth knowing
The task_type parameter is not supported, so task instructions go in the prompt (for example task: search result | query: {content}), and its embedding space is incompatible with gemini-embedding-001.
Released . Multilingual: yes.
FAQ
How many dimensions does Gemini Embedding 2 output?
Default output: 3,072 dimensions. Listed sizes: 3,072, 1,536 and 768. Google documents shorter output vectors for this model (Matryoshka-style), so you can store smaller embeddings by asking for fewer dimensions instead of re-embedding with another model.
What is the max input length of Gemini Embedding 2?
8,192 tokens per input, per Google's documentation. Longer text has to be chunked before you embed it.
How much does Gemini Embedding 2 cost?
The first-party list price is $0.20 per 1M input tokens ($0.10 through the batch API). Gemini API paid tier text input; image $0.45, audio $6.50 and video $12.00 per 1M tokens (Batch is half), free tier available; Vertex AI lists the same rates labelled Preview. Source: https://ai.google.dev/gemini-api/docs/pricing.
What can Gemini Embedding 2 embed?
Text, image, audio, video and PDF input, per the provider. It is documented as multilingual.
Sources
Last verified from the pages below.
- Gemini API embeddings guide - ai.google.dev
- Gemini API model page - ai.google.dev
- Gemini API pricing - ai.google.dev
- Gemini API release notes - ai.google.dev
- Vertex AI multimodal embeddings - docs.cloud.google.com
- Vertex AI pricing - cloud.google.com
More Google embedding models
Default dimensions, max input tokens and list price per 1M tokens.
Newsletter
New models, every week
One email per week. New model releases, embedding and retrieval updates and what they mean for what you build.
Keep exploring
Model API pricing and specs
First-party prices per 1M tokens for chat and reasoning models.
Local models
Open-weight LLMs you can download and run, with sizes and licenses.
What is RAG?
Where embeddings fit in a retrieval pipeline, end to end.
Vector databases compared
Where the vectors go once you have picked a model.