OpenClaw yêu cầu Node.js 22 trở lên.
curl -fsSL https://openclaw.ai/install.sh | bash
npm install -g @tokencode/tokencode
tokencode
Chọn OpenClaw trong trình hướng dẫn hoặc chạy:
npx @tokencode/tokencode oc -k sk-your-api-key -m claude-sonnet-4-6
CLI giữ nguyên các channel, gateway, provider khác và thiết lập cấp cao nhất khi hợp nhất provider TokenCode.
Thêm provider vào models.providers trong ~/.openclaw/openclaw.json:
{
"models": {
"mode": "merge",
"providers": {
"tokencode": {
"baseUrl": "https://tokencode.dev",
"apiKey": "sk-your-api-key",
"api": "anthropic-messages",
"models": [{
"id": "claude-sonnet-4-6",
"name": "claude-sonnet-4-6",
"reasoning": false,
"input": ["text", "image"],
"contextWindow": 200000,
"maxTokens": 8192,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
}]
}
}
}
}
Chạy openclaw gateway restart, sau đó mở openclaw tui và nhập /model. Với anthropic-messages, dùng https://tokencode.dev và không thêm /v1.