Google: Gemini Embedding 2 Preview
Gemini Embedding 2 Preview converts text, images, audio, video and PDF into numerical vectors in one multimodal space. Its separately documented preview profile supports cross-modal retrieval and comparison, an 8,192-token input and flexible vector dimensions.
About the model
This description covers the model’s capabilities. Available in Ailoot inputs, outputs and options are listed for the selected method below.
Gemini Embedding 2 Preview is Google’s named preview edition of its native multimodal embedding family. It maps text, images, video, audio and PDF into a shared numerical space, with semantic intent represented across more than 100 languages. The output is embeddings: vectors used to compare and retrieve related material. This preview identity remains separate from the stable Gemini Embedding 2 edition and does not imply interchangeable weights or an identical vector space.
The original announcement describes cross-modal search, classification, clustering, sentiment analysis and retrieval-augmented generation as downstream applications. A text query can find a related visual item, while an image or clip can also act as a search source. An application stores the representations, compares them and returns the corresponding records; a separate language model can use the retrieved source material to draft an answer. The embedding itself does not contain a natural-language explanation or transcript.
Its own model page documents an 8,192-token input limit and output dimensions from 128 to 3,072, with 768, 1,536 and 3,072 recommended sizes. The preview announcement gives a default of 3,072 and describes Matryoshka Representation Learning, which keeps useful information in shorter prefixes of the representation. Keep one chosen dimension for vectors that must be compared and retain the model edition with the collection, rather than merging representations simply because their lengths match.
The preview announcement documents up to six PNG or JPEG images per request, up to 120 seconds of MP4 or MOV video and PDF documents up to six pages. It also documents direct audio embedding without an intermediate text transcription. These specifications come from the preview’s own announcement, not from the later stable guide. The announcement does not establish every current audio-duration, codec or frame-sampling limit for this exact preview profile.
Interleaved multimodal input lets the representation reflect relationships between media, such as a picture and its caption. For a product catalogue, supply the photograph and approved description together when they describe one retrievable object. For a document collection, divide the source into focused passages or pages and preserve its title and position. For a media library, select a clip corresponding to the event users should find and keep its original time range with the stored record.
A useful retrieval task makes the intended relationship clear. A question seeking an explanation, a search for visually similar items and clustering by topic are different tasks even when they use the same source collection. Prepare the content consistently, record the edition and dimension and keep every vector linked to its source. Similarity supplies candidates for the application to inspect; it is not proof that two records state the same fact or that a retrieved source fully answers a question.
For a practical media search, represent the chosen image or video excerpt and compare it with the description of the desired content. Present the matching source alongside its caption or time range so a user can review it. For a knowledge assistant, retrieve the relevant page or passage before generating the written response. The Preview model’s role is the multimodal numerical representation that supports those selection steps, while storage, ranking rules and the final answer remain parts of the surrounding workflow.
Ailoot Ultra · Embeddings POST /v1/embeddings google/gemini-embedding-2-preview
google/gemini-embedding-2-preview
google/gemini-embedding-2-previewOverview
Gemini Embedding 2 Preview converts text, images, audio, video and PDF into numerical vectors in one multimodal space. Its separately documented preview profile supports cross-modal retrieval and comparison, an 8,192-token input and flexible vector dimensions.
- Accepted inputs
- Text
- Results
- embedding
Available in Ailoot · inputs & methods
Ailoot Ultra · Embeddings POST /v1/embeddings
- Input types
text- Output types
embedding- Context
- 8,192 tokens
- Output format
- json
| Field | Type | Requirement | Values & limits | Default |
|---|---|---|---|---|
Fieldmodel | Typestring | RequirementRequired | Values & limits google/gemini-embedding-2-preview | Default— |
Fieldinput | Typestring|string[] | RequirementRequired | Values & limits | Default— |
Input material combinations
text_to_embedding
Method parameters and lifecycle
| Parameter | Contract |
|---|---|
Parametercontent_type | Contractapplication/json |
Parameterrequired | Contractmodel, input |
Parameterinput_shapes | Contractstring, string[] |
Parametermaterial_types | Contracttext |
Lifecycle: synchronous_json
Keep every returned vector and index.
No image/audio/file-object support is inferred from this minimal text profile.
Pricing
Tariff references do not add request options. Supported parameters are listed for the selected method.
- Fast mode
- Not specified When fast mode is selected
- Flex mode
- Not specified When flex mode is selected
- Maximum reasoning effort
- Not specified When maximum reasoning effort uses the default adjustment
Ailoot rates
Prices by configuration
| Configuration | Rate schedule | Charge |
|---|---|---|
| ConfigurationBase token rates | Rate scheduleBase rate | Charge Input · Input tokens $0.0004 / 1K tokens Output · Output tokens $0 / 1K tokens Input · Cache read — / 1K tokens Input · Cache write — / 1K tokens Input · Cache write, 1 hour — / 1K tokens |
Ailoot reserves an estimated amount before a request. After the result, it settles the final charge from measured usage. Streaming settlement uses the final usage record. How reservation and settlement work →
Example requests
Ailoot Ultra · Embeddings
{
"model": "google/gemini-embedding-2-preview",
"input": [
"First document",
"Second document"
]
}set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
cat > embedding-request.json <<'JSON_REQUEST'
{
"model": "google/gemini-embedding-2-preview",
"input": [
"First document",
"Second document"
]
}
JSON_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/embeddings \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @embedding-request.json -o embedding-response.json
Receive and save results
Ailoot Ultra · Embeddings
json
Keep all completed results
Keep every complete returned response, file and content part.
Keep every vector with its index. Vector count must equal input count; dimensions must be consistent.
If the original response needs checking
No embedding job endpoint is introduced.
Response fields
| Field | Type |
|---|---|
Fieldobject | Typestring |
Fieldmodel | Typestring |
Fielddata[].index | Typeinteger |
Fielddata[].embedding | Typefinite float[] |
Fieldusage | Typeobject |
Errors and next steps
| Response | Condition | Next step |
|---|---|---|
Response400 · invalid_request_error | ConditionMissing model or malformed JSON. | Next stepCorrect indicated fields. |
Response413 · invalid_request_error | ConditionConfigured body limit exceeded. | Next stepReduce actual material. |
Response422 · invalid_request_error | ConditionInput or controls violate current dedicated policy. | Next stepUse shown minimal text input without inherited controls. |
Response503 · billing_error | ConditionAdmission or quote cannot be bound. | Next stepPreserve response; do not substitute a policy. |
Aliases
Model aliases
Ailoot Ultra google/gemini-embedding-2-preview
Method path aliases
Use the method paths shown above.
Related caller IDs
FAQ · Google: Gemini Embedding 2 Preview
- What inputs and results are available?
POST /v1/embeddings·google/gemini-embedding-2-preview:text→embedding- Which fields does the request use?
POST /v1/embeddings·google/gemini-embedding-2-preview:model,input- What limits apply?
POST /v1/embeddings·google/gemini-embedding-2-preview:ctx:8192