Skip to main content
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

x-goog-api-key
string
header
required

网关令牌 / Gateway token

Path Parameters

model
string
required

Body

application/json
requests
object[]
required

Response

读取业务字段,不只检查 HTTP 状态 / Validate business fields, not only HTTP status.

embeddings
object[]
required