Aliyun Bailian(百炼) for OpenClaw
Call Alibaba Cloud Bailian (百炼) LLM models via the DashScope API.
Setup
Get your API key from: https://bailian.console.aliyun.com/
Set the environment variable:
CODEBLOCK0
CLI Commands
CODEBLOCK1
Commands Overview
| Command | What it does |
|---|
| INLINECODE0 | General-purpose chat completion with Qwen, GLM, Kimi, MiniMax models |
| INLINECODE1 |
Translate text between languages |
|
models | List all available models |
Chat
General-purpose chat completion via DashScope Anthropic API.
Usage
CODEBLOCK2
Parameters
- -
--model (string, optional) — Model name. Default: INLINECODE4 - INLINECODE5 (string, required) — JSON array of
{role, content}. Roles: system, user, INLINECODE9 - INLINECODE10 (float, optional) — Sampling temperature 0-1. Default: INLINECODE11
- INLINECODE12 (integer, optional) — Max tokens to generate. Default: INLINECODE13
- INLINECODE14 (boolean, optional) — Enable streaming. Default: INLINECODE15
Available Models
Flagship: qwen3.5-plus, INLINECODE17
Coder: qwen3-coder-next, INLINECODE19
Other: glm-5, glm-4.7, kimi-k2.5, INLINECODE23
Translate
Translate text between languages using the LLM.
Usage
CODEBLOCK3
Parameters
- -
--text (string, required) — Text to translate - INLINECODE25 (string, optional) — Target language code. Default: INLINECODE26
- INLINECODE27 (string, optional) — Source language code. Default: INLINECODE28
Supported Languages
INLINECODE29 (English), zh (Chinese), ja (Japanese), ko (Korean), es (Spanish), fr (French), de (German), ru (Russian), ar (Arabic), pt (Portuguese), it (Italian), th (Thai), vi (Vietnamese), id (Indonesian)
Python Usage
CODEBLOCK4
Response Format
CODEBLOCK5
Notes
- - Default API host:
https://coding.dashscope.aliyuncs.com/apps/anthropic (set via ALIYUN_BAILIAN_API_HOST) - The API uses Anthropic-compatible format — messages are converted to Anthropic API format internally
- Coding Plan API key (
sk-sp-xxx) is different from regular DashScope API key - For reasoning tasks: try
qwen3-max-2026-01-23 or INLINECODE47 - For coding tasks: use
qwen3-coder-next or INLINECODE49
Learn More
- - Full API documentation: INLINECODE50
- Available models: INLINECODE51
阿里云百炼 for OpenClaw
通过DashScope API调用阿里云百炼大语言模型。
设置
从以下地址获取您的API密钥:https://bailian.console.aliyun.com/
设置环境变量:
bash
export ALIYUNBAILIANAPI_KEY=your-api-key
export ALIYUNBAILIANAPI_HOST=https://coding.dashscope.aliyuncs.com/apps/anthropic # 可选,默认已提供
CLI命令
bash
python -m scripts chat --model qwen3.5-plus --messages [{role: user, content: Hello}]
python -m scripts translate --text Hello --target-lang zh
python -m scripts models
命令概览
| 命令 | 功能说明 |
|---|
| chat | 使用Qwen、GLM、Kimi、MiniMax模型进行通用对话补全 |
| translate |
在语言之间翻译文本 |
| models | 列出所有可用模型 |
对话
通过DashScope Anthropic API进行通用对话补全。
使用方法
bash
python -m scripts chat --model qwen3.5-plus --messages [{role: user, content: Hello}]
参数
- - --model(字符串,可选)— 模型名称。默认值:qwen3.5-plus
- --messages(字符串,必填)— {role, content}的JSON数组。角色:system、user、assistant
- --temperature(浮点数,可选)— 采样温度0-1。默认值:0.7
- --max-tokens(整数,可选)— 生成的最大令牌数。默认值:2048
- --stream(布尔值,可选)— 启用流式输出。默认值:false
可用模型
旗舰版: qwen3.5-plus、qwen3-max-2026-01-23
编程版: qwen3-coder-next、qwen3-coder-plus
其他: glm-5、glm-4.7、kimi-k2.5、MiniMax-M2.5
翻译
使用大语言模型在语言之间翻译文本。
使用方法
bash
python -m scripts translate --text Hello --target-lang zh
python -m scripts translate --text 你好 --target-lang en --source-lang zh
参数
- - --text(字符串,必填)— 要翻译的文本
- --target-lang(字符串,可选)— 目标语言代码。默认值:en
- --source-lang(字符串,可选)— 源语言代码。默认值:auto
支持的语言
en(英语)、zh(中文)、ja(日语)、ko(韩语)、es(西班牙语)、fr(法语)、de(德语)、ru(俄语)、ar(阿拉伯语)、pt(葡萄牙语)、it(意大利语)、th(泰语)、vi(越南语)、id(印尼语)
Python使用
python
from scripts import chat, translate
对话
result = chat(messages=[{role: user, content: Hello}], model=qwen3.5-plus)
翻译
result = translate(text=Hello, target_lang=zh)
响应格式
json
{ success: true, result: {...} }
{ success: false, error: error message }
注意事项
- - 默认API主机:https://coding.dashscope.aliyuncs.com/apps/anthropic(通过ALIYUNBAILIANAPI_HOST设置)
- API使用兼容Anthropic的格式——消息会在内部转换为Anthropic API格式
- 编程计划API密钥(sk-sp-xxx)与常规DashScope API密钥不同
- 推理任务:尝试qwen3-max-2026-01-23或kimi-k2.5
- 编程任务:使用qwen3-coder-next或qwen3-coder-plus
了解更多
- - 完整API文档:references/API.md
- 可用模型:assets/models.json