A Pi Coding Agent extension that adds Alibaba Cloud Bailian Coding Plan as a provider. This extension enables Pi to connect to Bailian's Coding Plan subscription service.
Note: This is a provider extension, not the Coding Plan service itself. You must subscribe to Alibaba Cloud's Bailian Coding Plan separately to use this extension.
- 🔌 Connects Pi to Alibaba Cloud's Bailian Coding Plan API
- 🌍 Supports both International and China region endpoints
- 🔐 Handles API key configuration via environment variable or interactive login
- 📋 Provides model definitions for 9 AI models available through Coding Plan
These models are provided by Alibaba Cloud Bailian Coding Plan (subscription required):
| Model | Provider | Context | Max Tokens | Reasoning | Vision |
|---|---|---|---|---|---|
| Qwen3.5 Plus | Alibaba | 1M | 65,536 | ✅ | ✅ |
| Qwen3.6 Plus | Alibaba | 1M | 65,536 | ✅ | ✅ |
| Qwen3 Max | Alibaba | 262K | 32,768 | ❌ | ❌ |
| Qwen3 Coder Next | Alibaba | 262K | 65,536 | ❌ | ❌ |
| Qwen3 Coder Plus | Alibaba | 1M | 65,536 | ❌ | ❌ |
| GLM-5 | Zhipu | 202K | 16,384 | ✅ | ❌ |
| GLM-4.7 | Zhipu | 202K | 16,384 | ✅ | ❌ |
| Kimi K2.5 | Moonshot | 262K | 32,768 | ✅ | ✅ |
| MiniMax M2.5 | MiniMax | 196K | 24,576 | ✅ | ❌ |
You must subscribe to Alibaba Cloud Bailian Coding Plan to use this extension.
-
Subscribe to Coding Plan
- Visit Alibaba Cloud Model Studio
- Subscribe to Pro plan ($50/month, provided by Alibaba Cloud)
- Get your API key (format:
sk-sp-xxxxx) from Alibaba Cloud
-
Pi Coding Agent installed
npm install -g @mariozechner/pi-coding-agent
pi install git:github.com/Dopingus/pi-bailianpi install /path/to/pi-bailianpi -e git:github.com/Dopingus/pi-bailianUse Pi's built-in /login command:
pi
/login bailian-coding-planYou'll see instructions with the console URL. The browser will NOT open automatically - you need to:
- Manually open the console URL in your browser
- Get your API key from the Coding Plan page
- Paste the API key in the terminal
The key is securely stored in ~/.pi/agent/auth.json.
Available login targets:
/login bailian-coding-plan- International region/login bailian-coding-plan-cn- China mainland region
export BAILIAN_CODING_PLAN_API_KEY=sk-sp-xxxxx
piStore in ~/.pi/agent/auth.json:
{
"bailian-coding-plan": {
"type": "oauth",
"refresh": "sk-sp-xxxxx",
"access": "sk-sp-xxxxx",
"expires": 1776268800000
}
}In Pi interactive mode:
/modelThen select:
bailian-coding-plan/qwen3.5-plus(recommended)bailian-coding-plan/glm-5bailian-coding-plan/kimi-k2.5bailian-coding-plan/MiniMax-M2.5- etc.
Or use CLI flag:
pi --provider bailian-coding-plan --model qwen3.5-plus "your prompt"For users in mainland China, use the China endpoint:
# Interactive login
/login bailian-coding-plan-cn
# Or environment variable
export BAILIAN_CODING_PLAN_API_KEY=sk-sp-xxxxx
pi --provider bailian-coding-plan-cn --model qwen3.5-plusThese quotas are set by Alibaba Cloud Bailian Coding Plan:
Pro Plan ($50/month from Alibaba Cloud):
- 6,000 requests per 5 hours (sliding window)
- 45,000 requests per week (resets Monday 00:00 UTC+8)
- 90,000 requests per month (resets on subscription date)
Check your usage on the Coding Plan Console (Alibaba Cloud's dashboard).
sk-sp- prefix. Do not use regular Model Studio API keys (sk-).
- International:
https://coding-intl.dashscope.aliyuncs.com/apps/anthropic - China:
https://coding.dashscope.aliyuncs.com/apps/anthropic
Pi's anthropic-messages API implementation appends /v1/messages to construct the final URL:
- Final:
https://coding-intl.dashscope.aliyuncs.com/apps/anthropic/v1/messages✅
- Automated scripts
- Custom application backends
- Non-interactive batch API calls
Violation may result in subscription suspension.
Ensure you're using the Coding Plan-specific API key (starts with sk-sp-), not the general Model Studio API key (sk-).
To fix:
- Run
/logout bailian-coding-plan - Run
/login bailian-coding-planagain - Double-check you copied the correct key from the Coding Plan console
- Check that your subscription is active
- Verify the model is included in your plan
- Try
qwen3.5-plus(most widely supported)
Use the China region provider:
/login bailian-coding-plan-cn# View stored credentials
cat ~/.pi/agent/auth.json
# List available OAuth providers
/loginMIT