Update model configuration¶
Partially update the agent model configuration. Each successful update increments the configuration version.
PATCH https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/model-configs/{model_config_id}
Before you call¶
First Query model configuration detailsconfirm the current fields and versions. 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: Target workspace ID, passed through theX-Workspace-IDHeader and also asworkspace_idin the path.$MODEL_CONFIG_ID: Model configuration ID to update.
Request example¶
curl -X PATCH "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/model-configs/$MODEL_CONFIG_ID" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"capabilities": ["tool_calling"],
"parameters": {
"temperature": 0.2
}
}'
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
The current workspace ID. |
|
string |
Yes |
Model configuration ID. |
Request body¶
All fields are optional, submit only the fields that need to be updated.
Field |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
Configuration name, description, and display name. |
|
string |
No |
Configuration name, description, and display name. |
|
string |
No |
Configuration name, description, and display name. |
|
string |
No |
Configuration status, source type, and model category. |
|
string |
No |
Configuration status, source type, and model category. |
|
string |
No |
Configuration status, source type, and model category. |
|
string |
No |
Provider reference and model name. |
|
string |
No |
Provider reference and model name. |
|
string |
No |
Connection and credential reference. |
|
string |
No |
Connection and credential reference. |
|
object |
No |
Model parameters, parameter schema, and constraints. |
|
object |
No |
Model parameters, parameter schema, and constraints. |
|
object |
No |
Model parameters, parameter schema, and constraints. |
|
string[] |
No |
Model capability list. |
|
string |
No |
Billing information reference. |
|
object |
No |
String key-value labels and annotations. |
|
object |
No |
String key-value labels and annotations. |
|
object |
No |
Other metadata. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Successful response¶
When successful, 200 is returned, and data is the updated configuration. Save the new data.version to avoid treating the old configuration state as the current state.
{
"code": 0,
"data": {
"id": "mc_01",
"workspace_id": "ws_01",
"name": "销售分析模型",
"status": "active",
"source_kind": "workspace",
"model_category": "chat",
"model_name": "<MODEL_NAME>",
"capabilities": ["tool_calling"],
"version": 2,
"updated_at": "2026-08-18T02:00:00Z"
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
Model configuration ID. |
|
string |
The updated configuration name. |
|
string |
Updated status, source type and model category. |
|
string |
Updated status, source type and model category. |
|
string |
Updated status, source type and model category. |
|
string |
The updated model name. |
|
object or string[] |
Updated parameters, capabilities, and limitations; returned only if there is a value. |
|
object or string[] |
Updated parameters, capabilities, and limitations; returned only if there is a value. |
|
object or string[] |
Updated parameters, capabilities, and limitations; returned only if there is a value. |
|
integer |
Updated configuration version. |
|
string |
Update time. |
[] 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 request body, connection, or credential reference. |
Check request fields and reference IDs. |
|
|
Credentials are missing or invalid. |
Check API Key. |
|
|
The current identity does not have update permissions. |
Use valid credentials, or contact your administrator for authorization. |
|
|
The model configuration does not exist. |
First query the model configuration list. |
|
|
The updated configuration conflicts with the existing configuration. |
Modify the update content and try again. |
|
|
The model configuration service is unavailable. |
Try again later. |
Follow-up operations¶
Use Query model configuration details to confirm the current fields and versions.