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.

HTTP
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.

Shell
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

workspace_id

string

Yes

Current workspace ID.

agent_id

string

Yes

The agent ID of the model binding to be updated.

Query parameters

Field

Type

Required

Description

agent_workspace_id

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

model

object

No

Model binding configuration. Omitting or passing an empty object saves an empty model configuration.

model.model_config_ref

string

No

Model configuration ID. When provided, it must be resolvable in the current workspace.

model.default_model

string

No

Default model name.

model.params_override

object

No

Override model call parameters.

Successful response

JSON
{
  "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

code

integer

success code.

data

object

The data returned by this operation.

data.workspace_id

string

Call workspace and agent to define the workspace to which it belongs.

data.agent_workspace_id

string

Call workspace and agent to define the workspace to which it belongs.

data.agent_id

string

agent ID and resource version.

data.agent_version

integer

agent ID and resource version.

data.runtime

object

The currently resolved runtime Provider and Profile. Return when available.

data.runtime.provider

string

Run the provider.

data.runtime.profile

string

Run configuration name.

data.runtime.config

JSON value

Configuration object.

data.model

object

Saved and parsed model configuration.

data.model.model_config_ref

string

Model configuration ID.

data.model.default_model

string

Default model.

data.model.params_override

JSON value

Model parameter coverage.

data.provider

object

Summary of the Provider’s status, capabilities, and configuration. Return when available.

data.provider.provider_id

string

Association ID.

data.provider.profile_id

string

Association ID.

data.provider.display_name

string

Display name.

data.provider.description

string

Description of the current object.

data.provider.status

string

status.

data.provider.adapter_status

string

Adaptation status.

data.provider.runtime_available

boolean

available at runtime.

data.provider.development_only

boolean

Whether it is for development use only.

data.provider.capabilities

object

Capability description.

data.provider.capabilities.a2a_profile

string

A2A configuration.

data.provider.capabilities.streaming_mode

string

Streaming mode.

data.provider.capabilities.cancel_mode

string

Cancellation method.

data.provider.capabilities.task_snapshot_mode

string

Task snapshot mode.

data.provider.capabilities.workspace_mode

string

workspace mode.

data.provider.capabilities.external_network

string

External network capabilities.

data.provider.capabilities.checkpoint_mode

string

Checkpoint mode.

data.provider.capabilities.secondary_auth_mode

string

Secondary authorization mode.

data.provider.capabilities.input_request_mode

string

Enter request mode.

data.provider.capabilities.guardrail_mode

string

Guardrail mode.

data.provider.capabilities.trace_mode

string

Tracking mode.

data.provider.capabilities.artifact_mode

string

Product model.

data.provider.capabilities.permission_model

string

Permission model.

data.provider.capabilities.tool_mode

string

Tool calling mode.

data.provider.capabilities.file_input

boolean

File input capabilities.

data.provider.capabilities.state_transition_history

boolean

State change history capability.

data.provider.capabilities.native_code_execution

boolean

Native code execution capabilities.

data.provider.capabilities.native_file_edit

boolean

Native file editing capabilities.

data.provider.capabilities.native_shell

boolean

Native shell capabilities.

data.provider.capabilities.handoff

boolean

Task handover capabilities.

data.provider.capabilities.native_tool_policy

array of string or null

Native tool strategy.

data.provider.config_schema

JSON value

Configuration structure metadata.

data.provider.reason

string

Reason.

data.skills

array of object or null

The currently active skill binding. Returned if a binding exists.

data.skills[].id

string

ID of the current object.

data.skills[].workspace_id

string

The workspace ID to which it belongs.

data.skills[].kind

string

Resource type. The values are skill, tool, knowledge_base

data.skills[].status

string

status.

data.skills[].resource_id

string

Resource ID.

data.skills[].name

string

The name of the current object.

data.skills[].display_name

string

Display name.

data.skills[].description

string

Description of the current object.

data.skills[].category

string

classification.

data.skills[].phase

string

stage.

data.skills[].bindable

boolean

Whether it can be bound.

data.skills[].bindability_reason

string

Binding restriction reason.

data.skills[].supported_runtimes

array of string or null

Supported runtime environments.

data.skills[].config

JSON value

Configuration object.

data.skills[].runtime_tool_visibility

string

Visible range of runtime tools.

data.skills[].binding_source

string

Binding source.

data.skills[].manageable

boolean

Is it manageable.

data.tools

array of object or null

The currently valid tool bindings. Returned if a binding exists.

data.tools[].id

string

ID of the current object.

data.tools[].workspace_id

string

The workspace ID to which it belongs.

data.tools[].kind

string

Resource type. The values are skill, tool, knowledge_base

data.tools[].status

string

status.

data.tools[].resource_id

string

Resource ID.

data.tools[].name

string

The name of the current object.

data.tools[].display_name

string

Display name.

data.tools[].description

string

Description of the current object.

data.tools[].category

string

classification.

data.tools[].phase

string

stage.

data.tools[].bindable

boolean

Whether it can be bound.

data.tools[].bindability_reason

string

Binding restriction reason.

data.tools[].supported_runtimes

array of string or null

Supported runtime environments.

data.tools[].config

JSON value

Configuration object.

data.tools[].runtime_tool_visibility

string

Visible range of runtime tools.

data.tools[].binding_source

string

Binding source.

data.tools[].manageable

boolean

Is it manageable.

data.knowledge_bases

array of object or null

The currently valid knowledge base binding. Returned if a binding exists.

data.knowledge_bases[].id

string

ID of the current object.

data.knowledge_bases[].workspace_id

string

The workspace ID to which it belongs.

data.knowledge_bases[].kind

string

Resource type. The values are skill, tool, knowledge_base

data.knowledge_bases[].status

string

status.

data.knowledge_bases[].resource_id

string

Resource ID.

data.knowledge_bases[].name

string

The name of the current object.

data.knowledge_bases[].display_name

string

Display name.

data.knowledge_bases[].description

string

Description of the current object.

data.knowledge_bases[].category

string

classification.

data.knowledge_bases[].phase

string

stage.

data.knowledge_bases[].bindable

boolean

Whether it can be bound.

data.knowledge_bases[].bindability_reason

string

Binding restriction reason.

data.knowledge_bases[].supported_runtimes

array of string or null

Supported runtime environments.

data.knowledge_bases[].config

JSON value

Configuration object.

data.knowledge_bases[].runtime_tool_visibility

string

Visible range of runtime tools.

data.knowledge_bases[].binding_source

string

Binding source.

data.knowledge_bases[].manageable

boolean

Is it manageable.

data.channel_bindings

array of object or null

The currently valid channel binding. Returned if a binding exists.

data.channel_bindings[].provider

string

Run the provider.

data.channel_bindings[].channel_type

string

Channel type.

data.channel_bindings[].channel_instance_ids

array of string or null

Channel instance ID.

data.warnings

array of string or null

Unresolved resource reference specification. Does not return if no warning is generated.

Error response

JSON
{
  "code": 2,
  "message": "<错误信息>"
}

Common HTTP errors

HTTP status

Error code

Common cause

Recommended action

400

2

Invalid request field, workspace, or operation precondition.

Fix the request parameters and submit again.

401

6

Missing or invalid authentication credentials.

Check the credential type, expiration, and authentication header.

403

5, 7

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

3

The target object or required reference was not found.

Verify the object identifier, workspace, and current status.

409

4

Conflict in resource state, request payload, or concurrent modification.

Re-read the current state and version, then handle according to the latest result.

500

15

Internal processing failed; write operations may have been partially applied.

Retain request and trace details, and verify the current state before retrying.

503

15

A business, runtime, or authorization dependency is temporarily unavailable.

After the dependency recovers, check existing results first instead of blindly repeating writes.

Last updated on