# OpenClaw (/docs/examples/openclaw)


Overview [#overview]

[OpenClaw](https://github.com/nicepkg/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](https://github.com/nicepkg/openclaw)

Prerequisites [#prerequisites]

* [Node.js](https://nodejs.org/) 18+ installed
* A Yunxin API key from **Dashboard → API Keys**
* At least one model configured in Yunxin that supports chat completions

Installation [#installation]

Install OpenClaw globally via npm:

```bash
npm install -g openclaw
```

Or use npx to run without installing:

```bash
npx openclaw
```

Configuration [#configuration]

OpenClaw is configured via the `~/.openclaw/openclaw.json` file. Add Yunxin as a model provider:

```json
{
  "modelProviders": {
    "yunxin": {
      "type": "openai",
      "apiKey": "YOUR_YUNXIN_API_KEY",
      "baseURL": "https://api.yuhuanstudio.com/v1"
    }
  },
  "defaultModelProvider": "yunxin",
  "defaultModel": "model-id"
}
```

<Callout type="info">
  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](/docs/models-api).
</Callout>

Multiple Models [#multiple-models]

You can configure multiple models for different use cases:

```json
{
  "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 [#connecting-messaging-channels]

OpenClaw supports 25+ messaging platforms. After configuring Yunxin as your model provider, connect your preferred channels:

Telegram Example [#telegram-example]

```json
{
  "channels": {
    "telegram": {
      "enabled": true,
      "botToken": "YOUR_TELEGRAM_BOT_TOKEN"
    }
  }
}
```

Discord Example [#discord-example]

```json
{
  "channels": {
    "discord": {
      "enabled": true,
      "botToken": "YOUR_DISCORD_BOT_TOKEN"
    }
  }
}
```

<Callout type="info">
  Refer to the [OpenClaw documentation](https://github.com/nicepkg/openclaw) for the full list of supported channels and their configuration options.
</Callout>

Usage [#usage]

Start OpenClaw [#start-openclaw]

```bash
openclaw start
```

Chat via CLI [#chat-via-cli]

```bash
openclaw chat "Hello, how are you?"
```

Interactive Mode [#interactive-mode]

```bash
openclaw chat
```

Supported Features [#supported-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 [#recommended-configuration]

For the best experience with OpenClaw and Yunxin:

1. **Use a fast model** for real-time messaging channels to minimize response latency
2. **Set appropriate system prompts** to define the AI assistant's personality and capabilities
3. **Monitor rate limits** based on your Yunxin tier, especially for high-traffic channels

Troubleshooting [#troubleshooting]

Connection Errors [#connection-errors]

If OpenClaw cannot connect to Yunxin:

1. Verify your API key is correct in `openclaw.json`
2. Check that `baseURL` is set to `https://api.yuhuanstudio.com/v1`
3. Ensure your Yunxin account has active quota

Rate Limiting [#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 [#resources]

* [OpenClaw GitHub](https://github.com/nicepkg/openclaw)
* [Yunxin API Reference](/docs/chat-completions)
* [Authentication Guide](/docs/authentication)
* [Rate Limits](/docs/rate-limits)
