Update an inference endpoint
Generally available; Added in 8.17.0
Modify task_settings
, secrets (within service_settings
), or num_allocations
for an inference endpoint, depending on the specific endpoint service and 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.
Required authorization
- Cluster privileges:
manage_inference
PUT
/_inference/{inference_id}/_update
Console
PUT _inference/my-inference-endpoint/_update
{
"service_settings": {
"api_key": "<API_KEY>"
}
}
resp = client.inference.update(
inference_id="my-inference-endpoint",
inference_config={
"service_settings": {
"api_key": "<API_KEY>"
}
},
)
const response = await client.inference.update({
inference_id: "my-inference-endpoint",
inference_config: {
service_settings: {
api_key: "<API_KEY>",
},
},
});
response = client.inference.update(
inference_id: "my-inference-endpoint",
body: {
"service_settings": {
"api_key": "<API_KEY>"
}
}
)
$resp = $client->inference()->update([
"inference_id" => "my-inference-endpoint",
"body" => [
"service_settings" => [
"api_key" => "<API_KEY>",
],
],
]);
curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '{"service_settings":{"api_key":"<API_KEY>"}}' "$ELASTICSEARCH_URL/_inference/my-inference-endpoint/_update"
Request example
An example body for a `PUT _inference/my-inference-endpoint/_update` request.
{
"service_settings": {
"api_key": "<API_KEY>"
}
}