Connect to models from Model Studio and call model services in Elasticsearch using the Inference API.
Billing
This service is pay-as-you-go. You are charged only for the API calls you make.
Create a model
Log on to the Alibaba Cloud Elasticsearch console.
In the left navigation menu, choose Elasticsearch Clusters.
Navigate to the target cluster.
In the top navigation bar, select the resource group to which the cluster belongs and the region where the cluster resides.
On the Elasticsearch Clusters page, find the cluster and click its ID.
-
In the left-side navigation pane, choose .
-
Go to the Model Studio Model tab. The system has pre-configured a default model service space (default), with the model API key and service endpoint generated automatically. No manual configuration is required.
-
Click Initialize Model to integrate all Model Studio models available in the current region into the instance in a single operation. After integration, the corresponding models in the model list can be called using the Inference API.
ImportantDo not delete or disable the default model service space in the AI Search Open Platform. Otherwise, the corresponding models in the model list will become unavailable.
Usage examples
Text embedding
# text_embedding is the model category ID; text-embedding-v4 is the model ID in the console model list.
POST _inference/text_embedding/text-embedding-v4
{
"input":[
"风急天高猿啸哀",
"渚清沙白鸟飞回",
"无边落木萧萧下",
"不尽长江滚滚来"
]
}
Sample response:
{
"text_embedding": [
{
"embedding": [
0.049183346,
-0.068886764,
0.047604065,
-0.06778378,
-0.009488225,
-0.0791145,
-0.006082115,
0.057004552,
...
]
}
]
}
Multimodal embedding
# multi_modal_embedding is the model category ID; qwen3-vl-embedding is the model ID in the console model list.
POST _inference/multi_modal_embedding/qwen3-vl-embedding
{
"input":"""
{"text":"多模态向量模型"},
{"image":"https://img.alicdn.com/imgextra/i3/O1CN01rdstgY1uiZWt8gqSL_!!6000000006071-0-tps-1970-356.jpg"},
{"video":"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250107/lbcemt/new+video.mp4"},
{"multi_images":[
"https://img.alicdn.com/imgextra/i2/O1CN019eO00F1HDdlU4Syj5_!!6000000000724-2-tps-2476-1158.png",
"https://img.alicdn.com/imgextra/i2/O1CN01dSYhpw1nSoamp31CD_!!6000000005089-2-tps-1765-1639.png"
]}
"""
}
Sample response:
{
"text_embedding": [
{
"embedding": [
-0.014518738,
-0.014297485,
-0.056121826,
0.043823242,
0.01889038,
0.04547119,
...
]
}
]
}
Chat (completion)
# completion is the model category ID; qwen-plus is the model ID in the console model list.
POST _inference/completion/qwen-plus
{
"input":"你是谁"
}
Sample response:
{
"completion": [
{
"result": "Hello! I am Qwen, a large language model from Alibaba Group. I can answer questions, create text such as stories, official documents, emails, and scripts, perform logical reasoning, write code, express opinions, and play games. If you have any questions or need help, feel free to ask me anytime!"
}
]
}