Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

fix: include provider aliases in active provider filter (#353)

diegosouzapwa3369df62f17
diff --git a/src/app/api/models/route.ts b/src/app/api/models/route.ts
index d0153ac65d..6c317100b9 100644
--- a/src/app/api/models/route.ts
+++ b/src/app/api/models/route.ts
@@ -1,6 +1,6 @@
import { NextResponse } from "next/server";
import { getModelAliases, setModelAlias, getProviderConnections } from "@/models";
-import { AI_MODELS } from "@/shared/constants/config";
+import { AI_MODELS, PROVIDER_ID_TO_ALIAS } from "@/shared/constants/models";
import { updateModelAliasSchema } from "@/shared/validation/schemas";
import { isValidationFailure, validateBody } from "@/shared/validation/helpers";
@@ -18,7 +18,17 @@ export async function GET(request: Request) {
try {
const connections = await getProviderConnections();
const active = connections.filter((c: any) => c.isActive !== false);
- activeProviders = new Set(active.map((c: any) => c.provider));
+ // Include both provider IDs and their aliases in the active set.
+ // PROVIDER_MODELS keys are aliases (e.g. 'cc' for 'claude', 'gh' for 'github').
+ // DB connections are stored under provider IDs ('claude', 'github').
+ // Without this, models for aliased providers always appear unconfigured.
+ activeProviders = new Set<string>();
+ for (const c of active) {
+ const pId = String((c as any).provider);
+ activeProviders.add(pId);
+ const alias = PROVIDER_ID_TO_ALIAS[pId];
+ if (alias) activeProviders.add(alias);
+ }
} catch {
// If DB unavailable, show all models
}