docs/providers/qianfan.md
Qianfan is Baidu's MaaS platform: a unified, OpenAI-compatible API that routes requests to many models behind a single endpoint and API key. OpenClaw ships it as the official external plugin @openclaw/qianfan-provider.
| Property | Value |
|---|---|
| Provider | qianfan |
| Auth | QIANFAN_API_KEY |
| API | OpenAI-compatible (openai-completions) |
| Base URL | https://qianfan.baidubce.com/v2 |
| Default model | qianfan/deepseek-v3.2 |
Install the official plugin, then restart Gateway:
openclaw plugins install @openclaw/qianfan-provider
openclaw gateway restart
Non-interactive runs read the key from `--qianfan-api-key <key>` or
`QIANFAN_API_KEY`. Onboarding writes the provider config, adds the
`QIANFAN` alias for the default model, and sets `qianfan/deepseek-v3.2`
as the default model when none is configured.
| Model ref | Input | Context | Max output | Reasoning | Notes |
|---|---|---|---|---|---|
qianfan/deepseek-v3.2 | text | 98,304 | 32,768 | Yes | Default model |
qianfan/ernie-5.0-thinking-preview | text, image | 119,000 | 64,000 | Yes | Multimodal |
The catalog is static; there is no live model discovery.
<Tip> You only need to override `models.providers.qianfan` when you need a custom base URL or model metadata. </Tip>{
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,
},
],
},
},
},
}