技能 API
提交技能
提交技能清單以供市場審核和發佈。
POST
/
api
/
v1
/
skills
/
submit
提交技能
curl --request POST \
--url https://api.example.com/api/v1/skills/submit \
--header 'Content-Type: application/json' \
--data '
{
"manifest": {},
"skill_id": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/skills/submit"
payload = {
"manifest": {},
"skill_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({manifest: {}, skill_id: '<string>'})
};
fetch('https://api.example.com/api/v1/skills/submit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/skills/submit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'manifest' => [
],
'skill_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/skills/submit"
payload := strings.NewReader("{\n \"manifest\": {},\n \"skill_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/skills/submit")
.header("Content-Type", "application/json")
.body("{\n \"manifest\": {},\n \"skill_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/skills/submit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"manifest\": {},\n \"skill_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"submission": {
"id": "<string>",
"status": "<string>",
"reviewTier": "<string>",
"autoApproved": true
},
"review": {
"passed": true,
"tier": "<string>",
"checks": {}
}
}提交技能清單以供市場審核。系統會立即運行自動化檢查,並根據其風險等級將該技能自動批准或加入人工審核隊列。
身份驗證
需要 Bearer 令牌。參見身份驗證。請求正文
string
如果這是版本更新(而非新提交),則為已存在的技能 UUID。
請求示例
curl -X POST https://www.hitheo.ai/api/v1/skills/submit \
-H "Authorization: Bearer $THEO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"manifest": {
"name": "Inventory Check",
"slug": "inventory-check",
"version": "1.0.0",
"description": "Real-time inventory lookup and reorder alerts",
"category": "automation",
"author": { "name": "Acme Corp" },
"systemPromptExtension": "You are an inventory management specialist...",
"tools": [],
"permissions": ["execute:tools"]
}
}'
import { defineSkill } from "@hitheo/sdk";
const manifest = defineSkill({
name: "Inventory Check",
slug: "inventory-check",
version: "1.0.0",
description: "Real-time inventory lookup and reorder alerts",
category: "automation",
author: { name: "Acme Corp" },
systemPromptExtension: "You are an inventory management specialist...",
permissions: ["execute:tools"],
});
const result = await theo.submitSkill(manifest);
console.log(result.status); // "approved" or "pending_review"
console.log(result.reviewTier); // "auto", "staff", or "security"
響應(HTTP 201)
object
風險等級
| 等級 | 說明 |
|---|---|
auto | 低風險清單,通過所有自動化檢查——無需人工審核即可批准。 |
staff | 引入了工具、知識文件或寫入範圍權限的清單——由 Theo 市場團隊審核。 |
security | 同時結合外部網絡訪問與寫入能力或其他敏感面的清單——發佈前由安全團隊審核。 |
響應示例(自動批准)
{
"submission": {
"id": "sub_abc123",
"status": "approved",
"reviewTier": "auto",
"autoApproved": true
},
"review": {
"passed": true,
"tier": "auto",
"checks": { "schema": "pass", "injection_scan": "pass", "tool_names": "pass" }
}
}
錯誤
| 狀態碼 | 代碼 | 說明 |
|---|---|---|
| 422 | review_failed | 自動化檢查未通過——review.checks 中包含詳細信息 |
| 429 | rate_limit_exceeded | 提交頻率超出限制——請稍後重試 |
這個頁面有幫助嗎?
提交技能
curl --request POST \
--url https://api.example.com/api/v1/skills/submit \
--header 'Content-Type: application/json' \
--data '
{
"manifest": {},
"skill_id": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/skills/submit"
payload = {
"manifest": {},
"skill_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({manifest: {}, skill_id: '<string>'})
};
fetch('https://api.example.com/api/v1/skills/submit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/skills/submit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'manifest' => [
],
'skill_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/skills/submit"
payload := strings.NewReader("{\n \"manifest\": {},\n \"skill_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/skills/submit")
.header("Content-Type", "application/json")
.body("{\n \"manifest\": {},\n \"skill_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/skills/submit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"manifest\": {},\n \"skill_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"submission": {
"id": "<string>",
"status": "<string>",
"reviewTier": "<string>",
"autoApproved": true
},
"review": {
"passed": true,
"tier": "<string>",
"checks": {}
}
}