Update model binding¶
Update the model configuration actually used by the agent in the current workspace. For system agents, the update results are saved as model binding overrides of the current workspace.
PATCH $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/agents/{agent_id}/bindings/model
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. First query the agent list to obtain the agent ID, and confirm the model configuration ID to be bound. Prepare the personal access token, target workspace ID, and agent ID that can access the target workspace.
Request body¶
The example uses jq to construct the JSON request body. Install jq first and set the required environment variables. Do not JSON encode the variable values again.
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' \
--data-binary "$(jq -n --arg MODEL_CONFIG_ID "$MODEL_CONFIG_ID" '
{
"model": {
"model_config_ref": $MODEL_CONFIG_ID
}
}
')"
Path parameters
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Current workspace ID. |
|
string |
Yes |
The agent ID of the model binding to be updated. |
Query parameters
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
The workspace ID to which the agent definition belongs. If not provided, the current workspace is used. Only the current workspace or system workspace can be specified. |
Request body
Field |
Type |
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¶
{
"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"
},
"runtime": {
"provider": "astra",
"profile": ""
},
"provider": {
"provider_id": "",
"profile_id": "",
"display_name": "示例节点",
"status": "",
"adapter_status": "",
"runtime_available": false,
"capabilities": {
"a2a_profile": "",
"streaming_mode": "",
"cancel_mode": "",
"tool_mode": ""
}
}
}
}
Field |
Type |
Description |
|---|---|---|
|
integer |
success code. |
|
object |
The data returned by this operation. |
|
string |
Call workspace and agent to define the workspace to which it belongs. |
|
string |
Call workspace and agent to define the workspace to which it belongs. |
|
string |
agent ID and resource version. |
|
integer |
agent ID and resource version. |
|
object |
The currently resolved runtime Provider and Profile. Return when available. |
|
string |
Run the provider. |
|
string |
Run configuration name. |
|
JSON value |
Configuration object. |
|
object |
Saved and parsed model configuration. |
|
string |
Model configuration ID. |
|
string |
Default model. |
|
JSON value |
Model parameter coverage. |
|
object |
Summary of the Provider’s status, capabilities, and configuration. Return when available. |
|
string |
Association ID. |
|
string |
Association ID. |
|
string |
Display name. |
|
string |
Description of the current object. |
|
string |
status. |
|
string |
Adaptation status. |
|
boolean |
available at runtime. |
|
boolean |
Whether it is for development use only. |
|
object |
Capability description. |
|
string |
A2A configuration. |
|
string |
Streaming mode. |
|
string |
Cancellation method. |
|
string |
Task snapshot mode. |
|
string |
workspace mode. |
|
string |
External network capabilities. |
|
string |
Checkpoint mode. |
|
string |
Secondary authorization mode. |
|
string |
Enter request mode. |
|
string |
Guardrail mode. |
|
string |
Tracking mode. |
|
string |
Product model. |
|
string |
Permission model. |
|
string |
Tool calling mode. |
|
boolean |
File input capabilities. |
|
boolean |
State change history capability. |
|
boolean |
Native code execution capabilities. |
|
boolean |
Native file editing capabilities. |
|
boolean |
Native shell capabilities. |
|
boolean |
Task handover capabilities. |
|
array of string or null |
Native tool strategy. |
|
JSON value |
Configuration structure metadata. |
|
string |
Reason. |
|
array of object or null |
The currently active skill binding. Returned if a binding exists. |
|
string |
ID of the current object. |
|
string |
The workspace ID to which it belongs. |
|
string |
Resource type. The values are |
|
string |
status. |
|
string |
Resource ID. |
|
string |
The name of the current object. |
|
string |
Display name. |
|
string |
Description of the current object. |
|
string |
classification. |
|
string |
stage. |
|
boolean |
Whether it can be bound. |
|
string |
Binding restriction reason. |
|
array of string or null |
Supported runtime environments. |
|
JSON value |
Configuration object. |
|
string |
Visible range of runtime tools. |
|
string |
Binding source. |
|
boolean |
Is it manageable. |
|
array of object or null |
The currently valid tool bindings. Returned if a binding exists. |
|
string |
ID of the current object. |
|
string |
The workspace ID to which it belongs. |
|
string |
Resource type. The values are |
|
string |
status. |
|
string |
Resource ID. |
|
string |
The name of the current object. |
|
string |
Display name. |
|
string |
Description of the current object. |
|
string |
classification. |
|
string |
stage. |
|
boolean |
Whether it can be bound. |
|
string |
Binding restriction reason. |
|
array of string or null |
Supported runtime environments. |
|
JSON value |
Configuration object. |
|
string |
Visible range of runtime tools. |
|
string |
Binding source. |
|
boolean |
Is it manageable. |
|
array of object or null |
The currently valid knowledge base binding. Returned if a binding exists. |
|
string |
ID of the current object. |
|
string |
The workspace ID to which it belongs. |
|
string |
Resource type. The values are |
|
string |
status. |
|
string |
Resource ID. |
|
string |
The name of the current object. |
|
string |
Display name. |
|
string |
Description of the current object. |
|
string |
classification. |
|
string |
stage. |
|
boolean |
Whether it can be bound. |
|
string |
Binding restriction reason. |
|
array of string or null |
Supported runtime environments. |
|
JSON value |
Configuration object. |
|
string |
Visible range of runtime tools. |
|
string |
Binding source. |
|
boolean |
Is it manageable. |
|
array of object or null |
The currently valid channel binding. Returned if a binding exists. |
|
string |
Run the provider. |
|
string |
Channel type. |
|
array of string or null |
Channel instance ID. |
|
array of string or null |
Unresolved resource reference specification. Does not return if no warning is generated. |
Error response¶
{
"code": 2,
"message": "<错误信息>"
}
Common HTTP errors¶
HTTP status |
Error code |
Common cause |
Recommended action |
|---|---|---|---|
400 |
|
Invalid request field, workspace, or operation precondition. |
Fix the request parameters and submit again. |
401 |
|
Missing or invalid authentication credentials. |
Check the credential type, expiration, and authentication header. |
403 |
|
The current identity or active role does not have permission for this operation. |
Use an authorized identity or contact an administrator to grant access. |
404 |
|
The target object or required reference was not found. |
Verify the object identifier, workspace, and current status. |
409 |
|
Conflict in resource state, request payload, or concurrent modification. |
Re-read the current state and version, then handle according to the latest result. |
500 |
|
Internal processing failed; write operations may have been partially applied. |
Retain request and trace details, and verify the current state before retrying. |
503 |
|
A business, runtime, or authorization dependency is temporarily unavailable. |
After the dependency recovers, check existing results first instead of blindly repeating writes. |