From 1720cbec2f317d921cb071d5734b833acd1dbdc5 Mon Sep 17 00:00:00 2001 From: Christiaan Arnoldus Date: Tue, 14 Jul 2026 21:33:34 +0200 Subject: [PATCH 1/2] fix(ai-gateway): enforce exclusive provider filters --- .../src/app/api/openrouter/[...path]/route.ts | 38 +++++++------------ .../src/lib/ai-gateway/llm-proxy-helpers.ts | 26 +++++++++++++ 2 files changed, 40 insertions(+), 24 deletions(-) diff --git a/apps/web/src/app/api/openrouter/[...path]/route.ts b/apps/web/src/app/api/openrouter/[...path]/route.ts index bf68536f4b..f528a685d6 100644 --- a/apps/web/src/app/api/openrouter/[...path]/route.ts +++ b/apps/web/src/app/api/openrouter/[...path]/route.ts @@ -56,6 +56,7 @@ import { forbiddenFreeModelResponse, storeAndPreviousResponseIdIsNotSupported, apiKindNotSupportedResponse, + checkExclusiveModelProviderAllowed, } from '@/lib/ai-gateway/llm-proxy-helpers'; import { ProxyErrorType } from '@/lib/proxy-error-types'; import { getBalanceAndOrgSettings } from '@/lib/organizations/organization-usage'; @@ -591,21 +592,6 @@ export async function POST(request: NextRequest): Promise From 348c54a9c2ff3b8443bf29fdaa09a5514d561057 Mon Sep 17 00:00:00 2001 From: Christiaan Arnoldus Date: Tue, 14 Jul 2026 21:45:27 +0200 Subject: [PATCH 2/2] Revert --- apps/web/src/app/api/openrouter/[...path]/route.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/web/src/app/api/openrouter/[...path]/route.ts b/apps/web/src/app/api/openrouter/[...path]/route.ts index f528a685d6..879500a751 100644 --- a/apps/web/src/app/api/openrouter/[...path]/route.ts +++ b/apps/web/src/app/api/openrouter/[...path]/route.ts @@ -791,6 +791,15 @@ export async function POST(request: NextRequest): Promise