fix: 去除openai-apkey账户请求路径多余的v1

This commit is contained in:
shaw
2025-12-30 23:07:25 +08:00
parent 5cad90fb4d
commit 1ecef269f7
4 changed files with 2 additions and 27 deletions

View File

@@ -328,7 +328,7 @@ func (s *AccountTestService) testOpenAIAccountConnection(c *gin.Context, account
if baseURL == "" {
baseURL = "https://api.openai.com"
}
apiURL = strings.TrimSuffix(baseURL, "/") + "/v1/responses"
apiURL = strings.TrimSuffix(baseURL, "/") + "/responses"
} else {
return s.sendErrorAndEnd(c, fmt.Sprintf("Unsupported account type: %s", account.Type))
}

View File

@@ -371,7 +371,7 @@ func (s *OpenAIGatewayService) buildUpstreamRequest(ctx context.Context, c *gin.
// API Key accounts use Platform API or custom base URL
baseURL := account.GetOpenAIBaseURL()
if baseURL != "" {
targetURL = baseURL + "/v1/responses"
targetURL = baseURL + "/responses"
} else {
targetURL = openaiPlatformAPIURL
}