diff --git a/open-sse/config/providers/index.ts b/open-sse/config/providers/index.ts index a36b2ce99b..662dd552fc 100644 --- a/open-sse/config/providers/index.ts +++ b/open-sse/config/providers/index.ts @@ -1,6 +1,8 @@ import type { RegistryEntry } from "./shared.ts"; import { aimlapiProvider } from "./registry/aimlapi/index.ts"; +import { byteplusProvider } from "./registry/byteplus/index.ts"; +import { mimocodeProvider } from "./registry/mimocode/index.ts"; import { ollama_cloudProvider } from "./registry/ollama-cloud/index.ts"; import { syntheticProvider } from "./registry/synthetic/index.ts"; import { ideogramProvider } from "./registry/ideogram/index.ts"; @@ -320,4 +322,6 @@ export const REGISTRY: Record = { codex: codexProvider, venice: veniceProvider, kiro: kiroProvider, + byteplus: byteplusProvider, + mimocode: mimocodeProvider, }; diff --git a/open-sse/config/providers/registry/byteplus/index.ts b/open-sse/config/providers/registry/byteplus/index.ts new file mode 100644 index 0000000000..2acadce50a --- /dev/null +++ b/open-sse/config/providers/registry/byteplus/index.ts @@ -0,0 +1,21 @@ +import type { RegistryEntry } from "../../shared.ts"; + +// BytePlus ModelArk (Ark) — OpenAI-compatible, ap-southeast-1 region, Bearer auth. +// Re-added after the registry modularization (#3993) dropped it; restores #3877. +export const byteplusProvider: RegistryEntry = { + id: "byteplus", + alias: "bpm", + format: "openai", + executor: "default", + baseUrl: "https://ark.ap-southeast.bytepluses.com/api/v3/chat/completions", + modelsUrl: "https://ark.ap-southeast.bytepluses.com/api/v3/models", + authType: "apikey", + authHeader: "bearer", + defaultContextLength: 128000, + models: [ + { id: "seed-2.0", name: "Seed 2.0" }, + { id: "kimi-k2-thinking", name: "Kimi K2 Thinking", supportsReasoning: true }, + { id: "glm-4.7", name: "GLM 4.7" }, + { id: "gpt-oss-120b", name: "GPT-OSS-120B" }, + ], +}; diff --git a/open-sse/config/providers/registry/mimocode/index.ts b/open-sse/config/providers/registry/mimocode/index.ts new file mode 100644 index 0000000000..39023831c9 --- /dev/null +++ b/open-sse/config/providers/registry/mimocode/index.ts @@ -0,0 +1,16 @@ +import type { RegistryEntry } from "../../shared.ts"; +import { CHAT_OPENAI_COMPAT_MODELS } from "../../shared.ts"; + +// Mimocode (Xiaomi MiMo free OpenAI-compatible gateway) — no-auth, custom executor. +// Re-added after the registry modularization (#3993) dropped it; restores #3837. +export const mimocodeProvider: RegistryEntry = { + id: "mimocode", + alias: "mcode", + format: "openai", + executor: "mimocode", + baseUrl: "https://api.xiaomimimo.com", + chatPath: "/api/free-ai/openai/chat", + authType: "none", + authHeader: "none", + models: CHAT_OPENAI_COMPAT_MODELS["mimocode"], +}; diff --git a/tests/unit/provider-validation-specialty.test.ts b/tests/unit/provider-validation-specialty.test.ts index af8255ba02..8d0faa9ec4 100644 --- a/tests/unit/provider-validation-specialty.test.ts +++ b/tests/unit/provider-validation-specialty.test.ts @@ -2655,7 +2655,10 @@ test("qwen-web validator probes /api/v2/user (not /api/v2/models) and returns va globalThis.fetch = async (url, init = {}) => { probedUrl = String(url); sentHeaders = toPlainHeaders(init.headers); - return new Response(JSON.stringify({ data: { id: "u-1", name: "Tester" } }), { + // Qwen's /api/v2/user returns a real user object for a valid session. Since + // #3958 the validator inspects the body for `user` (Qwen answers 200 even for + // invalid tokens), so a valid response must carry one. + return new Response(JSON.stringify({ user: { id: "u-1", name: "Tester" } }), { status: 200, headers: { "content-type": "application/json" }, });