2026-06-20 10:09:50 +07:00
|
|
|
import { CLAUDE_API_HEADERS } from "../shared.js";
|
|
|
|
|
|
2026-09-10 23:41:40 +07:00
|
|
|
// Dual auth (same pattern as kimi):
|
|
|
|
|
// - API key (sk-...) → cloud API on api.xiaomimimo.com
|
|
|
|
|
// - Desktop account/OAuth → same cloud host, plus the Desktop-exclusive Preview
|
|
|
|
|
// models served by the account-service route on mimo-server-cn.xiaomimimo.com
|
|
|
|
|
// (authorized by a Xiaomi account session cookie, not the key).
|
|
|
|
|
// Endpoint is picked per model in the executor, same as opencode-go's /responses split.
|
2026-06-13 21:08:37 +07:00
|
|
|
export default {
|
2026-06-14 14:32:59 +07:00
|
|
|
id: "xiaomi-mimo",
|
2026-06-14 18:49:38 +07:00
|
|
|
priority: 290,
|
2026-06-14 14:32:59 +07:00
|
|
|
alias: "xiaomi-mimo",
|
|
|
|
|
aliases: [
|
|
|
|
|
"mimo",
|
2026-09-10 23:41:40 +07:00
|
|
|
"mimo-desktop",
|
|
|
|
|
"xmd",
|
2026-06-14 14:32:59 +07:00
|
|
|
],
|
|
|
|
|
uiAlias: "mimo",
|
2026-06-14 13:15:48 +07:00
|
|
|
display: {
|
2026-06-14 14:32:59 +07:00
|
|
|
name: "Xiaomi MiMo",
|
|
|
|
|
icon: "smart_toy",
|
|
|
|
|
color: "#FF6900",
|
|
|
|
|
textIcon: "XM",
|
|
|
|
|
website: "https://xiaomimimo.com",
|
|
|
|
|
notice: {
|
2026-08-05 11:45:27 +07:00
|
|
|
apiKeyUrl: "https://platform.xiaomimimo.com/console/api-keys",
|
2026-09-10 23:41:40 +07:00
|
|
|
signupUrl: "https://mimo.xiaomimimo.com/desktop/invite/",
|
2026-06-14 14:32:59 +07:00
|
|
|
},
|
2026-06-14 13:15:48 +07:00
|
|
|
},
|
2026-09-10 23:41:40 +07:00
|
|
|
category: "oauth",
|
|
|
|
|
authModes: ["oauth", "apikey"],
|
|
|
|
|
hasOAuth: true,
|
2026-08-05 11:45:27 +07:00
|
|
|
serviceKinds: ["llm", "tts"],
|
2026-06-14 14:32:59 +07:00
|
|
|
transport: {
|
|
|
|
|
baseUrl: "https://api.xiaomimimo.com/v1/chat/completions",
|
|
|
|
|
validateUrl: "https://api.xiaomimimo.com/v1/models",
|
2026-06-13 21:08:37 +07:00
|
|
|
},
|
2026-06-20 10:09:50 +07:00
|
|
|
// Multi-endpoint: pick the transport matching client sourceFormat to skip translation.
|
|
|
|
|
transports: [
|
|
|
|
|
{
|
|
|
|
|
format: "openai",
|
|
|
|
|
baseUrl: "https://api.xiaomimimo.com/v1/chat/completions",
|
|
|
|
|
auth: { combined: true, header: "Authorization", scheme: "bearer" },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
format: "claude",
|
|
|
|
|
baseUrl: "https://api.xiaomimimo.com/anthropic/v1/messages",
|
|
|
|
|
headers: { ...CLAUDE_API_HEADERS },
|
|
|
|
|
auth: { combined: true, header: "x-api-key", scheme: "raw" },
|
|
|
|
|
},
|
|
|
|
|
],
|
2026-06-14 14:32:59 +07:00
|
|
|
models: [
|
2026-09-10 23:41:40 +07:00
|
|
|
// Desktop-exclusive — served by the account-service route, which only accepts
|
|
|
|
|
// OpenAI format, so supportedFormats pins them to the openai transport.
|
|
|
|
|
{ id: "mimo-x-pro-preview", name: "MiMo-X-Pro-Preview", upstreamModelId: "xiaomi/mimo-x-pro-preview", supportedFormats: ["openai"] },
|
|
|
|
|
{ id: "mimo-x-flash-preview", name: "MiMo-X-Flash-Preview", upstreamModelId: "xiaomi/mimo-x-flash-preview", supportedFormats: ["openai"] },
|
|
|
|
|
// Cloud API models (api.xiaomimimo.com/v1)
|
2026-06-14 14:32:59 +07:00
|
|
|
{ id: "mimo-v2.5-pro", name: "MiMo V2.5 Pro" },
|
|
|
|
|
{ id: "mimo-v2.5", name: "MiMo V2.5" },
|
|
|
|
|
{ id: "mimo-v2-omni", name: "MiMo V2 Omni" },
|
|
|
|
|
{ id: "mimo-v2-flash", name: "MiMo V2 Flash" },
|
2026-08-05 11:45:27 +07:00
|
|
|
{ id: "mimo-v2.5-tts", name: "MiMo V2.5 TTS", kind: "tts" },
|
2026-06-14 14:32:59 +07:00
|
|
|
],
|
2026-08-05 11:45:27 +07:00
|
|
|
ttsConfig: {
|
|
|
|
|
baseUrl: "https://api.xiaomimimo.com/v1/chat/completions",
|
|
|
|
|
authType: "apikey",
|
|
|
|
|
authHeader: "bearer",
|
|
|
|
|
format: "xiaomi-mimo-tts",
|
|
|
|
|
},
|
2026-09-10 23:41:40 +07:00
|
|
|
features: {
|
|
|
|
|
usage: true,
|
|
|
|
|
usageApikey: true,
|
|
|
|
|
},
|
|
|
|
|
// Custom OAuth — non-standard ECDH encrypted-callback flow.
|
|
|
|
|
// Handled by the Xiaomi MiMo OAuth service, not the generic PKCE pipeline.
|
|
|
|
|
oauth: {
|
|
|
|
|
custom: true,
|
|
|
|
|
authorizeUrl: "https://platform.xiaomimimo.com/authorize",
|
|
|
|
|
// The callback carries ?u=<ECDH-encrypted payload> instead of ?code=.
|
|
|
|
|
// Decryption yields { uid, sk, url }.
|
|
|
|
|
callbackParam: "u",
|
|
|
|
|
kn: "mimocode",
|
|
|
|
|
},
|
2026-06-13 21:08:37 +07:00
|
|
|
};
|