You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- User-focused READMEs with comprehensive documentation
- Comprehensive technical CHANGELOG following Keep a Changelog format
- Correct quota documentation (1,000 req/day, not 2,000)
- Fix repository references to point to original repo (gustavodiasdev)
- Update badges and clone URLs following fork best practices
- Documentation in both English (README.md) and Portuguese (README.pt-BR.md)
- Restore critical error handling in src/index.ts and src/qwen/oauth.ts
<imgsrc="assets/screenshot.png"alt="OpenCode with Qwen Code"width="800">
9
9
</p>
10
10
11
-
**Authenticate OpenCode CLI with your qwen.ai account.** This plugin enables you to use Qwen models (Coder, Max, Plus and more) with **2,000 free requests per day** - no API key or credit card required!
11
+
**Authenticate OpenCode CLI with your qwen.ai account.** This plugin enables you to use the `coder-model`with **1,000 free requests per day** - no API key or credit card required!
12
12
13
-
[🇧🇷 Leia em Português](./README.pt-BR.md)
13
+
[🇧🇷 Leia em Português](./README.pt-BR.md) | [📜 Changelog](./CHANGELOG.md)
> **Note:** These limits are set by the Qwen OAuth API and may change. For professional use with higher quotas, consider using a [DashScope API Key](https://dashscope.aliyun.com).
54
+
102
55
## 🔑 Usage
103
56
104
57
### 1. Login
105
58
59
+
Run the following command to start the OAuth flow:
60
+
106
61
```bash
107
62
opencode auth login
108
63
```
109
64
110
65
### 2. Select Provider
111
66
112
-
Choose **"Other"** and type `qwen-code`
67
+
Choose **"Other"** and type `qwen-code`.
113
68
114
69
### 3. Authenticate
115
70
116
-
Select **"Qwen Code (qwen.ai OAuth)"**
117
-
118
-
- A browser window will open for you to authorize
119
-
- The plugin automatically detects when you complete authorization
120
-
- No need to copy/paste codes or press Enter!
71
+
Select **"Qwen Code (qwen.ai OAuth)"**.
121
72
122
-
> [!TIP]
123
-
> In the OpenCode TUI (graphical interface), the **Qwen Code** provider appears automatically in the provider list.
73
+
- A browser window will open for you to authorize.
74
+
- The plugin automatically detects when you complete authorization.
75
+
-**No need to copy/paste codes or press Enter!**
124
76
125
77
## 🎯 Available Models
126
78
127
79
### Coding Model
128
80
129
81
| Model | Context | Max Output | Features |
130
82
|-------|---------|------------|----------|
131
-
|`coder-model`| 1M tokens | 64K tokens | Official alias (Auto-routes to Qwen 3.5 Plus - Hybrid & Vision) |
83
+
|`coder-model`| 1M tokens |Up to 64K tokens¹| Official alias (Auto-routes to Qwen 3.5 Plus - Hybrid & Vision) |
132
84
133
-
> **Note:** This plugin aligns with the official `qwen-code-0.12.0` client, which exposes only the `coder-model` alias. This model automatically routes to the best available Qwen 3.5 Plus with hybrid reasoning and vision capabilities.
85
+
> ¹ Actual max output may vary depending on the specific model `coder-model` routes to.
86
+
87
+
> **Note:** This plugin aligns with the official `qwen-code` client. The `coder-model` alias automatically routes to the best available Qwen 3.5 Plus model with hybrid reasoning and vision capabilities.
3.**Token Storage**: Saves credentials to `~/.qwen/oauth_creds.json`
153
-
4.**Auto-refresh**: Renews tokens 30 seconds before expiration
97
+
### "Invalid access token" or "Token expired"
154
98
155
-
## 📊 Usage Limits
99
+
The plugin usually handles refresh automatically. If you see this error immediately:
156
100
157
-
| Plan | Rate Limit | Daily Limit |
158
-
|------|------------|-------------|
159
-
| Free (OAuth) | 60 req/min | 2,000 req/day |
101
+
1.**Re-authenticate:** Run `opencode auth login` again.
102
+
2.**Clear cache:** Delete the credentials file and login again:
103
+
```bash
104
+
rm ~/.qwen/oauth_creds.json
105
+
opencode auth login
106
+
```
160
107
161
-
> [!NOTE]
162
-
> Limits reset at midnight UTC. For higher limits, consider using an API key from [DashScope](https://dashscope.aliyun.com).
108
+
### Rate limit exceeded (429 errors)
163
109
164
-
## 🔧 Troubleshooting
110
+
If you hit the 60 req/min or 1,000 req/day limits:
111
+
- **Rate limit (60/min):** Wait a few minutes before trying again
112
+
- **Daily quota (1,000/day):** Wait until midnight UTC for the quota to reset
113
+
- **Web Search (200/min, 1,000/day):** Separate quota for web search tool
114
+
- Consider using a [DashScope API Key](https://dashscope.aliyun.com) for professional use with higher quotas
165
115
166
-
### Token expired
116
+
### Enable Debug Logs
167
117
168
-
The plugin automatically renews tokens. If issues persist:
118
+
If something isn't working, you can see detailed logs by setting the debug environment variable:
169
119
170
120
```bash
171
-
# Remove old credentials
172
-
rm ~/.qwen/oauth_creds.json
173
-
174
-
# Re-authenticate
175
-
opencode auth login
121
+
OPENCODE_QWEN_DEBUG=1 opencode
176
122
```
177
123
178
-
### Provider not showing in `auth login`
179
-
180
-
The `qwen-code` provider is added via plugin. In the `opencode auth login` command:
181
-
182
-
1. Select **"Other"**
183
-
2. Type `qwen-code`
184
-
185
-
### Rate limit exceeded (429 errors)
186
-
187
-
**As of v1.5.0, this should no longer occur!** The plugin now sends official Qwen Code headers that properly identify your client and prevent aggressive rate limiting.
188
-
189
-
If you still experience rate limiting:
190
-
- Ensure you're using v1.5.0 or later: `npm update opencode-qwencode-auth`
191
-
- Wait until midnight UTC for quota reset
192
-
- Consider [DashScope API](https://dashscope.aliyun.com) for higher limits
0 commit comments