> ## 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.