OpenClaw
Use OpenClaw with the Yunxin API as a model provider.
Overview
OpenClaw is an open-source personal AI assistant platform that supports 25+ messaging channels (Telegram, Discord, Slack, WeChat, and more). It supports connecting to OpenAI-compatible API providers, making it fully compatible with Yunxin.
GitHub: https://github.com/nicepkg/openclaw
Prerequisites
- Node.js 18+ installed
- A Yunxin API key from Dashboard → API Keys
- At least one model configured in Yunxin that supports chat completions
Installation
Install OpenClaw globally via npm:
npm install -g openclawOr use npx to run without installing:
npx openclawConfiguration
OpenClaw is configured via the ~/.openclaw/openclaw.json file. Add Yunxin as a model provider:
{
"modelProviders": {
"yunxin": {
"type": "openai",
"apiKey": "YOUR_YUNXIN_API_KEY",
"baseURL": "https://api.yuhuanstudio.com/v1"
}
},
"defaultModelProvider": "yunxin",
"defaultModel": "model-id"
}Replace YOUR_YUNXIN_API_KEY with your actual Yunxin API key and model-id with the model you want to use. You can find available models via the Models API.
Multiple Models
You can configure multiple models for different use cases:
{
"modelProviders": {
"yunxin": {
"type": "openai",
"apiKey": "YOUR_YUNXIN_API_KEY",
"baseURL": "https://api.yuhuanstudio.com/v1"
}
},
"defaultModelProvider": "yunxin",
"models": {
"default": "model-id",
"coding": "coding-model-id",
"creative": "creative-model-id"
}
}Connecting Messaging Channels
OpenClaw supports 25+ messaging platforms. After configuring Yunxin as your model provider, connect your preferred channels:
Telegram Example
{
"channels": {
"telegram": {
"enabled": true,
"botToken": "YOUR_TELEGRAM_BOT_TOKEN"
}
}
}Discord Example
{
"channels": {
"discord": {
"enabled": true,
"botToken": "YOUR_DISCORD_BOT_TOKEN"
}
}
}Refer to the OpenClaw documentation for the full list of supported channels and their configuration options.
Usage
Start OpenClaw
openclaw startChat via CLI
openclaw chat "Hello, how are you?"Interactive Mode
openclaw chatSupported Features
When using OpenClaw with Yunxin, the following features work seamlessly:
| Feature | Supported | Notes |
|---|---|---|
| Chat Completions | Yes | Via /v1/chat/completions endpoint |
| Streaming | Yes | Real-time response streaming |
| Multi-turn Conversations | Yes | Full conversation history |
| System Prompts | Yes | Customizable AI persona |
| Multiple Channels | Yes | Telegram, Discord, Slack, WeChat, etc. |
| Function Calling | Yes | Tool integration capabilities |
Recommended Configuration
For the best experience with OpenClaw and Yunxin:
- Use a fast model for real-time messaging channels to minimize response latency
- Set appropriate system prompts to define the AI assistant's personality and capabilities
- Monitor rate limits based on your Yunxin tier, especially for high-traffic channels
Troubleshooting
Connection Errors
If OpenClaw cannot connect to Yunxin:
- Verify your API key is correct in
openclaw.json - Check that
baseURLis set tohttps://api.yuhuanstudio.com/v1 - Ensure your Yunxin account has active quota
Rate Limiting
Yunxin enforces rate limits based on your tier:
- Free tier: 10 requests/minute
- Basic tier: 50 requests/minute
- Pro tier: 100 requests/minute
- Enterprise tier: Unlimited
For high-traffic deployments, consider upgrading your Yunxin tier.
Resources
How is this guide?