> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hitheo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 创建技能

> 创建一个新技能（默认私有）。

创建一个新技能。技能默认是私有的 —— 使用[提交技能](/api-reference/skills/submit)可将其发布到应用市场。

## 身份验证

需要 Bearer 令牌。参见[身份验证](/api-reference/authentication)。

## 请求体

<ParamField body="name" type="string" required>
  技能的可读名称。
</ParamField>

<ParamField body="slug" type="string" required>
  唯一标识符。必须为小写字母数字并可包含连字符（例如 `"inventory-check"`）。
</ParamField>

<ParamField body="category" type="string" required>
  技能类别。可选值为：`productivity`、`domain`、`integration`、`automation`、`creative`。
</ParamField>

<ParamField body="system_prompt_ext" type="string" required>
  当该技能被启用时注入到 LLM 上下文中的系统提示扩展。
</ParamField>

<ParamField body="description" type="string">
  该技能功能的简短描述。
</ParamField>

<ParamField body="tool_definitions" type="object[]">
  该技能提供的工具定义。
</ParamField>

<ParamField body="is_public" type="boolean" default="false">
  该技能是否公开列出。若需经过审核发布到应用市场，请使用[提交技能](/api-reference/skills/submit)。
</ParamField>

## 请求示例

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://www.hitheo.ai/api/v1/skills/create \
    -H "Authorization: Bearer $THEO_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Inventory Check",
      "slug": "inventory-check",
      "category": "automation",
      "system_prompt_ext": "You are an inventory specialist. Use check_stock to look up levels.",
      "description": "Real-time inventory lookup and reorder alerts",
      "tool_definitions": [
        {
          "name": "check_stock",
          "description": "Look up current stock levels for a SKU",
          "inputSchema": {
            "type": "object",
            "properties": { "sku": { "type": "string" } },
            "required": ["sku"]
          }
        }
      ]
    }'
  ```

  ```typescript SDK theme={null}
  const skill = await theo.createSkill({
    name: "Inventory Check",
    slug: "inventory-check",
    category: "automation",
    system_prompt_ext: "You are an inventory specialist. Use check_stock to look up levels.",
    description: "Real-time inventory lookup and reorder alerts",
    tool_definitions: [
      {
        name: "check_stock",
        description: "Look up current stock levels for a SKU",
        inputSchema: {
          type: "object",
          properties: { sku: { type: "string" } },
          required: ["sku"],
        },
      },
    ],
  });
  ```
</CodeGroup>

## 响应（HTTP 201）

<ResponseField name="skill" type="object">
  已创建的技能对象，包含全部字段，包括生成的 `id`。
</ResponseField>

## 错误

| 状态码 | 代码 | 描述 |
| - | - | - |
| 400 | `validation_error` | 缺少必填字段或 slug 格式无效 |
| 409 | `conflict` | 已存在使用该 slug 的技能 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.