Skip to main content
POST
/
ai
/
prediction
/
{USE_CASE}
/
{MODEL_ID}
curl --request POST \
  --url https://application_id.applications.lucidworks.com/ai/prediction/{USE_CASE}/{MODEL_ID} \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "batch": [
    {
      "text": "Not all those who wander are lost."
    }
  ],
  "useCaseConfig": {
    "labels": [
      "Harry Potter",
      "Lord of the Rings"
    ]
  }
}
'
{
"predictions": [
{
"tokensUsed": {
"inputTokens": 10,
"labelsTokens": 26
},
"labels": {
"Lord of the Rings": 0.40380859375,
"Harry Potter": 0.3681640625
},
"response": "Lord of the Rings: 0.40, Harry Potter: 0.37"
}
]
}

Headers

Authorization
string
required

Bearer token used for authentication. Format: Authorization: Bearer ACCESS_TOKEN.

Content-Type
string

application/json

Path Parameters

USE_CASE
string
required

The name of the use case for the model. Use the Use Case API to get the list of supported use cases.

MODEL_ID
string
required

The unique identifier of the model.

Body

application/json

Request information varies based on the use case in the request. See the specific use case for valid information for that use case.

batch
object[]

The batch of key:value pairs used as inputs in the prediction. Up to 32 inputs per request are allowed.

Maximum array length: 32
modelConfig
ModelConfig · object

Provides fields and values that specify ranges for tokens. Fields used for specific use cases and models are specified. The default values are used if other values are not specified.

Response

OK

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
object[]