AuthThe Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.AvailabilityExperimentalThis functionality is experimental and is not ready for production usage. Experimental features may change or be removed at any time. Elastic will work to fix any issues, but experimental features are not subject to the support SLA of official GA features. Specific Support terms apply.Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Inference input.
Either a string, an array of strings, a content object, or an array of content objects.
content objects may contain a single item or an array of items. Models that support multiple items per content
object will return a single embedding for each content object, regardless of how many items it contains.
Support for multiple items in a single content object is available in Elasticsearch 9.5.0 and later.
Multiple items in one content object example (available in Elasticsearch 9.5.0 and later):
Text
"input": [
{
"content": [
{
"type": "image",
"format": "base64",
"value": "data:image/jpeg;base64,..."
},
{
"type": "text",
"value": "Some text to create an embedding"
}
]
}
]
One of:
Allows specifying text-only inputs for the embedding task.
Allows specifying multimodal inputs for the embedding task.
One of:
{}EmbeddingContentObject[]
A wrapper object which contains the fields required to specify multimodal inputs
contentuniononeOfrequired
An object or an array of objects containing the input data for the model to embed
objectorobject[]
typeenumrequired
The type of input to embed. Not all models support all input types.
The audio, video, and pdf types are available in Elasticsearch 9.5.0 and later.
Values:textimageaudiovideopdf
formatenum
The format of the input. For the text type this must be text. For all other types, this must be base64 or url.
If not specified, this will default to text for the text type and base64 for all other types.
The url format is available in Elasticsearch 9.6.0 and later.
Not all services and models support all formats.
Values:textbase64url
valuestringrequired
The value of the input to embed. For the base64 format, this must be a base64-encoded data URI, i.e. "data:content/type;base64,...".
For the url format, this must be a URL that points to the content, i.e. "https://example.com/image.jpg".
A wrapper object which contains the fields required to specify multimodal inputs
contentuniononeOfrequired
An object or an array of objects containing the input data for the model to embed
objectorobject[]
typeenumrequired
The type of input to embed. Not all models support all input types.
The audio, video, and pdf types are available in Elasticsearch 9.5.0 and later.
Values:textimageaudiovideopdf
formatenum
The format of the input. For the text type this must be text. For all other types, this must be base64 or url.
If not specified, this will default to text for the text type and base64 for all other types.
The url format is available in Elasticsearch 9.6.0 and later.
Not all services and models support all formats.
Values:textbase64url
valuestringrequired
The value of the input to embed. For the base64 format, this must be a base64-encoded data URI, i.e. "data:content/type;base64,...".
For the url format, this must be a URL that points to the content, i.e. "https://example.com/image.jpg".
input_typestring
The input data type for the embedding model. Possible values include:
SEARCH
INGEST
CLASSIFICATION
CLUSTERING
Not all models support all values. Unsupported values will trigger a validation exception.
Accepted values depend on the configured inference service, refer to the relevant service-specific documentation for more info.
Note
The input_type parameter specified on the root level of the request body will take precedence over the input_type parameter specified in task_settings.
task_settingsobject
Task settings for the individual inference request. These settings are specific to the <task_type> you specified and override the task settings specified when initializing the service.