diff --git a/app/api/common.ts b/app/api/common.ts index e5afb4d89f4..cd2936ee39f 100644 --- a/app/api/common.ts +++ b/app/api/common.ts @@ -20,6 +20,10 @@ export async function requestOpenai(req: NextRequest) { baseUrl = `${PROTOCOL}://${baseUrl}`; } + if (baseUrl.endsWith('/')) { + baseUrl = baseUrl.slice(0, -1); + } + console.log("[Proxy] ", openaiPath); console.log("[Base Url]", baseUrl);