Gemini Embedding 2
google/gemini-embedding-2
Overview
Embedding
Google's first multimodal embedding model, which maps text, images, video, audio and PDFs into one space. Through indoRouter it embeds text.
Made by Google
Input
TextOutput
Embeddings- Context
- 8.192
- Input, maximum
- 8.192
- Embedding input, maximum
- 8.192
- Automatic fallback routes Not supported
Routes and pricing
Providers are tried in the order listed below. We try these providers in order. If one fails, we move on to the next, and you pay the rate of the one that answers.
- Input
- Rp3.700per million tokens$0.2
Today's reference rate: Rp18.500/USD
Prices exclude the 5,5% service fee
Data and privacy
Google Gemini API Additional Terms
- Used to train models
- No Under the Gemini API terms for paid use.
- Retention
- Logged for a limited period, only to detect abuse and meet legal duties.
- Processing location
- Any country where Google has facilities.
- At indoRouter
- We don't store your prompts or responses. Files you upload, batches, and responses you send with
store: trueare kept encrypted for up to 30 days.
Code samples
Use this model ID with any OpenAI SDK. The base URL is the same for every model.
curl https://api.indorouter.ai/v1/embeddings \
-H "authorization: Bearer $INDOROUTER_API_KEY" \
-H "content-type: application/json" \
-d '{"model": "google/gemini-embedding-2", "input": "halo"}'
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.indorouter.ai/v1",
api_key=os.environ["INDOROUTER_API_KEY"],
)
result = client.embeddings.create(model="google/gemini-embedding-2", input="halo")
print(len(result.data[0].embedding))
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.indorouter.ai/v1",
apiKey: process.env.INDOROUTER_API_KEY,
});
const result = await client.embeddings.create({ model: "google/gemini-embedding-2", input: "halo" });
console.log(result.data[0].embedding.length);