---
title: "Custom model prediction"
method: POST
path: "/ai/prediction/embedding/{MODEL_ID}"
tags: ["Get predictions"]
---

# Custom model prediction

`POST /ai/prediction/embedding/{MODEL_ID}`

The custom model prediction is an embedding use case. If a custom model is trained and deployed using the Lucidworks AI Models API, the `DEPLOYMENT_ID` in the Models API is the same value as the `MODEL_ID` you enter in the custom model to return a prediction.

## 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)
