We use cookies. Cookies and browser storage keep you signed in and remember your preferences. With your permission we also measure how the site is used. You can any time. See our cookie policy.
Google: Gemini Embedding 2 Preview
google/gemini-embedding-2-previewTry Google: Gemini Embedding 2 Preview now
Runs on your balance at the prices above. New accounts start with free usage.
Results will appear here.
Settings
Google: Gemini Embedding 2 Preview at a glance
- Input price is 900% higher than the median of 34 Embeddings models.
About Google: Gemini Embedding 2 Preview
Google: Gemini Embedding 2 Preview is an embedding model from Google, published under the model id google/gemini-embedding-2-preview. It sits in the embeddings category and is described by Google as its first multimodal embedding model. It is a preview release, which is worth noting if you are planning to depend on it in production.
The model accepts text, image, file, audio and video as input, and it produces embeddings as its only output. Its context length is 8192 tokens, and the maximum output is 7372. Google's description states that text and images are currently supported for mapping into a unified vector space, which is the part of the multimodal input list that is explicitly covered today.
That combination points at semantic search and retrieval-augmented generation, the two uses Google names in its description. You can embed documents and queries so that a vector store can retrieve passages by meaning rather than by keyword, and you can feed the retrieved passages to a generation model to ground its answers. Because images can be mapped into the same vector space as text, cross-modal retrieval also follows: indexing images alongside text and searching across both with a single query. The wider input list (file, audio, video) suggests where the model is headed, but the stated support is text and images, so treat those as the reliable inputs for now.
You call it through api14's OpenAI-compatible API using the model id google/gemini-embedding-2-preview, in the same way you would call any other embedding endpoint, so existing OpenAI client libraries and code paths work without changes. The model lists no supported parameters beyond the basics of the request, so keep your calls simple and avoid assuming tuning options that are not documented.
Two practical points. The 8192 token context bounds how much text you can embed in one call, so long documents need chunking before embedding. And since this is a preview model, if you need a stable, long term embedding target, a non-preview embedding model may be the safer choice.
How to call the Google: Gemini Embedding 2 Preview API
- Create an API key in your dashboard.
- Install the official openai SDK for your language.
- Set baseURL to https://api14.com/api/v1 and model to "google/gemini-embedding-2-preview".
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api14.com/api/v1",
apiKey: process.env.API14_API_KEY,
});
const result = await client.embeddings.create({
"model": "google/gemini-embedding-2-preview",
"input": [
"The quick brown fox",
"Lorem ipsum"
]
});
console.log(result.data.map((d) => d.embedding.length));
Specifications
- Context length
- 8,192
- Max output
- 7,372
- Input
- text, image, file, audio, video
- Output
- embeddings
Requests on api14 · last 7 days
Google: Gemini Embedding 2 Preview: frequently asked questions
- How much does the Google: Gemini Embedding 2 Preview API cost?
- Google: Gemini Embedding 2 Preview costs Input $0.70 / 1M tokens. It is charged from your USD balance only for successful requests; failed requests are free.
- What is the context window of Google: Gemini Embedding 2 Preview?
- Google: Gemini Embedding 2 Preview reads up to 8,192 tokens per request: prompt, history and documents together. It writes up to 7,372 output tokens per response.
- What can Google: Gemini Embedding 2 Preview do?
- Google: Gemini Embedding 2 Preview accepts text, image, file, audio, video and returns embeddings.
- How do I call Google: Gemini Embedding 2 Preview from my code?
- Point any OpenAI SDK at https://api14.com/api/v1 and set the model to "google/gemini-embedding-2-preview". No other code changes. Copy a ready example from the code panel on this page.
- What are alternatives to Google: Gemini Embedding 2 Preview?
- Comparable Embeddings models at a similar price: Google: Gemini Embedding 2, Google: Gemini Embedding 2 (batch), Google: Gemini Embedding 001. Each runs through the same API key, so switching is one string.
Google: Gemini Embedding 2 Preview community
New topicThis community has no topics yet. Open the first one about Google: Gemini Embedding 2 Preview.