资源
密钥技能绑定
读取或替换按密钥设置的技能白名单,用于限定该密钥可使用的技能范围。
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": [
{}
]
}