Create an inference endpoint
- PUT /_inference/{task_type}/{inference_id}
- PUT /_inference/{inference_id}
IMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Mistral, Azure OpenAI, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face. For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs.
The following integrations are available through the inference API. You can find the available task types next to the integration name:
- AlibabaCloud AI Search (
completion,rerank,sparse_embedding,text_embedding) - Amazon Bedrock (
completion,text_embedding) - Amazon SageMaker (
chat_completion,completion,rerank,sparse_embedding,text_embedding) - Anthropic (
completion) - Azure AI Studio (
completion,text_embedding) - Azure OpenAI (
completion,text_embedding) - Cohere (
completion,rerank,text_embedding) - DeepSeek (
chat_completion,completion) - Elasticsearch (
rerank,sparse_embedding,text_embedding- this service is for built-in models and models uploaded through Eland) - ELSER (
sparse_embedding) - Google AI Studio (
completion,text_embedding) - Google Vertex AI (
chat_completion,completion,rerank,text_embedding) - Hugging Face (
chat_completion,completion,rerank,text_embedding) - JinaAI (
rerank,text_embedding) - Llama (
chat_completion,completion,text_embedding) - Mistral (
chat_completion,completion,text_embedding) - OpenAI (
chat_completion,completion,text_embedding) - VoyageAI (
rerank,text_embedding) - Watsonx (
rerank,text_embedding)
- Cluster privileges:
manage_inference
Path Parameters
-
task_typeTaskTypeoptional -
The task type. Refer to the integration list in the API description for the available task types.
Leave it out to use
/_inference/{inference_id}. -
Values:
sparse_embeddingtext_embeddingrerankcompletionchat_completion -
inference_idstring Idrequired -
The inference Id
Query Parameters
-
timeoutstring Duration · default: 30s Specifies the amount of time to wait for the inference endpoint to be created.
Request
-
chunking_settingsInferenceChunkingSettings -
Chunking configuration object
-
max_chunk_sizenumber · default: 250 -
The maximum size of a chunk in words. This value cannot be higher than
300or lower than20(forsentencestrategy) or10(forwordstrategy). -
overlapnumber · default: 100 -
The number of overlapping words for chunks. It is applicable only to a
wordchunking strategy. This value cannot be higher than half themax_chunk_sizevalue. -
sentence_overlapnumber · default: 1 -
The number of overlapping sentences for chunks. It is applicable only for a
sentencechunking strategy. It can be either1or0. -
strategystring · default: sentence -
The chunking strategy:
sentenceorword. -
servicestringrequired -
The service type
-
service_settingsServiceSettingsrequired -
Settings specific to the service
-
task_settingsTaskSettings -
Task settings specific to the service and task type
Response
-
chunking_settingsInferenceChunkingSettings -
Chunking configuration object
-
max_chunk_sizenumber · default: 250 -
The maximum size of a chunk in words. This value cannot be higher than
300or lower than20(forsentencestrategy) or10(forwordstrategy). -
overlapnumber · default: 100 -
The number of overlapping words for chunks. It is applicable only to a
wordchunking strategy. This value cannot be higher than half themax_chunk_sizevalue. -
sentence_overlapnumber · default: 1 -
The number of overlapping sentences for chunks. It is applicable only for a
sentencechunking strategy. It can be either1or0. -
strategystring · default: sentence -
The chunking strategy:
sentenceorword. -
servicestringrequired -
The service type
-
service_settingsServiceSettingsrequired -
Settings specific to the service
-
task_settingsTaskSettings -
Task settings specific to the service and task type
-
inference_idstringrequired -
The inference Id
-
task_typeTaskTyperequired -
The task type
-
Values:
sparse_embeddingtext_embeddingrerankcompletionchat_completion