Elastic Stack (ELK Stack) Inference API
The inference API from Elastic Stack (ELK Stack) — 40 operation(s) for inference.
The inference API from Elastic Stack (ELK Stack) — 40 operation(s) for inference.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
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.curl "https://apis.io/api/v1/apis/elk-stack-inference-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
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. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Elasticsearch Request & Response Specification Inference API
license:
name: Apache 2.0
url: https://github.com/elastic/elasticsearch-specification/blob/main/LICENSE
version: ''
tags:
- name: inference
paths:
/_inference/chat_completion/{inference_id}/_stream:
post:
tags:
- inference
summary: Perform chat completion inference on the service
description: 'The chat completion inference API enables real-time responses for chat completion tasks by delivering answers incrementally, reducing response times during computation.
It only works with the `chat_completion` task type.
NOTE: The `chat_completion` task type is only available within the _stream API and only supports streaming.
The Chat completion inference API and the Stream inference API differ in their response structure and capabilities.
The Chat completion inference API provides more comprehensive customization options through more fields and function calling support.
To determine whether a given inference service supports this task type, please see the page for that service.'
operationId: inference-chat-completion-unified
parameters:
- in: path
name: inference_id
description: The inference Id
required: true
deprecated: false
schema:
$ref: '#/components/schemas/_types.Id'
style: simple
- in: query
name: timeout
description: Specifies the amount of time to wait for the inference request to complete.
deprecated: false
schema:
default: 120s
allOf:
- $ref: '#/components/schemas/_types.Duration'
style: form
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/inference._types.RequestChatCompletion'
examples:
PostChatCompletionRequestExample1:
summary: A chat completion task
description: Run `POST _inference/chat_completion/openai-completion/_stream` to perform a chat completion on the example question with streaming.
value: "{\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n}"
PostChatCompletionRequestExample2:
summary: A chat completion task with tool_calls
description: Run `POST _inference/chat_completion/openai-completion/_stream` to perform a chat completion using an Assistant message with `tool_calls`.
value: "{\n \"messages\": [\n {\n \"role\": \"assistant\",\n \"content\": \"Let's find out what the weather is\",\n \"tool_calls\": [ \n {\n \"id\": \"call_KcAjWtAww20AihPHphUh46Gd\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"arguments\": \"{\\\"location\\\":\\\"Boston, MA\\\"}\"\n }\n }\n ]\n },\n { \n \"role\": \"tool\",\n \"content\": \"The weather is cold\",\n \"tool_call_id\": \"call_KcAjWtAww20AihPHphUh46Gd\"\n }\n ]\n}"
PostChatCompletionRequestExample3:
summary: A chat completion task with tools and tool_calls
description: Run `POST _inference/chat_completion/openai-completion/_stream` to perform a chat completion using a User message with `tools` and `tool_choice`.
value: "{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What's the price of a scarf?\"\n }\n ]\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\",\n \"description\": \"Get the current price of a item\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"id\": \"123\"\n }\n }\n }\n }\n }\n ],\n \"tool_choice\": {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\"\n }\n }\n}"
PostChatCompletionRequestExample4:
summary: A chat completion task with `effort` parameter defined reasoning
description: Run `POST _inference/chat_completion/reasoning-chat-completion/_stream` to perform a chat completion task, using both `effort` parameter based reasoning configuration and including reasoning generated by the model on previous step.
value: "{\n \"messages\": [{\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n }, {\n \"role\": \"assistant\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [{\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n }, {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n }, {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n }, {\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"effort\": \"high\",\n \"summary\": \"detailed\",\n \"exclude\": false\n }\n}"
PostChatCompletionRequestExample5:
summary: A chat completion task with `enabled` parameter defined reasoning
description: Run `POST _inference/chat_completion/reasoning-chat-completion/_stream` to perform a chat completion task, using both `enabled` parameter based reasoning configuration and including reasoning generated by the model on previous step.
value: "{\n \"messages\": [{\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"Barber shaves all those, who do not shave themselves. Who shaves the barber?\"\n }\n ]\n }, {\n \"role\": \"assistant\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"This is the barber paradox. Such a barber cannot logically exist.\"\n }\n ],\n \"reasoning\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"reasoning_details\": [{\n \"type\": \"reasoning.encrypted\",\n \"data\": \"[REDACTED]\"\n }, {\n \"type\": \"reasoning.summary\",\n \"summary\": \"Barber shaving himself creates contradiction\"\n }, {\n \"type\": \"reasoning.text\",\n \"text\": \"If the barber shaves himself, he should not; if he does not, he should.\",\n \"signature\": \"sig_123\"\n }\n ]\n }, {\n \"role\": \"user\",\n \"content\": [{\n \"type\": \"text\",\n \"text\": \"What if there are 2 barbers?\"\n }\n ]\n }\n ],\n \"reasoning\": {\n \"enabled\": true,\n \"summary\": \"detailed\",\n \"exclude\": false\n }\n}"
required: true
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/_types.StreamResult'
examples:
PostChatCompletionResponseExample1:
description: A successful response when performing a chat completion task using a User message with `tools` and `tool_choice`.
value: "event: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\"choices\":[{\"delta\":{\"content\":\"\",\"role\":\"assistant\"},\"index\":0}],\"model\":\"gpt-4o-2024-08-06\",\"object\":\"chat.completion.chunk\"}}\n\nevent: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\"choices\":[{\"delta\":{\"content\":Elastic\"},\"index\":0}],\"model\":\"gpt-4o-2024-08-06\",\"object\":\"chat.completion.chunk\"}}\n\nevent: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\"choices\":[{\"delta\":{\"content\":\" is\"},\"index\":0}],\"model\":\"gpt-4o-2024-08-06\",\"object\":\"chat.completion.chunk\"}}\n\n(...)\n\nevent: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\"choices\":[],\"model\":\"gpt-4o-2024-08-06\",\"object\":\"chat.completion.chunk\",\"usage\":{\"completion_tokens\":28,\"prompt_tokens\":16,\"total_tokens\":44}}} \n\nevent: message\ndata: [DONE]"
PostChatCompletionResponseExample2:
description: A successful response when performing a chat completion task with response-level reasoning data.
value: 'event: message
data: {"chat_completion":{"id":"chatcmpl-910TWsy2VPnSfBbv5UztnSdYUJA10","choices":[{"delta":{"content":"With two barbers, the paradox disappears.","role":"assistant"},"index":0,"reasoning":"The contradiction only occurs when a barber must determine whether to shave himself.","reasoning_details":[{"type":"reasoning.encrypted","data":"[REDACTED]"},{"type":"reasoning.summary","summary":"Two barbers can shave each other."},{"type":"reasoning.text","text":"The contradiction only occurs when a barber must determine whether to shave himself.","signature":"sig_example"}]}],"model":"openai-gpt-oss-120b","object":"chat.completion.chunk"}}
event: message
data: {"chat_completion":{"id":"chatcmpl-910TWsy2VPnSfBbv5UztnSdYUJA10","choices":[{"delta":{"summary":"Each barber can shave the other, so neither needs to shave himself.","role":"assistant"},"index":0,"reasoning":"With two barbers, they can shave each other.","reasoning_details":[{"type":"reasoning.encrypted","data":"[REDACTED]"},{"type":"reasoning.summary","summary":"avoiding the self-reference paradox"},{"type":"reasoning.text","format":"some_text_reasoning_detail_format","text":"With two barbers, they can shave each other.","signature":"sig_example"}]}],"model":"openai-gpt-oss-120b","object":"chat.completion.chunk"}}
(...)
event: message
data: {"chat_completion":{"id":"chatcmpl-910TWsy2VPnSfBbv5UztnSdYUJA10","choices":[],"model":"openai-gpt-oss-120b","object":"chat.completion.chunk","usage":{"completion_tokens":28,"prompt_tokens":16,"total_tokens":44,"completion_tokens_details":{"reasoning_tokens":10}}}}
event: message
data: [DONE]'
x-state: Generally available; Added in 8.18.0
x-metaTags:
- content: Elasticsearch, Machine Learning
name: product_name
/_inference/completion/{inference_id}:
post:
tags:
- inference
summary: Perform completion inference on the service
description: 'Get responses for completion tasks.
This API works only with the completion task type.
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, Azure, 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.
This API requires the `monitor_inference` cluster privilege (the built-in `inference_admin` and `inference_user` roles grant this privilege).'
operationId: inference-completion
parameters:
- in: path
name: inference_id
description: The inference Id
required: true
deprecated: false
schema:
$ref: '#/components/schemas/_types.Id'
style: simple
- in: query
name: timeout
description: Specifies the amount of time to wait for the inference request to complete.
deprecated: false
schema:
default: 120s
allOf:
- $ref: '#/components/schemas/_types.Duration'
style: form
requestBody:
content:
application/json:
schema:
type: object
properties:
input:
description: 'Inference input.
Either a string or an array of strings.'
oneOf:
- type: string
- type: array
items:
type: string
task_settings:
description: Task settings for the individual inference request. These settings are specific to the <task_type> you specified and override the task settings specified when initializing the service.
allOf:
- $ref: '#/components/schemas/inference._types.TaskSettings'
required:
- input
examples:
CompletionRequestExample1:
summary: Completion task
description: Run `POST _inference/completion/openai_completions` to perform a completion on the example question.
value: "{\n \"input\": \"What is Elastic?\"\n}"
required: true
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/inference._types.CompletionInferenceResult'
examples:
CompletionResponseExample1:
summary: Completion task
description: 'A successful response from `POST _inference/completion/openai_completions`.
'
value: "{\n \"completion\": [\n {\n \"result\": \"Elastic is a company that provides a range of software solutions for search, logging, security, and analytics. Their flagship product is Elasticsearch, an open-source, distributed search engine that allows users to search, analyze, and visualize large volumes of data in real-time. Elastic also offers products such as Kibana, a data visualization tool, and Logstash, a log management and pipeline tool, as well as various other tools and solutions for data analysis and management.\"\n }\n ]\n}"
x-state: Generally available; Added in 8.11.0
x-metaTags:
- content: Elasticsearch, Machine Learning
name: product_name
/_inference/{inference_id}:
get:
tags:
- inference
summary: Get an inference endpoint
description: This API requires the `monitor_inference` cluster privilege (the built-in `inference_admin` and `inference_user` roles grant this privilege).
operationId: inference-get-1
parameters:
- $ref: '#/components/parameters/inference.get-inference_id'
responses:
'200':
$ref: '#/components/responses/inference.get-200'
x-state: Generally available; Added in 8.11.0
x-metaTags:
- content: Elasticsearch, Machine Learning
name: product_name
put:
tags:
- inference
summary: Create an inference endpoint
description: '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:
* AI21 (`chat_completion`, `completion`)
* AlibabaCloud AI Search (`completion`, `rerank`, `sparse_embedding`, `text_embedding`)
* Amazon Bedrock (`chat_completion`, `completion`, `text_embedding`)
* Amazon SageMaker (`chat_completion`, `completion`, `rerank`, `sparse_embedding`, `text_embedding`)
* Anthropic (`chat_completion`, `completion`)
* Azure AI Studio (`completion`, `rerank`, `text_embedding`)
* Azure OpenAI (`chat_completion`, `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`)
* Fireworks AI (`chat_completion`, `completion`, `text_embedding`)
* Google AI Studio (`completion`, `text_embedding`)
* Google Vertex AI (`chat_completion`, `completion`, `rerank`, `text_embedding`)
* Groq (`chat_completion`)
* Hugging Face (`chat_completion`, `completion`, `rerank`, `text_embedding`)
* JinaAI (`embedding`, `rerank`, `text_embedding`)
* Llama (`chat_completion`, `completion`, `text_embedding`)
* Mistral (`chat_completion`, `completion`, `text_embedding`)
* Nvidia (`chat_completion`, `completion`, `text_embedding`, `rerank`)
* OpenAI (`chat_completion`, `completion`, `text_embedding`)
* OpenShift AI (`chat_completion`, `completion`, `rerank`, `text_embedding`)
* VoyageAI (`rerank`, `text_embedding`)
* Watsonx (`chat_completion`, `completion`, `rerank`, `text_embedding`)
## Required authorization
* Cluster privileges: `manage_inference`
'
operationId: inference-put
parameters:
- $ref: '#/components/parameters/inference.put-inference_id'
- $ref: '#/components/parameters/inference.put-timeout'
requestBody:
$ref: '#/components/requestBodies/inference.put'
responses:
'200':
$ref: '#/components/responses/inference.put-200'
x-state: Generally available; Added in 8.11.0
x-metaTags:
- content: Elasticsearch, Machine Learning
name: product_name
post:
tags:
- inference
summary: Perform inference on the service
description: 'This API enables you to use machine learning models to perform specific tasks on data that you provide as an input.
It returns a response with the results of the tasks.
The inference endpoint you use can perform one specific task that has been defined when the endpoint was created with the create inference API.
For details about using this API with a service, such as Amazon Bedrock, Anthropic, or HuggingFace, refer to the service-specific documentation.
> info
> The 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, 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.
## Required authorization
* Cluster privileges: `monitor_inference`
'
operationId: inference-inference
parameters:
- $ref: '#/components/parameters/inference.inference-inference_id'
- $ref: '#/components/parameters/inference.inference-timeout'
requestBody:
$ref: '#/components/requestBodies/inference.inference'
responses:
'200':
$ref: '#/components/responses/inference.inference-200'
x-state: Generally available; Added in 8.11.0
x-metaTags:
- content: Elasticsearch, Machine Learning
name: product_name
delete:
tags:
- inference
summary: Delete an inference endpoint
description: This API requires the manage_inference cluster privilege (the built-in `inference_admin` role grants this privilege).
operationId: inference-delete
parameters:
- $ref: '#/components/parameters/inference.delete-inference_id'
- $ref: '#/components/parameters/inference.delete-dry_run'
- $ref: '#/components/parameters/inference.delete-force'
responses:
'200':
$ref: '#/components/responses/inference.delete-200'
x-state: Generally available; Added in 8.11.0
x-metaTags:
- content: Elasticsearch, Machine Learning
name: product_name
/_inference/{task_type}/{inference_id}:
get:
tags:
- inference
summary: Get an inference endpoint
description: This API requires the `monitor_inference` cluster privilege (the built-in `inference_admin` and `inference_user` roles grant this privilege).
operationId: inference-get-2
parameters:
- $ref: '#/components/parameters/inference.get-task_type'
- $ref: '#/components/parameters/inference.get-inference_id'
responses:
'200':
$ref: '#/components/responses/inference.get-200'
x-state: Generally available; Added in 8.11.0
x-metaTags:
- content: Elasticsearch, Machine Learning
name: product_name
put:
tags:
- inference
summary: Create an inference endpoint
description: '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:
* AI21 (`chat_completion`, `completion`)
* AlibabaCloud AI Search (`completion`, `rerank`, `sparse_embedding`, `text_embedding`)
* Amazon Bedrock (`chat_completion`, `completion`, `text_embedding`)
* Amazon SageMaker (`chat_completion`, `completion`, `rerank`, `sparse_embedding`, `text_embedding`)
* Anthropic (`chat_completion`, `completion`)
* Azure AI Studio (`completion`, `rerank`, `text_embedding`)
* Azure OpenAI (`chat_completion`, `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`)
* Fireworks AI (`chat_completion`, `completion`, `text_embedding`)
* Google AI Studio (`completion`, `text_embedding`)
* Google Vertex AI (`chat_completion`, `completion`, `rerank`, `text_embedding`)
* Groq (`chat_completion`)
* Hugging Face (`chat_completion`, `completion`, `rerank`, `text_embedding`)
* JinaAI (`embedding`, `rerank`, `text_embedding`)
* Llama (`chat_completion`, `completion`, `text_embedding`)
* Mistral (`chat_completion`, `completion`, `text_embedding`)
* Nvidia (`chat_completion`, `completion`, `text_embedding`, `rerank`)
* OpenAI (`chat_completion`, `completion`, `text_embedding`)
* OpenShift AI (`chat_completion`, `completion`, `rerank`, `text_embedding`)
* VoyageAI (`rerank`, `text_embedding`)
* Watsonx (`chat_completion`, `completion`, `rerank`, `text_embedding`)
## Required authorization
* Cluster privileges: `manage_inference`
'
operationId: inference-put-1
parameters:
- $ref: '#/components/parameters/inference.put-task_type'
- $ref: '#/components/parameters/inference.put-inference_id'
- $ref: '#/components/parameters/inference.put-timeout'
requestBody:
$ref: '#/components/requestBodies/inference.put'
responses:
'200':
$ref: '#/components/responses/inference.put-200'
x-state: Generally available; Added in 8.11.0
x-metaTags:
- content: Elasticsearch, Machine Learning
name: product_name
post:
tags:
- inference
summary: Perform inference on the service
description: 'This API enables you to use machine learning models to perform specific tasks on data that you provide as an input.
It returns a response with the results of the tasks.
The inference endpoint you use can perform one specific task that has been defined when the endpoint was created with the create inference API.
For details about using this API with a service, such as Amazon Bedrock, Anthropic, or HuggingFace, refer to the service-specific documentation.
> info
> The 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, 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.
## Required authorization
* Cluster privileges: `monitor_inference`
'
operationId: inference-inference-1
parameters:
- $ref: '#/components/parameters/inference.inference-task_type'
- $ref: '#/components/parameters/inference.inference-inference_id'
- $ref: '#/components/parameters/inference.inference-timeout'
requestBody:
$ref: '#/components/requestBodies/inference.inference'
responses:
'200':
$ref: '#/components/responses/inference.inference-200'
x-state: Generally available; Added in 8.11.0
x-metaTags:
- content: Elasticsearch, Machine Learning
name: product_name
delete:
tags:
- inference
summary: Delete an inference endpoint
description: This API requires the manage_inference cluster privilege (the built-in `inference_admin` role grants this privilege).
operationId: inference-delete-1
parameters:
- $ref: '#/components/parameters/inference.delete-task_type'
- $ref: '#/components/parameters/inference.delete-inference_id'
- $ref: '#/components/parameters/inference.delete-dry_run'
- $ref: '#/components/parameters/inference.delete-force'
responses:
'200':
$ref: '#/components/responses/inference.delete-200'
x-state: Generally available; Added in 8.11.0
x-metaTags:
- content: Elasticsearch, Machine Learning
name: product_name
/_inference/_region_policy:
get:
tags:
- inference
summary: Get the inference region policy
description: '
## Required authorization
* Cluster privileges: `monitor_inference`
'
operationId: inference-get-region-policy
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/inference._types.RegionPolicyDoc'
examples:
GetRegionPolicyResponseExample1:
summary: The configured region policy
description: A successful response when retrieving the currently configured region policy.
value: "{\n \"region_policy\": {\n \"allowed_geos\": [\"us\", \"eu\"]\n },\n \"created_at\": \"2026-07-13T12:00:00.000Z\",\n \"created_by\": \"inference_user\",\n \"updated_at\": \"2026-07-13T13:30:00.000Z\",\n \"updated_by\": \"inference_user\"\n}"
x-state: Generally available; Added in 9.5.0
x-metaTags:
- content: Elasticsearch, Machine Learning
name: product_name
put:
tags:
- inference
summary: Create or update the inference region policy
description: 'The region policy restricts inference to a set of allowed geographic areas or cloud service provider regions.
## Required authorization
* Cluster privileges: `manage_inference`
'
operationId: inference-put-region-policy
parameters:
- in: query
name: force
description: If `true`, the region policy is applied even if it would deny access to inference endpoints that are currently in use by ingest pipeline or indices.
deprecated: false
schema:
default: false
type: boolean
style: form
requestBody:
content:
application/json:
schema:
type: object
properties:
region_policy:
description: The region policy configuration.
allOf:
- $ref: '#/components/schemas/inference._types.RegionPolicy'
required:
- region_policy
examples:
PutRegionPolicyRequestExample1:
summary: A region policy allowing specific cloud service provider regions
description: Run `PUT _inference/_region_policy` to restrict inference to a specific set of cloud service provider regions.
value: "{\n \"region_policy\": {\n \"allowed_regions\": [\n { \"csp\": \"aws\", \"region\": \"us-east-1\" },\n { \"csp\": \"aws\", \"region\": \"eu-west-1\" }\n ]\n }\n}"
PutRegionPolicyRequestExample2:
summary: A region policy allowing specific geographic areas
description: Run `PUT _inference/_region_policy` to restrict inference to a specific set of geographic areas.
value: "{\n \"region_policy\": {\n \"allowed_geos\": [\"us\", \"eu\"]\n }\n}"
required: true
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/inference._types.RegionPolicyDoc'
examples:
PutRegionPolicyResponseExample1:
summary: A region policy allowing specific cloud service provider regions
description: A successful response when creating a region policy that allows specific cloud service provider regions.
value: "{\n \"region_policy\": {\n \"allowed_regions\": [\n { \"csp\": \"aws\", \"region\": \"us-east-1\" },\n { \"csp\": \"aws\", \"region\": \"eu-west-1\" }\n ]\n },\n \"created_at\": \"2026-07-13T12:00:00.000Z\",\n \"created_by\": \"inference_user\"\n}"
x-state: Generally available; Added in 9.5.0
x-metaTags:
- content: Elasticsearch, Machine Learning
name: product_name
delete:
tags:
- inference
summary: Delete the inference region policy
description: '
## Required authorization
* Cluster privileges: `manage_inference`
'
operationId: inference-delete-region-policy
responses:
'200':
description: ''
content:
application/json:
schema
# --- truncated at 32 KB (380 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/elk-stack/refs/heads/main/openapi/elk-stack-inference-api-openapi.yml