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
This commit is contained in:
@@ -14,7 +14,7 @@ export default {
|
|||||||
},
|
},
|
||||||
category: "apikey",
|
category: "apikey",
|
||||||
transport: {
|
transport: {
|
||||||
baseUrl: "https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions",
|
baseUrl: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions",
|
||||||
headers: {},
|
headers: {},
|
||||||
quirks: { preserveCacheControl: true },
|
quirks: { preserveCacheControl: true },
|
||||||
},
|
},
|
||||||
|
|||||||
24
tests/unit/alicode-intl-endpoint-2591.test.js
Normal file
24
tests/unit/alicode-intl-endpoint-2591.test.js
Normal file
@@ -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);
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user