qwen-free-api-fix 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +305 -0
- package/configs-example/dev/service.yml +14 -0
- package/configs-example/dev/system.yml +23 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2562 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2539 -0
- package/dist/index.mjs.map +1 -0
- package/dist/welcome.html +502 -0
- package/package.json +54 -0
|
@@ -0,0 +1,502 @@
|
|
|
1
|
+
<!-- index.html — Qwen Free API Theme (Based on Tech Light Theme v2) -->
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html lang="zh-CN">
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8"/>
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
7
|
+
<title>Qwen Free API — 服务已启动</title>
|
|
8
|
+
<style>
|
|
9
|
+
/* ===== Theme Variables ===== */
|
|
10
|
+
:root{
|
|
11
|
+
--bg:#F7FAFF;
|
|
12
|
+
--surface:#FFFFFF;
|
|
13
|
+
--text:#111827;
|
|
14
|
+
--muted:#4B5563;
|
|
15
|
+
--subtle:#6B7280;
|
|
16
|
+
--border:#D7E2F3;
|
|
17
|
+
--primary:#0EA5E9;
|
|
18
|
+
--primary-2:#0284C7;
|
|
19
|
+
--accent:#06B6D4;
|
|
20
|
+
--success:#10B981;
|
|
21
|
+
--warning:#EF4444;
|
|
22
|
+
|
|
23
|
+
--radius-lg:14px;
|
|
24
|
+
--radius-md:10px;
|
|
25
|
+
--radius-sm:8px;
|
|
26
|
+
|
|
27
|
+
--shadow-1:0 2px 0 rgba(17,24,39,0.04);
|
|
28
|
+
--shadow-2:0 6px 14px rgba(17,24,39,0.06);
|
|
29
|
+
|
|
30
|
+
--grid:24px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* ===== Reset ===== */
|
|
34
|
+
*,*::before,*::after{box-sizing:border-box}
|
|
35
|
+
html,body{height:100%}
|
|
36
|
+
body{
|
|
37
|
+
margin:0;
|
|
38
|
+
font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans SC",system-ui,sans-serif;
|
|
39
|
+
color:var(--text);
|
|
40
|
+
line-height:1.7;
|
|
41
|
+
background: linear-gradient(180deg,var(--bg),#F5F8FF);
|
|
42
|
+
}
|
|
43
|
+
body::before{
|
|
44
|
+
content:"";
|
|
45
|
+
position:fixed; inset:0; pointer-events:none;
|
|
46
|
+
background-image:
|
|
47
|
+
linear-gradient(rgba(17,24,39,0.015) 1px, transparent 1px),
|
|
48
|
+
linear-gradient(90deg, rgba(17,24,39,0.015) 1px, transparent 1px);
|
|
49
|
+
background-size:var(--grid) var(--grid), var(--grid) var(--grid);
|
|
50
|
+
mix-blend-mode:multiply;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* ===== Layout ===== */
|
|
54
|
+
.shell{max-width:1120px;margin:0 auto;padding:0 24px}
|
|
55
|
+
|
|
56
|
+
/* ===== Hero ===== */
|
|
57
|
+
.hero{padding:36px 0 18px}
|
|
58
|
+
.hero-inner{
|
|
59
|
+
display:grid; grid-template-columns:1fr; gap:18px;
|
|
60
|
+
align-items:center;
|
|
61
|
+
}
|
|
62
|
+
.hero-title{margin:0 0 8px; font-size:clamp(28px,4.2vw,42px); font-weight:900; letter-spacing:.2px}
|
|
63
|
+
.hero-desc{color:var(--muted); margin:0 0 16px}
|
|
64
|
+
.hero-actions{display:flex;gap:10px;flex-wrap:wrap}
|
|
65
|
+
.btn{
|
|
66
|
+
display:inline-flex; align-items:center; justify-content:center;
|
|
67
|
+
height:36px; padding:0 14px; border-radius:10px; border:1px solid var(--border);
|
|
68
|
+
background:var(--surface); color:var(--text); font-weight:700;
|
|
69
|
+
box-shadow:var(--shadow-1); text-decoration:none; cursor:pointer;
|
|
70
|
+
transition:transform .12s ease, box-shadow .12s ease, border-color .12s ease;
|
|
71
|
+
}
|
|
72
|
+
.btn:hover{transform:translateY(-1px); box-shadow:var(--shadow-2); border-color:#C9D8EE}
|
|
73
|
+
.btn.primary{background:linear-gradient(90deg,var(--primary),var(--primary-2)); color:#fff; border:none}
|
|
74
|
+
.stats{display:flex;gap:18px;flex-wrap:wrap;margin-top:10px}
|
|
75
|
+
.stat{
|
|
76
|
+
display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--border);
|
|
77
|
+
border-radius:10px;background:#FAFCFF;font-weight:700;color:#1F2937;
|
|
78
|
+
}
|
|
79
|
+
.stat .dot{width:8px;height:8px;border-radius:50%;background:var(--accent)}
|
|
80
|
+
|
|
81
|
+
/* ===== Sections ===== */
|
|
82
|
+
.section{margin:24px 0}
|
|
83
|
+
.hd{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:10px}
|
|
84
|
+
.hd h2{margin:0; font-size:20px; font-weight:800; letter-spacing:.1px}
|
|
85
|
+
.hd p{margin:0;color:var(--subtle)}
|
|
86
|
+
.grid{display:grid; grid-template-columns:repeat(4,1fr); gap:12px}
|
|
87
|
+
@media (max-width:1024px){ .grid{grid-template-columns:repeat(3,1fr)} }
|
|
88
|
+
@media (max-width:768px){ .grid{grid-template-columns:repeat(2,1fr)} }
|
|
89
|
+
@media (max-width:520px){ .grid{grid-template-columns:1fr} }
|
|
90
|
+
/* 支持模型专用布局 */
|
|
91
|
+
.models-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:12px}
|
|
92
|
+
@media (max-width:1024px){ .models-grid{grid-template-columns:repeat(2,1fr)} }
|
|
93
|
+
@media (max-width:768px){ .models-grid{grid-template-columns:repeat(2,1fr)} }
|
|
94
|
+
@media (max-width:520px){ .models-grid{grid-template-columns:1fr} }
|
|
95
|
+
/* 生态系统专用布局 */
|
|
96
|
+
.ecosystem-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:12px}
|
|
97
|
+
@media (max-width:1024px){ .ecosystem-grid{grid-template-columns:repeat(2,1fr)} }
|
|
98
|
+
@media (max-width:768px){ .ecosystem-grid{grid-template-columns:repeat(2,1fr)} }
|
|
99
|
+
@media (max-width:520px){ .ecosystem-grid{grid-template-columns:1fr} }
|
|
100
|
+
|
|
101
|
+
/* ===== Flat Blocks ===== */
|
|
102
|
+
.block{
|
|
103
|
+
border:1px solid var(--border);
|
|
104
|
+
background:var(--surface);
|
|
105
|
+
border-radius:var(--radius-md);
|
|
106
|
+
padding:14px 16px;
|
|
107
|
+
transition:border-color .12s ease, background-color .12s ease;
|
|
108
|
+
}
|
|
109
|
+
.block:hover{border-color:#C9D8EE; background:#FBFDFF}
|
|
110
|
+
.block h3{margin:0 0 6px; font-size:16px; font-weight:800}
|
|
111
|
+
.block p{margin:0; color:var(--muted); font-size:14px}
|
|
112
|
+
.block .line{
|
|
113
|
+
width:100%; height:6px; border-radius:4px; margin-bottom:10px;
|
|
114
|
+
background:linear-gradient(90deg,var(--primary),var(--primary-2));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* ===== Timeline ===== */
|
|
118
|
+
.timeline{
|
|
119
|
+
position:relative; padding-left:28px;
|
|
120
|
+
border-left:2px solid var(--border);
|
|
121
|
+
}
|
|
122
|
+
.step{ margin:0 0 18px; position:relative; }
|
|
123
|
+
.step::before{
|
|
124
|
+
content:""; position:absolute; left:-10px; top:2px;
|
|
125
|
+
width:10px; height:10px; border-radius:50%;
|
|
126
|
+
background:var(--primary); box-shadow:0 0 0 3px #E7F0FF;
|
|
127
|
+
}
|
|
128
|
+
.step h3{margin:0 0 6px; font-size:16px; font-weight:800}
|
|
129
|
+
.step p{margin:0 0 8px; color:var(--muted)}
|
|
130
|
+
.code{
|
|
131
|
+
font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,"Cascadia Code","Roboto Mono",Consolas,"Courier New";
|
|
132
|
+
font-size:13px; color:#0F172A; background:#F7FAFF;
|
|
133
|
+
border:1px solid var(--border); border-radius:var(--radius-sm);
|
|
134
|
+
padding:10px 12px; overflow:auto;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* ===== API Grid ===== */
|
|
138
|
+
.api-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:12px}
|
|
139
|
+
@media (max-width:900px){ .api-grid{grid-template-columns:repeat(2,1fr)} }
|
|
140
|
+
@media (max-width:640px){ .api-grid{grid-template-columns:1fr} }
|
|
141
|
+
.api-item .path{font-family:ui-monospace,Menlo,Consolas; font-size:13px; color:#1F2937}
|
|
142
|
+
.tag{
|
|
143
|
+
display:inline-flex; align-items:center; gap:6px;
|
|
144
|
+
padding:4px 8px; border:1px solid var(--border); border-radius:999px;
|
|
145
|
+
background:#F2F7FF; color:#1F2937; font-weight:700; font-size:12px; margin-top:8px;
|
|
146
|
+
}
|
|
147
|
+
.tag .dot{width:8px;height:8px;border-radius:50%;background:var(--accent)}
|
|
148
|
+
|
|
149
|
+
/* ===== Models & Ecosystem ===== */
|
|
150
|
+
.label{color:var(--subtle); font-weight:700; font-size:12px; margin-top:6px}
|
|
151
|
+
|
|
152
|
+
/* ===== Warning ===== */
|
|
153
|
+
.warn{
|
|
154
|
+
border:1px solid #FAD1D6;
|
|
155
|
+
border-left:4px solid var(--warning);
|
|
156
|
+
background:#FFF7F7;
|
|
157
|
+
border-radius:var(--radius-md);
|
|
158
|
+
padding:14px 16px;
|
|
159
|
+
}
|
|
160
|
+
.warn h3{margin:0 0 6px; color:#8B1C24}
|
|
161
|
+
.warn p{margin:0; color:#6B1A20}
|
|
162
|
+
|
|
163
|
+
/* ===== Service Status (14px) ===== */
|
|
164
|
+
.service-status{
|
|
165
|
+
display:flex;
|
|
166
|
+
align-items:center;
|
|
167
|
+
justify-content:center;
|
|
168
|
+
gap:10px;
|
|
169
|
+
background:#EAF7EF;
|
|
170
|
+
border:1px solid #CDE9D6;
|
|
171
|
+
border-left:4px solid #4CAF50;
|
|
172
|
+
color:#1F5E2E;
|
|
173
|
+
padding:14px 16px;
|
|
174
|
+
font-weight:800;
|
|
175
|
+
position:sticky;
|
|
176
|
+
top:0;
|
|
177
|
+
z-index:100;
|
|
178
|
+
margin-top:12px;
|
|
179
|
+
margin-bottom:0;
|
|
180
|
+
border-radius:10px;
|
|
181
|
+
box-shadow:0 6px 14px rgba(17,24,39,0.06);
|
|
182
|
+
transform:translateY(-120%);
|
|
183
|
+
opacity:0;
|
|
184
|
+
transition:transform .36s cubic-bezier(0.22, 1, 0.36, 1), opacity .24s ease;
|
|
185
|
+
}
|
|
186
|
+
.service-status.visible{
|
|
187
|
+
transform:translateY(0);
|
|
188
|
+
opacity:1;
|
|
189
|
+
}
|
|
190
|
+
.service-status:hover{
|
|
191
|
+
box-shadow:0 10px 22px rgba(17,24,39,0.08);
|
|
192
|
+
}
|
|
193
|
+
.service-status .status-dot{
|
|
194
|
+
width:10px;
|
|
195
|
+
height:10px;
|
|
196
|
+
background:#4CAF50;
|
|
197
|
+
border-radius:50%;
|
|
198
|
+
display:inline-block;
|
|
199
|
+
margin-right:6px;
|
|
200
|
+
animation:pulse 2s infinite;
|
|
201
|
+
box-shadow:0 0 0 3px rgba(76,175,80,0.16);
|
|
202
|
+
}
|
|
203
|
+
.service-status .label{
|
|
204
|
+
font-weight:800;
|
|
205
|
+
color:#1F5E2E;
|
|
206
|
+
letter-spacing:0.2px;
|
|
207
|
+
font-size:14px;
|
|
208
|
+
line-height:1.3;
|
|
209
|
+
}
|
|
210
|
+
.service-status .close-btn{
|
|
211
|
+
position:absolute;
|
|
212
|
+
right:12px;
|
|
213
|
+
top:50%;
|
|
214
|
+
transform:translateY(-50%);
|
|
215
|
+
display:inline-flex;
|
|
216
|
+
align-items:center;
|
|
217
|
+
justify-content:center;
|
|
218
|
+
width:28px; height:28px;
|
|
219
|
+
border-radius:8px;
|
|
220
|
+
border:1px solid #CDE9D6;
|
|
221
|
+
background:#F4FBF6;
|
|
222
|
+
color:#2E7D32;
|
|
223
|
+
cursor:pointer;
|
|
224
|
+
font-weight:800;
|
|
225
|
+
font-size:16px;
|
|
226
|
+
line-height:1;
|
|
227
|
+
transition:background-color .15s ease, border-color .15s ease, transform .12s ease;
|
|
228
|
+
}
|
|
229
|
+
.service-status .close-btn:hover{
|
|
230
|
+
background:#E6F6EC;
|
|
231
|
+
border-color:#BEE3CA;
|
|
232
|
+
transform:translateY(-50%) scale(1.02);
|
|
233
|
+
}
|
|
234
|
+
@keyframes pulse{
|
|
235
|
+
0% { opacity: 1; }
|
|
236
|
+
50% { opacity: 0.5; }
|
|
237
|
+
100% { opacity: 1; }
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/* ===== Custom Qwen Styles ===== */
|
|
241
|
+
.token-display{
|
|
242
|
+
background:linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
|
|
243
|
+
color:#234e52;
|
|
244
|
+
padding:6px 10px;
|
|
245
|
+
border-radius:6px;
|
|
246
|
+
font-family:'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
|
|
247
|
+
font-size:12px;
|
|
248
|
+
border:1px solid #81e6d9;
|
|
249
|
+
display:inline-block;
|
|
250
|
+
margin:2px;
|
|
251
|
+
box-shadow:0 2px 4px rgba(0, 0, 0, 0.05);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.method-step{
|
|
255
|
+
background:#FAFCFF;
|
|
256
|
+
border:1px solid var(--border);
|
|
257
|
+
border-radius:var(--radius-md);
|
|
258
|
+
padding:16px;
|
|
259
|
+
margin:12px 0;
|
|
260
|
+
transition:all .12s ease;
|
|
261
|
+
}
|
|
262
|
+
.method-step:hover{
|
|
263
|
+
border-color:#C9D8EE;
|
|
264
|
+
background:#FBFDFF;
|
|
265
|
+
}
|
|
266
|
+
.method-step h4{
|
|
267
|
+
margin:0 0 8px;
|
|
268
|
+
font-size:15px;
|
|
269
|
+
font-weight:800;
|
|
270
|
+
color:var(--text);
|
|
271
|
+
display:flex;
|
|
272
|
+
align-items:center;
|
|
273
|
+
gap:8px;
|
|
274
|
+
}
|
|
275
|
+
.method-number{
|
|
276
|
+
width:24px;height:24px;border-radius:6px;
|
|
277
|
+
background:linear-gradient(135deg,var(--primary),var(--primary-2));
|
|
278
|
+
color:white;display:flex;align-items:center;justify-content:center;
|
|
279
|
+
font-size:12px;font-weight:800;
|
|
280
|
+
}
|
|
281
|
+
.method-step ul{
|
|
282
|
+
margin:8px 0 0 0;padding-left:0;list-style:none;
|
|
283
|
+
}
|
|
284
|
+
.method-step li{
|
|
285
|
+
padding:6px 0;color:var(--muted);font-size:14px;
|
|
286
|
+
position:relative;padding-left:16px;
|
|
287
|
+
}
|
|
288
|
+
.method-step li::before{
|
|
289
|
+
content:"•";position:absolute;left:0;color:var(--primary);font-weight:800;
|
|
290
|
+
}
|
|
291
|
+
.method-step img{
|
|
292
|
+
max-width:100%;height:auto;border-radius:8px;margin:12px 0;
|
|
293
|
+
box-shadow:0 4px 12px rgba(0,0,0,0.1);
|
|
294
|
+
}
|
|
295
|
+
</style>
|
|
296
|
+
</head>
|
|
297
|
+
<body>
|
|
298
|
+
|
|
299
|
+
<main class="shell">
|
|
300
|
+
<!-- Service Status -->
|
|
301
|
+
<div class="service-status" id="serviceStatus" role="status" aria-live="polite">
|
|
302
|
+
<span class="status-dot" aria-hidden="true"></span>
|
|
303
|
+
<span class="label">Qwen-Free-API 服务已启动,请使用客户端进行连接</span>
|
|
304
|
+
<button class="close-btn" id="serviceStatusClose" aria-label="关闭提示" title="关闭提示">×</button>
|
|
305
|
+
</div>
|
|
306
|
+
|
|
307
|
+
<!-- Hero -->
|
|
308
|
+
<section class="hero">
|
|
309
|
+
<div class="hero-inner">
|
|
310
|
+
<div>
|
|
311
|
+
<h1 class="hero-title">面向开发者的 Qwen API 代理</h1>
|
|
312
|
+
<p class="hero-desc">兼容 OpenAI 协议,稳定流式、多轮上下文与检索。工程语义清晰、易接入、可维护。</p>
|
|
313
|
+
<div class="hero-actions">
|
|
314
|
+
<a class="btn primary" href="#guide">快速接入</a>
|
|
315
|
+
<a class="btn" href="#apis">查看接口</a>
|
|
316
|
+
</div>
|
|
317
|
+
</div>
|
|
318
|
+
</div>
|
|
319
|
+
</section>
|
|
320
|
+
|
|
321
|
+
<!-- Warning -->
|
|
322
|
+
<section class="section">
|
|
323
|
+
<div class="warn">
|
|
324
|
+
<h3>⚠️ 免责声明</h3>
|
|
325
|
+
<p><strong>逆向 API 存在不稳定性。建议前往 <a href="https://dashscope.console.aliyun.com/" target="_blank" rel="noreferrer">阿里云百炼平台</a> 付费使用,避免封禁风险。</strong></p>
|
|
326
|
+
<p><strong>本项目仅用于研究学习,不接受任何资金往来。仅限自用,禁止商用或对外提供服务。</strong></p>
|
|
327
|
+
</div>
|
|
328
|
+
</section>
|
|
329
|
+
|
|
330
|
+
<!-- Features -->
|
|
331
|
+
<section id="features" class="section">
|
|
332
|
+
<div class="hd">
|
|
333
|
+
<h2>核心特性</h2>
|
|
334
|
+
</div>
|
|
335
|
+
<div class="grid">
|
|
336
|
+
<div class="block">
|
|
337
|
+
<div class="line" aria-hidden="true"></div>
|
|
338
|
+
<h3>流式输出</h3>
|
|
339
|
+
<p>毫秒级首字节,边生成边传输,提升交互性能(SSE/Web/CLI)。</p>
|
|
340
|
+
</div>
|
|
341
|
+
<div class="block">
|
|
342
|
+
<div class="line" aria-hidden="true"></div>
|
|
343
|
+
<h3>多轮对话</h3>
|
|
344
|
+
<p>上下文记忆与压缩,保证长对话的稳定响应(Token 管理与截断策略)。</p>
|
|
345
|
+
</div>
|
|
346
|
+
<div class="block">
|
|
347
|
+
<div class="line" aria-hidden="true"></div>
|
|
348
|
+
<h3>联网检索</h3>
|
|
349
|
+
<p>实时信息聚合,提升回答的时效与准确性(可插拔 Provider)。</p>
|
|
350
|
+
</div>
|
|
351
|
+
<div class="block">
|
|
352
|
+
<div class="line" aria-hidden="true"></div>
|
|
353
|
+
<h3>Qwen 生态</h3>
|
|
354
|
+
<p>深度集成阿里云通义千问全家桶,支持 Qwen2.5 等先进模型。</p>
|
|
355
|
+
</div>
|
|
356
|
+
</div>
|
|
357
|
+
</section>
|
|
358
|
+
|
|
359
|
+
<!-- Guide: Timeline -->
|
|
360
|
+
<section id="guide" class="section">
|
|
361
|
+
<div class="hd">
|
|
362
|
+
<h2>接入指南</h2>
|
|
363
|
+
</div>
|
|
364
|
+
<div class="timeline">
|
|
365
|
+
<div class="step">
|
|
366
|
+
<h3>01 · 方法1:从通义千问获取 Token</h3>
|
|
367
|
+
<p>从 <a href="https://tongyi.aliyun.com/qianwen" target="_blank" rel="noreferrer">通义千问</a> 登录</p>
|
|
368
|
+
<p>进入通义千问随便发起一个对话,然后F12打开开发者工具,从Application > Cookies中找到<code>tongyi_sso_ticket</code>的值,这将作为Authorization的Bearer Token值:</p>
|
|
369
|
+
<img src="https://cdn.jsdelivr.net/gh/xiaoY233/Qwen-Free-API@master/doc/example-0.png" alt="获取tongyi_sso_ticket" style="max-width:100%;height:auto;border-radius:8px;margin:12px 0;box-shadow:0 4px 12px rgba(0,0,0,0.1);" />
|
|
370
|
+
<pre class="code">Authorization: Bearer YOUR_QWEN_TOKEN</pre>
|
|
371
|
+
</div>
|
|
372
|
+
<div class="step">
|
|
373
|
+
<h3>02 · 方法2:从阿里云获取 Token</h3>
|
|
374
|
+
<p>从 <a href="https://www.aliyun.com/" target="_blank" rel="noreferrer">阿里云</a> 登录(如果该账号有服务器等重要资产不建议使用),如果该账号之前未进入过<a href="https://tongyi.aliyun.com/qianwen" target="_blank" rel="noreferrer">通义千问</a> ,需要先进入同意协议,否则无法生效。</p>
|
|
375
|
+
<p>然后F12打开开发者工具,从Application > Cookies中找到<code>login_aliyunid_ticket</code>的值,这将作为Authorization的Bearer Token值:</p>
|
|
376
|
+
<img src="https://cdn.jsdelivr.net/gh/xiaoY233/Qwen-Free-API@master/doc/example-7.png" alt="获取login_aliyunid_ticket" style="max-width:100%;height:auto;border-radius:8px;margin:12px 0;box-shadow:0 4px 12px rgba(0,0,0,0.1);" />
|
|
377
|
+
<pre class="code">Authorization: Bearer YOUR_ALIYUN_TOKEN</pre>
|
|
378
|
+
</div>
|
|
379
|
+
<div class="step">
|
|
380
|
+
<h3>03 · 多账号轮询</h3>
|
|
381
|
+
<p>将多个 Token 用逗号拼接,服务自动挑选一个执行。</p>
|
|
382
|
+
<pre class="code">Authorization: Bearer TOKEN1,TOKEN2,TOKEN3</pre>
|
|
383
|
+
</div>
|
|
384
|
+
<div class="step">
|
|
385
|
+
<h3>04 · 选择客户端或 SDK</h3>
|
|
386
|
+
<p>推荐使用 LobeChat / NextChat / Dify 或直接使用 OpenAI SDK。</p>
|
|
387
|
+
<pre class="code">curl -X POST /v1/chat/completions \
|
|
388
|
+
-H "Authorization: Bearer YOUR_USER_TOKEN" \
|
|
389
|
+
-H "Content-Type: application/json" \
|
|
390
|
+
-d '{ "model":"qwen-turbo", "messages":[{"role":"user","content":"Hello"}] }'</pre>
|
|
391
|
+
</div>
|
|
392
|
+
</div>
|
|
393
|
+
</section>
|
|
394
|
+
|
|
395
|
+
<!-- APIs -->
|
|
396
|
+
<section id="apis" class="section">
|
|
397
|
+
<div class="hd">
|
|
398
|
+
<h2>接口兼容性</h2>
|
|
399
|
+
</div>
|
|
400
|
+
<div class="api-grid">
|
|
401
|
+
<div class="block api-item">
|
|
402
|
+
<h3>OpenAI 兼容</h3>
|
|
403
|
+
<div class="path">/v1/chat/completions</div>
|
|
404
|
+
<span class="tag"><span class="dot"></span> 推荐</span>
|
|
405
|
+
</div>
|
|
406
|
+
<div class="block api-item">
|
|
407
|
+
<h3>Google Gemini 兼容</h3>
|
|
408
|
+
<div class="path">/v1beta/models/:model:generateContent</div>
|
|
409
|
+
<span class="tag"><span class="dot"></span> gemini-cli</span>
|
|
410
|
+
</div>
|
|
411
|
+
<div class="block api-item">
|
|
412
|
+
<h3>Anthropic Claude 兼容</h3>
|
|
413
|
+
<div class="path">/v1/messages</div>
|
|
414
|
+
<span class="tag"><span class="dot"></span> claude-code</span>
|
|
415
|
+
</div>
|
|
416
|
+
</div>
|
|
417
|
+
</section>
|
|
418
|
+
|
|
419
|
+
<!-- Models -->
|
|
420
|
+
<section id="models" class="section">
|
|
421
|
+
<div class="hd">
|
|
422
|
+
<h2>支持模型</h2>
|
|
423
|
+
</div>
|
|
424
|
+
<div class="models-grid">
|
|
425
|
+
<div class="block">
|
|
426
|
+
<div class="line" aria-hidden="true"></div>
|
|
427
|
+
<h3>Qwen3-235B-A22B</h3>
|
|
428
|
+
<p>最强大的混合专家语言模型,支持思维预算机制</p>
|
|
429
|
+
<div class="label">用途 · 复杂推理 / 高性能任务</div>
|
|
430
|
+
</div>
|
|
431
|
+
<div class="block">
|
|
432
|
+
<div class="line" aria-hidden="true"></div>
|
|
433
|
+
<h3>Qwen3-Coder</h3>
|
|
434
|
+
<p>强大的编程专用语言模型,擅长代码生成和工具使用</p>
|
|
435
|
+
<div class="label">用途 · 代码生成 / 编程助手</div>
|
|
436
|
+
</div>
|
|
437
|
+
<div class="block">
|
|
438
|
+
<div class="line" aria-hidden="true"></div>
|
|
439
|
+
<h3>Qwen3-30B-A3B</h3>
|
|
440
|
+
<p>紧凑高性能的混合专家模型</p>
|
|
441
|
+
<div class="label">用途 · 平衡性能 / 通用任务</div>
|
|
442
|
+
</div>
|
|
443
|
+
<div class="block">
|
|
444
|
+
<div class="line" aria-hidden="true"></div>
|
|
445
|
+
<h3>Qwen3-Coder-Flash</h3>
|
|
446
|
+
<p>快速准确的代码生成模型</p>
|
|
447
|
+
<div class="label">用途 · 快速编程 / 代码补全</div>
|
|
448
|
+
</div>
|
|
449
|
+
<div class="block">
|
|
450
|
+
<div class="line" aria-hidden="true"></div>
|
|
451
|
+
<h3>Qwen2.5-Max</h3>
|
|
452
|
+
<p>Qwen系列中最强大的语言模型</p>
|
|
453
|
+
<div class="label">用途 · 高级推理 / 专业任务</div>
|
|
454
|
+
</div>
|
|
455
|
+
</div>
|
|
456
|
+
</section>
|
|
457
|
+
|
|
458
|
+
<!-- Ecosystem -->
|
|
459
|
+
<section id="ecosystem" class="section">
|
|
460
|
+
<div class="hd">
|
|
461
|
+
<h2>客户端生态</h2>
|
|
462
|
+
<p>覆盖聊天、命令行与应用开发场景。</p>
|
|
463
|
+
</div>
|
|
464
|
+
<div class="grid ecosystem-grid">
|
|
465
|
+
<div class="block"><h3>LobeChat</h3><p>现代化聊天界面。</p></div>
|
|
466
|
+
<div class="block"><h3>NextChat</h3><p>简洁多平台客户端。</p></div>
|
|
467
|
+
<div class="block"><h3>Dify</h3><p>AI 应用开发平台。</p></div>
|
|
468
|
+
<div class="block"><h3>OpenAI SDK</h3><p>直接编程接入。</p></div>
|
|
469
|
+
<div class="block"><h3>ChatBox</h3><p>桌面端聊天工具。</p></div>
|
|
470
|
+
<div class="block"><h3>继续探索</h3><p>更多客户端持续适配中。</p></div>
|
|
471
|
+
</div>
|
|
472
|
+
</section>
|
|
473
|
+
<br></br>
|
|
474
|
+
|
|
475
|
+
<!-- footer 已删除 -->
|
|
476
|
+
</main>
|
|
477
|
+
|
|
478
|
+
<script>
|
|
479
|
+
// 加载时滑入显示;点击关闭后本次会话隐藏
|
|
480
|
+
(function(){
|
|
481
|
+
const bar = document.getElementById('serviceStatus');
|
|
482
|
+
const closeBtn = document.getElementById('serviceStatusClose');
|
|
483
|
+
if(!bar || !closeBtn) return;
|
|
484
|
+
|
|
485
|
+
// 页面渲染后滑入
|
|
486
|
+
requestAnimationFrame(() => {
|
|
487
|
+
bar.classList.add('visible');
|
|
488
|
+
});
|
|
489
|
+
|
|
490
|
+
// 关闭:移除可见样式并在过渡后隐藏
|
|
491
|
+
closeBtn.addEventListener('click', () => {
|
|
492
|
+
bar.classList.remove('visible');
|
|
493
|
+
const onEnd = () => {
|
|
494
|
+
bar.style.display = 'none';
|
|
495
|
+
bar.removeEventListener('transitionend', onEnd);
|
|
496
|
+
};
|
|
497
|
+
bar.addEventListener('transitionend', onEnd);
|
|
498
|
+
}, { passive: true });
|
|
499
|
+
})();
|
|
500
|
+
</script>
|
|
501
|
+
</body>
|
|
502
|
+
</html>
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "qwen-free-api-fix",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Qwen Free API Server",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"qwen-free-api": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"directories": {
|
|
12
|
+
"dist": "dist"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist/",
|
|
16
|
+
"configs-example/"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"dev": "tsup --watch --onSuccess \"node dist/index.js\"",
|
|
20
|
+
"start": "node dist/index.js",
|
|
21
|
+
"build": "tsup",
|
|
22
|
+
"prepublishOnly": "npm run build"
|
|
23
|
+
},
|
|
24
|
+
"author": "xiaoY233",
|
|
25
|
+
"license": "ISC",
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"axios": "^1.6.7",
|
|
28
|
+
"colors": "^1.4.0",
|
|
29
|
+
"crc-32": "^1.2.2",
|
|
30
|
+
"cron": "^3.1.6",
|
|
31
|
+
"date-fns": "^3.3.1",
|
|
32
|
+
"eventsource-parser": "^1.1.2",
|
|
33
|
+
"form-data": "^4.0.0",
|
|
34
|
+
"fs-extra": "^11.2.0",
|
|
35
|
+
"koa": "^2.15.0",
|
|
36
|
+
"koa-body": "^5.0.0",
|
|
37
|
+
"koa-bodyparser": "^4.4.1",
|
|
38
|
+
"koa-range": "^0.3.0",
|
|
39
|
+
"koa-router": "^12.0.1",
|
|
40
|
+
"koa2-cors": "^2.0.6",
|
|
41
|
+
"lodash": "^4.17.21",
|
|
42
|
+
"mime": "^4.0.1",
|
|
43
|
+
"minimist": "^1.2.8",
|
|
44
|
+
"randomstring": "^1.3.0",
|
|
45
|
+
"uuid": "^9.0.1",
|
|
46
|
+
"yaml": "^2.3.4"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/lodash": "^4.14.202",
|
|
50
|
+
"@types/mime": "^3.0.4",
|
|
51
|
+
"tsup": "^8.0.2",
|
|
52
|
+
"typescript": "^5.3.3"
|
|
53
|
+
}
|
|
54
|
+
}
|