diff --git a/src/app/api/models/route.ts b/src/app/api/models/route.ts index 17ed086..ad04fff 100644 --- a/src/app/api/models/route.ts +++ b/src/app/api/models/route.ts @@ -12,7 +12,10 @@ export async function GET(req: NextRequest): Promise { headers.set("Authorization", `Bearer ${apiKey}`); headers.set("api-key", apiKey); } - const res = await fetch(`${baseUrl}/v1/models`, { headers }); + const res = await fetch(`${baseUrl}/v1/models`, { + headers: headers, + cache: "no-store", + }); if (res.status !== 200) { const statusText = res.statusText; const responseBody = await res.text(); diff --git a/src/components/chat/chat-topbar.tsx b/src/components/chat/chat-topbar.tsx index 5231419..0a1abb4 100644 --- a/src/components/chat/chat-topbar.tsx +++ b/src/components/chat/chat-topbar.tsx @@ -51,13 +51,7 @@ export default function ChatTopbar({ return null; } try { - const res = await fetch(basePath + "/api/models", { - method: "GET", - headers: { - "Content-Type": "application/json", - "cache-control": "no-cache", - }, - }); + const res = await fetch(basePath + "/api/models"); if (!res.ok) { const errorResponse = await res.json();