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.

HTTP
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

Shell
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

workspace_id

string

Yes

Execute workspace ID.

skill_id

string

Yes

The ID of the skill to be executed.

skill_workspace_id

string

No

The workspace to which the skill belongs. It can only be the current workspace or system. If it is not provided, check the current workspace first, and then check the system skills.

agent_id

string

No

Optional execution agent ID. When specified, the agent must be active and have current skills bound to it.

context_id

string

No

Context ID and text input.

message

string

No

Context ID and text input.

parts

array

No

Structured input fragment.

variables

object

No

Skill variables and parameters.

parameters

object

No

Skill variables and parameters.

resource_refs

array

No

Resource references. Each item must contain type and at least id or uri. Can include role, version and config.

idempotency_key

string

No

Idempotent keys.

metadata

object

No

Extended metadata. Variables, parameters, input fragments, and metadata cannot contain keys or run session references.

Successful response

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

code

integer

0 on success.

data.id

string

Execution record ID, execution workspace and skill ID.

data.workspace_id

string

Execution record ID, execution workspace and skill ID.

data.skill_id

string

Execution record ID, execution workspace and skill ID.

data.skill_version

integer

The skill version used in this submission.

data.agent_id

string

Association ID. The default submitter will be generated if not provided.

data.context_id

string

Association ID. The default submitter will be generated if not provided.

data.runtime_task_id

string

Runtime task ID and query address. Return when available.

data.runtime_task_url

string

Runtime task ID and query address. Return when available.

data.status

string

The running status returned this time can be completed or failed. HTTP 202 itself does not represent successful business execution.

data.metadata

object

Metadata returned at runtime. Return when available.

data.accepted_at

string

Request processing time, using RFC 3339 format.

Error response

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

Common HTTP errors

HTTP status code

error code

Description

400

2(INVALID_ARGUMENT)

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.

401

6(UNAUTHENTICATED)

Common Cause: Valid identity credentials are missing. Recommended Action: Check the API Key.

403

5(PERMISSION_DENIED)

Common reasons: Valid role or runtime access is not authorized. Recommended Action: Check the workspace role and runtime usage permissions.

404

3(NOT_FOUND)

Common reasons: The skill does not exist in the current or rollable system directories. Recommended Action: Check the skill ID and skill_workspace_id.

503

15(UNAVAILABLE)

Common reasons: Skill execution submitter, runtime access, or authorization dependencies are temporarily unavailable. Recommended Action: Try again later.

Last updated on