@@ -496,7 +496,7 @@ func (h *OpenAIGatewayHandler) Responses(c *gin.Context) {
496496 clientIP := ip .GetClientIP (c )
497497 requestPayloadHash := service .HashUsageRequestPayload (body )
498498 inboundEndpoint := GetInboundEndpoint (c )
499- upstreamEndpoint := GetUpstreamEndpoint (c , account . Platform )
499+ upstreamEndpoint := resolveOpenAIUpstreamEndpoint (c , account )
500500
501501 // 使用量记录通过有界 worker 池提交,避免请求热路径创建无界 goroutine。
502502 cyberBlocked := service .GetOpsCyberPolicy (c ) != nil
@@ -901,7 +901,7 @@ func (h *OpenAIGatewayHandler) Messages(c *gin.Context) {
901901 clientIP := ip .GetClientIP (c )
902902 requestPayloadHash := service .HashUsageRequestPayload (body )
903903 inboundEndpoint := GetInboundEndpoint (c )
904- upstreamEndpoint := GetUpstreamEndpoint (c , account . Platform )
904+ upstreamEndpoint := resolveOpenAIUpstreamEndpoint (c , account )
905905
906906 cyberBlocked := service .GetOpsCyberPolicy (c ) != nil
907907 h .submitOpenAIUsageRecordTask (c .Request .Context (), result , func (ctx context.Context ) {
@@ -1496,7 +1496,7 @@ func (h *OpenAIGatewayHandler) ResponsesWebSocket(c *gin.Context) {
14961496 }
14971497 h .gatewayService .ReportOpenAIAccountScheduleResult (account .ID , true , result .FirstTokenMs )
14981498 inboundEndpoint := GetInboundEndpoint (c )
1499- upstreamEndpoint := GetUpstreamEndpoint (c , account . Platform )
1499+ upstreamEndpoint := resolveOpenAIUpstreamEndpoint (c , account )
15001500 cyberBlocked := service .GetOpsCyberPolicy (c ) != nil
15011501 h .submitOpenAIUsageRecordTask (ctx , result , func (taskCtx context.Context ) {
15021502 if err := h .gatewayService .RecordUsage (taskCtx , & service.OpenAIRecordUsageInput {
@@ -2297,7 +2297,7 @@ func (h *OpenAIGatewayHandler) recordCyberPolicyIfMarked(c *gin.Context, apiKey
22972297 var accountID int64
22982298 if account != nil {
22992299 accountID = account .ID
2300- upstreamEndpoint = GetUpstreamEndpoint (c , account . Platform )
2300+ upstreamEndpoint = resolveOpenAIUpstreamEndpoint (c , account )
23012301 }
23022302 stream := false
23032303 if v , ok := c .Get (opsStreamKey ); ok {
0 commit comments