diff --git a/src/app/(dashboard)/dashboard/providers/[id]/components/modals/AddApiKeyModal.tsx b/src/app/(dashboard)/dashboard/providers/[id]/components/modals/AddApiKeyModal.tsx
index 7e74679dbe..de377cd9cb 100644
--- a/src/app/(dashboard)/dashboard/providers/[id]/components/modals/AddApiKeyModal.tsx
+++ b/src/app/(dashboard)/dashboard/providers/[id]/components/modals/AddApiKeyModal.tsx
@@ -435,7 +435,7 @@ export default function AddApiKeyModal({
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
- provider,
+ provider: provider === "kimi-coding" ? "kimi-coding-apikey" : provider,
entries: parsed.entries.map((e) => ({
name: e.name,
apiKey: e.apiKey,
diff --git a/src/app/(dashboard)/dashboard/providers/[id]/components/modals/__tests__/connModals.test.tsx b/src/app/(dashboard)/dashboard/providers/[id]/components/modals/__tests__/connModals.test.tsx
index 74db3db3c1..36064cd75a 100644
--- a/src/app/(dashboard)/dashboard/providers/[id]/components/modals/__tests__/connModals.test.tsx
+++ b/src/app/(dashboard)/dashboard/providers/[id]/components/modals/__tests__/connModals.test.tsx
@@ -241,6 +241,49 @@ describe("conn-modals (Phase 1c extraction)", () => {
);
});
+ it("AddApiKeyModal remaps Kimi Code bulk API-key additions to the admitted provider id", async () => {
+ const fetchMock = vi.fn(() =>
+ Promise.resolve({
+ ok: true,
+ json: async () => ({ success: 1, failed: 0, total: 1, errors: [] }),
+ text: async () => "",
+ } as Response)
+ );
+ vi.stubGlobal("fetch", fetchMock);
+ const c = renderModal(
+
+ );
+
+ const bulkTab = Array.from(c.querySelectorAll("button")).find(
+ (button) => button.textContent === "providers.bulkTabBulkAdd"
+ );
+ act(() => bulkTab!.click());
+ const bulkInput = c.querySelector("textarea");
+ setTextareaValue(bulkInput!, "main|sk-kimi-test");
+ const submitButton = Array.from(c.querySelectorAll("button")).find(
+ (button) => button.textContent === "providers.bulkAddAllKeys"
+ );
+ await act(async () => {
+ submitButton!.click();
+ await Promise.resolve();
+ await Promise.resolve();
+ });
+
+ expect(fetchMock).toHaveBeenCalledWith(
+ "/api/providers/bulk",
+ expect.objectContaining({
+ body: expect.stringContaining('"provider":"kimi-coding-apikey"'),
+ })
+ );
+ });
+
it("AddApiKeyModal does not infer a regional provider selection", () => {
const c = renderModal(