feature: Support getting the API key from the request header when provider.apiTokens is not configured. (#3394)

Co-authored-by: 澄潭 <zty98751@alibaba-inc.com>
This commit is contained in:
zikunchang
2026-01-28 14:03:24 +08:00
committed by GitHub
parent cbcc3ecf43
commit f2fcd68ef8
2 changed files with 60 additions and 1 deletions

View File

@@ -397,6 +397,9 @@ type ProviderConfig struct {
// @Title zh-CN 指定服务返回的响应需满足的JSON Schema
// @Description zh-CN 目前仅适用于OpenAI部分模型服务。参考https://platform.openai.com/docs/guides/structured-outputs
responseJsonSchema map[string]interface{} `required:"false" yaml:"responseJsonSchema" json:"responseJsonSchema"`
// @Title zh-CN 自定义认证Header名称
// @Description zh-CN 用于从请求中提取认证token的自定义header名称。如不配置则按默认优先级检查 x-api-key、x-authorization、anthropic-api-key 和 Authorization header。
authHeaderKey string `required:"false" yaml:"authHeaderKey" json:"authHeaderKey"`
// @Title zh-CN 自定义大模型参数配置
// @Description zh-CN 用于填充或者覆盖大模型调用时的参数
customSettings []CustomSetting