diff --git a/apps/web/.sample.env b/apps/web/.sample.env index b91d8d9..b802899 100644 --- a/apps/web/.sample.env +++ b/apps/web/.sample.env @@ -1 +1,2 @@ -AI_GATEWAY_API_KEY=xxx \ No newline at end of file +AI_GATEWAY_API_KEY=xxx +AI_GATEWAY_ENABLED=false \ No newline at end of file diff --git a/apps/web/app/api/prompt-patterns/route.ts b/apps/web/app/api/prompt-patterns/route.ts index 9949e39..b8a488a 100644 --- a/apps/web/app/api/prompt-patterns/route.ts +++ b/apps/web/app/api/prompt-patterns/route.ts @@ -6,6 +6,13 @@ const MODEL_ID = "openai/gpt-5.4-mini"; export const maxDuration = 30; export async function POST(req: Request) { + if (process.env.AI_GATEWAY_ENABLED !== "true") { + return Response.json( + { error: "AI gateway is currently disabled." }, + { status: 503 } + ); + } + const { messages, pattern,