Support per-format provider key auth

This commit is contained in:
fawney19
2026-04-29 15:46:50 +08:00
parent 07a319259b
commit e751289dfb
67 changed files with 1244 additions and 420 deletions

View File

@@ -1892,6 +1892,7 @@ watch(searchQuery, () => {
function normalizeAuthTypeForEdit(key: PoolKeyDetail): EndpointAPIKey['auth_type'] {
if (isOAuthManagedCredential(key)) return 'oauth'
if (isServiceAccountCredential(key)) return 'service_account'
if ((key.auth_type || '').trim().toLowerCase() === 'bearer') return 'bearer'
return 'api_key'
}
@@ -1903,6 +1904,7 @@ function toEndpointApiKey(key: PoolKeyDetail): EndpointAPIKey {
api_formats: key.api_formats || [],
api_key_masked: getProviderMaskedSecretLabel(key),
auth_type: normalizeAuthTypeForEdit(key),
auth_type_by_format: key.auth_type_by_format ?? null,
credential_kind: key.credential_kind ?? null,
runtime_auth_kind: key.runtime_auth_kind ?? null,
oauth_managed: key.oauth_managed ?? undefined,

View File

@@ -102,7 +102,7 @@ import { BookOpen } from 'lucide-vue-next'
>
<h2>3. 添加端点</h2>
<p class="text-sm text-[#666663] dark:text-[#a3a094] mb-4">
添加端点是添加上游支持的端点并非你需要使用的端点比如 Anyrouter 只支持 Claude Code 接入那么就应该添加 Claude CLI 端点
添加端点是添加上游支持的端点并非你需要使用的端点比如 Anyrouter 只支持 Claude Code 接入那么就应该添加 Claude Messages 端点并在 Key 中选择对应认证方式
</p>
<ul class="list-decimal pl-5 space-y-2 text-[#666663] dark:text-[#a3a094] text-sm">
<li><strong class="text-[#262624] dark:text-[#f1ead8] font-medium">选择格式</strong>选择上游支持的端点格式</li>

View File

@@ -21,7 +21,7 @@ graph LR
## 2. 核心原则
1. **API格式、端点、认证方式说明**
提供商支持不同的格式(如 OpenAI Chat, Claude ChatAether在接收请求后将统一管理路由。
提供商支持不同的格式(如 OpenAI Chat, Claude MessagesAether在接收请求后将统一管理路由。
2. **统一的入口模型名称**
在内部完成多提供商、多模型名称风格的聚合映射管理。客户端只需知道统一的模型名(例如 `claude-3-opus`Aether将根据映射规则自动寻找真正对应的上游模型名称。

View File

@@ -31,7 +31,7 @@
## 3. 添加端点
添加端点是添加上游支持的端点, 并非你需要使用的端点. 比如Anyrouter只支持Claude Code接入, 那么就应该添加Claude CLI端点
添加端点是添加上游支持的端点, 并非你需要使用的端点. 比如Anyrouter只支持Claude Code接入, 那么就应该添加Claude Messages端点并在Key中选择对应认证方式
1. **选择格式**: 选择上游支持的端点
2. **自定义Base URL、Path**: 根据上游提供的信息填写。为空则使用提示的默认值。