资源
密钥模型方案
读取或替换某个密钥的模型方案 —— 单模型锁定和/或按模式的引擎绑定。
GET
/
api
/
v1
/
keys
/
{id}
/
model-plan
密钥模型方案
curl --request GET \
--url https://api.example.com/api/v1/keys/{id}/model-plan \
--header 'Content-Type: application/json' \
--data '
{
"single_model": {},
"bindings": [
{}
]
}
'import requests
url = "https://api.example.com/api/v1/keys/{id}/model-plan"
payload = {
"single_model": {},
"bindings": [{}]
}
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({single_model: {}, bindings: [{}]})
};
fetch('https://api.example.com/api/v1/keys/{id}/model-plan', 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}/model-plan",
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([
'single_model' => [
],
'bindings' => [
[
]
]
]),
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}/model-plan"
payload := strings.NewReader("{\n \"single_model\": {},\n \"bindings\": [\n {}\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}/model-plan")
.header("Content-Type", "application/json")
.body("{\n \"single_model\": {},\n \"bindings\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/keys/{id}/model-plan")
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 \"single_model\": {},\n \"bindings\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"single_model": {},
"bindings": [
{}
],
"catalog": [
{}
]
}模型方案控制着该密钥运行哪个上游引擎。有两个相互独立的调节项:
single_model—— 为每一次文本轮次锁定同一个引擎。这是一种确定性的直通模式,会跳过分类器(非常适合编码 / IDE 后端场景,也包括 自带模型(BYO) 的custom:引擎)。bindings—— 将各个模式重新映射到指定引擎;分类器依然负责路由,但每个模式所使用的引擎是被锁定的。
arca-velox-5.1、arca-magnus-5.1、anthropic/claude-sonnet-4.6、anthropic/claude-opus-4.8、anthropic/claude-haiku-4.5、google/gemini-2.5-pro、openai/gpt-4.1,或者你自己的 custom:<providerId>:<model>。
如果需要完整的可运行流程(分支、护栏节点、路由),请改用 编排器图 —— 它的优先级高于模型方案。
身份验证
需要具备billing 权限范围的 API 密钥;调用者必须是该密钥的所有者。
路径参数
string
必填
该 API 密钥的 UUID。
获取方案
GET /api/v1/keys/{id}/model-plan
object | null
被锁定的引擎(
{ upstream_id, fallback_upstream_id }),或 null。array
按模式的覆盖设置:
{ mode, upstream_id, fallback_upstream_id }。array
可供选择的引擎列表(平台内置引擎 + 你的自定义提供方),用于构建选择器。
替换方案
PUT /api/v1/keys/{id}/model-plan —— 完整替换这两个字段(需要发送完整的目标状态)。
object | null
{ upstream_id, fallback_upstream_id? },用于为每一次文本轮次锁定同一个引擎;传 null 则清除该锁定。object[]
按模式的覆盖设置,每一项为
{ mode, upstream_id, fallback_upstream_id? }。所引用的每个上游 id 都会针对平台目录或你的自定义提供方进行校验。示例
curl -X PUT https://www.hitheo.ai/api/v1/keys/KEY_ID/model-plan \
-H "Authorization: Bearer $THEO_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "bindings": [
{ "mode": "fast", "upstream_id": "arca-velox-5.1" },
{ "mode": "think", "upstream_id": "arca-magnus-5.1" }
] }'
await theo.keys.setModelPlan("KEY_ID", {
single_model: { upstream_id: "anthropic/claude-opus-4.8" }, // 确定性直通
});
此页面对您有帮助吗?
密钥模型方案
curl --request GET \
--url https://api.example.com/api/v1/keys/{id}/model-plan \
--header 'Content-Type: application/json' \
--data '
{
"single_model": {},
"bindings": [
{}
]
}
'import requests
url = "https://api.example.com/api/v1/keys/{id}/model-plan"
payload = {
"single_model": {},
"bindings": [{}]
}
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({single_model: {}, bindings: [{}]})
};
fetch('https://api.example.com/api/v1/keys/{id}/model-plan', 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}/model-plan",
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([
'single_model' => [
],
'bindings' => [
[
]
]
]),
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}/model-plan"
payload := strings.NewReader("{\n \"single_model\": {},\n \"bindings\": [\n {}\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}/model-plan")
.header("Content-Type", "application/json")
.body("{\n \"single_model\": {},\n \"bindings\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/keys/{id}/model-plan")
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 \"single_model\": {},\n \"bindings\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"single_model": {},
"bindings": [
{}
],
"catalog": [
{}
]
}