openclaw-webmodel
v0.2.1
Published
Free web-based AI models for OpenClaw. ChatGPT, Grok, and more — no API keys needed.
Maintainers
Readme
openclaw-webmodel
Free web-based AI models for OpenClaw — ChatGPT, Grok, and more, without API keys.
Use ChatGPT and Grok directly through their web interfaces. No API keys needed, no per-token billing.
English
What is this?
openclaw-webmodel is an OpenClaw lifecycle plugin that lets your agent use web-based AI models (ChatGPT, Grok) via browser automation. Instead of paying for API access, it controls your logged-in browser sessions through Playwright CDP.
Features
- ChatGPT integration —
/chatgpt <message>for one-shot or/chatgptto lock mode - Grok integration —
/grok <message>for chat, auto-detects image generation prompts - Lock mode — After
/chatgptor/grok, all subsequent messages go through that model automatically - Auto session reset — Switching models automatically creates a clean session
- Dual-mode routing — Discord and TUI/HTTP paths are fully isolated, no interference
- Multi-instance support — Each gateway gets its own relay port (gateway port + 1000), no conflicts
- Relay provider — Built-in micro HTTP server acts as an OpenAI-compatible proxy for TUI mode
- Image generation — Grok Imagine and ChatGPT DALL-E, with auto-detection and local image saving
- Upgrade CLI —
openclaw-webmodel upgradeto detect, remove old, and install new version
How it works
TUI/HTTP mode:
User: /grok hello
→ Plugin calls Grok via browser automation
→ Returns response directly
→ Locks Grok mode + switches default model to relay + resets session
User: (next message)
→ before_model_resolve hook → switches to relay provider
→ before_prompt_build hook → forwards to Grok via browser
→ Relay HTTP server serves the response back to gatewayDiscord mode:
User: /grok hello
→ Plugin calls Grok via browser automation
→ Returns response directly + locks Grok mode
User: (next message)
→ before_dispatch hook → detects Discord (event.accountId present)
→ Calls Grok via browser → sends response via CLI to Discord channel
→ Returns { handled: true } → skips entire agent pipelineCommands
| Command | Description |
|---------|-------------|
| /chatgpt <msg> | Send message to ChatGPT, auto-lock mode |
| /chatgpt | Toggle ChatGPT lock mode |
| /chatgpt off | Unlock, return to default model |
| /grok <msg> | Send message to Grok, auto-lock mode |
| /grok | Toggle Grok lock mode |
| /grok off | Unlock, return to default model |
| /chatgpt-auth | Save ChatGPT cookies from Chrome |
| /grok-auth | Save Grok cookies from Chrome |
Setup
- Install the plugin:
openclaw plugins install openclaw-webmodel
openclaw gateway restartThat's it. The plugin auto-configures everything on first startup:
- Adds
webmodel-relayprovider tomodels.providers(port = gateway port + 1000) - Adds auth profile
webmodel-relay:default - Adds itself to
plugins.allowandplugins.entries - If
openclaw-superpowersis installed, addsdeferTocooperation
- Authenticate with web models:
# Start Chrome with debugging, log into chatgpt.com/grok.com, then:
/chatgpt-auth
/grok-authUpgrade
# Via CLI (recommended)
openclaw-webmodel upgrade
# Or manually
openclaw plugins install openclaw-webmodelThe upgrade command automatically detects old installations, removes them, and installs the latest version.
Architecture
- Browser automation — Playwright CDP connects to your logged-in Chrome session
- Relay HTTP server — Runs on
gateway_port + 1000, serves OpenAI-compatible SSE streaming responses - Dual-mode routing — Discord uses
before_dispatch+ CLI delivery; TUI usesbefore_model_resolve+ relay server - Lock file —
.webmodel-lockin per-instanceOPENCLAW_HOME/.openclaw/directory - Config model switch — On lock/unlock, updates both
agents.defaults.modelandagents.list[].modelfor session routing - Plugin cooperation — Works with
openclaw-superpowersviadeferTomechanism
中文
这是什么?
openclaw-webmodel 是一个 OpenClaw 生命周期插件,让你的 Agent 可以免费使用 ChatGPT、Grok 等网页版 AI 模型。通过浏览器自动化控制你已登录的浏览器会话,无需 API 密钥,无按量计费。
功能
- ChatGPT 集成 —
/chatgpt <消息>单次调用或/chatgpt锁定模式 - Grok 集成 —
/grok <消息>聊天,自动检测画图请求 - 锁定模式 — 执行
/chatgpt或/grok后,后续所有消息自动走对应模型 - 自动会话重置 — 切换模型时自动创建干净会话
- 双模式路由 — Discord 和 TUI/HTTP 路径完全隔离,互不干扰
- 多实例支持 — 每个网关独立 relay 端口(网关端口 + 1000),无冲突
- 中继提供商 — 内置微型 HTTP 服务器作为 OpenAI 兼容代理(TUI 模式)
- 图片生成 — Grok Imagine 和 ChatGPT DALL-E,自动检测并本地保存图片
- 升级 CLI —
openclaw-webmodel upgrade一键检测旧版、删除、升级
命令
| 命令 | 说明 |
|------|------|
| /chatgpt <消息> | 发送消息给 ChatGPT,自动锁定模式 |
| /chatgpt | 切换 ChatGPT 锁定 |
| /chatgpt off | 解锁,恢复默认模型 |
| /grok <消息> | 发送消息给 Grok,自动锁定模式 |
| /grok | 切换 Grok 锁定 |
| /grok off | 解锁,恢复默认模型 |
| /chatgpt-auth | 从 Chrome 保存 ChatGPT 登录凭据 |
| /grok-auth | 从 Chrome 保存 Grok 登录凭据 |
安装
openclaw plugins install openclaw-webmodel
openclaw gateway restart插件首次启动时自动配置所有必要项(relay provider、auth profile、插件注册)。然后用 /chatgpt-auth 和 /grok-auth 保存浏览器登录状态即可使用。
升级
openclaw-webmodel upgrade自动检测旧版安装、删除旧文件、安装最新版本。
License
MIT
