|
| 1 | +--- |
| 2 | +sidebar_label: Qwen Code CLI |
| 3 | +description: Access Qwen3 Coder models through OAuth authentication. 1M context windows with automatic token refresh. |
| 4 | +keywords: |
| 5 | + - qwen code |
| 6 | + - qwen cli |
| 7 | + - qwen3 coder |
| 8 | + - roo code |
| 9 | + - api provider |
| 10 | + - oauth |
| 11 | + - alibaba |
| 12 | + - dashscope |
| 13 | +image: /img/social-share.jpg |
| 14 | +--- |
| 15 | + |
| 16 | +# Qwen Code CLI Provider |
| 17 | + |
| 18 | +Access Alibaba's Qwen3 Coder models through OAuth authentication with automatic token refresh. Features massive 1M token context windows optimized for large codebases. |
| 19 | + |
| 20 | +:::info Setup Required |
| 21 | +1. **Install Qwen Client**: Download from the official website |
| 22 | +2. **Authenticate**: Run the client and sign in to create OAuth credentials |
| 23 | +3. **Configure in Roo Code**: Select "Qwen Code CLI API" as your provider |
| 24 | + - Default path `~/.qwen/oauth_creds.json` works automatically |
| 25 | + - Or specify a custom credentials path if needed |
| 26 | +::: |
| 27 | + |
| 28 | +**Website:** [https://chat.qwen.ai](https://chat.qwen.ai) |
| 29 | + |
| 30 | +--- |
| 31 | + |
| 32 | +## Supported Models |
| 33 | + |
| 34 | +Both models offer 1M context windows and 65K max output tokens (currently free): |
| 35 | + |
| 36 | +- **qwen3-coder-plus** (Default) - High-performance coding model |
| 37 | +- **qwen3-coder-flash** - Speed-optimized variant |
| 38 | + |
| 39 | +--- |
| 40 | + |
| 41 | +## Configuration |
| 42 | + |
| 43 | +### OAuth Credentials Path |
| 44 | +- **Default**: `~/.qwen/oauth_creds.json` |
| 45 | +- **Custom paths supported**: Both absolute and `~/` prefixed paths |
| 46 | +- Created automatically when you authenticate with the Qwen client |
| 47 | + |
| 48 | +--- |
| 49 | + |
| 50 | +## Key Features |
| 51 | + |
| 52 | +- **OAuth 2.0**: Secure authentication with automatic token refresh |
| 53 | +- **1M Context**: Handle entire codebases in a single conversation |
| 54 | +- **Auto-refresh**: Tokens refresh transparently with 30-second buffer |
| 55 | +- **Free Tier**: 2,000 requests/day and 60 requests/minute with no token limits, available during a promotional period. |
| 56 | +- **Reasoning Support**: Full support for thinking blocks |
| 57 | + |
| 58 | +--- |
| 59 | + |
| 60 | +## Common Issues |
| 61 | + |
| 62 | +**"Cannot find credentials file"** |
| 63 | +- Ensure you've authenticated with the Qwen client |
| 64 | +- Check file exists at `~/.qwen/oauth_creds.json` |
| 65 | + |
| 66 | +**"Token refresh failed"** |
| 67 | +- Check network connectivity |
| 68 | +- Re-authenticate with the Qwen client |
| 69 | + |
| 70 | +**"401 Unauthorized"** |
| 71 | +- Provider should auto-refresh (check logs) |
| 72 | +- If persistent, delete credentials and re-authenticate |
0 commit comments