---
type: api
title: 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).
url: https://www.elastic.co/elastic/docs-builder/docs/4850/api/doc/elasticsearch-serverless/operation/operation-inference-get
resource: https://www.elastic.co/elastic/docs-builder/docs/4850/api/doc/elasticsearch-serverless/operation/operation-inference-get
products:
  - Elasticsearch Serverless
---

# Get an inference endpoint

Authentication: required

## Paths

- `GET` `/_inference/{task_type}/{inference_id}`
- `GET` `/_inference/{task_type}/_all`
- `GET` `/_inference/{inference_id}`
- `GET` `/_inference`

#### Path parameters

- `task_type` (enum) — optional, leave it out to use `/_inference`
  The task type of the endpoint to return
  Values: `sparse_embedding`, `text_embedding`, `rerank`, `completion`, `chat_completion`, `embedding`, `document_extraction`, `decision`
- `inference_id` (string) — optional, leave it out to use `/_inference`
  The inference Id of the endpoint to return. Using `_all` or `*` will return all endpoints with the specified
`task_type` if one is specified, or all endpoints for all task types if no `task_type` is specified

## Description

This API requires the `monitor_inference` cluster privilege (the built-in `inference_admin` and `inference_user` roles grant this privilege).

## Required privileges

- Cluster privileges: `monitor_inference`

## Response

`application/json`

- `endpoints` (object[])
  - `chunking_settings` (object)
    The chunking configuration object.
Applies only to the `embedding`, `sparse_embedding` and `text_embedding` task types.
Not applicable to the `rerank`, `completion`, or `chat_completion` task types.
    - `max_chunk_size` (number · default: 250)
      The maximum size of a chunk in words.
This value cannot be lower than `20` (for `sentence` strategy) or `10` (for `word` strategy).
This value should not exceed the window size for the associated model.
    - `overlap` (number · default: 100)
      The number of overlapping words for chunks.
It is applicable only to a `word` chunking strategy.
This value cannot be higher than half the `max_chunk_size` value.
    - `sentence_overlap` (number · default: 1)
      The number of overlapping sentences for chunks.
It is applicable only for a `sentence` chunking strategy.
It can be either `1` or `0`.
    - `separator_group` (string)
      Only applicable to the `recursive` strategy and required when using it.

Sets a predefined list of separators in the saved chunking settings based on the selected text type.
Values can be `markdown` or `plaintext`.

Using this parameter is an alternative to manually specifying a custom `separators` list.
    - `separators` (string[])
      Only applicable to the `recursive` strategy and required when using it.

A list of strings used as possible split points when chunking text.

Each string can be a plain string or a regular expression (regex) pattern.
The system tries each separator in order to split the text, starting from the first item in the list.

After splitting, it attempts to recombine smaller pieces into larger chunks that stay within
the `max_chunk_size` limit, to reduce the total number of chunks generated.
    - `strategy` (string · default: sentence)
      The chunking strategy: `sentence`, `word`, `none` or `recursive`.

 * If `strategy` is set to `recursive`, you must also specify:

- `max_chunk_size`
- either `separators` or`separator_group`

Learn more about different chunking strategies in the linked documentation.
  - `service` (string)
    The service type
  - `service_settings` (object)
    Settings specific to the service
  - `task_settings` (object)
    Task settings specific to the service and task type
  - `inference_id` (string)
    The inference Id
  - `task_type` (enum)
    The task type
    Values: `sparse_embedding`, `text_embedding`, `rerank`, `completion`, `chat_completion`, `embedding`, `document_extraction`, `decision`
  - `metadata` (object)
    Metadata about the endpoint, such as the model it serves, where it is available and what it supports.
It is returned for the endpoints of the Elastic Inference Service.
    - `heuristics` (object)
      Properties of the endpoint that help clients to determine which model to use.
      - `properties` (string[])
        Tags that describe the properties of the model, for example `multilingual`, `english` or `multimodal`.
      - `status` (enum)
        The release status of the model.
        Values: `beta`, `preview`, `ga`, `deprecated`
      - `release_date` (string)
        The date on which the model was released, in `yyyy-MM-dd` format.
      - `end_of_life_date` (string)
        The date on which the model reaches the end of its life, in `yyyy-MM-dd` format.
    - `display` (object)
      Information to display for the endpoint.
      - `name` (string)
        The name to display for the endpoint.
      - `model_creator` (string)
        The creator of the model, for display purposes.
    - `model_identity` (object)
      The identity of the model that the endpoint serves.
      - `creator` (string)
        The model creator or lab, for example `anthropic`, `openai` or `jina`.
      - `family` (string)
        The model family within the creator, for example `claude`, `gpt` or `gemini`.
      - `tier` (string)
        The performance or size tier within the family, for example `sonnet` or `mini`.
It is not set if the model has no tier variants.
      - `version` (string)
        The version of the model.
    - `regions` (object[])
      The regions in which the endpoint is available.
      - `csp` (string)
        The cloud service provider, for example `aws`, `gcp` or `azure`.
      - `region` (string)
        The region of the cloud service provider, for example `us-east-1`.
      - `geo` (string)
        The geographic area, for example `us` or `eu`.
      - `region_display_name` (string)
        The human-readable name of the region.
    - `denied_by_region_policy` (boolean)
      If `true`, the region policy of the caller prohibits access to the endpoint.
    - `capabilities` (object)
      The capabilities of the endpoint.
      - `reasoning` (object)
        The reasoning support of the endpoint.
        - `supported_effort_levels` (enum[])
          The reasoning effort levels that the endpoint supports.
          Values: `xhigh`, `high`, `medium`, `low`, `minimal`, `none`
        - `default_effort_level` (enum)
          The reasoning effort level that the endpoint uses by default.
          Values: `xhigh`, `high`, `medium`, `low`, `minimal`, `none`
      - `context_window` (object)
        The context window of the model.
        - `max_input_tokens` (number)
          The maximum number of input tokens that the model accepts.
        - `max_output_tokens` (number)
          The maximum number of output tokens that the model generates.
      - `templates` (object)
        The prompt template support of the endpoint.
It is returned only for chat completion endpoints that require a template instead of caller-authored messages.
        - `policy` (enum)
          Whether the endpoint requires chat completion requests to carry a prompt template.
Elasticsearch displays the policy so that clients can choose the request shape, but it doesn't enforce it.
          Values: `required`
## Code examples

#### Console

```console
GET _inference/sparse_embedding/my-elser-model
```

#### JavaScript

```javascript
const response = await client.inference.get({
  task_type: "sparse_embedding",
  inference_id: "my-elser-model",
});
```

#### Python

```python
resp = client.inference.get(
    task_type="sparse_embedding",
    inference_id="my-elser-model",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_inference/sparse_embedding/my-elser-model" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.inference().get(g -> g
    .inferenceId("my-elser-model")
    .taskType(TaskType.SparseEmbedding)
);
```

#### C#

```c#
var response = await client.Inference
    .GetAsync(d1 => d1
        .InferenceId("my-elser-model")
        .TaskType(TaskType.SparseEmbedding)
    );
```

#### PHP

```php
$resp = $client->inference()->get([
    "task_type" => "sparse_embedding",
    "inference_id" => "my-elser-model",
]);
```

#### Ruby

```ruby
response = client.inference.get(
  task_type: "sparse_embedding",
  inference_id: "my-elser-model"
)
```

## Response examples

#### 200

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "endpoints": [
    {
      "chunking_settings": {
        "max_chunk_size": 250,
        "overlap": 100,
        "sentence_overlap": 1,
        "separator_group": "string",
        "separators": [
          "string"
        ],
        "strategy": "sentence"
      },
      "service": "string",
      "service_settings": {},
      "task_settings": {},
      "inference_id": "string",
      "task_type": "sparse_embedding",
      "metadata": {
        "heuristics": {
          "properties": [
            "string"
          ],
          "status": "beta",
          "release_date": "string",
          "end_of_life_date": "string"
        },
        "display": {
          "name": "string",
          "model_creator": "string"
        },
        "model_identity": {
          "creator": "string",
          "family": "string",
          "tier": "string",
          "version": "string"
        },
        "regions": [
          {
            "csp": "string",
            "region": "string",
            "geo": "string",
            "region_display_name": "string"
          }
        ],
        "denied_by_region_policy": false,
        "capabilities": {
          "reasoning": {},
          "context_window": {
            "max_input_tokens": 0,
            "max_output_tokens": 0
          },
          "templates": {}
        }
      }
    }
  ]
}
```

