{
"embeddings": [
{
"values": [
0.1,
0.2
]
}
]
}API reference
Gemini synchronous batch embeddings
Synchronous batch vectors and the current model-alias limitation.
{
"embeddings": [
{
"values": [
0.1,
0.2
]
}
]
}At revision
30a6d88a4, controller/relay.go dispatches native embeddings with case-sensitive strings.Contains(path, "embed"). The action :batchEmbedContents contains no lowercase embed, so the path model ID must contain lowercase embed, such as an available embedding model name. Other aliases can enter the wrong handler. The example rejects such batch aliases before sending. This is a current gateway limitation, not a Gemini protocol requirement; review it after upgrading.
POST /v1beta/models/{model}:batchEmbedContents
Send requests, each with model and content.parts, using one model per batch. Associate embeddings[].values with inputs in order.
Use a bare path model ID. The gateway maps the path model and rewrites body model values. taskType, title, and outputDimensionality depend on the model. Empty input is outside the example. This is neither SSE nor asynchronous Batch. See native embeddings.
阅读中文版Authorizations
GeminiApiKeyBearerAuth
网关令牌 / Gateway token
Path Parameters
Body
application/json
Show child attributes
Show child attributes
Response
读取业务字段,不只检查 HTTP 状态 / Validate business fields, not only HTTP status.
Show child attributes
Show child attributes