fix: 修复claude apikey账号请求时未携带beta=true 查询参数的bug

This commit is contained in:
shaw
2026-03-05 14:59:12 +08:00
parent aeb464f3ca
commit 9d70c38504
2 changed files with 6 additions and 6 deletions

View File

@@ -4583,7 +4583,7 @@ func (s *GatewayService) buildUpstreamRequestAnthropicAPIKeyPassthrough(
if err != nil {
return nil, err
}
targetURL = validatedURL + "/v1/messages"
targetURL = validatedURL + "/v1/messages?beta=true"
}
req, err := http.NewRequestWithContext(ctx, http.MethodPost, targetURL, bytes.NewReader(body))
@@ -4963,7 +4963,7 @@ func (s *GatewayService) buildUpstreamRequest(ctx context.Context, c *gin.Contex
if err != nil {
return nil, err
}
targetURL = validatedURL + "/v1/messages"
targetURL = validatedURL + "/v1/messages?beta=true"
}
}
@@ -7088,7 +7088,7 @@ func (s *GatewayService) buildCountTokensRequestAnthropicAPIKeyPassthrough(
if err != nil {
return nil, err
}
targetURL = validatedURL + "/v1/messages/count_tokens"
targetURL = validatedURL + "/v1/messages/count_tokens?beta=true"
}
req, err := http.NewRequestWithContext(ctx, http.MethodPost, targetURL, bytes.NewReader(body))
@@ -7135,7 +7135,7 @@ func (s *GatewayService) buildCountTokensRequest(ctx context.Context, c *gin.Con
if err != nil {
return nil, err
}
targetURL = validatedURL + "/v1/messages/count_tokens"
targetURL = validatedURL + "/v1/messages/count_tokens?beta=true"
}
}