Query model configuration list¶
Query the agent model configuration in the workspace.
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/model-configs
Before you call¶
Prepare a personal access token and target workspace ID that has access to the target workspace.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: The workspace ID to be queried, passed through theX-Workspace-IDHeader, and asworkspace_idin the path.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/model-configs?model_category=chat&limit=20" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
Current workspace ID, must be consistent with |
Query parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
Filter by configuration status. |
|
string |
No |
Filter by model source type. |
|
string |
No |
Filter by model category. |
|
string |
No |
Filter by provider reference. |
|
string |
No |
Query by name or related text. |
|
integer |
No |
Returns the upper limit of quantity. |
|
integer |
No |
Returns the offset. |
Successful response¶
Returns 200 on success. data.items is the model configuration, data.total, data.limit and data.offset describe the list ranges.
{
"code": 0,
"data": {
"items": [
{
"id": "mc_01",
"name": "Sales Analysis Model",
"status": "active",
"source_kind": "workspace",
"model_category": "chat",
"model_name": "<MODEL_NAME>",
"version": 1
}
],
"total": 1,
"limit": 20,
"offset": 0
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
array of object or null |
Model configuration list. The service may return |
|
string |
Model configuration ID. |
|
string |
Configuration name. |
|
string |
Configuration status. |
|
string |
Model source type. |
|
string |
Model category. |
|
string |
Model name. |
|
integer |
Configuration version. |
|
integer |
The total number of filter results, the current return upper limit and offset. |
|
integer |
The total number of filter results, the current return upper limit and offset. |
|
integer |
The total number of filter results, the current return upper limit and offset. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Error response¶
{
"code": 2,
"message": "模型配置参数无效"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
Invalid workspace or filter parameters. |
Check path and query parameters. |
|
|
Credentials are missing or invalid. |
Check API Key. |
|
|
The current identity does not have permission to read the workspace configuration. |
Use valid credentials, or contact your administrator for authorization. |
|
|
The model configuration service is unavailable. |
Try again later. |
Follow-up operations¶
Use configuration ID Query model configuration details.