From 80510e5f16d9dd1a9338cb49df88f4ffd4f81afa Mon Sep 17 00:00:00 2001 From: yangjianbo Date: Sat, 21 Feb 2026 12:36:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(gateway):=20=E6=98=8E=E7=A1=AE=E6=97=A7?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E6=8E=A5=E5=8F=A3=E4=B8=8D=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=9A=84=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将 /v1/chat/completions 的拦截文案改为旧协议不支持,避免误导为会路由到 Sora。 明确要求客户端改用 /v1/responses。 Co-Authored-By: Claude Opus 4.6 --- backend/internal/server/routes/gateway.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/internal/server/routes/gateway.go b/backend/internal/server/routes/gateway.go index 69881e70..930c8b9e 100644 --- a/backend/internal/server/routes/gateway.go +++ b/backend/internal/server/routes/gateway.go @@ -43,12 +43,12 @@ func RegisterGatewayRoutes( gateway.GET("/usage", h.Gateway.Usage) // OpenAI Responses API gateway.POST("/responses", h.OpenAIGateway.Responses) - // 明确阻止旧入口误用到 Sora,避免客户端把 OpenAI Chat Completions 当作 Sora 入口 + // 明确阻止旧协议入口:OpenAI 仅支持 Responses API,避免客户端误解为会自动路由到其它平台。 gateway.POST("/chat/completions", func(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{ "error": gin.H{ "type": "invalid_request_error", - "message": "For Sora, use /sora/v1/chat/completions. OpenAI should use /v1/responses.", + "message": "Unsupported legacy protocol: /v1/chat/completions is not supported. Please use /v1/responses.", }, }) })