From 8b9cac180ee6ebe8b395af83433f92b4c6f10d3e Mon Sep 17 00:00:00 2001 From: Ella CEO Date: Thu, 16 Jul 2026 15:55:56 +0700 Subject: [PATCH] fix(alicode-intl): use DashScope compatible-mode endpoint so standard keys work Switch baseUrl from coding-intl.dashscope.aliyuncs.com (Coding Plan keys only) to dashscope-intl.aliyuncs.com/compatible-mode so ordinary DashScope API keys authenticate. Path /v1/chat/completions and preserveCacheControl quirk unchanged. Fixes #2591 --- open-sse/providers/registry/alicode-intl.js | 2 +- tests/unit/alicode-intl-endpoint-2591.test.js | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 tests/unit/alicode-intl-endpoint-2591.test.js diff --git a/open-sse/providers/registry/alicode-intl.js b/open-sse/providers/registry/alicode-intl.js index b2eca7d8..b93d1d89 100644 --- a/open-sse/providers/registry/alicode-intl.js +++ b/open-sse/providers/registry/alicode-intl.js @@ -14,7 +14,7 @@ export default { }, category: "apikey", transport: { - baseUrl: "https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions", + baseUrl: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions", headers: {}, quirks: { preserveCacheControl: true }, }, diff --git a/tests/unit/alicode-intl-endpoint-2591.test.js b/tests/unit/alicode-intl-endpoint-2591.test.js new file mode 100644 index 00000000..7779328f --- /dev/null +++ b/tests/unit/alicode-intl-endpoint-2591.test.js @@ -0,0 +1,24 @@ +// #2591 — Alibaba Intl (alicode-intl) must use the OpenAI-compatible-mode +// DashScope endpoint so standard DashScope API keys work. The previous +// coding-intl host only accepted Alibaba Coding Plan keys and rejected +// ordinary DashScope keys with "Invalid API key". +import { describe, it, expect } from "vitest"; +import alicodeIntl from "../../open-sse/providers/registry/alicode-intl.js"; + +describe("alicode-intl endpoint (issue #2591)", () => { + it("routes to the compatible-mode DashScope endpoint", () => { + expect(alicodeIntl.id).toBe("alicode-intl"); + expect(alicodeIntl.transport.baseUrl).toBe( + "https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions" + ); + }); + + it("does not use the coding-intl host that rejects standard keys", () => { + expect(alicodeIntl.transport.baseUrl).not.toContain("coding-intl.dashscope.aliyuncs.com"); + }); + + it("keeps the chat/completions path and preserveCacheControl quirk", () => { + expect(alicodeIntl.transport.baseUrl).toContain("/v1/chat/completions"); + expect(alicodeIntl.transport.quirks.preserveCacheControl).toBe(true); + }); +});