Load the agent package¶
Verify and load the .moiagent agent package to the target workspace.
POST $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/agent-packages/load
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.
Prepare the personal access token that can access the target workspace, the target workspace ID, and the .moiagent package file to be loaded.
Create new agent: Agent creation permission is required.
Update existing agent: Agent update permission is required.
Read resources within the package: Requires read permissions for the associated volume and knowledge base.
Confirm that the resource references in the package are valid. Workspace access does not replace read permission on associated resources.
Request body¶
The upper limit of the uploaded agent package text is 128 MiB. Packages that exceed the upper limit or cannot be parsed will be rejected. The client should retain the original package and failure information, and cannot treat the failure response as no loading record was generated.
curl -X POST "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/agent-packages/load" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/octet-stream' \
--data-binary "@$PACKAGE_FILE"
Path parameters
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Load the ID of the target workspace. |
Request body
The request body is the complete binary content of the .moiagent package file. Submit using application/octet-stream and do not use JSON objects or package_file fields to encapsulate the file content.
Successful response¶
{
"code": 0,
"data": {
"plan": {
"workspace_id": "ws_01",
"agent_id": "agent_01",
"agent_version": "1.0.0",
"source_digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"resource_files": {},
"status": "validated"
},
"version": {
"workspace_id": "ws_01",
"agent_id": "agent_01",
"version": "1.0.0",
"source_digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"min_moi_version": "5.0.0",
"manifest": {
"schemaVersion": 1,
"id": "agent_01",
"version": "1.0.0",
"name": "摘要助手",
"model": "model-example",
"instruction": {
"path": "instructions/main.md"
},
"moiResourceRefs": {
"tools": [],
"skills": [],
"knowledgeBases": [],
"channelBindings": []
}
},
"status": "runnable",
"loaded_by": "user_01",
"loaded_at": "2026-10-14T00:00:00Z"
}
}
}
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
object |
response data. |
|
object |
Agent package loading plan. |
|
string |
Target workspace ID. |
|
string |
agent ID. |
|
string |
The agent version declared in the package. |
|
string |
Summary of package contents. |
|
object |
List of resource files in the package. |
|
string |
agent command. Can be omitted if not set. |
|
array of string |
Custom tool directory. Can be omitted if not set. |
|
array of string |
Custom skill catalog. Can be omitted if not set. |
|
string |
Load plan status. |
|
array of object |
diagnostic information. Does not return when no diagnosis is generated. Can be omitted if not set. |
|
string |
Prompt level. Value: |
|
string |
error code. |
|
string |
Operating Instructions. |
|
string |
Resource references. Can be omitted if not set. |
|
object |
The loaded agent version. |
|
string |
The workspace ID to which it belongs. |
|
string |
The agent ID to which the loaded version belongs. |
|
string |
The version identifier that has been loaded. |
|
string |
Base agent version reference. Can be omitted if not set. |
|
string |
A summary of the package contents of the version. |
|
string |
Minimum CloudSigma version required by the package. |
|
object |
Package list. |
|
integer |
Package manifest structure version. |
|
string |
Object ID. |
|
string |
Current version number. |
|
string |
Name. |
|
string |
Description. Can be omitted if not set. |
|
string |
Association model. |
|
string |
Model configuration reference. Can be omitted if not set. |
|
string |
Minimum CloudSigma version required by the package. Can be omitted if not set. |
|
object |
agent command. |
|
string |
Relative path within the package. |
|
object |
The associated CloudSigma resource reference. |
|
array of object |
List of discovered tools. |
|
string |
Name. |
|
string |
The workspace ID to which it belongs. Can be omitted if not set. |
|
array of object |
Skills list. |
|
string |
Name. |
|
string |
The workspace ID to which it belongs. Can be omitted if not set. |
|
array of object |
Associated knowledge base list. |
|
string |
Name. |
|
string |
The workspace ID to which it belongs. Can be omitted if not set. |
|
array of object |
Catalog files associated with the package. Can be omitted if not set. |
|
string |
The workspace ID where the resource is located. |
|
integer |
Volume ID. |
|
string |
Associated file ID. |
|
array of object |
Channel binding list. |
|
string |
Tool name. Can be omitted if not set. |
|
string |
The workspace ID where the tool is located. Can be omitted if not set. |
|
string |
Skill name. Can be omitted if not set. |
|
string |
The workspace ID where the skill is located. Can be omitted if not set. |
|
string |
Provider ID. Can be omitted if not set. |
|
string |
The workspace ID where the resource is located. |
|
string |
Channel instance ID. |
|
string |
Version status loaded. |
|
array of object |
Version diagnostic information. Does not return when no diagnosis is generated. Can be omitted if not set. |
|
string |
Prompt level. Value: |
|
string |
error code. |
|
string |
Operating Instructions. |
|
string |
Resource references. Can be omitted if not set. |
|
string |
The user ID that loaded this version. |
|
string |
Loading time. |
|
string |
Deactivator ID. Can be omitted if not set. |
|
string |
Deactivation time. Can be omitted if not set. |
Error response¶
{
"code": 2,
"message": "invalid agent package"
}
Field |
Type |
Description |
|---|---|---|
|
integer |
error code. |
|
string |
Error description. |
After the version is successfully loaded and saved, an error may still be returned during the operation record writing phase. If you encounter such an error, first check whether the target agent and version already exist. Do not directly load it repeatedly.