Method: models.batchEmbedText

Generates multiple embeddings from the model given input text in a synchronous call.

HTTP request

POST https://generativelanguage.googleapis.com/v1beta3/{model=models/*}:batchEmbedText

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
model

string

Required. The name of the Model to use for generating the embedding. Examples: models/embedding-gecko-001

Request body

The request body contains data with the following structure:

JSON representation
{
  "texts": [
    string
  ]
}
Fields
texts[]

string

Required. The free-form input texts that the model will turn into an embedding. The current limit is 100 texts, over which an error will be thrown.

Response body

The response to a EmbedTextRequest.

If successful, the response body contains data with the following structure:

JSON representation
{
  "embeddings": [
    {
      object (Embedding)
    }
  ]
}
Fields
embeddings[]

object (Embedding)

Output only. The embeddings generated from the input text.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/generative-language

For more information, see the Authentication Overview.