refactor(byok): move models suggestions list to server config models-list and fetch dynamically via API
Some checks failed
CI / Deploy production (on server) (push) Has been cancelled
CI / Lint, Unit Tests & Build (push) Has been cancelled

This commit is contained in:
Antigravity
2026-05-28 21:44:55 +00:00
parent 11a07adee7
commit 6703e75bf3
3 changed files with 26 additions and 21 deletions

View File

@@ -22,6 +22,8 @@ const createSchema = z.object({
baseUrl: z.string().url().optional(),
});
import { PROVIDER_MODEL_SUGGESTIONS } from '@/lib/ai/models-list';
export async function GET() {
const session = await auth();
if (!session?.user?.id) {
@@ -36,6 +38,7 @@ export async function GET() {
return NextResponse.json({
keys: keys.map(toPublicApiKey),
allowedProviders: getAllowedByokProviders(await getEffectiveTier(session.user.id)),
providerModels: PROVIDER_MODEL_SUGGESTIONS,
});
}