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

remove cc compatible models listing configuration

R.D.e7e4bf39fe1a
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d32417d91e..33df7fc8cd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,7 +4,7 @@
### 🐛 Bug Fixes
-- **CC Compatible UX & Streaming:** Unified the Add CC/OpenAI/Anthropic compatible actions around the Anthropic UI treatment, and forced CC-compatible upstream requests to use SSE while still returning streaming or non-streaming responses based on the client request.
+- **CC Compatible UX & Streaming:** Unified the Add CC/OpenAI/Anthropic compatible actions around the Anthropic UI treatment, forced CC-compatible upstream requests to use SSE while still returning streaming or non-streaming responses based on the client request, and removed CC model-list configuration/import support in favor of an explicit unsupported-model-listing error.
---
diff --git a/src/app/(dashboard)/dashboard/providers/[id]/page.tsx b/src/app/(dashboard)/dashboard/providers/[id]/page.tsx
index e941a11b93..d247a4caf9 100644
--- a/src/app/(dashboard)/dashboard/providers/[id]/page.tsx
+++ b/src/app/(dashboard)/dashboard/providers/[id]/page.tsx
@@ -471,7 +471,6 @@ interface EditCompatibleNodeModalProps {
const CC_COMPATIBLE_LABEL = "CC Compatible";
const CC_COMPATIBLE_DETAILS_TITLE = "CC Compatible Details";
const CC_COMPATIBLE_DEFAULT_CHAT_PATH = "/v1/messages?beta=true";
-const CC_COMPATIBLE_DEFAULT_MODELS_PATH = "/models";
function normalizeCodexLimitPolicy(policy: unknown): { use5h: boolean; useWeekly: boolean } {
const record =
@@ -5110,13 +5109,13 @@ function EditCompatibleNodeModal({
? "https://api.anthropic.com/v1"
: "https://api.openai.com/v1"),
chatPath: node.chatPath || (isCcCompatible ? CC_COMPATIBLE_DEFAULT_CHAT_PATH : ""),
- modelsPath: node.modelsPath || (isCcCompatible ? CC_COMPATIBLE_DEFAULT_MODELS_PATH : ""),
+ modelsPath: isCcCompatible ? "" : node.modelsPath || "",
});
setShowAdvanced(
!!(
node.chatPath ||
- node.modelsPath ||
- (isCcCompatible && !node.chatPath && !node.modelsPath)
+ (!isCcCompatible && node.modelsPath) ||
+ (isCcCompatible && !node.chatPath)
)
);
}
@@ -5136,8 +5135,7 @@ function EditCompatibleNodeModal({
prefix: formData.prefix,
baseUrl: formData.baseUrl,
chatPath: formData.chatPath || (isCcCompatible ? CC_COMPATIBLE_DEFAULT_CHAT_PATH : ""),
- modelsPath:
- formData.modelsPath || (isCcCompatible ? CC_COMPATIBLE_DEFAULT_MODELS_PATH : ""),
+ modelsPath: isCcCompatible ? "" : formData.modelsPath,
};
if (!isAnthropic) {
payload.apiType = formData.apiType;
@@ -5160,8 +5158,7 @@ function EditCompatibleNodeModal({
type: isAnthropic ? "anthropic-compatible" : "openai-compatible",
compatMode: isCcCompatible ? "cc" : undefined,
chatPath: formData.chatPath || (isCcCompatible ? CC_COMPATIBLE_DEFAULT_CHAT_PATH : ""),
- modelsPath:
- formData.modelsPath || (isCcCompatible ? CC_COMPATIBLE_DEFAULT_MODELS_PATH : ""),
+ modelsPath: isCcCompatible ? "" : formData.modelsPath,
}),
});
const data = await res.json();
@@ -5273,15 +5270,15 @@ function EditCompatibleNodeModal({
: t("chatPathHint")
}
/>
- <Input
- label={isCcCompatible ? "Models Path" : t("modelsPathLabel")}
- value={formData.modelsPath}
- onChange={(e) => setFormData({ ...formData, modelsPath: e.target.value })}
- placeholder={
- isCcCompatible ? CC_COMPATIBLE_DEFAULT_MODELS_PATH : t("modelsPathPlaceholder")
- }
- hint={isCcCompatible ? "Defaults to /models" : t("modelsPathHint")}
- />
+ {!isCcCompatible && (
+ <Input
+ label={t("modelsPathLabel")}
+ value={formData.modelsPath}
+ onChange={(e) => setFormData({ ...formData, modelsPath: e.target.value })}
+ placeholder={t("modelsPathPlaceholder")}
+ hint={t("modelsPathHint")}
+ />
+ )}
</div>
)}
<div className="flex gap-2">
diff --git a/src/app/(dashboard)/dashboard/providers/page.tsx b/src/app/(dashboard)/dashboard/providers/page.tsx
index 2dee7dca97..d4fa666c34 100644
--- a/src/app/(dashboard)/dashboard/providers/page.tsx
+++ b/src/app/(dashboard)/dashboard/providers/page.tsx
@@ -30,7 +30,6 @@ import { useTranslations } from "next-intl";
const CC_COMPATIBLE_LABEL = "CC Compatible";
const ADD_CC_COMPATIBLE_LABEL = "Add CC Compatible";
const CC_COMPATIBLE_DEFAULT_CHAT_PATH = "/v1/messages?beta=true";
-const CC_COMPATIBLE_DEFAULT_MODELS_PATH = "/models";
// Shared helper function to avoid code duplication between ProviderCard and ApiKeyProviderCard
function getStatusDisplay(connected, error, errorCode, t) {
@@ -1287,7 +1286,6 @@ function AddCcCompatibleModal({ isOpen, onClose, onCreated }) {
prefix: "",
baseUrl: "https://api.anthropic.com",
chatPath: CC_COMPATIBLE_DEFAULT_CHAT_PATH,
- modelsPath: CC_COMPATIBLE_DEFAULT_MODELS_PATH,
});
const [submitting, setSubmitting] = useState(false);
const [checkKey, setCheckKey] = useState("");
@@ -1316,7 +1314,6 @@ function AddCcCompatibleModal({ isOpen, onClose, onCreated }) {
type: "anthropic-compatible",
compatMode: "cc",
chatPath: formData.chatPath || CC_COMPATIBLE_DEFAULT_CHAT_PATH,
- modelsPath: formData.modelsPath || CC_COMPATIBLE_DEFAULT_MODELS_PATH,
}),
});
const data = await res.json();
@@ -1327,7 +1324,6 @@ function AddCcCompatibleModal({ isOpen, onClose, onCreated }) {
prefix: "",
baseUrl: "https://api.anthropic.com",
chatPath: CC_COMPATIBLE_DEFAULT_CHAT_PATH,
- modelsPath: CC_COMPATIBLE_DEFAULT_MODELS_PATH,
});
setCheckKey("");
setValidationResult(null);
@@ -1352,7 +1348,6 @@ function AddCcCompatibleModal({ isOpen, onClose, onCreated }) {
type: "anthropic-compatible",
compatMode: "cc",
chatPath: formData.chatPath || CC_COMPATIBLE_DEFAULT_CHAT_PATH,
- modelsPath: formData.modelsPath || CC_COMPATIBLE_DEFAULT_MODELS_PATH,
}),
});
const data = await res.json();
@@ -1415,13 +1410,6 @@ function AddCcCompatibleModal({ isOpen, onClose, onCreated }) {
placeholder={CC_COMPATIBLE_DEFAULT_CHAT_PATH}
hint={t("chatPathHint")}
/>
- <Input
- label={t("modelsPathLabel")}
- value={formData.modelsPath}
- onChange={(e) => setFormData({ ...formData, modelsPath: e.target.value })}
- placeholder={CC_COMPATIBLE_DEFAULT_MODELS_PATH}
- hint={t("modelsPathHint")}
- />
</div>
)}
<div className="flex gap-2">
diff --git a/src/app/api/provider-nodes/[id]/route.ts b/src/app/api/provider-nodes/[id]/route.ts
index c930d3b246..ef1dc3b8e4 100644
--- a/src/app/api/provider-nodes/[id]/route.ts
+++ b/src/app/api/provider-nodes/[id]/route.ts
@@ -83,7 +83,7 @@ export async function PUT(request: Request, { params }: { params: Promise<{ id:
prefix: prefix.trim(),
baseUrl: sanitizedBaseUrl,
chatPath: chatPath || null,
- modelsPath: modelsPath || null,
+ modelsPath: isClaudeCodeCompatibleProvider(id) ? null : modelsPath || null,
};
if (node.type === "openai-compatible") {
@@ -105,8 +105,12 @@ export async function PUT(request: Request, { params }: { params: Promise<{ id:
baseUrl: sanitizedBaseUrl,
nodeName: updated.name,
chatPath: updated.chatPath || undefined,
- modelsPath: updated.modelsPath || undefined,
} as JsonRecord;
+ if (updated.modelsPath) {
+ providerSpecificData.modelsPath = updated.modelsPath;
+ } else {
+ delete providerSpecificData.modelsPath;
+ }
if (node.type === "openai-compatible") {
providerSpecificData.apiType = apiType;
}
diff --git a/src/app/api/provider-nodes/route.ts b/src/app/api/provider-nodes/route.ts
index e436335645..b58f159d27 100644
--- a/src/app/api/provider-nodes/route.ts
+++ b/src/app/api/provider-nodes/route.ts
@@ -109,7 +109,7 @@ export async function POST(request) {
baseUrl: sanitizedBaseUrl,
name: name.trim(),
chatPath: chatPath || null,
- modelsPath: modelsPath || null,
+ modelsPath: compatMode === "cc" ? null : modelsPath || null,
});
return NextResponse.json({ node }, { status: 201 });
}
diff --git a/src/app/api/provider-nodes/validate/route.ts b/src/app/api/provider-nodes/validate/route.ts
index 5b96a4c8a2..27d6b9f4e7 100644
--- a/src/app/api/provider-nodes/validate/route.ts
+++ b/src/app/api/provider-nodes/validate/route.ts
@@ -57,7 +57,6 @@ export async function POST(request) {
providerSpecificData: {
baseUrl: sanitizeClaudeCodeCompatibleBaseUrl(baseUrl),
chatPath: chatPath || undefined,
- modelsPath: modelsPath || undefined,
},
});
diff --git a/src/app/api/providers/[id]/models/route.ts b/src/app/api/providers/[id]/models/route.ts
index 78d098a567..f40867e4fc 100644
--- a/src/app/api/providers/[id]/models/route.ts
+++ b/src/app/api/providers/[id]/models/route.ts
@@ -1,6 +1,7 @@
import { NextResponse } from "next/server";
import { getProviderConnectionById } from "@/models";
import {
+ isClaudeCodeCompatibleProvider,
isOpenAICompatibleProvider,
isAnthropicCompatibleProvider,
} from "@/shared/constants/providers";
@@ -555,6 +556,13 @@ export async function GET(
}
if (isAnthropicCompatibleProvider(provider)) {
+ if (isClaudeCodeCompatibleProvider(provider)) {
+ return NextResponse.json(
+ { error: `Provider ${provider} does not support models listing` },
+ { status: 400 }
+ );
+ }
+
let baseUrl = getProviderBaseUrl(connection.providerSpecificData);
if (!baseUrl) {
return NextResponse.json(
diff --git a/tests/unit/cc-compatible-provider.test.mjs b/tests/unit/cc-compatible-provider.test.mjs
index 23af6abb8f..ddae9a8640 100644
--- a/tests/unit/cc-compatible-provider.test.mjs
+++ b/tests/unit/cc-compatible-provider.test.mjs
@@ -8,6 +8,7 @@ const TEST_DATA_DIR = fs.mkdtempSync(path.join(os.tmpdir(), "omniroute-cc-compat
process.env.DATA_DIR = TEST_DATA_DIR;
const core = await import("../../src/lib/db/core.ts");
+const providersDb = await import("../../src/lib/db/providers.ts");
const { DefaultExecutor } = await import("../../open-sse/executors/default.ts");
const {
buildClaudeCodeCompatibleRequest,
@@ -21,6 +22,7 @@ const { validateProviderApiKey } = await import("../../src/lib/providers/validat
const providerNodesRoute = await import("../../src/app/api/provider-nodes/route.ts");
const providerNodesValidateRoute =
await import("../../src/app/api/provider-nodes/validate/route.ts");
+const providerModelsRoute = await import("../../src/app/api/providers/[id]/models/route.ts");
const originalFetch = globalThis.fetch;
const originalFlag = process.env.ENABLE_CC_COMPATIBLE_PROVIDER;
@@ -398,7 +400,7 @@ test("provider-nodes create route creates CC node with dedicated prefix when ena
assert.match(data.node.id, /^anthropic-compatible-cc-/);
assert.equal(data.node.baseUrl, "https://proxy.example.com");
assert.equal(data.node.chatPath, CLAUDE_CODE_COMPATIBLE_DEFAULT_CHAT_PATH);
- assert.equal(data.node.modelsPath, CLAUDE_CODE_COMPATIBLE_DEFAULT_MODELS_PATH);
+ assert.equal(data.node.modelsPath, null);
});
test("provider-nodes validate route rejects CC mode when feature flag is disabled", async () => {
@@ -429,3 +431,28 @@ test("provider-nodes list route exposes CC flag state from server env", async ()
const data = await response.json();
assert.equal(data.ccCompatibleProviderEnabled, true);
});
+
+test("provider models route reports CC compatible providers do not support models listing", async () => {
+ process.env.ENABLE_CC_COMPATIBLE_PROVIDER = "true";
+
+ const connection = await providersDb.createProviderConnection({
+ provider: "anthropic-compatible-cc-test",
+ authType: "apikey",
+ name: "cc-live",
+ apiKey: "sk-test",
+ providerSpecificData: {
+ baseUrl: "https://proxy.example.com",
+ chatPath: CLAUDE_CODE_COMPATIBLE_DEFAULT_CHAT_PATH,
+ },
+ });
+
+ const response = await providerModelsRoute.GET(
+ new Request(`http://localhost/api/providers/${connection.id}/models`),
+ { params: { id: connection.id } }
+ );
+
+ assert.equal(response.status, 400);
+ assert.deepEqual(await response.json(), {
+ error: "Provider anthropic-compatible-cc-test does not support models listing",
+ });
+});