Install
openclaw skills install mimo-api-fix诊断和修复 mimo-v2.5-pro(或其他 mimo 系列模型)调用失败的问题。当 LLM 请求返回 400 Param Incorrect、provider rejected the request schema or tool payload、或 providerRuntimeFailureKind=schema 时触发。用于排查 API 兼容性、tool calling 格式、模型配置等问题。
openclaw skills install mimo-api-fixOpenClaw 调用 mimo-v2.5-pro 时报错:
400 Param Incorrectprovider rejected the request schema or tool payloadfailoverReason: "format"providerRuntimeFailureKind: "schema"系统会自动 fallback 到其他模型(如 qwen3.5:122b)。
# 从配置获取 API key 和 baseUrl
API_KEY=$(python3 -c "import json; d=json.load(open('$HOME/.openclaw/openclaw.json')); print(d['models']['providers']['custom']['apiKey'])")
BASE_URL=$(python3 -c "import json; d=json.load(open('$HOME/.openclaw/openclaw.json')); print(d['models']['providers']['custom']['baseUrl'])")
# 测试基础连通性
curl -s "$BASE_URL/models" -H "Authorization: Bearer $API_KEY" | python3 -m json.tool | head -20
curl -s "$BASE_URL/chat/completions" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mimo-v2.5-pro",
"messages": [{"role":"user","content":"hello, reply with one word"}],
"max_tokens": 50
}' | python3 -m json.tool
如果失败 → API 端点本身有问题,不是 OpenClaw 的问题。
curl -s "$BASE_URL/chat/completions" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mimo-v2.5-pro",
"messages": [{"role":"user","content":"what is the weather? use get_weather tool"}],
"tools": [{"type":"function","function":{"name":"get_weather","description":"Get weather","parameters":{"type":"object","properties":{"location":{"type":"string"}},"required":["location"]}}}],
"max_tokens": 500
}' | python3 -m json.tool
检查返回中 finish_reason 是否为 "tool_calls",tool_calls 是否有内容。
python3 -c "
import json
d = json.load(open('$HOME/.openclaw/openclaw.json'))
for m in d['models']['providers']['custom']['models']:
if 'mimo' in m.get('id',''):
print(json.dumps(m, indent=2))
"
关键字段:
toolCall: 如果为 false,工具调用被禁用maxTokens: 过高可能导致 API 拒绝reasoning: 某些 API 不支持grep -i "mimo" /tmp/openclaw/openclaw-*.log | grep -i "error\|fail\|400" | tail -10
症状:之前能用,突然报 400,过一会儿又好了
原因:配置热加载瞬间有请求在处理,请求格式不一致
修复:通常无需处理,会自动恢复。如果持续报错,重启 gateway:
openclaw gateway restart
症状:模型能对话但不能调用工具
检查:查看配置中 toolCall 是否为 false
修复:
python3 -c "
import json
f = '$HOME/.openclaw/openclaw.json'
d = json.load(open(f))
for m in d['models']['providers']['custom']['models']:
if 'mimo' in m.get('id',''):
m['toolCall'] = True
json.dump(d, open(f,'w'), indent=2, ensure_ascii=False)
"
症状:curl 测试带 tools 也返回 400
修复:确认使用的是正确的 mimo-v2.5-pro 端点,不是其他不支持 tools 的模型。
症状:model_not_found 错误
检查:确认配置中 id 字段与 API 端点支持的模型名一致:
curl -s "$BASE_URL/models" -H "Authorization: Bearer $API_KEY" | python3 -c "
import json,sys
d=json.load(sys.stdin)
for m in d['data']:
print(m['id'])
"
bash ~/.openclaw/workspace/skills/skills/mimo-api-fix/scripts/diagnose.sh