---
title: "Model predictions by use case"
method: POST
path: "/ai/prediction/{USE_CASE}/{MODEL_ID}"
tags: ["Get predictions"]
---

# Model predictions by use case

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

This is an all-purpose prediction endpoint you can use by specifying a `USE_CASE` and `MODEL_ID`.  

IMPORTANT: The available use cases are detailed in their own section in this specification.

## Path parameters

- `USE_CASE` string, required
- `MODEL_ID` string, required

## Headers

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

## Request body

- BasicGenericRequest
  - `batch` object[] — The batch of key:value pairs used in the chunking request.
    - `text` string — The content to be split into chunks based on the chunking strategy (`chunker`) sent in the request. The maximum text size allowed for input is approximately 1 MB.
  - `modelConfig` ModelConfig — Provides fields and values that specify ranges for tokens.
    - `vectorQuantizationMethod` string — Vector quantization compresses data size, as well as reducing memory usage. The methods are: * `min-max` - Creates tensors of the text and converts it to uint8 by normalizing it to the range [0, 255]. * `max-scale` - Finds the maximum absolute value for the encoded text, normalizes it by scaling the text to a range of -127 to 127, and then returns the quantized text as an 8-bit integer tensor.
    - `dimReductionSize` integer — Used to reduce vector size while maintaining good quality. This field allows any integer above 0, but less than or equal to the vector dimension of the model. If you send a vector dimension larger than the model, a 400 Bad Request error is returned. Not every model is designed to support this parameter. In this scenario, a warning message is generated that indicates quality can decrease.
  - `useCaseConfig` UseCaseConfigChunking
    - `dataType` string — This optional parameter enables model-specific handling in the Async Chunking 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 Async Chunking API. The string values to use are: "dataType": "query" for the query. "dataType": "passage" for fields searched at query time.
  - `chunkerConfig` object — This parameter contains fields that determine how the text is split and the size of text chunks created. IMPORTANT: Specific information is detailed in each use case.

## Response `200`

OK

- BasicGenericResponse — IMPORTANT: This contains some of the information in a response to this use case. However, the response varies based on the use case and other information in the request. See the specific use case for valid information for that use case.
  - `predictions` BasicGenericResponseTokens[]
    - `response` string — The results returned from the request.

## Other responses

- `201` — Created

---

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