#4284·AionUi

[Feature]: Anthropic 自定义接口增加 Bearer Token 和自定义请求头支持 (比如cloudflare中的Anthropic )

Author: WenLiCGCreated Sep 22, 2026Updated Sep 22, 2026
Labelsenhancementneeds-triage

Feature Description

希望 Anthropic 模型平台支持选择 API 认证方式,包括:

x-api-key Authorization: Bearer 自定义请求头

Problem Statement

AionUI 的 Anthropic 平台目前似乎固定使用:

x-api-key: <API_KEY>

部分兼容 Anthropic Messages API 的服务要求使用:

Authorization: Bearer <API_TOKEN>

例如配置 Cloudflare Anthropic Messages 接口时,AionUI 返回:

API error 401: Authentication error

相同的 API 地址、Token、模型名称和请求体,在 PowerShell 中使用 Authorization: Bearer 后可以正常返回模型内容。

Proposed Solution

建议在 Anthropic 模型配置页面增加“认证方式”选项:

认证方式:

  • Anthropic API Key
  • Bearer Token
  • 自定义请求头

选择 Bearer Token 时,AionUI 应发送:

Authorization: Bearer <API_KEY>

同时建议允许关闭默认的 x-api-key 请求头,以兼容更多 Anthropic Messages API 服务。

Feature Category

AI Model Integration

Additional Context

No response