openclaw添加第三方api配置
第三行的xxx和agents.defaults.model.primary中的xxx必须一样,primary中的xxx相当于从models.providers里面选择了一个分类。网上大部分配置文件没有openai-completions,博主亲测不加无法使用api。
·
先贴配置文件:
"models": {
"providers": {
"xxx": {
"baseUrl": "https://api2.aigcbest.top/v1",
"apiKey": "你自己的api",
"api": "anthropic-messages",
"models": [
{
"id": "gemini-3-flash-preview-nothinking",
"name": "gemini-3-flash-preview-nothinking",
"api": "openai-completions",
"reasoning": true,
"input": [
"text",
"image"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 200000,
"maxTokens": 8192
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "xxx/gemini-3-flash-preview-nothinking"
},
"workspace": "/root/.openclaw/workspace",
"compaction": {
"mode": "safeguard"
},
"maxConcurrent": 4,
"subagents": {
"maxConcurrent": 8
}
}
},
第三行的xxx和agents.defaults.model.primary中的xxx必须一样,primary中的xxx相当于从models.providers里面选择了一个分类
网上大部分配置文件没有openai-completions,博主亲测不加无法使用api
更多推荐

所有评论(0)