Mistral
Mistral AI 是欧洲领先的 AI 公司,提供高性能的开源和闭源大语言模型。
获取 API Key
- 前往 Mistral AI 控制台 注册账号
- 在「API Keys」页面创建 API Key
- 复制 API Key
配置 OpenClaw
bash
openclaw models auth login --provider mistral
# 按提示输入 API Key或手动编辑配置文件:
jsonc
// ~/.openclaw/config.json
{
"models": {
"providers": {
"mistral": {
"apiKey": "xxxxxxxxxxxxxxxxxxxxxxxx",
"baseUrl": "https://api.mistral.ai/v1"
}
}
}
}支持的模型
| 模型 ID | 说明 | 上下文窗口 |
|---|---|---|
mistral-large-latest | 旗舰模型,综合能力最强 | 128K |
mistral-medium-latest | 均衡版本 | 32K |
mistral-small-latest | 轻量快速版 | 32K |
codestral-latest | 编程专用模型 | 32K |
open-mistral-nemo | 开源模型,12B 参数 | 128K |
使用示例:
bash
openclaw models default set mistral/mistral-large-latest
openclaw chat "请用 Python 实现一个快速排序算法"环境变量
bash
export MISTRAL_API_KEY="xxxxxxxxxxxxxxxxxxxxxxxx"故障排查
API 调用失败
- 确认 API Key 有效
- 检查账户余额
模型不可用
- 确认模型 ID 正确
- 部分模型可能需要特定的订阅计划
