主题
OpenClaw 配置
使用 CC Switch 管理密钥,再按 provider 类型填写协议、Base URL 与 User-Agent。
开始之前
先在 CC Switch 统一配置 中添加 Entropic Echo 配置并确认 API Key 可用。OpenClaw 作为外接客户端调用时,还需要为每个 provider 单独设置协议和 User-Agent。
配置 API provider
无论是否通过 CC Switch,只要 OpenClaw 作为外接客户端调用,就要注意以下几点:
- 同一个 OpenClaw 可以同时接 Claude 和 Codex
- 不同 provider 要分别填写对应 User-Agent
- 不能把 Claude 的 UA 直接复用到 Codex provider 上
- 国产模型 provider 不建议省略浏览器型 UA
如果你是第一次接 OpenClaw,建议先按这个顺序排:
- 先在 CC Switch 统一配置 中确认 Key 可用
- 再看 外接兼容与接入说明 确认 Base URL、协议和模型
- 最后回到本页填写 OpenClaw provider 细节
如果配置的是 Claude provider :
- Base URL :
https://api.entropicecho.com - API 协议 :
Anthropic Messages - 必须添加 Claude 对应 Headers :
json
"headers": {
"Authorization": "Bearer sk-xxx",
"User-Agent": "claude-cli/2.0.76 (external, cli)"
}1
2
3
4
2
3
4
如果配置的是 Codex provider :
- Base URL :
https://api.entropicecho.com/v1 - API 协议 :
OpenAI Responses - 必须添加 Codex 对应 Headers :
json
"headers": {
"Authorization": "Bearer sk-xxx",
"User-Agent": "codex_cli_rs/0.77.0 (Windows 10.0.26100; x86_64) WindowsTerminal"
}1
2
3
4
2
3
4
如果配置的是 国产模型 provider :
- 模型 ID :从 模型广场 复制对应模型 ID
- Headers :使用浏览器型
User-Agent
json
"headers": {
"Authorization": "Bearer sk-xxx",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:149.0) Gecko/20100101 Firefox/149.0"
}1
2
3
4
2
3
4
无论是 Claude provider、Codex provider 还是国产模型 provider,缺少各自对应 UA 时,都可能报 403 block 或 403 Forbidden。配置模型时,从模型广场复制模型 ID 填入即可。
外接场景的 UA 规则见 外接调用 User-Agent 说明。
如果你还要接 JetBrains、Trae 等其他外接客户端,可统一从 外接兼容与接入说明 进入,再按客户端页面分别落地。
完整配置 JSON 参考
展开查看
json
{
"agents": {
"defaults": {
"compaction": {
"mode": "safeguard"
},
"maxConcurrent": 4,
"model": {
"primary": "entropicecho-codex/gpt-5.6"
},
"subagents": {
"maxConcurrent": 8
},
"workspace": "C:\\\\Users\\\\<USERNAME>\\\\.openclaw\\\\workspace"
},
"list": [
{
"agentDir": "C:\\\\Users\\\\<USERNAME>\\\\.openclaw\\\\agents\\\\main\\\\agent",
"id": "main",
"name": "main",
"workspace": "C:\\\\Users\\\\<USERNAME>\\\\.openclaw\\\\workspace"
}
]
},
"channels": {
"feishu": {
"appId": "<YOUR_FEISHU_APP_ID>",
"appSecret": "<YOUR_FEISHU_APP_SECRET>",
"domain": "feishu",
"enabled": true,
"groupPolicy": "disabled"
}
},
"commands": {
"native": "auto",
"nativeSkills": "auto",
"ownerDisplay": "raw",
"restart": true
},
"gateway": {
"auth": {
"mode": "token",
"token": "<YOUR_GATEWAY_TOKEN>"
},
"bind": "loopback",
"mode": "local",
"nodes": {
"denyCommands": [
"camera.snap",
"camera.clip",
"screen.record",
"calendar.add",
"contacts.add",
"reminders.add"
]
},
"port": 18789,
"tailscale": {
"mode": "off",
"resetOnExit": false
}
},
"hooks": {
"internal": {
"enabled": true,
"entries": {
"session-memory": {
"enabled": true
}
}
}
},
"messages": {
"ackReactionScope": "group-mentions"
},
"models": {
"mode": "merge",
"providers": {
"entropicecho-claude": {
"api": "anthropic-messages",
"apiKey": "sk-xxx",
"baseUrl": "https://api.entropicecho.com",
"headers": {
"Authorization": "Bearer sk-xxx",
"User-Agent": "claude-cli/2.0.76 (external, cli)"
},
"models": [
{
"contextWindow": 200000,
"cost": { "cacheRead": 0, "cacheWrite": 0, "input": 0, "output": 0 },
"id": "claude-opus-4-5-20251101",
"maxTokens": 32000,
"name": "claude-opus-4-5"
},
{ "id": "claude-haiku-4-5-20251001", "name": "claude-haiku-4-5" },
{ "id": "claude-opus-4-6", "name": "claude-opus-4-6" },
{ "id": "claude-sonnet-4-5-20250929", "name": "claude-sonnet-4-5" },
{ "id": "claude-sonnet-4-6", "name": "claude-sonnet-4-6" }
]
},
"entropicecho-codex": {
"api": "openai-responses",
"apiKey": "sk-xxx",
"baseUrl": "https://api.entropicecho.com/v1",
"headers": {
"Authorization": "Bearer sk-xxx",
"User-Agent": "codex_cli_rs/0.77.0 (Windows 10.0.26100; x86_64) WindowsTerminal"
},
"models": [
{
"contextWindow": 200000,
"cost": { "cacheRead": 0, "cacheWrite": 0, "input": 0, "output": 0 },
"id": "gpt-5.6",
"maxTokens": 32000,
"name": "gpt-5.6"
},
{ "id": "gpt-5.5", "name": "gpt-5.5" },
{ "id": "gpt-5.4", "name": "gpt-5.4" },
{ "id": "gpt-5.4-mini", "name": "gpt-5.4-mini" }
]
}
}
},
"plugins": {
"entries": {
"feishu": { "enabled": true }
}
},
"session": {
"dmScope": "per-channel-peer"
},
"tools": {
"profile": "coding"
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135