Aliyun Bailian(百炼) for LLM chat, and language translation. Use when you need to generate code, generate text with LLMs, or translate between languages.
Call Alibaba Cloud Bailian (百炼) LLM models via the DashScope API.
Get your API key from: https://bailian.console.aliyun.com/
Set the environment variable:
bash
export ALIYUN_BAILIAN_API_KEY="your-api-key"
export ALIYUN_BAILIAN_API_HOST="https://coding.dashscope.aliyuncs.com/apps/anthropic" # optional, default provided
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
CommandWhat it doeschatGeneral-purpose chat completion with Qwen, GLM, Kimi, MiniMax modelstranslateTranslate text between languagesmodelsList all available models
General-purpose chat completion via DashScope Anthropic API.
bash
python -m scripts chat --model qwen3.5-plus --messages '[{"role": "user", "content": "Hello"}]'
--model (string, optional) — Model name. Default: qwen3.5-plus--messages (string, required) — JSON array of {role, content}. Roles: system, user, assistant--temperature (float, optional) — Sampling temperature 0-1. Default: 0.7--max-tokens (integer, optional) — Max tokens to generate. Default: 2048--stream (boolean, optional) — Enable streaming. Default: falseFlagship: qwen3.5-plus, qwen3-max-2026-01-23
Coder: qwen3-coder-next, qwen3-coder-plus
Other: glm-5, glm-4.7, kimi-k2.5, MiniMax-M2.5
Translate text between languages using the LLM.
bash
python -m scripts translate --text "Hello" --target-lang zh
python -m scripts translate --text "你好" --target-lang en --source-lang zh
--text (string, required) — Text to translate--target-lang (string, optional) — Target language code. Default: en--source-lang (string, optional) — Source language code. Default: autoen (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
from scripts import chat, translate
# Chat
result = chat(messages=[{"role": "user", "content": "Hello"}], model="qwen3.5-plus")
# Translate
result = translate(text="Hello", target_lang="zh")
json
{ "success": true, "result": {...} }
{ "success": false, "error": "error message" }
https://coding.dashscope.aliyuncs.com/apps/anthropic (set via ALIYUN_BAILIAN_API_HOST)sk-sp-xxx) is different from regular DashScope API keyqwen3-max-2026-01-23 or kimi-k2.5qwen3-coder-next or qwen3-coder-plusreferences/API.mdassets/models.json