Create an OpenAI inference endpoint
- PUT /_inference/{task_type}/{openai_inference_id}
Create an inference endpoint to perform an inference task with the openai service or openai compatible APIs.
Required authorization
- Cluster privileges manage_inference
Request body
-
chunking_settingsobject -
The chunking configuration object.
- Reference
-
max_chunk_sizenumber · default: 250 -
The maximum size of a chunk in words. This value cannot be higher than
300or lower than20(forsentencestrategy) or10(forwordstrategy). -
overlapnumber · default: 100 -
The number of overlapping words for chunks. It is applicable only to a
wordchunking strategy. This value cannot be higher than half themax_chunk_sizevalue. -
servicerequired -
The type of service supported for the specified task type. In this case,
openai. -
Values:
openai -
service_settingsobjectrequired -
Settings used to install the inference model. These settings are specific to the
openaiservice. -
api_keystringrequired -
A valid API key of your OpenAI account. You can find your OpenAI API keys in your OpenAI account under the API keys section.
ImportantYou need to provide the API key only once, during the inference model creation. The get inference endpoint API does not retrieve your API key.
- External docs
-
dimensionsnumber -
The number of dimensions the resulting output embeddings should have. It is supported only in
text-embedding-3and later models. If it is not set, the OpenAI defined default for the model is used. -
model_idstringrequired -
The name of the model to use for the inference task. Refer to the OpenAI documentation for the list of available text embedding models.
- External docs
-
organization_idstring -
The unique identifier for your organization. You can find the Organization ID in your OpenAI account under Settings > Organizations.
-
rate_limitobject -
This setting helps to minimize the number of rate limit errors returned from OpenAI. The
openaiservice sets a default number of requests allowed per minute depending on the task type. Fortext_embedding, it is set to3000. Forcompletion, it is set to500.
Response
-
chunking_settingsobject -
Chunking configuration object
-
max_chunk_sizenumber · default: 250 -
The maximum size of a chunk in words. This value cannot be higher than
300or lower than20(forsentencestrategy) or10(forwordstrategy). -
overlapnumber · default: 100 -
The number of overlapping words for chunks. It is applicable only to a
wordchunking strategy. This value cannot be higher than half themax_chunk_sizevalue.