Install
openclaw skills install @mattheliu/ernie-integrationStep-by-step guide for integrating Baidu ERNIE 5.0 (Qianfan) models into Clawdbot. Use when someone asks how to add ERNIE models, configure Baidu Qianfan, or set up ERNIE 5.0 in Clawdbot.
openclaw skills install @mattheliu/ernie-integrationComplete guide for adding Baidu ERNIE 5.0 (Qianfan) models to Clawdbot.
ERNIE 5.0 is Baidu's latest large language model with deep thinking capabilities:
ernie-5.0-thinking-preview) - Advanced reasoning model with 128K context window via OpenAI-compatible APIbce-v3/ALTAK-...)Note: The API key uses Baidu's BCE authentication format.
Add to ~/.bashrc or ~/.zshrc for persistence:
export ERNIE_API_KEY="bce-v3/ALTAK-your-key-here"
source ~/.zshrc # or source ~/.bashrc
Security note: Never commit API keys to version control. Rotate keys regularly on the Qianfan console.
Edit your clawdbot.json config:
{
"agents": {
"defaults": {
"model": {
"primary": "ernie/ernie-5.0-thinking-preview"
},
"models": {
"ernie/ernie-5.0-thinking-preview": {
"alias": "ernie-5.0"
}
}
}
},
"models": {
"mode": "merge",
"providers": {
"ernie": {
"baseUrl": "https://qianfan.baidubce.com/v2",
"apiKey": "${ERNIE_API_KEY}",
"api": "openai-completions",
"models": [
{
"id": "ernie-5.0-thinking-preview",
"name": "ERNIE 5.0",
"contextWindow": 128000,
"maxTokens": 65536
}
]
}
}
}
}
clawdbot gateway restart
clawdbot models list
You should see ERNIE models in the list.
Set as default:
clawdbot models set ernie/ernie-5.0-thinking-preview
Or use model alias in chat:
/model ernie-5.0
| Parameter | Value |
|---|---|
| Model ID | ernie-5.0-thinking-preview |
| Context Window | 128K tokens |
| Max Input | 119K tokens |
| Max Output | 1 - 65536 tokens |
| RPM (Rate Per Minute) | 60 |
| TPM (Tokens Per Minute) | 150,000 |
| Parameter | Type | Description |
|---|---|---|
model | string | Model ID (required) |
messages | array | Chat context messages (required) |
stream | boolean | Enable streaming response |
temperature | number | Output randomness (model-specific range) |
top_p | number | Nucleus sampling parameter |
max_tokens | integer | Maximum output tokens |
stop | array | Stop sequences (up to 4 elements) |
frequency_penalty | number | Frequency-based repetition penalty |
presence_penalty | number | Presence-based repetition penalty |
ERNIE 5.0 supports deep thinking mode:
| Parameter | Type | Description |
|---|---|---|
enable_thinking | boolean | Enable thinking mode |
thinking_budget | integer | Max thinking chain tokens (default: 16384) |
thinking_strategy | string | short_think or chain_of_draft |
reasoning_effort | string | low, medium (default), or high |
Check config syntax:
clawdbot gateway config.get | grep -A 20 ernie
Verify API key is set:
echo $ERNIE_API_KEY
bce-v3/ALTAK-...https://qianfan.baidubce.com/v2Test API endpoint directly:
curl -X POST "https://qianfan.baidubce.com/v2/chat/completions" \
-H "Authorization: Bearer $ERNIE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "ernie-5.0-thinking-preview", "messages": [{"role": "user", "content": "test"}]}'
ERNIE 5.0 has the following rate limits:
If you hit rate limits, reduce request frequency or apply for higher quotas on Qianfan console.
ernie/ernie-5.0-thinking-preview) - Best for complex reasoning tasks, deep analysis, and tasks requiring extensive thinking