OpenClaw
Use Yunxin as the model provider for OpenClaw across its messaging channels.
Overview
OpenClaw is an open-source personal AI assistant platform that
connects to 25+ messaging channels (Telegram, Discord, Slack, WeChat, and more). It supports
OpenAI-compatible providers, so you can wire it to Yunxin's POST /v1/chat/completions endpoint.
GitHub: https://github.com/nicepkg/openclaw
Prerequisites
- Node.js 18+ installed
- A Yunxin API key from Dashboard → API Keys (keys begin with
sk-) - A model id that supports chat completions — discover ids via the Models API
Installation
npm install -g openclawOr run without installing:
npx openclawConfiguration
OpenClaw is configured via ~/.openclaw/openclaw.json. Add Yunxin as an OpenAI-type model provider,
using the OpenAI base URL (with the /v1 suffix) and your sk- key:
{
"modelProviders": {
"yunxin": {
"type": "openai",
"apiKey": "sk-your-yunxin-key",
"baseURL": "https://api.yuhuanstudio.com/v1"
}
},
"defaultModelProvider": "yunxin",
"defaultModel": "model-id"
}Replace sk-your-yunxin-key with your actual key and model-id with the model you want. You can use a
provider/model id (for example openai/gpt-4o) to pin a provider. Find available models via the
Models API.
Multiple models
Configure different models for different use cases:
{
"modelProviders": {
"yunxin": {
"type": "openai",
"apiKey": "sk-your-yunxin-key",
"baseURL": "https://api.yuhuanstudio.com/v1"
}
},
"defaultModelProvider": "yunxin",
"models": {
"default": "model-id",
"coding": "coding-model-id",
"creative": "creative-model-id"
}
}Connecting messaging channels
After configuring Yunxin as your model provider, enable your preferred channels.
Telegram
{
"channels": {
"telegram": {
"enabled": true,
"botToken": "YOUR_TELEGRAM_BOT_TOKEN"
}
}
}Discord
{
"channels": {
"discord": {
"enabled": true,
"botToken": "YOUR_DISCORD_BOT_TOKEN"
}
}
}See the OpenClaw documentation for the full channel list and their options.
Usage
# Start the service
openclaw start
# One-off message
openclaw chat "Hello, how are you?"
# Interactive mode
openclaw chatSupported features
When OpenClaw runs against Yunxin's Chat Completions endpoint:
| Feature | Supported | Notes |
|---|---|---|
| Chat Completions | Yes | Via POST /v1/chat/completions. |
| Streaming | Yes | Real-time response streaming. |
| Multi-turn conversations | Yes | Full conversation history. |
| System prompts | Yes | Customizable assistant persona. |
| Multiple channels | Yes | Telegram, Discord, Slack, WeChat, etc. |
| Function calling | Yes | Tool use, on models that support it. |
Feature availability depends on the chosen model — check each model's capabilities via the
Models API.
Recommended configuration
- Use a fast model for real-time channels to minimize response latency.
- Set clear system prompts to define the assistant's persona.
- Mind your rate limit. High-traffic channels can hit your tier's per-minute request limit — watch
X-RateLimit-Remainingand pace accordingly.
Troubleshooting
Connection errors
- Verify the
apiKeyinopenclaw.jsonis a validsk-key. - Confirm
baseURLishttps://api.yuhuanstudio.com/v1(with/v1, since this is the OpenAI-format provider). - Confirm your account has sufficient credit balance —
402 insufficient_balancemeans top up.
Rate limiting
Yunxin's per-minute request limit depends on your tier (Free 10, Basic 50, Fellow/Pro 100, Enterprise
custom). On 429, honor the Retry-After header. See Rate Limits.
Resources
How is this guide?