Perform inference on the service
Added in 8.11.0
Path parameters
-
inference_id
string Required The inference Id
Query parameters
-
timeout
string Specifies the amount of time to wait for the inference request to complete.
Body
-
query
string Query input, required for rerank task. Not required for other tasks.
input
string | array[string] Required Inference input. Either a string or an array of strings.
-
task_settings
object Additional properties are allowed.
POST
/_inference/{inference_id}
curl \
--request POST http://api.example.com/_inference/{inference_id} \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"query":"string","input":"string","task_settings":{}}'
Request examples
{
"query": "string",
"input": "string",
"task_settings": {}
}
Response examples (200)
{
"text_embedding_bytes": [
{
"embedding": [
42.0
]
}
],
"text_embedding": [
{
"embedding": [
42.0
]
}
],
"sparse_embedding": [
{
"embedding": {
"additionalProperty1": 42.0,
"additionalProperty2": 42.0
}
}
],
"completion": [
{
"result": "string"
}
],
"rerank": [
{
"index": 42.0,
"relevance_score": 42.0,
"text": "string"
}
]
}