gemini-embedding-001 是 Google 在 Gemini API 上的通用文字嵌入模型,官方文件面向語意檢索、文字分類、分群與檢索增強生成。
- 輸入
- 文字 $0.15/M
- 輸出
- 文字
規格與限制
Token
| 上下文視窗(供應商規格) | 2,048 |
|---|
向量嵌入
| 嵌入維度 | 128 到 3072,可選 供應商建議的維度:768 · 1536 · 3072 |
|---|---|
| 可截斷輸出 | 支援 |
模型
| 模態 | 文字 → 文字 |
|---|
Google's general-purpose text embedding model on the Gemini API, documented for semantic search, classification, clustering and RAG. Output dimensionality is Matryoshka rather than fixed: the docs give it as "Flexible, supports: 128 - 3072" with 768, 1536 and 3072 named as recommended, so a single dimension count does not describe this model. Input is capped at 2,048 tokens per request. The task_type parameter accepts SEMANTIC_SIMILARITY, CLASSIFICATION, CLUSTERING, RETRIEVAL_DOCUMENT, RETRIEVAL_QUERY, CODE_RETRIEVAL_QUERY, QUESTION_ANSWERING and FACT_VERIFICATION. Google's deprecation page lists a shutdown date of 2028-05-14 with gemini-embedding-2 as the replacement.
30 秒上手 Gemini Embedding 001
相容 OpenAI:換掉 base_url,SDK 不用換。POST /v1/embeddings
from openai import OpenAI
client = OpenAI(
base_url="https://synthorai.io/v1",
api_key="sk-syn-...",
)
resp = client.chat.completions.create(
model="gemini-embedding-001",
messages=[{"role": "user", "content": "Summarize this diff"}],
)
print(resp.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://synthorai.io/v1",
apiKey: "sk-syn-...",
});
const resp = await client.chat.completions.create({
model: "gemini-embedding-001",
messages: [{ role: "user", content: "Summarize this diff" }],
});
console.log(resp.choices[0].message.content);curl https://synthorai.io/v1/chat/completions \
-H "Authorization: Bearer sk-syn-..." \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-embedding-001",
"messages": [{"role": "user", "content": "Hello"}]
}'package main
import (
"context"
"fmt"
"github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/option"
)
func main() {
client := openai.NewClient(
option.WithBaseURL("https://synthorai.io/v1"),
option.WithAPIKey("sk-syn-..."),
)
resp, _ := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
Model: "gemini-embedding-001",
Messages: []openai.ChatCompletionMessageParamUnion{
openai.UserMessage("Summarize this diff"),
},
})
fmt.Println(resp.Choices[0].Message.Content)
}import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.chat.completions.*;
OpenAIClient client = OpenAIOkHttpClient.builder()
.baseUrl("https://synthorai.io/v1")
.apiKey("sk-syn-...")
.build();
ChatCompletion resp = client.chat().completions().create(
ChatCompletionCreateParams.builder()
.model("gemini-embedding-001")
.addUserMessage("Summarize this diff")
.build());
System.out.println(resp.choices().get(0).message().content().orElse(""));關於 Gemini Embedding 001
- 對橫向比較嵌入模型的人而言,它最要緊的性質是輸出維度並不固定:Google 寫的是「Flexible, supports: 128 - 3072」,並點名 768、1536、3072 為建議值,因此單一維度數描述不了這個模型,需要更短的向量時也不必換模型。
- 單次請求輸入上限 2,048 token;task_type 參數接受 SEMANTIC_SIMILARITY、CLASSIFICATION、CLUSTERING、RETRIEVAL_DOCUMENT、RETRIEVAL_QUERY、CODE_RETRIEVAL_QUERY、QUESTION_ANSWERING 與 FACT_VERIFICATION,因此一個模型可以同時服務檢索對的兩端。
- Google 的棄用頁給出的停用日期是 2028 年 5 月 14 日,替代模型為 gemini-embedding-2,屬於已公布的長期退役路徑,而非無限期。
常見問題
Gemini Embedding 001 API 可以免費試用嗎?
可以,新帳號有 10 次試用呼叫和最高 $1 的免費額度,免綁卡。在綁定付款方式之前,就足夠你拿實際的工作負載試試 Gemini Embedding 001。
Gemini Embedding 001 最擅長什麼?
輸出維度可在 128 到 3072 間選擇、一個模型可服務檢索對的兩端、已公布 2028 年 5 月停用日期。完整介紹請見「關於」一節,內容取自供應商官方的發布說明。
Gemini Embedding 001 的價格是多少?
在 Synthorai 上,Gemini Embedding 001 的輸入價是每百萬 token $0.15,輸出價是每百萬 token $0。這就是供應商官網價,平台不加價。
Gemini Embedding 001 支援提示詞快取(prompt caching)嗎?
Gemini Embedding 001 目前在 Synthorai 上沒有快取讀取折扣。閘道上的其他模型仍支援提示詞快取,可以到價格表查看支援快取的替代模型。 各供應商快取比較 →
如何開通 Gemini Embedding 001?
把現有 OpenAI SDK 的 base_url 指向 "https://synthorai.io/v1",model 設為 "gemini-embedding-001" 就可以了。一把 API 金鑰就能呼叫閘道上的所有模型。
相關模型
比較
本頁每一個數值都摘錄自供應商自己的文件(連結見上方),並附上查核日期。價格是放在整個目錄裡比較;各家供應商定義不一樣的規格,只說明差異,不畫成圖表比較。這裡沒有任何數據是我們自己量測的,也不做評分。