openclaw-zero-token README

The project's README from github.com/linuxhsj/openclaw-zero-token. As one markdown file: README.md.

OpenClaw Zero Token

Use LLMs without API tokens — log in via browser once, then call ChatGPT, Claude, Gemini, DeepSeek, Qwen (intl/cn), Doubao, Kimi, Zhipu GLM, Grok, Xiaomi MiMo, Manus and more for free through a unified gateway.

License: MIT

English | 简体中文


Table of Contents


Overview

OpenClaw Zero Token is a fork of OpenClaw that focuses on removing API token cost by driving the official web UIs (browser login) instead of paid API keys.

Why Zero Token?

Traditional usage Zero Token way
Buy API tokens Completely free
Pay per request No enforced quota
Credit card required Browser login only
API tokens may leak Credentials stored local

Supported providers

Provider Status Models (examples)
DeepSeek ✅ tested deepseek-chat, deepseek-reasoner
Qwen International ✅ tested Qwen 3.5 Plus, Qwen 3.5 Turbo
Qwen China ✅ tested Qwen 3.5 Plus, Qwen 3.5 Turbo
Kimi ✅ tested Moonshot v1 8K / 32K / 128K
Claude Web ✅ tested claude-sonnet-4-6, claude-opus-4-6, claude-haiku-4-6
Doubao ✅ tested doubao-seed-2.0, doubao-pro
ChatGPT Web ✅ tested GPT-4, GPT-4 Turbo
Gemini Web ✅ tested Gemini Pro, Gemini Ultra
Grok Web ✅ tested Grok 1, Grok 2
GLM Web (Zhipu) ✅ tested glm-4-Plus, glm-4-Think
GLM Web (International) ✅ tested GLM-4 Plus, GLM-4 Think
Xiaomi MiMo ✅ tested MiMo 2.0, MiMo 2.5 Pro
Manus API ✅ tested Manus 1.6, Manus 1.6 Lite (API key, free quota)

Tool calling

Web models can call local tools (web_search, web_fetch, exec, read, write, message) via prompt-injected tool definitions. Based on arXiv:2407.04997 and ComfyUI LLM Party (5k+ stars).

11/13 web models support tool calling (verified):

Model Tool Calling Chat Notes
DeepSeek ✅ ✅ exec: list desktop files
Kimi ✅ ✅ All 6 tools verified
Claude ✅ ✅ web_search OK
ChatGPT ✅ ✅ web_search OK
Qwen CN ✅ ✅ web_search OK
Qwen Web ✅ ✅ web_search OK
Grok ✅ ✅ web_search OK
Gemini ✅ ⚠️ web_search OK, DOM polling unstable
Xiaomi MiMo ✅ ✅ web_search OK
GLM ✅ ✅ Tool calling and chat OK
GLM Intl ✅ ✅ Tool calling and chat OK
Doubao ❌ ⚠️ Excluded (stream parser limitation)
Perplexity — ✅ Search engine, no tool injection

The middleware (src/zero-token/tool-calling/) only injects tool prompts when keywords in the user message suggest a tool action — normal chat stays short to reduce ban risk.

Agent file access is restricted by the configured workspace directory (see agents.defaults.workspace).

Extra features

AskOnce: one question, answers from all models.
AskOnce can broadcast a single query to multiple configured providers and show their replies side by side.

AskOnce: ask once, multi-model answers


How It Works

High-level architecture

┌─────────────────────────────────────────────────────────────────────────────┐
│                              OpenClaw Zero Token                            │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│  ┌─────────────┐    ┌─────────────┐    ┌─────────────┐    ┌─────────────┐  │
│  │   Web UI    │    │  CLI/TUI    │    │   Gateway   │    │  Channels   │  │
│  │  (Lit 3.x)  │    │             │    │  (Port API) │    │ (Telegram…) │  │
│  └──────┬──────┘    └──────┬──────┘    └──────┬──────┘    └──────┬──────┘  │
│         │                  │                  │                  │          │
│         └──────────────────┴──────────────────┴──────────────────┘          │
│                                    │                                         │
│                           ┌────────▼────────┐                               │
│                           │   Agent Core    │                               │
│                           │  (PI-AI Engine) │                               │
│                           └────────┬────────┘                               │
│                                    │                                         │
│  ┌───────────────────────────────────────────────────────────────────────┐  │
│  │  Provider Layer                                                       │  │
│  │  DeepSeek Web (Zero Token)                                       ✅   │  │
│  │  Qwen Web intl/cn (Zero Token)                                  ✅   │  │
│  │  Kimi (Zero Token)                                              ✅   │  │
│  │  Claude Web (Zero Token)                                        ✅   │  │
│  │  Doubao (Zero Token)                                            ✅   │  │
│  │  ChatGPT Web (Zero Token)                                       ✅   │  │
│  │  Gemini Web (Zero Token)                                        ✅   │  │
│  │  Grok Web (Zero Token)                                          ✅   │  │
│  │  GLM Web (Zero Token)                                           ✅   │  │
│  │  Xiaomi MiMo (Zero Token)                                       ✅   │  │
│  │  Manus API (Token)                                              ✅   │  │
│  └───────────────────────────────────────────────────────────────────────┘  │
│                                                                              │
└─────────────────────────────────────────────────────────────────────────────┘

DeepSeek auth flow (example)

1. Start browser
   openclaw gateway  ──▶  Chrome (CDP: 18892, user-data-dir)

2. User logs in
   Browser  ──▶  https://chat.deepseek.com  (scan / password login)

3. Capture credentials
   Playwright CDP  ──▶  listen network requests
                    └─▶ intercept Authorization header + cookies

4. Store credentials
   auth.json  ◀──  { cookie, bearer, userAgent }

5. Call web API
   DeepSeek WebClient  ──▶  DeepSeek Web API  ──▶  chat.deepseek.com
   (reuses stored cookie + bearer token)

Quick Start

Platforms

Requirements

Helper scripts (first-time & daily use)

First-time:
  1. Build          pnpm install && pnpm build && pnpm ui:build
  2. Start Chrome   ./start-chrome-debug.sh
  3. Login sites    Qwen intl/cn, Kimi, DeepSeek, ...
  4. Onboard        ./onboard.sh webauth
  5. Start server   ./server.sh

Daily:
  start-chrome-debug.sh → onboard.sh → server.sh
  server.sh [start|stop|restart|status] manages the gateway

Script overview (core 3 scripts):

Script Purpose When to use
start-chrome-debug.sh Start Chrome in debug mode Step 2: open browser on port 9222 for logins + onboarding
onboard.sh Auth/onboarding wizard Step 4/5: select provider (e.g. deepseek-web) and capture credentials
server.sh Manage gateway service Step 5 & daily use: start / stop / restart / status on port 3001

Installation

Clone and build

git clone https://github.com/linuxhsj/openclaw-zero-token.git
cd openclaw-zero-token
pnpm install
pnpm build
pnpm ui:build

Configure authentication

# Start Chrome in debug mode (keep this terminal open)
./start-chrome-debug.sh

# Log into each web model in the browser tabs that open
# (DeepSeek, Qwen, Kimi, Claude, ChatGPT, Gemini, Grok, etc.)

# In a NEW terminal, run the auth wizard
./onboard.sh webauth

Start the gateway

./server.sh

Open the Web UI at the URL printed in the terminal.

Clean rebuild (if you get ERR_MODULE_NOT_FOUND)

rm -rf dist dist-runtime node_modules
pnpm install
pnpm build
pnpm ui:build
./server.sh restart

Note: Always use pnpm build (not npm run build). If you see hash mismatch errors like Cannot find module dist/xxx-HASH.js, do a clean rebuild as shown above.

Step 3: Start the gateway

./server.sh

This will start the HTTP gateway and Web UI.


Usage

Web UI

After ./server.sh the Web UI is started automatically. Open it in your browser and chat with any configured model.

Switch models

Use /model inside the chat box:

# Switch to Claude Web
/model claude-web

# Switch to Doubao
/model doubao-web

# Switch to DeepSeek
/model deepseek-web

# Or specify exact models
/model claude-web/claude-sonnet-4-6
/model doubao-web/doubao-seed-2.0
/model deepseek-web/deepseek-chat

Claude Web: Prefer the full model id: /model claude-web/claude-sonnet-4-6 (matches the catalog default). /model claude-web alone can fail to resolve or pick the intended model in some setups.

List available models

/models

Important: Only providers configured via ./onboard.sh webauth are written into openclaw.json and shown in /models.

The output shows:

Example:

Model                                      Input      Ctx      Local Auth  Tags
doubao-web/doubao-seed-2.0                 text       63k      no    no    default,configured,alias:Doubao Browser
claude-web/claude-sonnet-4-6         text+image 195k     no    no    configured,alias:Claude Web
deepseek-web/deepseek-chat                 text       64k      no    no    configured

HTTP API

curl http://127.0.0.1:3001/v1/chat/completions \
  -H "Authorization: Bearer YOUR_GATEWAY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-web/deepseek-chat",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

CLI / TUI

node openclaw.mjs tui

Configuration

Example openclaw.json

{
  "auth": {
    "profiles": {
      "deepseek-web:default": {
        "provider": "deepseek-web",
        "mode": "api_key"
      }
    }
  },
  "models": {
    "providers": {
      "deepseek-web": {
        "baseUrl": "https://chat.deepseek.com",
        "api": "deepseek-web",
        "models": [
          {
            "id": "deepseek-chat",
            "name": "DeepSeek Chat",
            "contextWindow": 64000,
            "maxTokens": 4096
          },
          {
            "id": "deepseek-reasoner",
            "name": "DeepSeek Reasoner",
            "reasoning": true,
            "contextWindow": 64000,
            "maxTokens": 8192
          }
        ]
      }
    }
  },
  "gateway": {
    "port": 3001,
    "auth": {
      "mode": "token",
      "token": "your-gateway-token"
    }
  }
}

Troubleshooting

./onboard.sh webauth

The wizard will create all required directories and basic files.

Fix issues: doctor command

If you already ran the project but see missing-directories or similar errors:

node dist/index.mjs doctor

The doctor command will:

Limitations:


Roadmap

Current focus

Planned


Adding New Platforms

To add a new web provider you usually need:

1. Auth module (src/zero-token/providers/{platform}-web-auth.ts)

export async function loginPlatformWeb(params: {
  onProgress: (msg: string) => void;
  openUrl: (url: string) => Promise<boolean>;
}): Promise<{ cookie: string; bearer: string; userAgent: string }> {
  // Automate browser login and capture credentials
}

2. API client (src/zero-token/providers/{platform}-web-client*.ts)

export class PlatformWebClient {
  constructor(options: { cookie: string; bearer?: string }) {}

  async chatCompletions(params: ChatParams): Promise<ReadableStream> {
    // Call platform web API
  }
}

3. Stream handler (src/zero-token/streams/{platform}-web-stream.ts) and register it in web-stream-factories.ts

export function createPlatformWebStreamFn(credentials: string): StreamFn {
  // Handle provider-specific streaming format
}

File Structure

openclaw-zero-token/
├── src/
│   ├── zero-token/
│   │   ├── providers/                    # Web clients + *-web-auth.ts
│   │   └── streams/                      # *-web-stream.ts + web-stream-factories.ts
│   ├── agents/
│   │   └── web-stream-factories.ts       # Re-export (stable import for runner)
│   ├── commands/
│   │   └── auth-choice.apply.deepseek-web.ts  # Auth flow
│   └── browser/
│       └── chrome.ts                     # Chrome automation
├── ui/                                   # Web UI (Lit 3.x)
├── .openclaw-zero-state/                 # Local state (ignored)
│   ├── openclaw.json                     # Config
│   └── agents/main/agent/
│       └── auth.json                     # Credentials (sensitive)
└── .gitignore                            # Includes .openclaw-zero-state/

Security Notes

  1. Credential storage: cookies and bearer tokens live in local auth.json and must never be committed.
  2. Session lifetime: web sessions expire; you may need to re-login from time to time.
  3. Rate limiting: web endpoints may enforce rate limits; they are not suited for heavy production workloads.
  4. Compliance: this project is for personal learning and experimentation. Always follow each platform’s Terms of Service.

Sync With Upstream OpenClaw

For a Zero Token–specific file checklist and merge playbook, see Upstream sync (Zero Token).

This project is based on OpenClaw. To sync upstream changes:

git remote add upstream https://github.com/openclaw/openclaw.git
git fetch upstream
git merge upstream/main

Contributing

PRs are welcome, especially for:


License

MIT License


Acknowledgments


Disclaimer

This project is for learning and research only.
When using it to access any third-party service, you are responsible for complying with that service’s Terms of Use.
The authors are not liable for any issues caused by misuse of this project.

openclaw-zero-token (linuxhsj/openclaw-zero-token)

Searching Database…

这是什么?OpenClaw Zero Token 是 OpenClaw 的一个分支,让你可以免费使用 Claude、ChatGPT、Gemini、DeepSeek、Qwen、Doubao、Grok、Kimi、GLM 等主流 AI 对话模型。你只需在浏览器中登录一次各家的官方网页版,无需支付 API 令牌费用,然后通过一个统一的网关把调用转发给它们。
它是聊天应用,还是放在其他工具后面的服务?它是一个本地网关服务:在后台通过浏览器自动化驱动各家官方网页界面,并将结果以统一的 HTTP API、Web UI 和 CLI/TUI 的形式提供出来,因此其他工具或智能体可以像调用普通大模型后端一样与它交互。
我该如何让它运行起来?使用 pnpm 克隆并构建仓库,运行引导向导(./onboard.sh webauth),通过调试模式下的 Chrome 实例登录某个服务商的网页界面,然后用 ./server.sh 启动网关。在 Windows 上,请在 WSL2 中运行所有内容,并按照 Linux 的步骤操作。
构建之前需要先安装什么?你需要 Node.js >=22.12.0、pnpm >=9.0.0,以及 Chrome 浏览器。Chrome 需要以调试模式使用,以便你登录各服务商的账号。
这种方式有什么需要注意的地方吗?有。由于它是通过驱动真实的网页聊天界面来工作的,浏览器会话会过期,需要重新登录;在高频使用下,服务商可能会限流或封禁账号;项目本身也提醒,它不适合用于生产环境。
我的登录凭据存放在哪里?从你的浏览器登录中获取的 Cookie 和 Bearer 令牌保存在你本机的 auth.json 文件中,绝不会发送到其他任何地方;文档特别提醒,该文件绝对不能提交到版本控制系统中。
这些基于网页的模型支持工具调用吗?支持。网关会把工具定义(websearch、webfetch、exec、read、write、message)注入到聊天提示词中,在测试的 13 家服务商中,有 11 家支持这一功能;由于流解析器的限制,Doubao 被排除在外。
什么是 AskOnce?AskOnce 可以把同一个问题同时发送给你配置的所有服务商,并将它们的回复并排显示,方便你对比多个模型的答案。
为什么 Gemini 只获得部分支持?Gemini 的工具调用功能可以正常使用,但它的对话流式输出依赖不稳定的 DOM 轮询,因此在兼容性表格中被标注为注意项,而不是完整的勾号。
我能自己为新的 AI 平台添加支持吗?可以。你需要在 src/zero-token/providers 和 src/zero-token/streams 下分别添加一个认证模块、一个网页 API 客户端和一个流处理器,然后在 web-stream-factories.ts 中注册新的流。
What are similar projects?OmniRoute, 9router, magpie, casbin-gateway, nofx, opencodex, ccx, brigade
Creator
linuxhsj
Size
222.8 MB
Stars
5.2K
Age
7mo
Commits · 90 Days