Elastic Inference API

Inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio 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.

GitHub OpenAPI
Business capability
Model Inference AE-110.10

Operations 43

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /_inference/chat_completion/{inference_id}/_stream Stream a chat completion from an endpoint · Perform chat completion inference on the service #
Ask an LLM
“How do I get streamed chat responses from an Elasticsearch chat_completion endpoint?”
“Can I pass tools and a tool choice to a chat completion inference call?”
Tell an agent
Stream a chat reply from {inference_id} for these messages: {messages}.
Send {messages} to chat endpoint {inference_id} with temperature {temperature}.
POST /_inference/completion/{inference_id} Get a text completion from an endpoint · Perform completion inference on the service #
Ask an LLM
“How do I get a non-streamed text completion from an inference endpoint?”
“Which task type does the completion inference API require?”
Tell an agent
Complete the text {input} using completion endpoint {inference_id}.
Run a one-shot completion on {inference_id} for the prompt {input}.
GET /_inference/{inference_id} Get an inference endpoint by ID · Get an inference endpoint #
Ask an LLM
“What configuration does a specific inference endpoint have?”
“What privilege do I need to read an inference endpoint's details?”
Tell an agent
Show me inference endpoint {inference_id}.
Look up the settings of inference endpoint {inference_id} without giving a task type.
PUT /_inference/{inference_id} Create an inference endpoint · Create an inference endpoint #
Ask an LLM
“How do I create an inference endpoint in Elasticsearch without naming the task type in the URL?”
“Can I configure chunking settings when I create an inference endpoint?”
Tell an agent
Create inference endpoint {inference_id} on service {service}.
Register {inference_id} using {service} with settings {service_settings}, task type left out of the path.
POST /_inference/{inference_id} Run inference on an endpoint · Perform inference on the service #
Ask an LLM
“Can I run any inference task against an endpoint by its ID alone?”
“What input types can I send to a generic inference request?”
Tell an agent
Run inference on {inference_id} with input {input}.
Send {input} to endpoint {inference_id} for whatever task it was set up for.
DELETE /_inference/{inference_id} Delete an inference endpoint · Delete an inference endpoint #
Ask an LLM
“How do I remove an inference endpoint I no longer use?”
“Can I dry-run deleting an inference endpoint to see what references it?”
Tell an agent destructive · confirm first
Delete inference endpoint {inference_id}.
Force-delete endpoint {inference_id} even if pipelines still reference it.
GET /_inference/{task_type}/{inference_id} Get an inference endpoint by task type · Get an inference endpoint #
Ask an LLM
“How do I fetch an inference endpoint scoped to a specific task type?”
“Which embedding endpoints exist for a given task type?”
Tell an agent
Show the {task_type} inference endpoint {inference_id}.
Get details for {inference_id} under task type {task_type}.
PUT /_inference/{task_type}/{inference_id} Create an inference endpoint for a task type · Create an inference endpoint #
Ask an LLM
“How do I create an inference endpoint for a specific task type like text_embedding?”
“Can I set task settings when creating a task-typed inference endpoint?”
Tell an agent
Create a {task_type} inference endpoint {inference_id} on service {service}.
Register {inference_id} for task type {task_type} with service settings {service_settings}.
POST /_inference/{task_type}/{inference_id} Run inference on an endpoint of a task type · Perform inference on the service #
Ask an LLM
“Can I run inference by naming both the task type and the endpoint?”
“How do I pass a query along with input to a task-typed inference call?”
Tell an agent
Perform a {task_type} task with endpoint {inference_id} on input {input}.
Call {inference_id} as a {task_type} task using query {query} and input {input}.
DELETE /_inference/{task_type}/{inference_id} Delete an inference endpoint of a task type · Delete an inference endpoint #
Ask an LLM
“How do I delete an inference endpoint when I know its task type?”
“What happens to ingest pipelines when I delete a task-typed endpoint?”
Tell an agent destructive · confirm first
Delete the {task_type} inference endpoint {inference_id}.
Remove endpoint {inference_id} of task type {task_type} as a dry run first.
POST /_inference/embedding/{inference_id} Generate dense embeddings · Perform dense embedding inference on the service #
Ask an LLM
“How do I get dense vector embeddings for some text in Elasticsearch?”
“Can I mark embedding input as a search query versus an ingested document?”
Tell an agent
Create dense embeddings for {input} using {inference_id}.
Embed {input} as {input_type} with dense embedding endpoint {inference_id}.
GET /_inference List all inference endpoints · Get an inference endpoint #
Ask an LLM
“Which inference endpoints are configured on my cluster?”
“Can I see every inference endpoint at once?”
Tell an agent
List all my inference endpoints.
Show every configured inference endpoint across task types.
PUT /_inference/{task_type}/{ai21_inference_id} Create an AI21 inference endpoint · Create a AI21 inference endpoint #
Ask an LLM
“Can I use AI21 Jamba models for completions from my cluster?”
“Which task types does the ai21 service accept?”
Tell an agent
Create AI21 endpoint {ai21_inference_id} for {task_type}.
Hook up AI21 as {ai21_inference_id} ({task_type}) with API key settings {service_settings}.
PUT /_inference/{task_type}/{alibabacloud_inference_id} Create an AlibabaCloud AI Search endpoint · Create an AlibabaCloud AI Search inference endpoint #
Ask an LLM
“Is AlibabaCloud AI Search usable for reranking inside Elasticsearch?”
“What workspace and host settings does the alibabacloud-ai-search service want?”
Tell an agent
Create AlibabaCloud AI Search endpoint {alibabacloud_inference_id} for {task_type}.
Register AlibabaCloud {task_type} endpoint {alibabacloud_inference_id} using {service_settings}.
PUT /_inference/{task_type}/{amazonbedrock_inference_id} Create an Amazon Bedrock inference endpoint · Create an Amazon Bedrock inference endpoint #
Ask an LLM
“What access and secret keys does an Amazon Bedrock endpoint need?”
“Can I embed text with a Bedrock-hosted model from Elasticsearch?”
Tell an agent
Create Amazon Bedrock endpoint {amazonbedrock_inference_id} for {task_type}.
Wire Bedrock model settings {service_settings} into {task_type} endpoint {amazonbedrock_inference_id}.
PUT /_inference/{task_type}/{amazonsagemaker_inference_id} Create an Amazon SageMaker inference endpoint · Create an Amazon SageMaker inference endpoint #
Ask an LLM
“Can my own SageMaker model deployment serve inference to Elasticsearch?”
“Which payload schemas does the amazon_sagemaker service understand?”
Tell an agent
Create SageMaker endpoint {amazonsagemaker_inference_id} for {task_type}.
Point {task_type} endpoint {amazonsagemaker_inference_id} at my SageMaker deployment via {service_settings}.
PUT /_inference/{task_type}/{anthropic_inference_id} Create an Anthropic inference endpoint · Create an Anthropic inference endpoint #
Ask an LLM
“Can I call Claude models for completions from Elasticsearch?”
“Does the anthropic service require max_tokens in its task settings?”
Tell an agent
Create Anthropic endpoint {anthropic_inference_id} for {task_type}.
Set up Claude completions as {anthropic_inference_id} ({task_type}) with {service_settings}.
PUT /_inference/{task_type}/{azureaistudio_inference_id} Create an Azure AI Studio inference endpoint · Create an Azure AI studio inference endpoint #
Ask an LLM
“What target URL and provider does an Azure AI Studio endpoint need?”
“Can Azure AI Studio models produce embeddings for my index?”
Tell an agent
Create Azure AI Studio endpoint {azureaistudio_inference_id} for {task_type}.
Register AI Studio deployment {service_settings} as {task_type} endpoint {azureaistudio_inference_id}.
PUT /_inference/{task_type}/{azureopenai_inference_id} Create an Azure OpenAI inference endpoint · Create an Azure OpenAI inference endpoint #
Ask an LLM
“Does an Azure OpenAI endpoint need a resource name, deployment ID and API version?”
“Can I generate embeddings through my Azure-hosted OpenAI deployment?”
Tell an agent
Create Azure OpenAI endpoint {azureopenai_inference_id} for {task_type}.
Connect Azure deployment {service_settings} as {task_type} endpoint {azureopenai_inference_id}.
PUT /_inference/{task_type}/{cohere_inference_id} Create a Cohere inference endpoint · Create a Cohere inference endpoint #
Ask an LLM
“Can a Cohere endpoint rerank results as well as embed text?”
“What embedding type options does the cohere service offer?”
Tell an agent
Create Cohere endpoint {cohere_inference_id} for {task_type}.
Use Cohere model settings {service_settings} for {task_type} endpoint {cohere_inference_id}.
PUT /_inference/{task_type}/{contextualai_inference_id} Create a Contextual AI inference endpoint · Create an Contextual AI inference endpoint #
Ask an LLM
“Can Contextual AI rerank my search results inside Elasticsearch?”
“What does the contextualai service need in its settings?”
Tell an agent
Create Contextual AI endpoint {contextualai_inference_id} for {task_type}.
Add Contextual AI reranker {contextualai_inference_id} ({task_type}) with {service_settings}.
PUT /_inference/{task_type}/{custom_inference_id} Create a custom inference endpoint · Create a custom inference endpoint #
Ask an LLM
“Can I call an external model service that has no built-in integration?”
“How do I define my own request and response format for an inference service?”
Tell an agent
Create a custom inference endpoint {custom_inference_id} for task type {task_type}.
Set up custom endpoint {custom_inference_id} for {task_type} with request template settings {service_settings}.
PUT /_inference/{task_type}/{deepseek_inference_id} Create a DeepSeek inference endpoint · Create a DeepSeek inference endpoint #
Ask an LLM
“Can I run DeepSeek chat completions through an inference endpoint?”
“Which model ID goes into a deepseek endpoint's settings?”
Tell an agent
Create DeepSeek endpoint {deepseek_inference_id} for {task_type}.
Register DeepSeek model {service_settings} as {task_type} endpoint {deepseek_inference_id}.
PUT /_inference/{task_type}/{elasticsearch_inference_id} Create an Elasticsearch-hosted model endpoint · Create an Elasticsearch inference endpoint #
Ask an LLM
“Can I deploy E5 or a trained model inside my own cluster as an endpoint?”
“How many allocations and threads should a cluster-hosted model get?”
Tell an agent
Create cluster-hosted model endpoint {elasticsearch_inference_id} for {task_type}.
Deploy built-in model {service_settings} on my nodes as {task_type} endpoint {elasticsearch_inference_id}.
PUT /_inference/{task_type}/{elser_inference_id} Create an ELSER inference endpoint · Create an ELSER inference endpoint #
Ask an LLM
“Is the elser service deprecated in favor of the elasticsearch service?”
“How do I get ELSER sparse vectors with adaptive allocations?”
Tell an agent
Create ELSER endpoint {elser_inference_id} for {task_type}.
Start ELSER as {task_type} endpoint {elser_inference_id} with allocation settings {service_settings}.
PUT /_inference/{task_type}/{googleaistudio_inference_id} Create a Google AI Studio inference endpoint · Create an Google AI Studio inference endpoint #
Ask an LLM
“Can I use Gemini models from Google AI Studio for completions?”
“What API key does the googleaistudio service ask for?”
Tell an agent
Create Google AI Studio endpoint {googleaistudio_inference_id} for {task_type}.
Register AI Studio Gemini model {service_settings} as {task_type} endpoint {googleaistudio_inference_id}.
PUT /_inference/{task_type}/{googlevertexai_inference_id} Create a Google Vertex AI inference endpoint · Create a Google Vertex AI inference endpoint #
Ask an LLM
“Does a Vertex AI endpoint need a GCP project ID, location and service account?”
“Can Vertex AI rerank results for my cluster?”
Tell an agent
Create Vertex AI endpoint {googlevertexai_inference_id} for {task_type}.
Connect GCP project settings {service_settings} as Vertex {task_type} endpoint {googlevertexai_inference_id}.
PUT /_inference/{task_type}/{groq_inference_id} Create a Groq inference endpoint · Create a Groq inference endpoint #
Ask an LLM
“Can I stream fast chat completions from Groq into Elasticsearch?”
“Which model name belongs in a groq service configuration?”
Tell an agent
Create Groq endpoint {groq_inference_id} for {task_type}.
Register Groq model {service_settings} as {task_type} endpoint {groq_inference_id}.
PUT /_inference/{task_type}/{huggingface_inference_id} Create a Hugging Face inference endpoint · Create a Hugging Face inference endpoint #
Ask an LLM
“Can I use a Hugging Face Inference Endpoint URL to embed documents?”
“Does the hugging_face service support reranking or chat?”
Tell an agent
Create Hugging Face endpoint {huggingface_inference_id} for {task_type}.
Point {task_type} endpoint {huggingface_inference_id} at my HF deployment URL in {service_settings}.
PUT /_inference/{task_type}/{jinaai_inference_id} Create a JinaAI inference endpoint · Create an JinaAI inference endpoint #
Ask an LLM
“Can Jina embeddings and the Jina reranker both run through one service?”
“What model ID should a jinaai endpoint use?”
Tell an agent
Create JinaAI endpoint {jinaai_inference_id} for {task_type}.
Register Jina model {service_settings} as {task_type} endpoint {jinaai_inference_id}.
PUT /_inference/{task_type}/{llama_inference_id} Create a Llama inference endpoint · Create a Llama inference endpoint #
Ask an LLM
“Can I connect a self-hosted Llama Stack server to my cluster?”
“What URL and model ID does the llama service expect?”
Tell an agent
Create Llama endpoint {llama_inference_id} for {task_type}.
Use my Llama Stack server {service_settings} as {task_type} endpoint {llama_inference_id}.
PUT /_inference/{task_type}/{mistral_inference_id} Create a Mistral inference endpoint · Create a Mistral inference endpoint #
Ask an LLM
“Can I embed text with Mistral's embedding model in Elasticsearch?”
“Which Mistral model name goes into the endpoint settings?”
Tell an agent
Create Mistral endpoint {mistral_inference_id} for {task_type}.
Register Mistral model {service_settings} as {task_type} endpoint {mistral_inference_id}.
PUT /_inference/{task_type}/{nvidia_inference_id} Create an Nvidia inference endpoint · Create an Nvidia inference endpoint #
Ask an LLM
“Can NVIDIA NIM-hosted models serve embeddings or reranking here?”
“What URL and model does the nvidia service configuration take?”
Tell an agent
Create Nvidia endpoint {nvidia_inference_id} for {task_type}.
Register NVIDIA model {service_settings} as {task_type} endpoint {nvidia_inference_id}.
PUT /_inference/{task_type}/{openai_inference_id} Create an OpenAI inference endpoint · Create an OpenAI inference endpoint #
Ask an LLM
“Can I point the openai service at an OpenAI-compatible base URL?”
“Does an OpenAI embeddings endpoint let me set the dimensions?”
Tell an agent
Create OpenAI endpoint {openai_inference_id} for {task_type}.
Register GPT or embedding model {service_settings} as {task_type} endpoint {openai_inference_id}.
PUT /_inference/{task_type}/{openshiftai_inference_id} Create an OpenShift AI inference endpoint · Create an OpenShift AI inference endpoint #
Ask an LLM
“Can a model served on Red Hat OpenShift AI back an inference endpoint?”
“What URL does the openshift_ai service need?”
Tell an agent
Create OpenShift AI endpoint {openshiftai_inference_id} for {task_type}.
Connect my OpenShift AI model server {service_settings} as {task_type} endpoint {openshiftai_inference_id}.
PUT /_inference/{task_type}/{voyageai_inference_id} Create a VoyageAI inference endpoint · Create a VoyageAI inference endpoint #
Ask an LLM
“Can VoyageAI produce embeddings and rerank results for my index?”
“Which voyage model belongs in the endpoint settings?”
Tell an agent
Create VoyageAI endpoint {voyageai_inference_id} for {task_type}.
Register Voyage model {service_settings} as {task_type} endpoint {voyageai_inference_id}.
PUT /_inference/{task_type}/{watsonx_inference_id} Create a Watsonx inference endpoint · Create a Watsonx inference endpoint #
Ask an LLM
“Does an IBM watsonx.ai endpoint need a project ID and API version?”
“Can I embed text with a watsonx model from Elasticsearch?”
Tell an agent
Create Watsonx endpoint {watsonx_inference_id} for {task_type}.
Register watsonx.ai model {service_settings} as {task_type} endpoint {watsonx_inference_id}.
POST /_inference/rerank/{inference_id} Rerank documents against a query · Perform reranking inference on the service #
Ask an LLM
“How do I reorder search results by relevance to a query with a model?”
“Can I limit reranking output to the top N documents?”
Tell an agent
Rerank {input} against the query {query} using {inference_id}.
Return only the top {top_n} of {input} for {query} via rerank endpoint {inference_id}.
POST /_inference/sparse_embedding/{inference_id} Generate sparse embeddings · Perform sparse embedding inference on the service #
Ask an LLM
“How do I turn text into sparse token-weight vectors?”
“What does the sparse embedding inference return for my text?”
Tell an agent
Generate sparse embeddings for {input} with {inference_id}.
Expand {input} into weighted tokens using sparse endpoint {inference_id}.
POST /_inference/completion/{inference_id}/_stream Stream a text completion · Perform streaming completion inference on the service #
Ask an LLM
“Can I receive a completion incrementally instead of waiting for the full answer?”
“Which services support streaming completion inference?”
Tell an agent
Stream a completion of {input} from {inference_id}.
Stream the answer to prompt {input} token by token from completion endpoint {inference_id}.
POST /_inference/text_embedding/{inference_id} Generate text embeddings · Perform text embedding inference on the service #
Ask an LLM
“How do I get text_embedding vectors for passages?”
“Can I tell the text embedding endpoint my input is a search query?”
Tell an agent
Generate text embeddings for {input} with {inference_id}.
Embed {input} as {input_type} through text_embedding endpoint {inference_id}.
PUT /_inference/{inference_id}/_update Update an inference endpoint · Update an inference endpoint #
Ask an LLM
“How do I rotate the API key stored on an existing inference endpoint?”
“Can I change num_allocations on an inference endpoint after creating it?”
Tell an agent
Update inference endpoint {inference_id} with new service settings {service_settings}.
Change the task settings on existing endpoint {inference_id} to {task_settings}.
PUT /_inference/{task_type}/{inference_id}/_update Update an inference endpoint of a task type · Update an inference endpoint #
Ask an LLM
“Can I update an endpoint's secrets when I address it by task type?”
“What settings can be modified on a task-typed endpoint I already created?”
Tell an agent
Update the {task_type} endpoint {inference_id} with service settings {service_settings}.
Modify task settings of existing {task_type} endpoint {inference_id} to {task_settings}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/elastic:elastic-inference-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

elastic-inference-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Elasticsearch Inference API
  description: 'Elasticsearch provides REST APIs that are used by the UI components and can be called directly to configure and access Elasticsearch features.

    ## Documentation source and versions

    This documentation is derived from the main branch of the elasticsearch-specification repository. It is provided under license Attribution-NonCommercial-NoDerivatives 4.0 International.

    This documentation contains work-in-progress information for future Elastic Stack releases.'
  license:
    name: Apache 2.0
    url: https://github.com/elastic/elasticsearch-specification/blob/main/LICENSE
  version: ''
security:
- apiKeyAuth: []
- basicAuth: []
- bearerAuth: []
tags:


# --- truncated at 32 KB (439 KB total) ---
# Full source: https://artifacts.apis.io/elastic/openapi/elastic-inference-api-openapi.yml