aixxai 1.7.2 → 1.7.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aixxai",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "description": "AIXX CLI - 让你的AI调用万物。One command, every AI model. By AIXX (Wanan Exchange), the verification-first compute exchange. 安装:npx aixxai",
5
5
  "type": "module",
6
6
  "bin": {
@@ -46,9 +46,32 @@ export async function balance(subArgs) {
46
46
  process.exit(1);
47
47
  }
48
48
 
49
+ // 0.5 数据API额度预取(1121千问终检⑥顺序优化:先打快的,展示也排前面)
50
+ let dataApi = null;
51
+ try {
52
+ const c = new AbortController();
53
+ const t0 = setTimeout(() => c.abort(), 8000);
54
+ const u = await fetch('https://www.aixx.vip/api/v1/account/usage', {
55
+ headers: { Authorization: `Bearer ${apiKey}` },
56
+ signal: c.signal,
57
+ });
58
+ clearTimeout(t0);
59
+ const j = await u.json();
60
+ if (j && j.ok) dataApi = j;
61
+ } catch { /* 数据API额度查询失败不影响主流程 */ }
62
+
49
63
  console.log(`使用Key: ${maskKey(apiKey)}`);
50
64
  console.log(`后端地址: ${baseUrl}\n`);
51
65
 
66
+ // 4. GPU行情数据API额度先上屏(预取于下方0.5段完成·千问终检⑥:最快的先显示)
67
+ if (dataApi) {
68
+ const left = dataApi.free_quota - dataApi.free_used;
69
+ console.log('── GPU 行情数据 API ──');
70
+ console.log(`📊 档位:${dataApi.tier === 'sub' ? '订阅中' : '免费档'}${dataApi.sub_expires_at ? `(至 ${String(dataApi.sub_expires_at).slice(0, 10)})` : ''}`);
71
+ console.log(`📊 免费额度:剩 ${left} / ${dataApi.free_quota} 次(今日已用 ${dataApi.today_counted})`);
72
+ console.log('────────────────────────────────────\n');
73
+ }
74
+
52
75
  // 0. /v1/account 端点已退役(1121千问终检:console/v1/account=404死路,白耗一次请求)
53
76
  // 直接走 /dashboard/billing/subscription(1121实测200活)
54
77
 
@@ -131,9 +154,7 @@ export async function balance(subArgs) {
131
154
  // 所以这里如实告知用户,引导去后台查精确余额。
132
155
  console.log(`💰 计费方式:按账户余额扣费(注册送$0.5试用额度,用完需充值)`);
133
156
  // 1120 WorkBuddy实测: unlimited档下dashboard/billing/usage返回的单位不可信(曾显示¥58969虚惊)
134
- // 按账户余额扣费时"已用"以账户维度为准——这里不再展示误算值, 引导官方端点
135
- console.log(`📊 已用额度:以账户维度计(请用下方官方入口查看精确值)`);
136
- console.log(`💡 精确余额请登录AIXX后台查看:${baseUrl.replace(/\/v1$/, '')}`);
157
+ // 按账户余额扣费时"已用"以账户维度为准——不展示误算值;1121千问终检:死文案删除
137
158
  } else {
138
159
  // 正常有限额度
139
160
  const remainingUsd = Math.max(0, hardLimitUsd - usedUsd);
@@ -146,25 +167,13 @@ export async function balance(subArgs) {
146
167
  }
147
168
  console.log('────────────────────────────────────');
148
169
 
149
- // 4. GPU行情数据API额度(1121千问终检③"最后一跳":/api/v1/account/usage @ www.aixx.vip)
150
- if (apiKey) {
151
- try {
152
- const ctrl = new AbortController();
153
- const t4 = setTimeout(() => ctrl.abort(), 12000);
154
- const u = await fetch('https://www.aixx.vip/api/v1/account/usage', {
155
- headers: { Authorization: `Bearer ${apiKey}` },
156
- signal: ctrl.signal,
157
- });
158
- clearTimeout(t4);
159
- const j = await u.json();
160
- if (j && j.ok) {
161
- const left = j.free_quota - j.free_used;
162
- console.log('\n── GPU 行情数据 API ──');
163
- console.log(`📊 档位:${j.tier === 'sub' ? '订阅中' : '免费档'}${j.sub_expires_at ? `(至 ${String(j.sub_expires_at).slice(0, 10)})` : ''}`);
164
- console.log(`📊 免费额度:剩 ${left} / ${j.free_quota} 次(今日已用 ${j.today_counted})`);
165
- console.log('────────────────────────────────────');
166
- }
167
- } catch { /* 数据API额度查询失败不影响主流程 */ }
170
+ // 4. GPU行情数据API额度(预取结果上屏——千问终检⑥:数据API段排前·展示顺序=数据API→模型余额)
171
+ if (dataApi) {
172
+ const left = dataApi.free_quota - dataApi.free_used;
173
+ console.log('\n── GPU 行情数据 API ──');
174
+ console.log(`📊 档位:${dataApi.tier === 'sub' ? '订阅中' : '免费档'}${dataApi.sub_expires_at ? `(至 ${String(dataApi.sub_expires_at).slice(0, 10)})` : ''}`);
175
+ console.log(`📊 免费额度:剩 ${left} / ${dataApi.free_quota} 次(今日已用 ${dataApi.today_counted})`);
176
+ console.log('────────────────────────────────────');
168
177
  }
169
178
 
170
179
  console.log('\n💡 提示:');