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:
Ella CEO
2026-07-16 15:55:56 +07:00
committed by decolua
parent 30d0f6d3d8
commit 8b9cac180e
2 changed files with 25 additions and 1 deletions

View File

@@ -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 },
}, },

View 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);
});
});