Execute skills¶
Submit a skill run request. The successful response is 202 Accepted, which only means that the request has been accepted, but does not mean that the skill has been executed.
POST $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/skills/{skill_id}/execute
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 skill details to confirm that the skill is active. Prepare the personal access token, target workspace ID, and skill ID that can access the target workspace.
Select the skill with status active and confirm that a valid role and runtime access are granted.
Request body¶
curl -X POST "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/skills/$SKILL_ID/execute" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"message": "请总结这段内容。",
"idempotency_key": "<IDEMPOTENCY_KEY>"
}'
Provide at least one of message, parts, variables or resource_refs.
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Execute workspace ID. |
|
string |
Yes |
The ID of the skill to be executed. |
|
string |
No |
The workspace to which the skill belongs. It can only be the current workspace or |
|
string |
No |
Optional execution agent ID. When specified, the agent must be active and have current skills bound to it. |
|
string |
No |
Context ID and text input. |
|
string |
No |
Context ID and text input. |
|
array |
No |
Structured input fragment. |
|
object |
No |
Skill variables and parameters. |
|
object |
No |
Skill variables and parameters. |
|
array |
No |
Resource references. Each item must contain |
|
string |
No |
Idempotent keys. |
|
object |
No |
Extended metadata. Variables, parameters, input fragments, and metadata cannot contain keys or run session references. |
Successful response¶
{
"code": 0,
"data": {
"id": "skill-exec-efdb64a2-78e4-5c4e-b54c-f213111e61db",
"workspace_id": "ws_01",
"skill_id": "skill_01",
"skill_version": 2,
"agent_id": "skill:skill_01",
"context_id": "ctx-8efdb64a-278e-4c4e-b54c-f213111e61db",
"runtime_task_id": "task-efdb64a2-78e4-5c4e-b54c-f213111e61db",
"status": "completed",
"metadata": {"provider": "default", "profile": "default", "entrypoint": "skill_execute"},
"accepted_at": "2026-01-02T15:04:05Z"
}
}
Returns 202 on success. Use runtime_task_id or runtime_task_url to track subsequent run status and results (field only appears when runtime returns).
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
Execution record ID, execution workspace and skill ID. |
|
string |
Execution record ID, execution workspace and skill ID. |
|
string |
Execution record ID, execution workspace and skill ID. |
|
integer |
The skill version used in this submission. |
|
string |
Association ID. The default submitter will be generated if not provided. |
|
string |
Association ID. The default submitter will be generated if not provided. |
|
string |
Runtime task ID and query address. Return when available. |
|
string |
Runtime task ID and query address. Return when available. |
|
string |
The running status returned this time can be completed or failed. HTTP 202 itself does not represent successful business execution. |
|
object |
Metadata returned at runtime. Return when available. |
|
string |
Request processing time, using RFC 3339 format. |
Error response¶
{
"code": 2,
"message": "<错误信息>"
}
Common HTTP errors
HTTP status code |
error code |
Description |
|---|---|---|
|
|
Common reasons: The input is empty, the resource reference is invalid, the skill is not activated, or the specified agent is not bound to the skill. Recommended Action: Complete input, use active skills, and check resource and agent bindings. |
|
|
Common Cause: Valid identity credentials are missing. Recommended Action: Check the API Key. |
|
|
Common reasons: Valid role or runtime access is not authorized. Recommended Action: Check the workspace role and runtime usage permissions. |
|
|
Common reasons: The skill does not exist in the current or rollable system directories. Recommended Action: Check the skill ID and |
|
|
Common reasons: Skill execution submitter, runtime access, or authorization dependencies are temporarily unavailable. Recommended Action: Try again later. |