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
google/gemini-embedding-2Try Google: Gemini Embedding 2 now
Runs on your balance at the prices above. New accounts start with free usage.
Results will appear here.
Settings
Google: Gemini Embedding 2 at a glance
- Input price is 900% higher than the median of 34 Embeddings models.
About Google: Gemini Embedding 2
Google: Gemini Embedding 2 is an embedding model from Google, listed on api14 under the model id google/gemini-embedding-2. It sits in the embeddings category and is described by Google as the company's first multimodal embedding model. Rather than generating chat responses, it converts inputs into vectors that you can store and compare, which makes it a building block for search and retrieval systems rather than an assistant you talk to directly.
The model accepts text, image, file, audio and video inputs, and its only output modality is embeddings. Google's description notes that text and images are currently supported for mapping into a unified vector space for semantic search and retrieval-augmented generation (RAG). The context window is 8192 tokens, and the maximum output is 7372. Because the output is a vector rather than prose, you should expect to consume the result programmatically, for example by writing it to a vector index, instead of reading it as text.
Those capabilities point to a fairly specific set of uses. Semantic search over a document collection is the obvious one: embed your corpus once, embed the query at request time, and rank by vector similarity. RAG pipelines follow from the same idea, where retrieved passages are passed to a separate generation model. The multimodal input support means you can also build retrieval that mixes text and images in one vector space, which suits catalogues, media libraries or any collection where a query in words should be able to surface a relevant picture. Audio and video inputs are listed as accepted modalities, so indexing those assets is possible too, though Google's description only calls out text and images as currently mapped into the unified space.
You call the model through api14's OpenAI-compatible API using the model id google/gemini-embedding-2. Because the interface follows the OpenAI embeddings convention, existing clients and SDKs that already point at an OpenAI-compatible base URL should work with minimal changes. The model lists no supported parameters, so there is nothing extra to tune in the request body beyond the standard embedding call fields such as the model id and the input. If you are porting an existing pipeline, check that you are not relying on optional parameters that this model does not accept.
One practical consideration is the 8192 token context window. Inputs longer than that need to be split before embedding, and chunking strategy will affect retrieval quality, so plan for it rather than assuming whole documents fit. Also keep in mind that this model produces embeddings only. If your application needs generated text, summaries or answers, you will need a separate chat or completion model alongside it, with Gemini Embedding 2 handling the retrieval side of the pipeline.
How to call the Google: Gemini Embedding 2 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".
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",
"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: frequently asked questions
- How much does the Google: Gemini Embedding 2 API cost?
- Google: Gemini Embedding 2 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?
- Google: Gemini Embedding 2 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 do?
- Google: Gemini Embedding 2 accepts text, image, file, audio, video and returns embeddings.
- How do I call Google: Gemini Embedding 2 from my code?
- Point any OpenAI SDK at https://api14.com/api/v1 and set the model to "google/gemini-embedding-2". No other code changes. Copy a ready example from the code panel on this page.
- What are alternatives to Google: Gemini Embedding 2?
- Comparable Embeddings models at a similar price: Google: Gemini Embedding 2 Preview, 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 community
New topicThis community has no topics yet. Open the first one about Google: Gemini Embedding 2.