---
type: api
title: Get an inference endpoint
description: **All methods and paths for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch-serverless/operation/operation-inference-get
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch-serverless/operation/operation-inference-get
products:
  - Elasticsearch Serverless
---

# Get an inference endpoint


Availability:

## Paths

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

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch-serverless/authentication#apikeyauth)

#### Path Parameters

- `task_type` (enum TaskType) — 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`
- `inference_id` (string Id) — 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).

## Response

`application/json`

- `endpoints` ([] InferenceEndpointInfo)
  - `chunking_settings` ({} InferenceChunkingSettings)
    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` (ServiceSettings)
    Settings specific to the service
  - `task_settings` (TaskSettings)
    Task settings specific to the service and task type
  - `inference_id` (string)
    The inference Id
  - `task_type` (enum TaskType)
    The task type
    Values: `sparse_embedding`, `text_embedding`, `rerank`, `completion`, `chat_completion`, `embedding`
## 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"
)
```

