---
title: "English language model text encoder"
method: POST
path: "/ai/prediction/embedding/text-encoder"
tags: ["Get predictions"]
---

# English language model text encoder

`POST /ai/prediction/embedding/text-encoder`

The English language encoder is an embedding use that takes in plain English text and returns a 768-dimensional vector encoding of that text. This model powers this semantic search.

The API truncates incoming text to approximately 256 words before the model encodes it and returns a vector. An example usage pattern is to encode all the texts and descriptions in a website and then use this encoder on query text, supporting natural language queries such as "1990s children’s fiction".

Each API request includes one batch containing up to 32 text strings.

## Headers

- `Authorization` string, required
- `Content-Type` string

## Request body

- BatchEmbeddingEncoders
  - `batch` object[] — The batch of key:value pairs used as inputs in the prediction. Up to 32 inputs per request are allowed.
    - `text` string — The content the model analyzes.
  - `useCaseConfig` UseCaseConfigEmbedding
    - `dataType` string — This optional parameter enables model-specific handling in the Prediction API to help improve model accuracy. Use the most applicable fields based on available dataTypes and the dataType value that best aligns with the text sent to the Prediction API. The two string values to use for embedding models are: * `"dataType": "query"` for the query. For query-to-query pairing, best practice is to use `dataType=query` on both API calls. * `"dataType": "passage"` for fields searched at query time. For example, if questions and answers from a FAQ are indexed, the value for questions is `"dataType": "query"` and the value for the answers is `"dataType": "passage"`.
  - `modelConfig` ModelConfigEmbedding — Provides fields and values specific to pre-trained embedding models.
    - `lowercaseInput` boolean — This parameter is optional, and controls how query response text becomes vectors. If `lowercaseInput` is set to `true`, inputs are set to lowercase before encoding, so variation in embeddings is not introduced (which makes similarity search more stable and predictable). This field is used for pre-trained models and instances in a similarity query when you don't want the case to affect the vectors returned in the query. Default value is `false`.

## Response `200`

OK

- EmbeddingEncodersResponse
  - `predictions` object[]
    - `vector` JsonNode — Query parameters to be passed to Fusion in the body.

---

[API](https://skmtc.dev/lucidworks/apis/rules-rewrites-api.md) · [All operations](https://skmtc.dev/lucidworks/apis/rules-rewrites-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/lucidworks/rules-rewrites-api/revisions/f2d3747848e8/schema)
