---
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/v8/operation/operation-inference-get
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-inference-get
products:
  - Elasticsearch
---

# Get an inference endpoint


Availability: 8.11+

## 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/v8/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#bearerauth)

#### 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`
- `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

## Response

`application/json`

- `endpoints` ([] InferenceEndpointInfo)
  - `chunking_settings` ({} InferenceChunkingSettings)
    Chunking configuration object
    - `max_chunk_size` (number · default: 250)
      The maximum size of a chunk in words.
This value cannot be higher than `300` or lower than `20` (for `sentence` strategy) or `10` (for `word` strategy).
    - `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`.
    - `strategy` (string · default: sentence)
      The chunking strategy: `sentence` or `word`.
  - `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`
## 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"
)
```

