2023-09-29 16:12:07 +08:00
[role="xpack"]
[[delete-inference-api]]
=== Delete {infer} API
2025-01-01 03:32:29 +08:00
.New API reference
[sidebar]
--
For the most up-to-date API details, refer to {api-es}/group/endpoint-inference[{infer-cap} APIs].
--
2024-04-04 21:42:03 +08:00
Deletes an {infer} endpoint.
2024-10-21 15:41:55 +08:00
IMPORTANT: The {infer} APIs enable you to use certain services, such as built-in {ml} 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 {infer} APIs offer an alternative way to use and manage trained models.
However, if you do not plan to use the {infer} APIs to use these models or if you want to use non-NLP models, use the <<ml-df-trained-models-apis>>.
2024-01-09 22:46:46 +08:00
2023-09-29 16:12:07 +08:00
[discrete]
[[delete-inference-api-request]]
==== {api-request-title}
2024-03-26 15:20:34 +08:00
`DELETE /_inference/<inference_id>`
2024-03-20 19:15:21 +08:00
2024-03-26 15:20:34 +08:00
`DELETE /_inference/<task_type>/<inference_id>`
2023-09-29 16:12:07 +08:00
[discrete]
[[delete-inference-api-prereqs]]
==== {api-prereq-title}
2024-03-20 19:15:21 +08:00
* Requires the `manage_inference` <<privileges-list-cluster,cluster privilege>>
(the built-in `inference_admin` role grants this privilege)
2023-09-29 16:12:07 +08:00
[discrete]
[[delete-inference-api-path-params]]
==== {api-path-parms-title}
2024-03-26 15:20:34 +08:00
<inference_id>::
2023-09-29 16:12:07 +08:00
(Required, string)
2024-03-26 15:20:34 +08:00
The unique identifier of the {infer} endpoint to delete.
2023-09-29 16:12:07 +08:00
<task_type>::
2024-02-07 00:15:24 +08:00
(Optional, string)
2023-09-29 16:12:07 +08:00
The type of {infer} task that the model performs.
2024-06-03 23:32:31 +08:00
[discrete]
[[delete-inference-query-parms]]
== {api-query-parms-title}
`dry_run`::
(Optional, Boolean)
2024-09-26 22:09:28 +08:00
When `true`, checks the `semantic_text` fields and {infer} processors that reference the endpoint and returns them in a list, but does not delete the endpoint.
Defaults to `false`.
2024-06-03 23:32:31 +08:00
`force`::
(Optional, Boolean)
2024-09-26 22:09:28 +08:00
Deletes the endpoint regardless if it's used in a `semantic_text` field or in an {infer} pipeline.
2024-06-03 23:32:31 +08:00
2023-09-29 16:12:07 +08:00
[discrete]
[[delete-inference-api-example]]
==== {api-examples-title}
2024-02-07 00:15:24 +08:00
The following API call deletes the `my-elser-model` {infer} model that can
2023-09-29 16:12:07 +08:00
perform `sparse_embedding` tasks.
[source,console]
------------------------------------------------------------
DELETE /_inference/sparse_embedding/my-elser-model
------------------------------------------------------------
// TEST[skip:TBD]
The API returns the following response:
[source,console-result]
------------------------------------------------------------
{
"acknowledged": true
}
------------------------------------------------------------
2024-02-07 00:15:24 +08:00
// NOTCONSOLE