diff --git a/src/pages/api/chat.ts b/src/pages/api/chat.ts index 233ca1f..f644b3a 100644 --- a/src/pages/api/chat.ts +++ b/src/pages/api/chat.ts @@ -1,10 +1,5 @@ -import { - createParser, - ParsedEvent, - ReconnectInterval, -} from "eventsource-parser"; +import { createParser, ParsedEvent, ReconnectInterval } from "eventsource-parser"; import { NextRequest } from "next/server"; -import { API_KEY } from "@/env"; import { openAIApiEndpoint, openAIApiKey, gpt35 } from "@/utils"; export const config = { @@ -18,15 +13,6 @@ const getApiEndpoint = (apiEndpoint: string) => { }; const handler = async (req: NextRequest) => { - if (API_KEY) { - const auth = req.headers.get("Authorization"); - if (!auth || auth !== `Bearer ${API_KEY}`) { - return new Response("Unauthorized", { - status: 401, - }); - } - } - const reqBody = await req.json(); const openAIApiConfig = reqBody.openAIApiConfig; const apiKey = openAIApiConfig?.key || openAIApiKey;