Update model binding¶
Updates the model configuration actually used by the agent in the current workspace. For system agents, the update results are saved as a model binding overlay for the current workspace.
PATCH $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/agents/{agent_id}/bindings/model
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
First Query the agent list to obtain the agent ID, and confirm the model configuration ID to be bound.
Set the operation-specific values used in the request:
$AGENT_ID: The agent ID of the model binding to be updated.$MODEL_CONFIG_ID: Model configuration ID to bind.
Request¶
curl -X PATCH "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/agents/$AGENT_ID/bindings/model" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"model": {
"model_config_ref": "'"$MODEL_CONFIG_ID"'"
}
}'
Path parameters
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
The current workspace ID. |
|
string |
Yes |
The agent ID of the model binding to be updated. |
Query parameters
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
ID of the workspace to which the agent definition belongs. If not provided, the current workspace is used; only the current workspace or the system workspace can be specified. |
Request body
Field |
Type |
Is it required |
Description |
|---|---|---|---|
|
object |
No |
Model binding configuration. Omitting or passing an empty object saves an empty model configuration. |
|
string |
No |
Model configuration ID. When provided, it must be resolvable in the current workspace. |
|
string |
No |
Default model name. |
|
object |
No |
Override model call parameters. |
Successful response¶
Returns 200 on success. data is the complete resource binding parsed after the update.
{
"code": 0,
"data": {
"workspace_id": "ws_01",
"agent_workspace_id": "ws_01",
"agent_id": "agent_01",
"agent_version": 3,
"model": {
"model_config_ref": "mc_01"
}
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
Calling workspace and the workspace owning the agent definition. |
|
string |
Calling workspace and the workspace owning the agent definition. |
|
string |
Agent ID and resource version. |
|
integer |
Agent ID and resource version. |
|
object |
Saved and resolved model configuration. |
|
array |
Currently active tool bindings; returned when bindings exist. |
|
array |
Currently active skill bindings; returned when bindings exist. |
|
array |
Currently active knowledge base bindings; returned when bindings exist. |
|
array |
Currently active channel bindings; returned when bindings exist. |
|
string[] |
Unresolvable resource reference description; not returned when no warnings are generated. |
|
object |
Currently resolved runtime Provider and Profile; returned when available. |
|
object |
Provider status, capabilities, and configuration summary; returned when available. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Error response¶
{
"code": 2,
"message": "<error message>"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The request body is invalid, the model field does not comply with the constraints, or |
Check JSON, model configuration ID and workspace scope. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
Agent, model configuration or run provider configuration does not exist. |
Check the path, model configuration ID and run target. |
|
|
The agent resource service is unavailable. |
Try again later. |
Follow-up operations¶
Use the same agent identifier Query agent details to confirm that the model binding has been updated.