Queries the detailed configuration of a specific model by instance ID and model name.
Operation description
Request description
This API retrieves the details of a specific model in an instance, such as its model type, URL, and status.
Ensure that the provided
instanceIdandmodelNameare valid. Otherwise, an error is returned or the resource cannot be found.The response includes the model content, such as request headers and parameters. It also contains the creation and update times. This information helps you understand the model's configuration and its current status.
Try it now
Test
RAM authorization
Action | Access level | Resource type | Condition key | Dependent action |
searchengine:GetModel | get | *Instance
| None | None |
Request syntax
GET /openapi/ha3/instances/{instanceId}/models/{modelName} HTTP/1.1Request parameters
Parameter | Type | Required | Description | Example |
instanceId | string | Yes | The instance ID. | ha-cn-pl32rf0**** |
modelName | string | Yes | The model name. | test |
Response elements
Element | Type | Description | Example |
object | Schema of Response | ||
requestId | string | The request ID. | 38b079f1-7846-4226-8c90-3e2644b5c52b |
| result | object | The model configuration. | |
name | string | The model name. | test |
type | string | The model type.
Valid values:
| text_embedding |
url | string | The model's access URL. | http://***.platform-cn-shanghai.opensearch.aliyuncs.com/v3/openapi/workspaces/default/text-embedding/ops-text-embedding-001 |
status | string | The model status.
| ok |
dimension | integer | The model dimension. | 128 |
| content | object | The model configuration. | |
modelName | string | The model name. | test |
modelType | string | The model type.
| text_embedding |
url | string | The model service endpoint. | http://***.platform-cn-shanghai.opensearch.aliyuncs.com/v3/openapi/workspaces/default/text-embedding/ops-text-embedding-001 |
method | string | The HTTP method to access the model service. PUT and POST are supported. | POST |
| request | object | The request configuration. | |
| header | object | The HTTP request header. | |
Authorization | string | Authentication information. The format is Bearer access_token. | Bearer OS-v0********6vvs |
Content-Type | string | The HTTP request's content type. | application/json |
| urlParams | object | URL parameters. Some model services require you to pass parameters in the URL. | |
build | object | Parameters passed during index building. | key: value |
search | object | Parameters passed during a query. | key: value |
requestBody | string | The request body's template string. | {\"input\": [\"%{input}\"], \"input_type\": \"%{input_type}\"} |
| parameters | object | Define parameters here if they differ between the build and search phases. | |
| build | object | Parameters for the index building phase. | |
input_type | string | The input type. | query |
| search | object | Parameters for the query phase. | |
input_type | string | The input type. | document |
| response | object | The method to parse the result. This is described in JSONPath format. | |
embeddings | string | The method to parse the result. This is described in JSONPath format. | $.result.embeddings[*].embedding |
createTime | string | The creation time. | 2024-05-21 16:05:26 |
updateTime | string | The update time. | 2024-05-21 16:05:26 |
Examples
Success response
JSON format
{
"requestId": "38b079f1-7846-4226-8c90-3e2644b5c52b",
"result": {
"name": "test",
"type": "text_embedding",
"url": "http://***.platform-cn-shanghai.opensearch.aliyuncs.com/v3/openapi/workspaces/default/text-embedding/ops-text-embedding-001",
"status": "ok",
"dimension": 128,
"content": {
"modelName": "test",
"modelType": "text_embedding",
"url": "http://***.platform-cn-shanghai.opensearch.aliyuncs.com/v3/openapi/workspaces/default/text-embedding/ops-text-embedding-001",
"method": "POST",
"request": {
"header": {
"Authorization": "Bearer OS-v0********6vvs\n",
"Content-Type": "application/json\n"
},
"urlParams": {
"build": {
"test": "test",
"test2": 1
},
"search": {
"test": "test",
"test2": 1
}
},
"requestBody": "{\\\"input\\\": [\\\"%{input}\\\"], \\\"input_type\\\": \\\"%{input_type}\\\"}\n",
"parameters": {
"build": {
"input_type": "query\n"
},
"search": {
"input_type": "document\n"
}
}
},
"response": {
"embeddings": "$.result.embeddings[*].embedding\n"
}
},
"createTime": "2024-05-21 16:05:26",
"updateTime": "2024-05-21 16:05:26"
}
}Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.