Use major AI models (Claude, ChatGPT, Gemini, DeepSeek, Qwen, etc.) without API tokens by leveraging browser authentication instead of paid API keys
triggers
["set up openclaw zero token","use AI models without API keys","configure browser auth for LLMs","run DeepSeek/Claude/Qwen without tokens","onboard web model authentication","start openclaw gateway","use tool calling with web models","query multiple AI models at once"]
OpenClaw Zero Token is a TypeScript-based gateway that lets you use major AI models (Claude, ChatGPT, Gemini, DeepSeek, Qwen, Kimi, Doubao, Grok, GLM, Xiaomi MiMo, Manus) completely free by automating browser-based authentication instead of requiring paid API tokens. It drives official web UIs using Chrome DevTools Protocol (CDP) and Playwright to capture credentials, then proxies requests through a unified OpenAI-compatible API gateway.
What It Does
Zero-cost LLM access: Log in via browser once, reuse credentials for API calls
Unified gateway: OpenAI-compatible API endpoint on port 3001
11 web models with tool calling: web_search, web_fetch, exec, read, write, message
AskOnce multi-model queries: Broadcast one question to all configured providers
# Gateway settings
PORT=3001
NODE_ENV=production
# Browser debugging (DO NOT expose publicly)
CHROME_DEBUG_PORT=9222
# Optional: workspace for agent file access
AGENT_WORKSPACE=/home/user/agent-workspace
# Optional: logging
LOG_LEVEL=info
First-Time Authentication Flow
OpenClaw uses a three-step process:
Start debug Chrome → Opens browser on port 9222
Login to web models → Manual browser login (scan QR / password)
Run onboard wizard → Captures credentials automatically
# Terminal 1: Start Chrome in debug mode (keep running)
./start-chrome-debug.sh
# This opens Chrome with tabs for:# - DeepSeek: https://chat.deepseek.com# - Qwen intl: https://hf.co/chat# - Qwen cn: https://tongyi.aliyun.com# - Kimi: https://kimi.moonshot.cn# - Claude: https://claude.ai# etc.# LOG IN to each site manually in the browser
OpenClaw injects tool definitions into prompts for 11/13 web models. Tools are only injected when user message contains keywords like "search", "read", "execute".
# CLI usage (if implemented)
pnpm ask-once "What is the capital of France?"# Returns responses from:# - DeepSeek: "Paris..."# - Qwen: "The capital is Paris..."# - Kimi: "Paris, established in..."# etc.
functionselectModel(task: string): string {
if (task.includes('reasoning') || task.includes('logic')) {
return'deepseek-web/deepseek-reasoner';
}
if (task.includes('code')) {
return'qwen-web/qwen-plus';
}
return'kimi/moonshot-v1-8k'; // default
}
const model = selectModel('Write a sorting algorithm');
const response = await client.chat.completions.create({
model,
messages: [{ role: 'user', content: 'Implement quicksort in Python' }],
});
3. Workspace-Safe Agent
import * as path from'path';
constWORKSPACE = process.env.AGENT_WORKSPACE || '/tmp/agent-workspace';
asyncfunctionsafeAgentTask(instruction: string) {
// Ensure workspace existsawait fs.promises.mkdir(WORKSPACE, { recursive: true });
const response = await client.chat.completions.create({
model: 'kimi/moonshot-v1-32k',
messages: [{
role: 'system',
content: `You are a helpful agent. All file operations must be within ${WORKSPACE}.`
}, {
role: 'user',
content: instruction
}],
});
return response.choices[0].message.content;
}
// Example: "Create a file notes.txt with today's date"awaitsafeAgentTask('Write the current timestamp to notes.txt');
4. Re-authentication Helper
import { execSync } from'child_process';
asyncfunctionensureAuth(provider: string) {
const authPath = `data/auth/${provider}.json`;
try {
const authData = await fs.promises.readFile(authPath, 'utf-8');
const parsed = JSON.parse(authData);
// Check if token is expired (example logic)if (Date.now() > parsed.expiresAt) {
console.log(`Auth expired for ${provider}, re-running onboard...`);
execSync(`./onboard.sh webauth ${provider}`, { stdio: 'inherit' });
}
} catch (error) {
console.log(`No auth found for ${provider}, running onboard...`);
execSync(`./onboard.sh webauth ${provider}`, { stdio: 'inherit' });
}
}
// Before making API callsawaitensureAuth('deepseek-web');
Troubleshooting
Chrome Debug Port Issues
Symptom: onboard.sh fails with "Cannot connect to CDP"
# Kill existing Chrome processes
pkill -f "chrome.*remote-debugging-port=9222"# Restart debug Chrome
./start-chrome-debug.sh
# Verify port is open
lsof -i :9222 # Should show Chrome process
Authentication Expired
Symptom: API calls return 401/403 after initial setup
# Re-run onboarding for specific provider
./onboard.sh webauth
# Select the provider that's failing# Example: [1] deepseek-web# Manually verify in browser:# 1. Open http://localhost:9222 in another browser# 2. Navigate to chat site# 3. Check if logged in
Stream Parsing Errors
Symptom: "Cannot parse SSE stream" for Doubao or Gemini