mirror of https://github.com/openclaw/openclaw.git
2.5 KiB
2.5 KiB
| summary | read_when | title | ||
|---|---|---|---|---|
| Use Qianfan's unified API to access many models in OpenClaw |
|
Qianfan |
Qianfan Provider Guide
Qianfan is Baidu's MaaS platform, provides a unified API that routes requests to many models behind a single endpoint and API key. It is OpenAI-compatible, so most OpenAI SDKs work by switching the base URL.
Prerequisites
- A Baidu Cloud account with Qianfan API access
- An API key from the Qianfan console
- OpenClaw installed on your system
Getting Your API Key
- Visit the Qianfan Console
- Create a new application or select an existing one
- Generate an API key (format:
bce-v3/ALTAK-...) - Copy the API key for use with OpenClaw
CLI setup
openclaw onboard --auth-choice qianfan-api-key
Config snippet
{
env: { QIANFAN_API_KEY: "bce-v3/ALTAK-..." },
agents: {
defaults: {
model: { primary: "qianfan/deepseek-v3.2" },
models: {
"qianfan/deepseek-v3.2": { alias: "QIANFAN" },
},
},
},
models: {
providers: {
qianfan: {
baseUrl: "https://qianfan.baidubce.com/v2",
api: "openai-completions",
models: [
{
id: "deepseek-v3.2",
name: "DEEPSEEK V3.2",
reasoning: true,
input: ["text"],
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
contextWindow: 98304,
maxTokens: 32768,
},
{
id: "ernie-5.0-thinking-preview",
name: "ERNIE-5.0-Thinking-Preview",
reasoning: true,
input: ["text", "image"],
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
contextWindow: 119000,
maxTokens: 64000,
},
],
},
},
},
}
Notes
- Default bundled model ref:
qianfan/deepseek-v3.2 - Default base URL:
https://qianfan.baidubce.com/v2 - Bundled catalog currently includes
deepseek-v3.2andernie-5.0-thinking-preview - Add or override
models.providers.qianfanonly when you need custom base URL or model metadata - Qianfan runs through the OpenAI-compatible transport path, not native OpenAI request shaping