Build a Free AI Agent: Alibaba Bailian API + OpenClaw
Want a personal AI agent that can browse the web, manage files, run commands, and chat with you on WhatsApp or Telegram — all for free? By combining Alibaba Cloud Bailian’s free API with OpenClaw, you can build a fully functional AI assistant without spending a cent.
What You’ll Build
- A local AI agent powered by Alibaba’s Qwen models (1 million free tokens per model)
- Connected to your favorite chat apps (WhatsApp, Telegram, Discord, Slack, and more)
- Capable of browser automation, file management, shell commands, and scheduled tasks
Part 1: Get Your Free Alibaba Bailian API Key
What is Alibaba Bailian?
Alibaba Cloud Bailian (Model Studio) is Alibaba’s AI platform that provides free API access to powerful Qwen models. Each model comes with an independent free quota of 1 million tokens, so using multiple models gives you millions of total free tokens.
Available Free Models
| Model | Highlights | Best For |
|---|---|---|
| Qwen3.6-Plus | 1M context window, strong coding | Complex tasks, coding |
| Qwen3.5-Omni | Audio, video, and text | Multimodal tasks |
| Qwen-Plus | Balanced performance | General use (recommended for OpenClaw) |
| Qwen-Turbo | Fastest, lowest cost | Quick responses, high volume |
| GLM-5 | Strong reasoning | Logic-heavy tasks |
Sign Up Steps
- Register at aliyun.com
- Visit the Bailian Console and accept the service agreement
- Go to the API Key page (top-right corner) → click Create API Key
- Save your API key — it starts with
sk-and works across all models
Free Tier Limits
- 1 million tokens per model (independent quotas)
- Valid for 90 days from activation
- No credit card required
- Enable “stop when quota exhausted” to prevent accidental charges
Part 2: Set Up OpenClaw
What is OpenClaw?
OpenClaw is a free, open-source AI agent that runs locally on your machine. It connects any LLM to real software — your browser, file system, terminal, calendar, and chat apps. Think of it as giving your AI model hands and feet.
Key Features
- Chat integration: WhatsApp, Telegram, Discord, Slack, Teams, Signal, Feishu, LINE
- Browser automation: Control Chrome, take screenshots, interact with web pages
- File management: Read, write, and organize files on your machine
- Shell commands: Run terminal commands directly
- Scheduled tasks: Set up cron jobs and webhooks
- Voice control: Wake-word detection on macOS/iOS
Install OpenClaw
Prerequisites: Node.js 24 (or 22.16+). Windows users need WSL2.
npm install -g openclaw@latest
openclaw onboard --install-daemon
Part 3: Connect Bailian to OpenClaw
OpenClaw uses an OpenAI-compatible API format, which means it works perfectly with Alibaba Bailian’s DashScope endpoint. Here’s how to configure it.
Step 1: Set Your API Key
# Linux/Mac
export DASHSCOPE_API_KEY="your-api-key-here"
# Windows (PowerShell)
$env:DASHSCOPE_API_KEY="your-api-key-here"
Step 2: Configure OpenClaw
Edit the config file at ~/.openclaw/openclaw.json:
{
"models": {
"mode": "merge",
"providers": {
"bailian": {
"baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"apiKey": "DASHSCOPE_API_KEY",
"api": "openai-completions",
"models": [
{
"id": "qwen3.5-plus",
"name": "Qwen 3.5 Plus",
"reasoning": false,
"input": ["text", "image"],
"contextWindow": 1000000,
"maxTokens": 65536
},
{
"id": "qwen-turbo",
"name": "Qwen Turbo",
"reasoning": false,
"input": ["text"],
"contextWindow": 131072,
"maxTokens": 8192
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "bailian/qwen3.5-plus"
},
"models": {
"bailian/qwen3.5-plus": {},
"bailian/qwen-turbo": {}
}
}
}
}
Step 3: Verify the Connection
# List available models
openclaw models list --provider bailian
# Test connectivity
openclaw models status --probe
Important Configuration Notes
- Set
reasoningtofalsefor all DashScope models — otherwise responses may be empty - Model IDs must match exactly (e.g.,
qwen3.5-plus, notqwen-3.5-plus) - If you get HTTP 400 errors, add role mapping to convert
developerrole tosystem
Regional API Endpoints
| Region | Base URL |
|---|---|
| China (Beijing) | https://dashscope.aliyuncs.com/compatible-mode/v1 |
| Singapore | https://dashscope-intl.aliyuncs.com/compatible-mode/v1 |
| US (Virginia) | https://dashscope-us.aliyuncs.com/compatible-mode/v1 |
| Hong Kong | https://cn-hongkong.dashscope.aliyuncs.com/compatible-mode/v1 |
Part 4: Use Your Free AI Agent
Once configured, you can interact with your agent through any connected chat app. Here are some examples of what you can do:
Example Commands via Chat
- “Summarize the PDF on my desktop” — reads and summarizes local files
- “Search Google for the latest AI news and give me a summary” — browses the web automatically
- “Create a Python script that converts CSV to JSON” — writes code and saves it
- “Every morning at 9am, check Hacker News and send me the top 5 stories” — sets up scheduled tasks
- “Open my GitHub repo and create an issue about the login bug” — browser automation
Bonus: Using the API Directly (Python)
You can also use the Bailian API directly in your own projects with the OpenAI SDK:
pip install -U openai
import os
from openai import OpenAI
client = OpenAI(
api_key=os.getenv("DASHSCOPE_API_KEY"),
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
)
response = client.chat.completions.create(
model="qwen-plus",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain quantum computing in simple terms."}
]
)
print(response.choices[0].message.content)
Cost Comparison: Free AI Agent Solutions
| Setup | Cost | Free Tokens | Agent Features |
|---|---|---|---|
| Bailian + OpenClaw | $0 | 1M per model (90 days) | Full (browser, files, chat, scheduling) |
| OpenAI + ChatGPT | $20/month | Limited free tier | Limited to ChatGPT interface |
| Claude Pro | $20/month | Limited free tier | Web search, file upload |
| Self-hosted Ollama + OpenClaw | $0 (need GPU) | Unlimited | Full |
Related Reads
- Cohere Free API: The Best Free Embedding and Rerank API for RAG in 2026
- Groq vs Cerebras vs Gemini: Which Free AI API Is Actually Fastest in 2026?
- Cerebras Inference API: The Fastest Free AI API You’ve Never Heard Of
- Mistral AI Free API: Call Nemo and Mixtral for Free with Any OpenAI SDK
- GitHub Models: Free GPT-4o and Llama API for Every Developer
Final Thoughts
The combination of Alibaba Bailian and OpenClaw gives you a completely free, fully-featured AI agent. Bailian provides the brains (powerful Qwen models with generous free quotas), while OpenClaw provides the body (browser control, file access, chat integration, and more).
Since each Bailian model has its own independent 1 million token quota, you effectively get millions of free tokens to power your agent. And because both tools use the OpenAI-compatible API standard, setup takes just minutes.
Get started:
- Alibaba Bailian: bailian.console.aliyun.com
- OpenClaw: openclaw.ai
Originally published at toolfreebie.com.
Top comments (0)