Create skills¶
Create a skill in the current workspace and create version 1 as the current version. The skill must also provide a name, description, and command body or route summary.
POST https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/skills
Before you call¶
Prepare a personal access token and target workspace ID that has access to the target workspace.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: The workspace ID of the skill to be created, passed through theX-Workspace-IDHeader.
requirements.skill_refs cannot reference the skill itself; tool and skill references must be valid resource IDs. Keys or running session references cannot be included in the metadata and schema.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/skills" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"name": "摘要技能",
"description": "总结输入内容。",
"instruction": {
"body": "总结用户提供的内容。"
},
"status": "active",
"tags": ["文本处理"]
}'
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
The current workspace ID. |
Request body¶
Field |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
Skill name, up to 128 characters. |
|
string |
Yes |
Skill description, up to 4096 characters. |
|
object |
Condition required |
Command definition; when |
|
object |
Condition required |
Route summary; when |
|
string |
No |
Status: |
|
string |
No |
Source type and reference. The source type defaults to |
|
string |
No |
Source type and reference. The source type defaults to |
|
string |
No |
Classification and display information. |
|
string |
No |
Classification and display information. |
|
string[] |
No |
Classification and display information. |
|
string |
No |
Classification and display information. |
|
string |
No |
Classification and display information. |
|
object |
No |
Dependency requirement, can include |
|
object |
No |
Input parameter Schema and output convention. |
|
object |
No |
Input parameter Schema and output convention. |
|
object |
No |
Market metadata, tags, annotations, and extended metadata. |
|
object |
No |
Market metadata, tags, annotations, and extended metadata. |
|
object |
No |
Market metadata, tags, annotations, and extended metadata. |
|
object |
No |
Market metadata, tags, annotations, and extended metadata. |
|
string |
No |
Description of changes for the first version. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Successful response¶
Returns 201 and the new skill on success.
{
"code": 0,
"data": {
"id": "skill_01",
"workspace_id": "ws_01",
"name": "摘要技能",
"description": "总结输入内容。",
"status": "active",
"source_type": "custom",
"instruction": {
"body": "总结用户提供的内容。"
},
"version": 1,
"created_at": "2026-01-02T15:04:05Z",
"updated_at": "2026-01-02T15:04:05Z"
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
Skill ID and workspace. |
|
string |
Skill ID and workspace. |
|
string |
Basic information and status of the skill. |
|
string |
Basic information and status of the skill. |
|
string |
Basic information and status of the skill. |
|
string |
Source type and source reference; not returned if reference is not set. |
|
string |
Source type and source reference; not returned if reference is not set. |
|
object |
Directive, routing summary, and dependency requirements. |
|
object |
Directive, routing summary, and dependency requirements. |
|
object |
Directive, routing summary, and dependency requirements. |
|
object |
Input Schema and output convention; does not return if not set. |
|
object |
Input Schema and output convention; does not return if not set. |
|
integer |
Current skill version; the new skill is |
|
string |
Creation and last update times, using RFC 3339 format. |
|
string |
Creation and last update times, using RFC 3339 format. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Error response¶
{
"code": 2,
"message": "<错误信息>"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
Name, description, directive and route summary are missing, or dependency, state, source type is invalid. |
Complete required fields and check resource references and field values. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current identity does not have permission to create skills in the workspace. |
Check workspace authorization. |
|
|
The specified skill ID already exists. |
Change skill ID or update existing skills. |
|
|
Skill services or authorized dependencies are temporarily unavailable. |
Try again later. |
Follow-up operations¶
Record the returned skill ID. Use Query skill details to confirm the saved result.