Gemini Embedding 2
Multilingual text embeddings for search, retrieval and clustering.
- by Google
- Embeddings
- $0.20 per M tokens
- Multilingual3072 dimensions
On this page
1.Call
OpenAI-compatible embeddings; works with the official OpenAI SDKs. Every response carries an x-request-id trace ID.
curl https://api.ewest.ai/v1/embeddings \
-H "Authorization: Bearer $EWEST_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "ewest/gemini-embedding", "input": ["How do I reset my password?", "Billing questions"]}'
# → {"data": [{"embedding": [0.012, -0.034, …], "index": 0}, …], "usage": {…}}2.Authentication
Send your API key in the Authorization: Bearer header, as the examples above do (clients built for the Anthropic API can use x-api-key). Create keys under API keys. Keep the key on your server, never in browser code. More in the authentication guide.
3.Schema
What you send and what comes back, for ewest/gemini-embedding. The output tables are read from the API's OpenAPI description.
Input
POST /v1/embeddings- The model id,
modelstringRequiredewest/gemini-embedding. - Text to embed, or a list of texts. Up to 8,192 tokens each.
inputstring or arrayRequired
Output
Returns an embedding vector. POST /v1/embeddings answers 200: One vector per input, in input order.
- Always
objectstringAlwayslist. - The model that produced the embeddings.
modelstringAlways - One embedding per input, in order.
dataarray of objectAlways - Always
data[].objectstringSometimesembedding. - Position of the input this embedding belongs to.
data[].indexintegerAlways - The vector: a list of numbers, or a base64 string with
data[].embeddingarray of number, or string (base64)Alwaysencoding_format: "base64". - Token usage of the request.
usageobjectSometimes - Tokens in the input.
usage.prompt_tokensintegerSometimes - Total tokens billed.
usage.total_tokensintegerSometimes
Sample response
The vector is shortened here; ewest/gemini-embedding returns 3,072 numbers per input.
{
"object": "list",
"model": "ewest/gemini-embedding",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [-0.0064, 0.011, 0.0149, 0.0042]
}
],
"usage": {
"prompt_tokens": 5,
"total_tokens": 5
}
}4.Details
- Input limit
- 8,192 tokens per input
- Dimensions
- 3072
- API
- OpenAI-compatible embeddings