chore: fix

This commit is contained in:
Lluis Agusti
2026-01-29 00:56:45 +07:00
parent b9c6871a8d
commit 6bd4318374

View File

@@ -1,3 +1,4 @@
import { getServerAuthToken } from "@/lib/autogpt-server-api/helpers";
import { NextRequest, NextResponse } from "next/server";
const WHISPER_API_URL = "https://api.openai.com/v1/audio/transcriptions";
@@ -9,6 +10,12 @@ function getExtensionFromMimeType(mimeType: string): string {
}
export async function POST(request: NextRequest) {
const token = await getServerAuthToken();
if (!token) {
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
}
const apiKey = process.env.OPENAI_API_KEY;
if (!apiKey) {