資源
密鑰技能綁定
讀取或替換按密鑰設置的技能白名單,用於限定該密鑰可使用的技能範圍。
GET
/
api
/
v1
/
keys
/
{id}
/
skills
密鑰技能綁定
curl --request GET \
--url https://api.example.com/api/v1/keys/{id}/skills \
--header 'Content-Type: application/json' \
--data '
{
"skill_ids": [
"<string>"
]
}
'import requests
url = "https://api.example.com/api/v1/keys/{id}/skills"
payload = { "skill_ids": ["<string>"] }
headers = {"Content-Type": "application/json"}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({skill_ids: ['<string>']})
};
fetch('https://api.example.com/api/v1/keys/{id}/skills', 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/keys/{id}/skills",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'skill_ids' => [
'<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/keys/{id}/skills"
payload := strings.NewReader("{\n \"skill_ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("GET", 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.get("https://api.example.com/api/v1/keys/{id}/skills")
.header("Content-Type", "application/json")
.body("{\n \"skill_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/keys/{id}/skills")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"skill_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"key_id": "<string>",
"inherits_all": true,
"skill_ids": [
"<string>"
],
"skills": [
{}
]
}每個 API 密鑰都可以攜帶一份顯式的技能白名單。空白名單表示該密鑰繼承你安裝的全部技能(默認行為)。非空白名單會將該密鑰限制為白名單內的技能,且在請求時與你已安裝的技能集合取交集。
團隊作用域的密鑰只能綁定公開的、由調用者本人創建的、或歸屬於該密鑰所在團隊的技能。若任一 ID 對該密鑰不可見,請求將返回
身份驗證
需要具備billing 權限範圍的 API 密鑰。調用者必須是該密鑰的所有者,或具有管理 API 密鑰權限的團隊成員。
路徑參數
string
必填
API 密鑰的 UUID。
獲取綁定關係
GET /api/v1/keys/{id}/skills
string
API 密鑰的 UUID。
boolean
當白名單為空時為
true(表示該密鑰繼承全部已安裝的技能)。string[]
已綁定的技能 ID(當
inherits_all 為 true 時為空)。array
每個已綁定技能的展示元數據:
id、slug、name、category、is_public。替換綁定關係
PUT /api/v1/keys/{id}/skills
string[]
必填
要綁定的完整技能 ID 集合。傳入空數組可將該密鑰重置為繼承全部已安裝的技能。
400 skill_visibility_denied,且不會做任何變更。
示例
curl -X PUT https://www.hitheo.ai/api/v1/keys/KEY_ID/skills \
-H "Authorization: Bearer $THEO_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "skill_ids": ["11111111-2222-3333-4444-555555555555"] }'
{
"key_id": "KEY_ID",
"inherits_all": false,
"skill_ids": ["11111111-2222-3333-4444-555555555555"]
}
這個頁面有幫助嗎?
密鑰技能綁定
curl --request GET \
--url https://api.example.com/api/v1/keys/{id}/skills \
--header 'Content-Type: application/json' \
--data '
{
"skill_ids": [
"<string>"
]
}
'import requests
url = "https://api.example.com/api/v1/keys/{id}/skills"
payload = { "skill_ids": ["<string>"] }
headers = {"Content-Type": "application/json"}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({skill_ids: ['<string>']})
};
fetch('https://api.example.com/api/v1/keys/{id}/skills', 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/keys/{id}/skills",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'skill_ids' => [
'<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/keys/{id}/skills"
payload := strings.NewReader("{\n \"skill_ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("GET", 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.get("https://api.example.com/api/v1/keys/{id}/skills")
.header("Content-Type", "application/json")
.body("{\n \"skill_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/keys/{id}/skills")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"skill_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"key_id": "<string>",
"inherits_all": true,
"skill_ids": [
"<string>"
],
"skills": [
{}
]
}