feat: add GetClaudeAuthHeader function and update FetchUpstreamModels to support Anthropic channel type

This commit is contained in:
RedwindA
2025-10-09 02:43:19 +08:00
parent 5f19d212d0
commit dcd0f4fb0d
2 changed files with 12 additions and 3 deletions
+8
View File
@@ -127,6 +127,14 @@ func GetAuthHeader(token string) http.Header {
return h
}
// GetClaudeAuthHeader get claude auth header
func GetClaudeAuthHeader(token string) http.Header {
h := http.Header{}
h.Add("x-api-key", token)
h.Add("anthropic-version", "2023-06-01")
return h
}
func GetResponseBody(method, url string, channel *model.Channel, headers http.Header) ([]byte, error) {
req, err := http.NewRequest(method, url, nil)
if err != nil {