mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-02 21:07:33 +08:00
Adds first-class Xiaomi Token Plan provider support with regional onboarding/configuration, token-plan key prefix validation, runtime pricing/catalog metadata, and docs/test coverage. Keeps Token Plan model catalog discovery runtime-owned so region-specific base URLs are required and the provider cannot silently fall back to the static SGP manifest catalog. Fixes #86169. Verification: - node scripts/run-vitest.mjs src/plugins/provider-discovery.runtime.test.ts extensions/xiaomi/index.test.ts src/plugins/manifest-model-catalog.test.ts src/model-catalog/manifest-planner.test.ts - git diff --check - autoreview --mode local: clean, no accepted/actionable findings - CI run 26678998539: all relevant checks passed; check-prod-types failed on unrelated browser unused-function issue already present on origin/main Co-authored-by: NianJiuZst <3235467914@qq.com> Co-authored-by: Peter Steinberger <steipete@gmail.com>
199 lines
5.9 KiB
JSON
199 lines
5.9 KiB
JSON
{
|
|
"id": "xiaomi",
|
|
"activation": {
|
|
"onStartup": false
|
|
},
|
|
"enabledByDefault": true,
|
|
"providers": ["xiaomi", "xiaomi-token-plan"],
|
|
"autoEnableWhenConfiguredProviders": ["xiaomi", "xiaomi-token-plan"],
|
|
"setup": {
|
|
"providers": [
|
|
{
|
|
"id": "xiaomi",
|
|
"envVars": ["XIAOMI_API_KEY"]
|
|
},
|
|
{
|
|
"id": "xiaomi-token-plan",
|
|
"envVars": ["XIAOMI_TOKEN_PLAN_API_KEY"]
|
|
}
|
|
]
|
|
},
|
|
"modelCatalog": {
|
|
"providers": {
|
|
"xiaomi": {
|
|
"baseUrl": "https://api.xiaomimimo.com/v1",
|
|
"api": "openai-completions",
|
|
"models": [
|
|
{
|
|
"id": "mimo-v2-flash",
|
|
"name": "Xiaomi MiMo V2 Flash",
|
|
"input": ["text"],
|
|
"contextWindow": 262144,
|
|
"maxTokens": 8192,
|
|
"cost": {
|
|
"input": 0,
|
|
"output": 0,
|
|
"cacheRead": 0,
|
|
"cacheWrite": 0
|
|
}
|
|
},
|
|
{
|
|
"id": "mimo-v2-pro",
|
|
"name": "Xiaomi MiMo V2 Pro",
|
|
"input": ["text"],
|
|
"reasoning": true,
|
|
"contextWindow": 1048576,
|
|
"maxTokens": 32000,
|
|
"cost": {
|
|
"input": 0,
|
|
"output": 0,
|
|
"cacheRead": 0,
|
|
"cacheWrite": 0
|
|
}
|
|
},
|
|
{
|
|
"id": "mimo-v2-omni",
|
|
"name": "Xiaomi MiMo V2 Omni",
|
|
"input": ["text", "image"],
|
|
"reasoning": true,
|
|
"contextWindow": 262144,
|
|
"maxTokens": 32000,
|
|
"cost": {
|
|
"input": 0,
|
|
"output": 0,
|
|
"cacheRead": 0,
|
|
"cacheWrite": 0
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"xiaomi-token-plan": {
|
|
"baseUrl": "https://token-plan-sgp.xiaomimimo.com/v1",
|
|
"api": "openai-completions",
|
|
"models": [
|
|
{
|
|
"id": "mimo-v2.5-pro",
|
|
"name": "Xiaomi MiMo V2.5 Pro",
|
|
"input": ["text"],
|
|
"reasoning": true,
|
|
"contextWindow": 1048576,
|
|
"maxTokens": 32000,
|
|
"cost": {
|
|
"input": 1,
|
|
"output": 3,
|
|
"cacheRead": 0.2,
|
|
"cacheWrite": 0,
|
|
"tieredPricing": [
|
|
{ "input": 1, "output": 3, "cacheRead": 0.2, "cacheWrite": 0, "range": [0, 256000] },
|
|
{ "input": 1, "output": 3, "cacheRead": 0.4, "cacheWrite": 0, "range": [256000] }
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"id": "mimo-v2.5",
|
|
"name": "Xiaomi MiMo V2.5",
|
|
"input": ["text", "image"],
|
|
"reasoning": true,
|
|
"contextWindow": 1048576,
|
|
"maxTokens": 32000,
|
|
"cost": {
|
|
"input": 0.4,
|
|
"output": 2,
|
|
"cacheRead": 0.08,
|
|
"cacheWrite": 0,
|
|
"tieredPricing": [
|
|
{ "input": 0.4, "output": 2, "cacheRead": 0.08, "cacheWrite": 0, "range": [0, 256000] },
|
|
{ "input": 0.4, "output": 2, "cacheRead": 0.16, "cacheWrite": 0, "range": [256000] }
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"discovery": {
|
|
"xiaomi": "static",
|
|
"xiaomi-token-plan": "runtime"
|
|
}
|
|
},
|
|
"providerEndpoints": [
|
|
{
|
|
"endpointClass": "xiaomi-native",
|
|
"hosts": [
|
|
"api.xiaomimimo.com",
|
|
"token-plan-ams.xiaomimimo.com",
|
|
"token-plan-cn.xiaomimimo.com",
|
|
"token-plan-sgp.xiaomimimo.com"
|
|
]
|
|
}
|
|
],
|
|
"contracts": {
|
|
"speechProviders": ["xiaomi"]
|
|
},
|
|
"providerAuthEnvVars": {
|
|
"xiaomi": ["XIAOMI_API_KEY"],
|
|
"xiaomi-token-plan": ["XIAOMI_TOKEN_PLAN_API_KEY"]
|
|
},
|
|
"providerAuthChoices": [
|
|
{
|
|
"provider": "xiaomi",
|
|
"method": "api-key",
|
|
"choiceId": "xiaomi-api-key",
|
|
"choiceLabel": "Xiaomi API key (Pay-as-you-go)",
|
|
"groupId": "xiaomi",
|
|
"groupLabel": "Xiaomi",
|
|
"groupHint": "Pay-as-you-go / Token Plan",
|
|
"optionKey": "xiaomiApiKey",
|
|
"cliFlag": "--xiaomi-api-key",
|
|
"cliOption": "--xiaomi-api-key <key>",
|
|
"cliDescription": "Xiaomi MiMo pay-as-you-go API key"
|
|
},
|
|
{
|
|
"provider": "xiaomi-token-plan",
|
|
"method": "token-plan-ams",
|
|
"choiceId": "xiaomi-token-plan-ams",
|
|
"choiceLabel": "Xiaomi Token Plan (Europe)",
|
|
"choiceHint": "Endpoint preset: token-plan-ams.xiaomimimo.com/v1",
|
|
"groupId": "xiaomi",
|
|
"groupLabel": "Xiaomi",
|
|
"groupHint": "Pay-as-you-go / Token Plan",
|
|
"optionKey": "xiaomiTokenPlanApiKey",
|
|
"cliFlag": "--xiaomi-token-plan-api-key",
|
|
"cliOption": "--xiaomi-token-plan-api-key <key>",
|
|
"cliDescription": "Xiaomi MiMo Token Plan API key"
|
|
},
|
|
{
|
|
"provider": "xiaomi-token-plan",
|
|
"method": "token-plan-cn",
|
|
"choiceId": "xiaomi-token-plan-cn",
|
|
"choiceLabel": "Xiaomi Token Plan (China)",
|
|
"choiceHint": "Endpoint preset: token-plan-cn.xiaomimimo.com/v1",
|
|
"groupId": "xiaomi",
|
|
"groupLabel": "Xiaomi",
|
|
"groupHint": "Pay-as-you-go / Token Plan",
|
|
"optionKey": "xiaomiTokenPlanApiKey",
|
|
"cliFlag": "--xiaomi-token-plan-api-key",
|
|
"cliOption": "--xiaomi-token-plan-api-key <key>",
|
|
"cliDescription": "Xiaomi MiMo Token Plan API key"
|
|
},
|
|
{
|
|
"provider": "xiaomi-token-plan",
|
|
"method": "token-plan-sgp",
|
|
"choiceId": "xiaomi-token-plan-sgp",
|
|
"choiceLabel": "Xiaomi Token Plan (Singapore)",
|
|
"choiceHint": "Endpoint preset: token-plan-sgp.xiaomimimo.com/v1",
|
|
"groupId": "xiaomi",
|
|
"groupLabel": "Xiaomi",
|
|
"groupHint": "Pay-as-you-go / Token Plan",
|
|
"optionKey": "xiaomiTokenPlanApiKey",
|
|
"cliFlag": "--xiaomi-token-plan-api-key",
|
|
"cliOption": "--xiaomi-token-plan-api-key <key>",
|
|
"cliDescription": "Xiaomi MiMo Token Plan API key"
|
|
}
|
|
],
|
|
"configSchema": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {}
|
|
}
|
|
}
|