fix(alicode-intl): split into Coding Plan + Model Studio providers

8b9cac1 swapped alicode-intl to the DashScope compatible-mode endpoint to
fix #2591 for standard DashScope keys, but that broke Coding Plan keys
(sk-sp-...) which only work on coding-intl.dashscope.aliyuncs.com. The two
key types use two different hosts and are not interchangeable.

- alicode-intl: revert to coding-intl endpoint (Coding Plan keys)
- alims-intl: new provider for dashscope-intl/compatible-mode (standard keys)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
decolua
2026-07-19 16:29:55 +07:00
co-authored by Claude Fable 5
parent c4a120af8f
commit 55628eea02
9 changed files with 86 additions and 19 deletions
@@ -229,6 +229,14 @@ const PROVIDER_MODELS_CONFIG = {
authPrefix: "Bearer ",
parseResponse: (data) => data.data || []
},
"alims-intl": {
url: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1/models",
method: "GET",
headers: { "Content-Type": "application/json" },
authHeader: "Authorization",
authPrefix: "Bearer ",
parseResponse: (data) => data.data || []
},
"volcengine-ark": createOpenAIModelsConfig("https://ark.cn-beijing.volces.com/api/coding/v3/models"),
byteplus: createOpenAIModelsConfig("https://ark.ap-southeast.bytepluses.com/api/coding/v3/models"),
+5 -2
View File
@@ -620,10 +620,13 @@ async function testApiKeyConnection(connection, effectiveProxy = null) {
return { valid, error: valid ? null : "Invalid API key" };
}
case "alicode":
case "alicode-intl": {
// Aliyun Coding Plan uses OpenAI-compatible API
case "alicode-intl":
case "alims-intl": {
// Aliyun Coding Plan uses OpenAI-compatible API; alims-intl uses Model Studio compatible-mode
const aliBaseUrl = connection.provider === "alicode-intl"
? "https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions"
: connection.provider === "alims-intl"
? "https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions"
: "https://coding.dashscope.aliyuncs.com/v1/chat/completions";
const res = await fetchWithConnectionProxy(aliBaseUrl, {
method: "POST",
+2 -1
View File
@@ -301,11 +301,12 @@ export async function POST(request) {
case "minimax":
case "minimax-cn":
case "alicode-intl":
case "alims-intl":
case "alicode":
case "agentrouter": {
// Use baseUrl from PROVIDERS (DRY); separate openai-format vs claude-format flow
const cfg = PROVIDERS[provider];
const isOpenAiFormat = provider === "glm-cn" || provider === "alicode" || provider === "alicode-intl";
const isOpenAiFormat = provider === "glm-cn" || provider === "alicode" || provider === "alicode-intl" || provider === "alims-intl";
if (isOpenAiFormat) {
const testModel = getDefaultModel(provider);