@teinai/cli 1.1.7 → 1.1.9
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/index.js +899 -554
- package/package.json +24 -24
package/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
var
|
|
3
|
+
var zt = Object.create;
|
|
4
4
|
var me = Object.defineProperty;
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
5
|
+
var Yt = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var Qt = Object.getOwnPropertyNames;
|
|
7
|
+
var Xt = Object.getPrototypeOf,
|
|
8
|
+
Zt = Object.prototype.hasOwnProperty;
|
|
9
9
|
var y = (e, t, i) => () => {
|
|
10
10
|
if (i) throw i[0];
|
|
11
11
|
try {
|
|
@@ -14,25 +14,25 @@ var y = (e, t, i) => () => {
|
|
|
14
14
|
throw ((i = [r]), r);
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
var
|
|
17
|
+
var ei = (e, t) => {
|
|
18
18
|
for (var i in t) me(e, i, { get: t[i], enumerable: !0 });
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
ti = (e, t, i, r) => {
|
|
21
21
|
if ((t && typeof t == 'object') || typeof t == 'function')
|
|
22
|
-
for (let n of
|
|
23
|
-
!
|
|
22
|
+
for (let n of Qt(t))
|
|
23
|
+
!Zt.call(e, n) &&
|
|
24
24
|
n !== i &&
|
|
25
|
-
me(e, n, { get: () => t[n], enumerable: !(r =
|
|
25
|
+
me(e, n, { get: () => t[n], enumerable: !(r = Yt(t, n)) || r.enumerable });
|
|
26
26
|
return e;
|
|
27
27
|
};
|
|
28
|
-
var
|
|
29
|
-
(i = e != null ?
|
|
30
|
-
|
|
28
|
+
var v = (e, t, i) => (
|
|
29
|
+
(i = e != null ? zt(Xt(e)) : {}),
|
|
30
|
+
ti(t || !e || !e.__esModule ? me(i, 'default', { value: e, enumerable: !0 }) : i, e)
|
|
31
31
|
);
|
|
32
|
-
function
|
|
32
|
+
function D() {
|
|
33
33
|
try {
|
|
34
|
-
if (
|
|
35
|
-
let e =
|
|
34
|
+
if ($.default.existsSync(O)) {
|
|
35
|
+
let e = $.default.readFileSync(O, 'utf-8');
|
|
36
36
|
return JSON.parse(e);
|
|
37
37
|
}
|
|
38
38
|
} catch {}
|
|
@@ -40,44 +40,54 @@ function L() {
|
|
|
40
40
|
}
|
|
41
41
|
function ge(e) {
|
|
42
42
|
try {
|
|
43
|
-
|
|
44
|
-
let i = { ...
|
|
45
|
-
(
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
$.default.existsSync(te) || $.default.mkdirSync(te, { recursive: !0, mode: 448 });
|
|
44
|
+
let i = { ...D(), ...e };
|
|
45
|
+
($.default.writeFileSync(O, JSON.stringify(i, null, 2), { encoding: 'utf-8', mode: 384 }),
|
|
46
|
+
$.default.chmodSync(te, 448),
|
|
47
|
+
$.default.chmodSync(O, 384));
|
|
48
48
|
} catch (t) {
|
|
49
|
-
throw new Error(`Failed to save config to ${
|
|
49
|
+
throw new Error(`Failed to save config to ${O}: ${t}`);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function K(e) {
|
|
53
53
|
if (e && e.trim()) return e.trim();
|
|
54
54
|
let t = process.env.TEIN_API_KEY || process.env.TEIN_KEY;
|
|
55
55
|
if (t && t.trim()) return t.trim();
|
|
56
|
-
let i =
|
|
56
|
+
let i = D();
|
|
57
57
|
return i.apiKey && i.apiKey.trim() ? i.apiKey.trim() : '';
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function k(e) {
|
|
60
60
|
if (e && e.trim()) return e.trim().replace(/\/+$/, '');
|
|
61
61
|
let t = process.env.TEIN_API_URL;
|
|
62
62
|
if (t && t.trim()) return t.trim().replace(/\/+$/, '');
|
|
63
|
-
let i =
|
|
63
|
+
let i = D();
|
|
64
64
|
return i.apiUrl && i.apiUrl.trim() ? i.apiUrl.trim().replace(/\/+$/, '') : 'https://api.tein.ai';
|
|
65
65
|
}
|
|
66
66
|
function ie() {
|
|
67
|
-
return
|
|
67
|
+
return O;
|
|
68
68
|
}
|
|
69
|
-
var
|
|
69
|
+
var $,
|
|
70
70
|
Ge,
|
|
71
71
|
fe,
|
|
72
72
|
te,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
O,
|
|
74
|
+
C = y(() => {
|
|
75
75
|
'use strict';
|
|
76
|
-
((
|
|
77
|
-
(Ge =
|
|
78
|
-
(fe =
|
|
76
|
+
(($ = v(require('node:fs'))),
|
|
77
|
+
(Ge = v(require('node:os'))),
|
|
78
|
+
(fe = v(require('node:path'))),
|
|
79
79
|
(te = fe.default.join(Ge.default.homedir(), '.tein')),
|
|
80
|
-
(
|
|
80
|
+
(O = fe.default.join(te, 'config.json')));
|
|
81
|
+
});
|
|
82
|
+
var oi,
|
|
83
|
+
Je,
|
|
84
|
+
He,
|
|
85
|
+
We = y(() => {
|
|
86
|
+
'use strict';
|
|
87
|
+
((oi = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4']),
|
|
88
|
+
(Je = [...oi, 'auto']),
|
|
89
|
+
(He =
|
|
90
|
+
'The medium endpoint renders non-square images at 1K only. Use resolution 1K, aspect_ratio 1:1, or the dynamic endpoint for a non-square 2K or 4K image.'));
|
|
81
91
|
});
|
|
82
92
|
var B,
|
|
83
93
|
he = y(() => {
|
|
@@ -87,11 +97,11 @@ var B,
|
|
|
87
97
|
function ye(e) {
|
|
88
98
|
return !1;
|
|
89
99
|
}
|
|
90
|
-
var
|
|
100
|
+
var ze = y(() => {
|
|
91
101
|
'use strict';
|
|
92
102
|
});
|
|
93
103
|
var re,
|
|
94
|
-
|
|
104
|
+
Ye = y(() => {
|
|
95
105
|
'use strict';
|
|
96
106
|
re = {
|
|
97
107
|
source: 'TEIN Price Board',
|
|
@@ -128,7 +138,7 @@ var re,
|
|
|
128
138
|
{ slug: 'seed', name: 'Seed', models: ['seed-audio-1-0', 'seed-2-1-turbo'] },
|
|
129
139
|
{ slug: 'wan', name: 'Wan', models: ['wan-3-0', 'wan-3-0-prime'] },
|
|
130
140
|
{ slug: 'happy-horse', name: 'HappyHorse', models: ['happy-horse-1-1', 'happy-horse-1-0'] },
|
|
131
|
-
{ slug: 'minimax', name: 'Hailuo', models: ['minimax-h3'] },
|
|
141
|
+
{ slug: 'minimax', name: 'Hailuo', models: ['minimax-h3', 'minimax-h3-turbo'] },
|
|
132
142
|
{ slug: 'qwen', name: 'Qwen', models: ['qwen-3', 'qwen-3-pro'] },
|
|
133
143
|
{
|
|
134
144
|
slug: 'nano-banana',
|
|
@@ -163,6 +173,11 @@ var re,
|
|
|
163
173
|
'claude-haiku-4-5',
|
|
164
174
|
],
|
|
165
175
|
},
|
|
176
|
+
{ slug: 'kling', name: 'Kling', models: ['kling-v4', 'kling-v3-video'] },
|
|
177
|
+
{ slug: 'ltx', name: 'LTX', models: ['ltx-2.3-pro'] },
|
|
178
|
+
{ slug: 'vidu', name: 'Vidu', models: ['vidu-q4-preview'] },
|
|
179
|
+
{ slug: 'flux', name: 'FLUX', models: ['flux-2-dev'] },
|
|
180
|
+
{ slug: 'eleven', name: 'ElevenLabs', models: ['eleven-v4'] },
|
|
166
181
|
],
|
|
167
182
|
models: [
|
|
168
183
|
{
|
|
@@ -1211,21 +1226,24 @@ var re,
|
|
|
1211
1226
|
price: { starter: 0.0289, plus: 0.0275, scale: 0.0257 },
|
|
1212
1227
|
label: '480p',
|
|
1213
1228
|
resolution: '480p',
|
|
1229
|
+
unfiltered: { starter: 0.0303, plus: 0.0288, scale: 0.0269 },
|
|
1214
1230
|
},
|
|
1215
1231
|
{
|
|
1216
1232
|
id: '720p',
|
|
1217
1233
|
price: { starter: 0.0579, plus: 0.055, scale: 0.0514 },
|
|
1218
1234
|
label: '720p',
|
|
1219
1235
|
resolution: '720p',
|
|
1236
|
+
unfiltered: { starter: 0.0607, plus: 0.0577, scale: 0.0539 },
|
|
1220
1237
|
},
|
|
1221
1238
|
{
|
|
1222
1239
|
id: '1080p',
|
|
1223
1240
|
price: { starter: 0.1169, plus: 0.1111, scale: 0.1026 },
|
|
1224
1241
|
label: '1080p',
|
|
1225
1242
|
resolution: '1080p',
|
|
1243
|
+
unfiltered: { starter: 0.1227, plus: 0.1166, scale: 0.1077 },
|
|
1226
1244
|
},
|
|
1227
1245
|
],
|
|
1228
|
-
unfiltered:
|
|
1246
|
+
unfiltered: 0.05,
|
|
1229
1247
|
priority: null,
|
|
1230
1248
|
draft: null,
|
|
1231
1249
|
axes: { resolution: ['480p', '720p', '1080p'] },
|
|
@@ -1348,13 +1366,13 @@ var re,
|
|
|
1348
1366
|
},
|
|
1349
1367
|
{
|
|
1350
1368
|
id: '768p',
|
|
1351
|
-
price: { starter: 0.
|
|
1369
|
+
price: { starter: 0.0388, plus: 0.0385, scale: 0.0385 },
|
|
1352
1370
|
label: '768P',
|
|
1353
1371
|
resolution: '768p',
|
|
1354
1372
|
},
|
|
1355
1373
|
{
|
|
1356
1374
|
id: '2k',
|
|
1357
|
-
price: { starter: 0.
|
|
1375
|
+
price: { starter: 0.063, plus: 0.0616, scale: 0.0616 },
|
|
1358
1376
|
label: '2K',
|
|
1359
1377
|
resolution: '2k',
|
|
1360
1378
|
},
|
|
@@ -3220,88 +3238,132 @@ var re,
|
|
|
3220
3238
|
api: { model: 'gpt-6-astra' },
|
|
3221
3239
|
variants: [
|
|
3222
3240
|
{
|
|
3223
|
-
id: 'cheap-input',
|
|
3241
|
+
id: 'cheap-input-0-272k',
|
|
3224
3242
|
price: { starter: 0.6593, plus: 0.6263, scale: 0.5605 },
|
|
3225
|
-
label: 'Input',
|
|
3243
|
+
label: 'Input (0\u2013272K prompt)',
|
|
3226
3244
|
endpoint: 'cheap',
|
|
3227
3245
|
component: 'input',
|
|
3246
|
+
context: '0\u2013272K',
|
|
3228
3247
|
},
|
|
3229
3248
|
{
|
|
3230
|
-
id: 'cheap-output',
|
|
3249
|
+
id: 'cheap-output-0-272k',
|
|
3231
3250
|
price: { starter: 3.2967, plus: 3.1319, scale: 2.8022 },
|
|
3232
|
-
label: 'Output',
|
|
3251
|
+
label: 'Output (0\u2013272K prompt)',
|
|
3233
3252
|
endpoint: 'cheap',
|
|
3234
3253
|
component: 'output',
|
|
3254
|
+
context: '0\u2013272K',
|
|
3235
3255
|
},
|
|
3236
3256
|
{
|
|
3237
|
-
id: 'cheap-cache_read',
|
|
3257
|
+
id: 'cheap-cache_read-0-272k',
|
|
3238
3258
|
price: { starter: 0.0659, plus: 0.0626, scale: 0.0561 },
|
|
3239
|
-
label: 'Cache read',
|
|
3259
|
+
label: 'Cache read (0\u2013272K prompt)',
|
|
3240
3260
|
endpoint: 'cheap',
|
|
3241
3261
|
component: 'cache_read',
|
|
3262
|
+
context: '0\u2013272K',
|
|
3242
3263
|
},
|
|
3243
3264
|
{
|
|
3244
|
-
id: 'cheap-cache_write',
|
|
3265
|
+
id: 'cheap-cache_write-0-272k',
|
|
3245
3266
|
price: { starter: 0.8242, plus: 0.783, scale: 0.7006 },
|
|
3246
|
-
label: 'Cache write',
|
|
3267
|
+
label: 'Cache write (0\u2013272K prompt)',
|
|
3247
3268
|
endpoint: 'cheap',
|
|
3248
3269
|
component: 'cache_write',
|
|
3270
|
+
context: '0\u2013272K',
|
|
3249
3271
|
},
|
|
3250
3272
|
{
|
|
3251
|
-
id: '
|
|
3252
|
-
price: { starter: 1.
|
|
3253
|
-
label: 'Input',
|
|
3254
|
-
endpoint: '
|
|
3273
|
+
id: 'cheap-input-272k-plus',
|
|
3274
|
+
price: { starter: 1.3186, plus: 1.2526, scale: 1.121 },
|
|
3275
|
+
label: 'Input (272K+ prompt)',
|
|
3276
|
+
endpoint: 'cheap',
|
|
3255
3277
|
component: 'input',
|
|
3278
|
+
context: '272K+',
|
|
3256
3279
|
},
|
|
3257
3280
|
{
|
|
3258
|
-
id: '
|
|
3259
|
-
price: { starter:
|
|
3260
|
-
label: 'Output',
|
|
3261
|
-
endpoint: '
|
|
3281
|
+
id: 'cheap-output-272k-plus',
|
|
3282
|
+
price: { starter: 4.9451, plus: 4.6979, scale: 4.2033 },
|
|
3283
|
+
label: 'Output (272K+ prompt)',
|
|
3284
|
+
endpoint: 'cheap',
|
|
3262
3285
|
component: 'output',
|
|
3286
|
+
context: '272K+',
|
|
3263
3287
|
},
|
|
3264
3288
|
{
|
|
3265
|
-
id: '
|
|
3266
|
-
price: { starter: 0.
|
|
3267
|
-
label: 'Cache read',
|
|
3268
|
-
endpoint: '
|
|
3289
|
+
id: 'cheap-cache_read-272k-plus',
|
|
3290
|
+
price: { starter: 0.1318, plus: 0.1252, scale: 0.1122 },
|
|
3291
|
+
label: 'Cache read (272K+ prompt)',
|
|
3292
|
+
endpoint: 'cheap',
|
|
3269
3293
|
component: 'cache_read',
|
|
3294
|
+
context: '272K+',
|
|
3270
3295
|
},
|
|
3271
3296
|
{
|
|
3272
|
-
id: '
|
|
3273
|
-
price: { starter: 1.
|
|
3274
|
-
label: 'Cache write',
|
|
3275
|
-
endpoint: '
|
|
3297
|
+
id: 'cheap-cache_write-272k-plus',
|
|
3298
|
+
price: { starter: 1.6484, plus: 1.566, scale: 1.4012 },
|
|
3299
|
+
label: 'Cache write (272K+ prompt)',
|
|
3300
|
+
endpoint: 'cheap',
|
|
3276
3301
|
component: 'cache_write',
|
|
3302
|
+
context: '272K+',
|
|
3277
3303
|
},
|
|
3278
3304
|
{
|
|
3279
|
-
id: 'stable-input',
|
|
3280
|
-
price: { starter:
|
|
3281
|
-
label: 'Input',
|
|
3305
|
+
id: 'stable-input-0-272k',
|
|
3306
|
+
price: { starter: 7.7, plus: 7.315, scale: 6.545 },
|
|
3307
|
+
label: 'Input (0\u2013272K prompt)',
|
|
3282
3308
|
endpoint: 'stable',
|
|
3283
3309
|
component: 'input',
|
|
3310
|
+
context: '0\u2013272K',
|
|
3284
3311
|
},
|
|
3285
3312
|
{
|
|
3286
|
-
id: 'stable-output',
|
|
3287
|
-
price: { starter:
|
|
3288
|
-
label: 'Output',
|
|
3313
|
+
id: 'stable-output-0-272k',
|
|
3314
|
+
price: { starter: 38.5, plus: 36.575, scale: 32.725 },
|
|
3315
|
+
label: 'Output (0\u2013272K prompt)',
|
|
3289
3316
|
endpoint: 'stable',
|
|
3290
3317
|
component: 'output',
|
|
3318
|
+
context: '0\u2013272K',
|
|
3291
3319
|
},
|
|
3292
3320
|
{
|
|
3293
|
-
id: 'stable-cache_read',
|
|
3294
|
-
price: { starter:
|
|
3295
|
-
label: 'Cache read',
|
|
3321
|
+
id: 'stable-cache_read-0-272k',
|
|
3322
|
+
price: { starter: 0.77, plus: 0.7315, scale: 0.6545 },
|
|
3323
|
+
label: 'Cache read (0\u2013272K prompt)',
|
|
3296
3324
|
endpoint: 'stable',
|
|
3297
3325
|
component: 'cache_read',
|
|
3326
|
+
context: '0\u2013272K',
|
|
3298
3327
|
},
|
|
3299
3328
|
{
|
|
3300
|
-
id: 'stable-cache_write',
|
|
3301
|
-
price: { starter:
|
|
3302
|
-
label: 'Cache write',
|
|
3329
|
+
id: 'stable-cache_write-0-272k',
|
|
3330
|
+
price: { starter: 9.625, plus: 9.1438, scale: 8.1813 },
|
|
3331
|
+
label: 'Cache write (0\u2013272K prompt)',
|
|
3332
|
+
endpoint: 'stable',
|
|
3333
|
+
component: 'cache_write',
|
|
3334
|
+
context: '0\u2013272K',
|
|
3335
|
+
},
|
|
3336
|
+
{
|
|
3337
|
+
id: 'stable-input-272k-plus',
|
|
3338
|
+
price: { starter: 15.4, plus: 14.63, scale: 13.09 },
|
|
3339
|
+
label: 'Input (272K+ prompt)',
|
|
3340
|
+
endpoint: 'stable',
|
|
3341
|
+
component: 'input',
|
|
3342
|
+
context: '272K+',
|
|
3343
|
+
},
|
|
3344
|
+
{
|
|
3345
|
+
id: 'stable-output-272k-plus',
|
|
3346
|
+
price: { starter: 57.75, plus: 54.8625, scale: 49.0875 },
|
|
3347
|
+
label: 'Output (272K+ prompt)',
|
|
3348
|
+
endpoint: 'stable',
|
|
3349
|
+
component: 'output',
|
|
3350
|
+
context: '272K+',
|
|
3351
|
+
},
|
|
3352
|
+
{
|
|
3353
|
+
id: 'stable-cache_read-272k-plus',
|
|
3354
|
+
price: { starter: 1.54, plus: 1.463, scale: 1.309 },
|
|
3355
|
+
label: 'Cache read (272K+ prompt)',
|
|
3356
|
+
endpoint: 'stable',
|
|
3357
|
+
component: 'cache_read',
|
|
3358
|
+
context: '272K+',
|
|
3359
|
+
},
|
|
3360
|
+
{
|
|
3361
|
+
id: 'stable-cache_write-272k-plus',
|
|
3362
|
+
price: { starter: 19.25, plus: 18.2876, scale: 16.3626 },
|
|
3363
|
+
label: 'Cache write (272K+ prompt)',
|
|
3303
3364
|
endpoint: 'stable',
|
|
3304
3365
|
component: 'cache_write',
|
|
3366
|
+
context: '272K+',
|
|
3305
3367
|
},
|
|
3306
3368
|
],
|
|
3307
3369
|
unfiltered: null,
|
|
@@ -3309,11 +3371,10 @@ var re,
|
|
|
3309
3371
|
draft: null,
|
|
3310
3372
|
endpoints: [
|
|
3311
3373
|
{ id: 'cheap', label: 'Cheap', recommended: !0 },
|
|
3312
|
-
{ id: 'balanced', label: 'Balanced' },
|
|
3313
3374
|
{ id: 'stable', label: 'Stable', verified: !0 },
|
|
3314
3375
|
],
|
|
3315
3376
|
defaultEndpoint: 'cheap',
|
|
3316
|
-
from: { variant: 'cheap-input' },
|
|
3377
|
+
from: { variant: 'cheap-input-0-272k' },
|
|
3317
3378
|
},
|
|
3318
3379
|
{
|
|
3319
3380
|
slug: 'gemini-3.1-pro-preview',
|
|
@@ -3325,27 +3386,6 @@ var re,
|
|
|
3325
3386
|
unit: '/M tok',
|
|
3326
3387
|
api: { model: 'gemini-3.1-pro-preview' },
|
|
3327
3388
|
variants: [
|
|
3328
|
-
{
|
|
3329
|
-
id: 'cheap-input',
|
|
3330
|
-
price: { starter: 0.2418, plus: 0.2297, scale: 0.2056 },
|
|
3331
|
-
label: 'Input',
|
|
3332
|
-
endpoint: 'cheap',
|
|
3333
|
-
component: 'input',
|
|
3334
|
-
},
|
|
3335
|
-
{
|
|
3336
|
-
id: 'cheap-output',
|
|
3337
|
-
price: { starter: 1.4506, plus: 1.3781, scale: 1.2331 },
|
|
3338
|
-
label: 'Output',
|
|
3339
|
-
endpoint: 'cheap',
|
|
3340
|
-
component: 'output',
|
|
3341
|
-
},
|
|
3342
|
-
{
|
|
3343
|
-
id: 'cheap-cache_read',
|
|
3344
|
-
price: { starter: 0.0242, plus: 0.023, scale: 0.0206 },
|
|
3345
|
-
label: 'Cache read',
|
|
3346
|
-
endpoint: 'cheap',
|
|
3347
|
-
component: 'cache_read',
|
|
3348
|
-
},
|
|
3349
3389
|
{
|
|
3350
3390
|
id: 'stable-input-0-195k',
|
|
3351
3391
|
price: { starter: 1.5, plus: 1.425, scale: 1.275 },
|
|
@@ -3398,12 +3438,9 @@ var re,
|
|
|
3398
3438
|
unfiltered: null,
|
|
3399
3439
|
priority: null,
|
|
3400
3440
|
draft: null,
|
|
3401
|
-
endpoints: [
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
],
|
|
3405
|
-
defaultEndpoint: 'cheap',
|
|
3406
|
-
from: { variant: 'cheap-input' },
|
|
3441
|
+
endpoints: [{ id: 'stable', label: 'Stable', recommended: !0 }],
|
|
3442
|
+
defaultEndpoint: 'stable',
|
|
3443
|
+
from: { variant: 'stable-input-0-195k' },
|
|
3407
3444
|
},
|
|
3408
3445
|
{
|
|
3409
3446
|
slug: 'gemini-3.8-flash',
|
|
@@ -3456,21 +3493,21 @@ var re,
|
|
|
3456
3493
|
variants: [
|
|
3457
3494
|
{
|
|
3458
3495
|
id: 'cheap-input',
|
|
3459
|
-
price: { starter: 0.
|
|
3496
|
+
price: { starter: 0.95, plus: 0.9025, scale: 0.8075 },
|
|
3460
3497
|
label: 'Input',
|
|
3461
3498
|
endpoint: 'cheap',
|
|
3462
3499
|
component: 'input',
|
|
3463
3500
|
},
|
|
3464
3501
|
{
|
|
3465
3502
|
id: 'cheap-output',
|
|
3466
|
-
price: { starter:
|
|
3503
|
+
price: { starter: 4.75, plus: 4.5125, scale: 4.0375 },
|
|
3467
3504
|
label: 'Output',
|
|
3468
3505
|
endpoint: 'cheap',
|
|
3469
3506
|
component: 'output',
|
|
3470
3507
|
},
|
|
3471
3508
|
{
|
|
3472
3509
|
id: 'cheap-cache_read',
|
|
3473
|
-
price: { starter: 0.
|
|
3510
|
+
price: { starter: 0.095, plus: 0.0902, scale: 0.0808 },
|
|
3474
3511
|
label: 'Cache read',
|
|
3475
3512
|
endpoint: 'cheap',
|
|
3476
3513
|
component: 'cache_read',
|
|
@@ -4199,13 +4236,296 @@ var re,
|
|
|
4199
4236
|
defaultEndpoint: 'cheap',
|
|
4200
4237
|
from: { variant: 'cheap-input' },
|
|
4201
4238
|
},
|
|
4239
|
+
{
|
|
4240
|
+
slug: 'kling-v4',
|
|
4241
|
+
name: 'Kling Video 4.0',
|
|
4242
|
+
family: 'kling',
|
|
4243
|
+
vendor: 'Kuaishou',
|
|
4244
|
+
desc: 'Longer takes with sound that follows the action: text, a start frame with an optional end frame, or up to 10 images and 5 videos, at 720p or 1080p for 3 to 30 seconds.',
|
|
4245
|
+
kind: 'video',
|
|
4246
|
+
unit: '/sec',
|
|
4247
|
+
api: { model: 'kling-v4' },
|
|
4248
|
+
variants: [
|
|
4249
|
+
{
|
|
4250
|
+
id: '720p',
|
|
4251
|
+
price: { starter: 0.1963, plus: 0.1864, scale: 0.1745 },
|
|
4252
|
+
label: '720p',
|
|
4253
|
+
resolution: '720p',
|
|
4254
|
+
withVideo: !1,
|
|
4255
|
+
},
|
|
4256
|
+
{
|
|
4257
|
+
id: '1080p',
|
|
4258
|
+
price: { starter: 0.2938, plus: 0.2791, scale: 0.2612 },
|
|
4259
|
+
label: '1080p',
|
|
4260
|
+
resolution: '1080p',
|
|
4261
|
+
withVideo: !1,
|
|
4262
|
+
},
|
|
4263
|
+
{
|
|
4264
|
+
id: '720p-video',
|
|
4265
|
+
price: { starter: 0.1175, plus: 0.1116, scale: 0.1045 },
|
|
4266
|
+
label: '720p \xB7 with reference video',
|
|
4267
|
+
resolution: '720p',
|
|
4268
|
+
withVideo: !0,
|
|
4269
|
+
},
|
|
4270
|
+
{
|
|
4271
|
+
id: '1080p-video',
|
|
4272
|
+
price: { starter: 0.1763, plus: 0.1674, scale: 0.1567 },
|
|
4273
|
+
label: '1080p \xB7 with reference video',
|
|
4274
|
+
resolution: '1080p',
|
|
4275
|
+
withVideo: !0,
|
|
4276
|
+
},
|
|
4277
|
+
],
|
|
4278
|
+
unfiltered: null,
|
|
4279
|
+
priority: null,
|
|
4280
|
+
draft: null,
|
|
4281
|
+
axes: { resolution: ['720p', '1080p'] },
|
|
4282
|
+
from: { variant: '720p' },
|
|
4283
|
+
},
|
|
4284
|
+
{
|
|
4285
|
+
slug: 'kling-v3-video',
|
|
4286
|
+
name: 'Kling Video 3.0',
|
|
4287
|
+
family: 'kling',
|
|
4288
|
+
vendor: 'Kuaishou',
|
|
4289
|
+
desc: 'Text-to-video and image-to-video at 720p, 1080p or 4K, for 3 to 15 seconds. Sound is optional; silent clips are the lower rate.',
|
|
4290
|
+
kind: 'video',
|
|
4291
|
+
unit: '/sec',
|
|
4292
|
+
api: { model: 'kling-v3-video' },
|
|
4293
|
+
variants: [
|
|
4294
|
+
{
|
|
4295
|
+
id: '720p-silent',
|
|
4296
|
+
price: { starter: 0.1, plus: 0.095, scale: 0.0889 },
|
|
4297
|
+
label: '720p \xB7 silent',
|
|
4298
|
+
resolution: '720p',
|
|
4299
|
+
quality: 'silent',
|
|
4300
|
+
},
|
|
4301
|
+
{
|
|
4302
|
+
id: '720p-audio',
|
|
4303
|
+
price: { starter: 0.1488, plus: 0.1413, scale: 0.1323 },
|
|
4304
|
+
label: '720p \xB7 with audio',
|
|
4305
|
+
resolution: '720p',
|
|
4306
|
+
quality: 'audio',
|
|
4307
|
+
},
|
|
4308
|
+
{
|
|
4309
|
+
id: '1080p-silent',
|
|
4310
|
+
price: { starter: 0.1325, plus: 0.1258, scale: 0.1178 },
|
|
4311
|
+
label: '1080p \xB7 silent',
|
|
4312
|
+
resolution: '1080p',
|
|
4313
|
+
quality: 'silent',
|
|
4314
|
+
},
|
|
4315
|
+
{
|
|
4316
|
+
id: '1080p-audio',
|
|
4317
|
+
price: { starter: 0.1988, plus: 0.1888, scale: 0.1767 },
|
|
4318
|
+
label: '1080p \xB7 with audio',
|
|
4319
|
+
resolution: '1080p',
|
|
4320
|
+
quality: 'audio',
|
|
4321
|
+
},
|
|
4322
|
+
{
|
|
4323
|
+
id: '4k-silent',
|
|
4324
|
+
price: { starter: 0.495, plus: 0.4702, scale: 0.44 },
|
|
4325
|
+
label: '4K \xB7 silent',
|
|
4326
|
+
resolution: '4k',
|
|
4327
|
+
quality: 'silent',
|
|
4328
|
+
},
|
|
4329
|
+
{
|
|
4330
|
+
id: '4k-audio',
|
|
4331
|
+
price: { starter: 0.495, plus: 0.4702, scale: 0.44 },
|
|
4332
|
+
label: '4K \xB7 with audio',
|
|
4333
|
+
resolution: '4k',
|
|
4334
|
+
quality: 'audio',
|
|
4335
|
+
},
|
|
4336
|
+
],
|
|
4337
|
+
unfiltered: null,
|
|
4338
|
+
priority: null,
|
|
4339
|
+
draft: null,
|
|
4340
|
+
axes: { resolution: ['720p', '1080p', '4k'] },
|
|
4341
|
+
from: { variant: '720p-silent' },
|
|
4342
|
+
},
|
|
4343
|
+
{
|
|
4344
|
+
slug: 'minimax-h3-turbo',
|
|
4345
|
+
name: 'MiniMax H3 Turbo',
|
|
4346
|
+
family: 'minimax',
|
|
4347
|
+
vendor: 'MiniMax',
|
|
4348
|
+
desc: 'The MiniMax H3 recipe at a faster, lower rate: text, a start frame, first and last frame, or references, at 480p or 768p for 5 to 15 seconds, with sound.',
|
|
4349
|
+
kind: 'video',
|
|
4350
|
+
unit: '/sec',
|
|
4351
|
+
api: { model: 'minimax-h3-turbo' },
|
|
4352
|
+
variants: [
|
|
4353
|
+
{
|
|
4354
|
+
id: '480p',
|
|
4355
|
+
price: { starter: 0.025, plus: 0.0237, scale: 0.0223 },
|
|
4356
|
+
label: '480p',
|
|
4357
|
+
resolution: '480p',
|
|
4358
|
+
},
|
|
4359
|
+
{
|
|
4360
|
+
id: '768p',
|
|
4361
|
+
price: { starter: 0.025, plus: 0.0237, scale: 0.0223 },
|
|
4362
|
+
label: '768p',
|
|
4363
|
+
resolution: '768p',
|
|
4364
|
+
},
|
|
4365
|
+
],
|
|
4366
|
+
unfiltered: null,
|
|
4367
|
+
priority: null,
|
|
4368
|
+
draft: null,
|
|
4369
|
+
axes: { resolution: ['480p', '768p'] },
|
|
4370
|
+
from: { variant: '480p' },
|
|
4371
|
+
},
|
|
4372
|
+
{
|
|
4373
|
+
slug: 'ltx-2.3-pro',
|
|
4374
|
+
name: 'LTX 2.3 Pro',
|
|
4375
|
+
family: 'ltx',
|
|
4376
|
+
vendor: 'Lightricks',
|
|
4377
|
+
desc: 'Cinematic text, image, or first-and-last-frame video at 1080p, 1440p or 4K, in 16:9, for 6, 8 or 10 seconds, with sound.',
|
|
4378
|
+
kind: 'video',
|
|
4379
|
+
unit: '/sec',
|
|
4380
|
+
api: { model: 'ltx-2.3-pro' },
|
|
4381
|
+
variants: [
|
|
4382
|
+
{
|
|
4383
|
+
id: '1080p',
|
|
4384
|
+
price: { starter: 0.0375, plus: 0.0356, scale: 0.0334 },
|
|
4385
|
+
label: '1080p',
|
|
4386
|
+
resolution: '1080p',
|
|
4387
|
+
},
|
|
4388
|
+
{
|
|
4389
|
+
id: '1440p',
|
|
4390
|
+
price: { starter: 0.075, plus: 0.0712, scale: 0.0667 },
|
|
4391
|
+
label: '1440p',
|
|
4392
|
+
resolution: '1440p',
|
|
4393
|
+
},
|
|
4394
|
+
{
|
|
4395
|
+
id: '4k',
|
|
4396
|
+
price: { starter: 0.125, plus: 0.1187, scale: 0.1112 },
|
|
4397
|
+
label: '4K',
|
|
4398
|
+
resolution: '4k',
|
|
4399
|
+
},
|
|
4400
|
+
],
|
|
4401
|
+
unfiltered: null,
|
|
4402
|
+
priority: null,
|
|
4403
|
+
draft: null,
|
|
4404
|
+
axes: { resolution: ['1080p', '1440p', '4k'] },
|
|
4405
|
+
from: { variant: '1080p' },
|
|
4406
|
+
},
|
|
4407
|
+
{
|
|
4408
|
+
slug: 'vidu-q4-preview',
|
|
4409
|
+
name: 'Vidu Q4 Preview',
|
|
4410
|
+
family: 'vidu',
|
|
4411
|
+
vendor: 'Vidu',
|
|
4412
|
+
desc: 'Image-to-video and reference-to-video with synchronized sound, from 540p up to 4K, for 3 to 16 seconds.',
|
|
4413
|
+
kind: 'video',
|
|
4414
|
+
unit: '/sec',
|
|
4415
|
+
api: { model: 'vidu-q4-preview' },
|
|
4416
|
+
variants: [
|
|
4417
|
+
{
|
|
4418
|
+
id: '540p',
|
|
4419
|
+
price: { starter: 0.0563, plus: 0.0534, scale: 0.05 },
|
|
4420
|
+
label: '540p',
|
|
4421
|
+
resolution: '540p',
|
|
4422
|
+
},
|
|
4423
|
+
{
|
|
4424
|
+
id: '720p',
|
|
4425
|
+
price: { starter: 0.1188, plus: 0.1128, scale: 0.1056 },
|
|
4426
|
+
label: '720p',
|
|
4427
|
+
resolution: '720p',
|
|
4428
|
+
},
|
|
4429
|
+
{
|
|
4430
|
+
id: '1080p',
|
|
4431
|
+
price: { starter: 0.15, plus: 0.1425, scale: 0.1334 },
|
|
4432
|
+
label: '1080p',
|
|
4433
|
+
resolution: '1080p',
|
|
4434
|
+
},
|
|
4435
|
+
{
|
|
4436
|
+
id: '1440p',
|
|
4437
|
+
price: { starter: 0.2375, plus: 0.2256, scale: 0.2112 },
|
|
4438
|
+
label: '1440p',
|
|
4439
|
+
resolution: '1440p',
|
|
4440
|
+
},
|
|
4441
|
+
{
|
|
4442
|
+
id: '4k',
|
|
4443
|
+
price: { starter: 0.4875, plus: 0.4631, scale: 0.4334 },
|
|
4444
|
+
label: '4K',
|
|
4445
|
+
resolution: '4k',
|
|
4446
|
+
},
|
|
4447
|
+
],
|
|
4448
|
+
unfiltered: null,
|
|
4449
|
+
priority: null,
|
|
4450
|
+
draft: null,
|
|
4451
|
+
axes: { resolution: ['540p', '720p', '1080p', '1440p', '4k'] },
|
|
4452
|
+
from: { variant: '540p' },
|
|
4453
|
+
},
|
|
4454
|
+
{
|
|
4455
|
+
slug: 'flux-2-dev',
|
|
4456
|
+
name: 'FLUX.2 Dev',
|
|
4457
|
+
family: 'flux',
|
|
4458
|
+
vendor: 'Black Forest Labs',
|
|
4459
|
+
desc: 'Image editing and text-to-image, priced by output size.',
|
|
4460
|
+
kind: 'image',
|
|
4461
|
+
unit: '/img',
|
|
4462
|
+
api: { model: 'flux-2-dev' },
|
|
4463
|
+
variants: [
|
|
4464
|
+
{
|
|
4465
|
+
id: '1024x768',
|
|
4466
|
+
price: { starter: 0.004, plus: 0.0038, scale: 0.0035 },
|
|
4467
|
+
label: '1024\xD7768',
|
|
4468
|
+
resolution: '1024x768',
|
|
4469
|
+
},
|
|
4470
|
+
{
|
|
4471
|
+
id: '1024x1024',
|
|
4472
|
+
price: { starter: 0.0053, plus: 0.005, scale: 0.0047 },
|
|
4473
|
+
label: '1024\xD71024',
|
|
4474
|
+
resolution: '1024x1024',
|
|
4475
|
+
},
|
|
4476
|
+
{
|
|
4477
|
+
id: '1024x1808',
|
|
4478
|
+
price: { starter: 0.0093, plus: 0.0088, scale: 0.0083 },
|
|
4479
|
+
label: '1024\xD71808',
|
|
4480
|
+
resolution: '1024x1808',
|
|
4481
|
+
},
|
|
4482
|
+
{
|
|
4483
|
+
id: '2048x1536',
|
|
4484
|
+
price: { starter: 0.0158, plus: 0.015, scale: 0.014 },
|
|
4485
|
+
label: '2048\xD71536',
|
|
4486
|
+
resolution: '2048x1536',
|
|
4487
|
+
},
|
|
4488
|
+
{
|
|
4489
|
+
id: '2048x2048',
|
|
4490
|
+
price: { starter: 0.021, plus: 0.0199, scale: 0.0187 },
|
|
4491
|
+
label: '2048\xD72048',
|
|
4492
|
+
resolution: '2048x2048',
|
|
4493
|
+
},
|
|
4494
|
+
],
|
|
4495
|
+
unfiltered: null,
|
|
4496
|
+
priority: null,
|
|
4497
|
+
draft: null,
|
|
4498
|
+
axes: { resolution: ['1024x768', '1024x1024', '1024x1808', '2048x1536', '2048x2048'] },
|
|
4499
|
+
from: { variant: '1024x768' },
|
|
4500
|
+
},
|
|
4501
|
+
{
|
|
4502
|
+
slug: 'eleven-v4',
|
|
4503
|
+
name: 'ElevenLabs v4',
|
|
4504
|
+
family: 'eleven',
|
|
4505
|
+
vendor: 'ElevenLabs',
|
|
4506
|
+
desc: 'Speech and multi-voice dialogue, billed per character.',
|
|
4507
|
+
kind: 'audio',
|
|
4508
|
+
unit: '/char',
|
|
4509
|
+
api: { model: 'eleven-v4' },
|
|
4510
|
+
variants: [
|
|
4511
|
+
{
|
|
4512
|
+
id: 'char',
|
|
4513
|
+
price: { starter: 0.0013, plus: 0.0012, scale: 0.0012 },
|
|
4514
|
+
label: 'Per character',
|
|
4515
|
+
},
|
|
4516
|
+
],
|
|
4517
|
+
unfiltered: null,
|
|
4518
|
+
priority: null,
|
|
4519
|
+
draft: null,
|
|
4520
|
+
from: { variant: 'char' },
|
|
4521
|
+
},
|
|
4202
4522
|
],
|
|
4203
4523
|
};
|
|
4204
4524
|
});
|
|
4205
4525
|
function ke(e, t) {
|
|
4206
4526
|
return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
|
|
4207
4527
|
}
|
|
4208
|
-
function
|
|
4528
|
+
function pi(e, t) {
|
|
4209
4529
|
if (e === 'seedance-2-mini') return 'mini';
|
|
4210
4530
|
if (e !== 'seedance-2') return;
|
|
4211
4531
|
let i = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
|
|
@@ -4215,79 +4535,79 @@ function ni(e, t) {
|
|
|
4215
4535
|
? 'fast'
|
|
4216
4536
|
: 'standard';
|
|
4217
4537
|
}
|
|
4218
|
-
function
|
|
4538
|
+
function di(e, t) {
|
|
4219
4539
|
let i = e
|
|
4220
4540
|
.trim()
|
|
4221
4541
|
.toLowerCase()
|
|
4222
4542
|
.replace(/-(?:unfiltered|uncensored)$/, '');
|
|
4223
4543
|
if (i === 'seedance-2' || i === 'seedance-2-mini') {
|
|
4224
|
-
let n =
|
|
4544
|
+
let n = pi(i, t),
|
|
4225
4545
|
s = be.get(ke('seedance-2', n));
|
|
4226
4546
|
return s ? s.slug : null;
|
|
4227
4547
|
}
|
|
4228
4548
|
let r = ae.get(i) ?? be.get(ke(i));
|
|
4229
4549
|
return r ? r.slug : null;
|
|
4230
4550
|
}
|
|
4231
|
-
function
|
|
4232
|
-
return ae.has(e) && !(
|
|
4551
|
+
function ui(e, t) {
|
|
4552
|
+
return ae.has(e) && !(ci.has(e) && t) ? e : di(e, t);
|
|
4233
4553
|
}
|
|
4234
4554
|
function F(e, t) {
|
|
4235
|
-
let i =
|
|
4555
|
+
let i = ui(e, t);
|
|
4236
4556
|
return i ? (ae.get(i) ?? null) : null;
|
|
4237
4557
|
}
|
|
4238
4558
|
function ne() {
|
|
4239
|
-
return
|
|
4559
|
+
return xe.models;
|
|
4240
4560
|
}
|
|
4241
|
-
var
|
|
4561
|
+
var xe,
|
|
4242
4562
|
ae,
|
|
4243
4563
|
be,
|
|
4244
|
-
|
|
4245
|
-
|
|
4564
|
+
Qe,
|
|
4565
|
+
li,
|
|
4246
4566
|
we,
|
|
4247
|
-
|
|
4248
|
-
|
|
4567
|
+
ci,
|
|
4568
|
+
L = y(() => {
|
|
4249
4569
|
'use strict';
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
((
|
|
4570
|
+
ze();
|
|
4571
|
+
Ye();
|
|
4572
|
+
((xe = {
|
|
4253
4573
|
...re,
|
|
4254
4574
|
families: re.families.map((e) => ({ ...e, models: e.models.filter((t) => !ye(t)) })),
|
|
4255
4575
|
models: re.models.filter((e) => !ye(e.slug)),
|
|
4256
4576
|
}),
|
|
4257
4577
|
(ae = new Map()),
|
|
4258
4578
|
(be = new Map()),
|
|
4259
|
-
(
|
|
4260
|
-
(
|
|
4579
|
+
(Qe = new Map()),
|
|
4580
|
+
(li = new Map()),
|
|
4261
4581
|
(we = new Map()));
|
|
4262
|
-
for (let e of
|
|
4582
|
+
for (let e of xe.models) {
|
|
4263
4583
|
(ae.set(e.slug, e), be.set(ke(e.api.model, e.api.quality), e));
|
|
4264
|
-
for (let t of e.variants)
|
|
4584
|
+
for (let t of e.variants) Qe.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
|
|
4265
4585
|
for (let t of e.editVariants ?? [])
|
|
4266
|
-
|
|
4267
|
-
for (let t of e.addons ?? [])
|
|
4586
|
+
Qe.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
|
|
4587
|
+
for (let t of e.addons ?? []) li.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
|
|
4268
4588
|
we.set(e.slug, e.family);
|
|
4269
4589
|
}
|
|
4270
|
-
for (let e of
|
|
4271
|
-
|
|
4590
|
+
for (let e of xe.families) for (let t of e.models) we.has(t) || we.set(t, e.slug);
|
|
4591
|
+
ci = new Set(['seedance-2']);
|
|
4272
4592
|
});
|
|
4273
4593
|
function se(e) {
|
|
4274
4594
|
let t = e.from?.variant;
|
|
4275
4595
|
return (t && e.variants.find((i) => i.id === t)) || e.variants[0];
|
|
4276
4596
|
}
|
|
4277
|
-
function
|
|
4597
|
+
function ve(e) {
|
|
4278
4598
|
if (e.endpoints?.length)
|
|
4279
|
-
return e.editVariants?.length && e.endpoints.some((t) => t.id ===
|
|
4280
|
-
?
|
|
4599
|
+
return e.editVariants?.length && e.endpoints.some((t) => t.id === Xe)
|
|
4600
|
+
? Xe
|
|
4281
4601
|
: (e.defaultEndpoint ?? e.endpoints[0].id);
|
|
4282
4602
|
}
|
|
4283
|
-
var
|
|
4284
|
-
|
|
4603
|
+
var Xe,
|
|
4604
|
+
Ie = y(() => {
|
|
4285
4605
|
'use strict';
|
|
4286
|
-
|
|
4287
|
-
|
|
4606
|
+
L();
|
|
4607
|
+
Xe = 'dynamic';
|
|
4288
4608
|
});
|
|
4289
4609
|
var oe,
|
|
4290
|
-
|
|
4610
|
+
_e = y(() => {
|
|
4291
4611
|
'use strict';
|
|
4292
4612
|
oe = {
|
|
4293
4613
|
'gemini-3-8-flash': 'gemini-3.8-flash',
|
|
@@ -4297,29 +4617,29 @@ var oe,
|
|
|
4297
4617
|
'gpt-image-2-5-sunburst': 'gpt-image-2.5-sunburst',
|
|
4298
4618
|
};
|
|
4299
4619
|
});
|
|
4300
|
-
var
|
|
4620
|
+
var Ze = y(() => {
|
|
4301
4621
|
'use strict';
|
|
4302
4622
|
});
|
|
4303
|
-
function
|
|
4304
|
-
return typeof t == 'string' && (
|
|
4623
|
+
function et(e, t) {
|
|
4624
|
+
return typeof t == 'string' && (mi[e]?.includes(t) ?? !1);
|
|
4305
4625
|
}
|
|
4306
|
-
var
|
|
4307
|
-
|
|
4626
|
+
var mi,
|
|
4627
|
+
tt = y(() => {
|
|
4308
4628
|
'use strict';
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4629
|
+
L();
|
|
4630
|
+
Ie();
|
|
4631
|
+
Ze();
|
|
4632
|
+
mi = {};
|
|
4313
4633
|
});
|
|
4314
|
-
function
|
|
4315
|
-
return e === 'nano-banana-pro' ?
|
|
4634
|
+
function it(e) {
|
|
4635
|
+
return e === 'nano-banana-pro' ? fi : gi;
|
|
4316
4636
|
}
|
|
4317
|
-
var
|
|
4318
|
-
|
|
4319
|
-
|
|
4637
|
+
var fi,
|
|
4638
|
+
gi,
|
|
4639
|
+
rt = y(() => {
|
|
4320
4640
|
'use strict';
|
|
4321
|
-
((
|
|
4322
|
-
(
|
|
4641
|
+
((fi = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
|
|
4642
|
+
(gi = [
|
|
4323
4643
|
'auto',
|
|
4324
4644
|
'1:1',
|
|
4325
4645
|
'1:4',
|
|
@@ -4337,10 +4657,10 @@ var di,
|
|
|
4337
4657
|
'21:9',
|
|
4338
4658
|
]));
|
|
4339
4659
|
});
|
|
4340
|
-
var
|
|
4341
|
-
|
|
4660
|
+
var at,
|
|
4661
|
+
nt = y(() => {
|
|
4342
4662
|
'use strict';
|
|
4343
|
-
|
|
4663
|
+
at = [
|
|
4344
4664
|
'prompt',
|
|
4345
4665
|
'system',
|
|
4346
4666
|
'messages',
|
|
@@ -4354,10 +4674,10 @@ var tt,
|
|
|
4354
4674
|
'endpoint',
|
|
4355
4675
|
];
|
|
4356
4676
|
});
|
|
4357
|
-
var
|
|
4358
|
-
|
|
4677
|
+
var st,
|
|
4678
|
+
ot = y(() => {
|
|
4359
4679
|
'use strict';
|
|
4360
|
-
|
|
4680
|
+
st = [
|
|
4361
4681
|
{
|
|
4362
4682
|
slug: 'claude-fable-5-1',
|
|
4363
4683
|
family: 'fable-5-1',
|
|
@@ -4426,13 +4746,13 @@ var rt,
|
|
|
4426
4746
|
},
|
|
4427
4747
|
];
|
|
4428
4748
|
});
|
|
4429
|
-
function
|
|
4749
|
+
function lt(e) {
|
|
4430
4750
|
return `$${e}`;
|
|
4431
4751
|
}
|
|
4432
4752
|
function Pe(e, t, i) {
|
|
4433
4753
|
return F(e)?.variants.find((n) => n.endpoint === t && n.component === i)?.price.starter ?? null;
|
|
4434
4754
|
}
|
|
4435
|
-
function
|
|
4755
|
+
function hi(e) {
|
|
4436
4756
|
return [
|
|
4437
4757
|
{
|
|
4438
4758
|
name: 'prompt',
|
|
@@ -4498,13 +4818,13 @@ function ui(e) {
|
|
|
4498
4818
|
},
|
|
4499
4819
|
];
|
|
4500
4820
|
}
|
|
4501
|
-
function
|
|
4821
|
+
function pt() {
|
|
4502
4822
|
return Object.fromEntries(
|
|
4503
|
-
|
|
4823
|
+
st.map((e) => {
|
|
4504
4824
|
let t = Pe(e.slug, 'cheap', 'input'),
|
|
4505
4825
|
i = Pe(e.slug, 'cheap', 'output'),
|
|
4506
4826
|
r = Pe(e.slug, 'stable', 'input') != null,
|
|
4507
|
-
n = t != null && i != null ? `${
|
|
4827
|
+
n = t != null && i != null ? `${lt(t)}/M in \xB7 ${lt(i)}/M out` : '',
|
|
4508
4828
|
s = {
|
|
4509
4829
|
slug: e.slug,
|
|
4510
4830
|
name: e.name,
|
|
@@ -4515,29 +4835,29 @@ function st() {
|
|
|
4515
4835
|
priceFormatted: n,
|
|
4516
4836
|
unit: '/M tokens',
|
|
4517
4837
|
primaryToolName: 'run_task',
|
|
4518
|
-
parameters:
|
|
4838
|
+
parameters: hi(r),
|
|
4519
4839
|
};
|
|
4520
4840
|
return [e.slug, s];
|
|
4521
4841
|
}),
|
|
4522
4842
|
);
|
|
4523
4843
|
}
|
|
4524
|
-
var
|
|
4844
|
+
var dt = y(() => {
|
|
4525
4845
|
'use strict';
|
|
4526
|
-
|
|
4527
|
-
|
|
4846
|
+
ot();
|
|
4847
|
+
L();
|
|
4528
4848
|
});
|
|
4529
4849
|
var G,
|
|
4530
4850
|
le,
|
|
4531
4851
|
Te = y(() => {
|
|
4532
4852
|
'use strict';
|
|
4533
|
-
((G = ['seedance-2-5', 'seedance-2', 'seedance-2-mini', 'seedream-5-pro']),
|
|
4853
|
+
((G = ['seedance-2-5', 'seedance-2', 'seedance-2-mini', 'seedream-5-pro', 'wan-3-0']),
|
|
4534
4854
|
(le =
|
|
4535
4855
|
'a request with creative_mode: true answers 503 checkpoint_unavailable and nothing is charged'));
|
|
4536
4856
|
});
|
|
4537
4857
|
function J(e) {
|
|
4538
4858
|
return `$${Number(e.toFixed(5))}`;
|
|
4539
4859
|
}
|
|
4540
|
-
function
|
|
4860
|
+
function ki(e) {
|
|
4541
4861
|
if (e.kind === 'llm') {
|
|
4542
4862
|
let t = e.defaultEndpoint,
|
|
4543
4863
|
i = (s) =>
|
|
@@ -4555,14 +4875,14 @@ function hi(e) {
|
|
|
4555
4875
|
}
|
|
4556
4876
|
return `from ${J(se(e).price.starter)}${e.unit}`;
|
|
4557
4877
|
}
|
|
4558
|
-
function
|
|
4878
|
+
function xi(e, t) {
|
|
4559
4879
|
let i = t.filter((r) => Number.isFinite(r) && r > 0);
|
|
4560
4880
|
return i.length ? `from ${J(Math.min(...i))}${e}` : null;
|
|
4561
4881
|
}
|
|
4562
|
-
function
|
|
4882
|
+
function ft(e) {
|
|
4563
4883
|
for (let t of B) {
|
|
4564
4884
|
let i = de[t],
|
|
4565
|
-
r = i ?
|
|
4885
|
+
r = i ? xi(i.unit, e[t] ?? []) : null;
|
|
4566
4886
|
i && r && (i.priceFormatted = r);
|
|
4567
4887
|
}
|
|
4568
4888
|
}
|
|
@@ -4578,13 +4898,13 @@ function H(e, t) {
|
|
|
4578
4898
|
...(t ? { description: t } : {}),
|
|
4579
4899
|
};
|
|
4580
4900
|
}
|
|
4581
|
-
function
|
|
4901
|
+
function gt(e) {
|
|
4582
4902
|
if (!e.endpoints?.length) return null;
|
|
4583
|
-
let t = e.endpoints.filter((i) =>
|
|
4903
|
+
let t = e.endpoints.filter((i) => et(e.slug, i.id));
|
|
4584
4904
|
return {
|
|
4585
4905
|
name: 'endpoint',
|
|
4586
4906
|
type: 'select',
|
|
4587
|
-
default:
|
|
4907
|
+
default: ve(e),
|
|
4588
4908
|
options: e.endpoints.filter((i) => !t.includes(i)).map((i) => i.id),
|
|
4589
4909
|
description:
|
|
4590
4910
|
(e.slug === 'gemini-3.1-pro-preview'
|
|
@@ -4593,20 +4913,20 @@ function ut(e) {
|
|
|
4593
4913
|
(t.length ? ` ${t.map((i) => i.label).join(' and ')}: coming soon.` : ''),
|
|
4594
4914
|
};
|
|
4595
4915
|
}
|
|
4596
|
-
function
|
|
4916
|
+
function _i(e, t) {
|
|
4597
4917
|
if (e.unfiltered == null || t.some((r) => r.name === 'creative_mode')) return t;
|
|
4598
4918
|
let i = G.includes(e.api.model);
|
|
4599
|
-
return [...t.filter((r) =>
|
|
4919
|
+
return [...t.filter((r) => !$e.has(r.name)), i ? ht : vi];
|
|
4600
4920
|
}
|
|
4601
4921
|
function Me(e, t) {
|
|
4602
|
-
let i = e.filter((n) =>
|
|
4603
|
-
r = [
|
|
4604
|
-
return (r.push(
|
|
4922
|
+
let i = e.filter((n) => !$e.has(n.name)),
|
|
4923
|
+
r = [ht, Ii];
|
|
4924
|
+
return (r.push(yt, bt), [...i, ...r]);
|
|
4605
4925
|
}
|
|
4606
|
-
function
|
|
4926
|
+
function ct(e) {
|
|
4607
4927
|
return [
|
|
4608
4928
|
...e
|
|
4609
|
-
.filter((t) => !
|
|
4929
|
+
.filter((t) => !Pi.has(t.name) && !$e.has(t.name))
|
|
4610
4930
|
.map((t) =>
|
|
4611
4931
|
t.name === 'resolution'
|
|
4612
4932
|
? {
|
|
@@ -4622,13 +4942,13 @@ function lt(e) {
|
|
|
4622
4942
|
options: ['standard'],
|
|
4623
4943
|
description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
|
|
4624
4944
|
},
|
|
4625
|
-
|
|
4626
|
-
|
|
4945
|
+
yt,
|
|
4946
|
+
bt,
|
|
4627
4947
|
];
|
|
4628
4948
|
}
|
|
4629
|
-
function
|
|
4949
|
+
function Ke(e, t) {
|
|
4630
4950
|
return [
|
|
4631
|
-
|
|
4951
|
+
S('Text prompt describing the video.'),
|
|
4632
4952
|
{ name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
|
|
4633
4953
|
{
|
|
4634
4954
|
name: 'duration',
|
|
@@ -4655,10 +4975,10 @@ function Se(e, t) {
|
|
|
4655
4975
|
),
|
|
4656
4976
|
];
|
|
4657
4977
|
}
|
|
4658
|
-
function
|
|
4659
|
-
let t =
|
|
4978
|
+
function Ti(e) {
|
|
4979
|
+
let t = gt(e);
|
|
4660
4980
|
return [
|
|
4661
|
-
|
|
4981
|
+
S('Image prompt text. Supports complex composition and text instructions.'),
|
|
4662
4982
|
...(t ? [t] : []),
|
|
4663
4983
|
{
|
|
4664
4984
|
name: 'quality',
|
|
@@ -4666,7 +4986,20 @@ function xi(e) {
|
|
|
4666
4986
|
default: 'low',
|
|
4667
4987
|
options: e.axes?.quality ?? ['low', 'medium', 'high'],
|
|
4668
4988
|
},
|
|
4669
|
-
H(
|
|
4989
|
+
H(
|
|
4990
|
+
e,
|
|
4991
|
+
e.slug === 'gpt-image-2'
|
|
4992
|
+
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${He}`
|
|
4993
|
+
: '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
|
|
4994
|
+
),
|
|
4995
|
+
{
|
|
4996
|
+
name: 'aspect_ratio',
|
|
4997
|
+
type: 'select',
|
|
4998
|
+
default: 'auto',
|
|
4999
|
+
options: [...Je],
|
|
5000
|
+
description:
|
|
5001
|
+
"The frame. auto: an edit keeps its first input image's ratio (the nearest listed one), text to image is 1:1. The image is delivered at exactly the size for the ratio and resolution.",
|
|
5002
|
+
},
|
|
4670
5003
|
{
|
|
4671
5004
|
name: 'input_images',
|
|
4672
5005
|
type: 'string[]',
|
|
@@ -4710,15 +5043,15 @@ function xi(e) {
|
|
|
4710
5043
|
},
|
|
4711
5044
|
];
|
|
4712
5045
|
}
|
|
4713
|
-
function
|
|
5046
|
+
function Mi(e) {
|
|
4714
5047
|
return [
|
|
4715
|
-
|
|
5048
|
+
S('Image prompt text.'),
|
|
4716
5049
|
{
|
|
4717
5050
|
name: 'input_images',
|
|
4718
5051
|
type: 'string[]',
|
|
4719
5052
|
description: 'Images to edit or use as reference (up to 14).',
|
|
4720
5053
|
},
|
|
4721
|
-
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...
|
|
5054
|
+
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...it(e.slug)] },
|
|
4722
5055
|
H(e),
|
|
4723
5056
|
{
|
|
4724
5057
|
name: 'n',
|
|
@@ -4744,37 +5077,34 @@ function _i(e) {
|
|
|
4744
5077
|
},
|
|
4745
5078
|
];
|
|
4746
5079
|
}
|
|
4747
|
-
function
|
|
4748
|
-
let e =
|
|
5080
|
+
function Ci() {
|
|
5081
|
+
let e = at,
|
|
4749
5082
|
t = [];
|
|
4750
|
-
for (let i of
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
: n
|
|
4761
|
-
? { description: i.description ? `${i.description} ${n}` : n }
|
|
5083
|
+
for (let i of wt(!0))
|
|
5084
|
+
e.includes(i.name) &&
|
|
5085
|
+
(t.push({
|
|
5086
|
+
...i,
|
|
5087
|
+
...(i.name === 'max_tokens' ? { min: 64 } : {}),
|
|
5088
|
+
...(i.name === 'messages'
|
|
5089
|
+
? {
|
|
5090
|
+
description:
|
|
5091
|
+
'Chat history: system, developer, user (text and image_url parts) and assistant turns; no tool turns.',
|
|
5092
|
+
}
|
|
4762
5093
|
: {}),
|
|
4763
|
-
|
|
5094
|
+
}),
|
|
4764
5095
|
i.name === 'top_p' &&
|
|
4765
5096
|
t.push({
|
|
4766
5097
|
name: 'top_k',
|
|
4767
5098
|
type: 'number',
|
|
4768
5099
|
min: 1,
|
|
4769
5100
|
max: 64,
|
|
4770
|
-
description: 'Sample from the k likeliest tokens.
|
|
5101
|
+
description: 'Sample from the k likeliest tokens.',
|
|
4771
5102
|
}));
|
|
4772
|
-
}
|
|
4773
5103
|
return t;
|
|
4774
5104
|
}
|
|
4775
|
-
function
|
|
5105
|
+
function wt(e) {
|
|
4776
5106
|
return [
|
|
4777
|
-
|
|
5107
|
+
S('The user message or task.'),
|
|
4778
5108
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
4779
5109
|
{
|
|
4780
5110
|
name: 'messages',
|
|
@@ -4867,40 +5197,40 @@ function ht(e) {
|
|
|
4867
5197
|
},
|
|
4868
5198
|
];
|
|
4869
5199
|
}
|
|
4870
|
-
function
|
|
4871
|
-
if (e.slug === 'seed-2-1-turbo') return
|
|
4872
|
-
let t =
|
|
5200
|
+
function Ei(e) {
|
|
5201
|
+
if (e.slug === 'seed-2-1-turbo') return Si;
|
|
5202
|
+
let t = gt(e);
|
|
4873
5203
|
return [
|
|
4874
5204
|
...(e.slug === 'gemini-3.1-pro-preview'
|
|
4875
|
-
?
|
|
4876
|
-
: e.slug === 'gpt-6-astra' ||
|
|
4877
|
-
?
|
|
4878
|
-
:
|
|
5205
|
+
? Ci()
|
|
5206
|
+
: e.slug === 'gpt-6-astra' || $i.includes(e.slug)
|
|
5207
|
+
? wt(e.slug !== 'gpt-6-astra')
|
|
5208
|
+
: Ki),
|
|
4879
5209
|
...(t ? [t] : []),
|
|
4880
5210
|
];
|
|
4881
5211
|
}
|
|
4882
|
-
function
|
|
5212
|
+
function qi(e) {
|
|
4883
5213
|
let t = e.slug;
|
|
4884
|
-
if (e.kind === 'llm') return
|
|
4885
|
-
if (e.editVariants?.length) return
|
|
5214
|
+
if (e.kind === 'llm') return Ei(e);
|
|
5215
|
+
if (e.editVariants?.length) return Ti(e);
|
|
4886
5216
|
switch (t) {
|
|
4887
5217
|
case 'seedance-2-5':
|
|
4888
|
-
return Me(
|
|
5218
|
+
return Me(ut, t);
|
|
4889
5219
|
case 'seedance-2-5-lite':
|
|
4890
|
-
return
|
|
5220
|
+
return ct(ut);
|
|
4891
5221
|
case 'seedance-2':
|
|
4892
|
-
return Me(
|
|
5222
|
+
return Me(mt, t);
|
|
4893
5223
|
case 'seedance-2-lite':
|
|
4894
|
-
return
|
|
5224
|
+
return ct(mt);
|
|
4895
5225
|
case 'seedance-2-mini':
|
|
4896
|
-
return Me(
|
|
5226
|
+
return Me(Ai, t);
|
|
4897
5227
|
case 'nano-banana-2':
|
|
4898
5228
|
case 'nano-banana-2.1':
|
|
4899
5229
|
case 'nano-banana-pro':
|
|
4900
|
-
return
|
|
5230
|
+
return Mi(e);
|
|
4901
5231
|
case 'seedream-5-pro':
|
|
4902
5232
|
return [
|
|
4903
|
-
|
|
5233
|
+
S('Detailed description of the image to generate.'),
|
|
4904
5234
|
{ name: 'images', type: 'string[]', description: 'Reference images (the first is free).' },
|
|
4905
5235
|
H(e),
|
|
4906
5236
|
{
|
|
@@ -4914,7 +5244,7 @@ function $i(e) {
|
|
|
4914
5244
|
case 'qwen-3':
|
|
4915
5245
|
case 'qwen-3-pro':
|
|
4916
5246
|
return [
|
|
4917
|
-
|
|
5247
|
+
S('Image prompt text; dense layouts and multilingual text work well.'),
|
|
4918
5248
|
{
|
|
4919
5249
|
name: 'images',
|
|
4920
5250
|
type: 'string[]',
|
|
@@ -4960,7 +5290,7 @@ function $i(e) {
|
|
|
4960
5290
|
];
|
|
4961
5291
|
case 'wan-3-0':
|
|
4962
5292
|
case 'wan-3-0-prime':
|
|
4963
|
-
return
|
|
5293
|
+
return Ke(e, {
|
|
4964
5294
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
4965
5295
|
aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
|
|
4966
5296
|
minSec: 2,
|
|
@@ -4970,7 +5300,7 @@ function $i(e) {
|
|
|
4970
5300
|
});
|
|
4971
5301
|
case 'happy-horse-1-1':
|
|
4972
5302
|
case 'happy-horse-1-0':
|
|
4973
|
-
return
|
|
5303
|
+
return Ke(e, {
|
|
4974
5304
|
modes:
|
|
4975
5305
|
t === 'happy-horse-1-0'
|
|
4976
5306
|
? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
|
|
@@ -4981,7 +5311,7 @@ function $i(e) {
|
|
|
4981
5311
|
references: t === 'happy-horse-1-0' ? ['images', 'videos'] : ['images'],
|
|
4982
5312
|
});
|
|
4983
5313
|
case 'minimax-h3':
|
|
4984
|
-
return
|
|
5314
|
+
return Ke(e, {
|
|
4985
5315
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
4986
5316
|
aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
|
|
4987
5317
|
minSec: 4,
|
|
@@ -4989,40 +5319,40 @@ function $i(e) {
|
|
|
4989
5319
|
references: ['images', 'videos', 'audios', 'first_frame_image', 'last_frame_image'],
|
|
4990
5320
|
});
|
|
4991
5321
|
default:
|
|
4992
|
-
return [
|
|
5322
|
+
return [S('Prompt text.')];
|
|
4993
5323
|
}
|
|
4994
5324
|
}
|
|
4995
|
-
function
|
|
5325
|
+
function Se(e, t = e.api.model) {
|
|
4996
5326
|
return {
|
|
4997
5327
|
slug: t,
|
|
4998
5328
|
name: e.name,
|
|
4999
|
-
category:
|
|
5000
|
-
kind:
|
|
5329
|
+
category: yi[e.kind],
|
|
5330
|
+
kind: wi[e.kind],
|
|
5001
5331
|
vendor: e.vendor ?? '',
|
|
5002
5332
|
description: e.desc ?? e.name,
|
|
5003
|
-
priceFormatted:
|
|
5333
|
+
priceFormatted: ki(e),
|
|
5004
5334
|
unit: e.unit,
|
|
5005
|
-
primaryToolName:
|
|
5006
|
-
parameters:
|
|
5335
|
+
primaryToolName: bi[e.kind],
|
|
5336
|
+
parameters: _i(e, qi(e)),
|
|
5007
5337
|
};
|
|
5008
5338
|
}
|
|
5009
|
-
function
|
|
5339
|
+
function Ri() {
|
|
5010
5340
|
let e = {};
|
|
5011
5341
|
for (let t of ne())
|
|
5012
5342
|
if (t.slug !== 'seedance-2-fast') {
|
|
5013
5343
|
if (t.slug === 'seedance-2-mini') {
|
|
5014
|
-
e['seedance-2-mini'] =
|
|
5344
|
+
e['seedance-2-mini'] = Se(t, 'seedance-2-mini');
|
|
5015
5345
|
continue;
|
|
5016
5346
|
}
|
|
5017
5347
|
if (t.slug === 'seedance-2') {
|
|
5018
|
-
let i =
|
|
5348
|
+
let i = Se(t);
|
|
5019
5349
|
((i.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
|
|
5020
5350
|
(e['seedance-2'] = i));
|
|
5021
5351
|
continue;
|
|
5022
5352
|
}
|
|
5023
|
-
t.slug.startsWith('claude-') || (e[t.api.model] =
|
|
5353
|
+
t.slug.startsWith('claude-') || (e[t.api.model] = Se(t));
|
|
5024
5354
|
}
|
|
5025
|
-
Object.assign(e,
|
|
5355
|
+
Object.assign(e, pt());
|
|
5026
5356
|
for (let [t, i] of Object.entries(oe))
|
|
5027
5357
|
e[i] && Object.defineProperty(e, t, { value: e[i], enumerable: !1 });
|
|
5028
5358
|
return e;
|
|
@@ -5030,7 +5360,7 @@ function Ci() {
|
|
|
5030
5360
|
function V(e) {
|
|
5031
5361
|
return de[e] ?? null;
|
|
5032
5362
|
}
|
|
5033
|
-
function
|
|
5363
|
+
function vt(e, t, i) {
|
|
5034
5364
|
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite') && t === 'duration') {
|
|
5035
5365
|
let r = (n) => (typeof n == 'string' ? n.trim().toLowerCase() : '');
|
|
5036
5366
|
if (r(i.mode) === 'edit' || r(i.omni_reference_task_type) === 'edit') return !1;
|
|
@@ -5040,85 +5370,86 @@ function wt(e, t, i) {
|
|
|
5040
5370
|
function E() {
|
|
5041
5371
|
return Object.values(de);
|
|
5042
5372
|
}
|
|
5043
|
-
var
|
|
5044
|
-
fi,
|
|
5045
|
-
gi,
|
|
5046
|
-
K,
|
|
5047
|
-
mt,
|
|
5373
|
+
var yi,
|
|
5048
5374
|
bi,
|
|
5049
5375
|
wi,
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
Ke,
|
|
5053
|
-
Ii,
|
|
5376
|
+
S,
|
|
5377
|
+
ht,
|
|
5054
5378
|
vi,
|
|
5055
|
-
|
|
5056
|
-
Ti,
|
|
5057
|
-
pe,
|
|
5058
|
-
pt,
|
|
5379
|
+
Ii,
|
|
5059
5380
|
yt,
|
|
5060
5381
|
bt,
|
|
5061
|
-
|
|
5382
|
+
$e,
|
|
5383
|
+
Pi,
|
|
5062
5384
|
Ki,
|
|
5385
|
+
Si,
|
|
5386
|
+
$i,
|
|
5387
|
+
pe,
|
|
5388
|
+
ut,
|
|
5389
|
+
kt,
|
|
5390
|
+
xt,
|
|
5391
|
+
mt,
|
|
5392
|
+
Ai,
|
|
5063
5393
|
de,
|
|
5064
5394
|
W = y(() => {
|
|
5065
5395
|
'use strict';
|
|
5396
|
+
We();
|
|
5066
5397
|
he();
|
|
5067
|
-
|
|
5398
|
+
L();
|
|
5399
|
+
Ie();
|
|
5068
5400
|
_e();
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
ot();
|
|
5401
|
+
tt();
|
|
5402
|
+
rt();
|
|
5403
|
+
nt();
|
|
5404
|
+
dt();
|
|
5074
5405
|
Te();
|
|
5075
|
-
((
|
|
5076
|
-
(
|
|
5406
|
+
((yi = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
|
|
5407
|
+
(bi = {
|
|
5077
5408
|
video: 'generate_video',
|
|
5078
5409
|
image: 'generate_image',
|
|
5079
5410
|
audio: 'generate_audio',
|
|
5080
5411
|
llm: 'run_task',
|
|
5081
5412
|
}),
|
|
5082
|
-
(
|
|
5413
|
+
(wi = {
|
|
5083
5414
|
video: 'Text-to-Video',
|
|
5084
5415
|
image: 'Text-to-Image',
|
|
5085
5416
|
audio: 'Text-to-Audio',
|
|
5086
5417
|
llm: 'Reasoning (LLM)',
|
|
5087
5418
|
}));
|
|
5088
|
-
|
|
5089
|
-
((
|
|
5419
|
+
S = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
|
|
5420
|
+
((ht = {
|
|
5090
5421
|
name: 'creative_mode',
|
|
5091
5422
|
type: 'boolean',
|
|
5092
5423
|
default: !1,
|
|
5093
5424
|
description:
|
|
5094
5425
|
'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
|
|
5095
5426
|
}),
|
|
5096
|
-
(
|
|
5427
|
+
(vi = {
|
|
5097
5428
|
name: 'creative_mode',
|
|
5098
5429
|
type: 'boolean',
|
|
5099
5430
|
default: !1,
|
|
5100
5431
|
description: `Not available yet on this model: ${le}.`,
|
|
5101
5432
|
}),
|
|
5102
|
-
(
|
|
5433
|
+
(Ii = {
|
|
5103
5434
|
name: 'priority',
|
|
5104
5435
|
type: 'boolean',
|
|
5105
5436
|
default: !1,
|
|
5106
5437
|
description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
|
|
5107
5438
|
}),
|
|
5108
|
-
(
|
|
5439
|
+
(yt = {
|
|
5109
5440
|
name: 'reference_roles',
|
|
5110
5441
|
type: 'json',
|
|
5111
5442
|
description: `Omni Reference only. Role of each reference, by tag { "@Image1": "prop" } or by kind { "image": ["prop"] }. Image: appearance, clothing, prop, scene_layout, lighting, first_frame, last_frame; Seedance 2.5 also keyframe, storyboard. Video: motion, camera, style; Seedance 2.5 also blockout_coarse, blockout_fine. Audio: voice, ambience, music, sound_effect. On a tag, the value image, video or audio uses that kind's default (appearance, motion, voice).`,
|
|
5112
5443
|
}),
|
|
5113
|
-
(
|
|
5444
|
+
(bt = {
|
|
5114
5445
|
name: 'auto_fit_images',
|
|
5115
5446
|
type: 'boolean',
|
|
5116
5447
|
default: !1,
|
|
5117
5448
|
description:
|
|
5118
5449
|
'Fits a reference image whose aspect ratio (width / height) is outside 0.40-2.50 just inside it: a slight stretch, or the image on a blurred copy of itself, never cropped. Off: such an image is refused with a 422. First and last frames are never changed. Same price.',
|
|
5119
5450
|
}),
|
|
5120
|
-
(
|
|
5121
|
-
|
|
5451
|
+
($e = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
|
|
5452
|
+
Pi = new Set([
|
|
5122
5453
|
'quality',
|
|
5123
5454
|
'bitrate_mode',
|
|
5124
5455
|
'draft',
|
|
@@ -5126,8 +5457,8 @@ var mi,
|
|
|
5126
5457
|
'draft_generation_id',
|
|
5127
5458
|
'pass_faces',
|
|
5128
5459
|
]);
|
|
5129
|
-
((
|
|
5130
|
-
|
|
5460
|
+
((Ki = [
|
|
5461
|
+
S('The user message or task.'),
|
|
5131
5462
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
5132
5463
|
{
|
|
5133
5464
|
name: 'messages',
|
|
@@ -5144,8 +5475,8 @@ var mi,
|
|
|
5144
5475
|
{ name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
|
|
5145
5476
|
{ name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
|
|
5146
5477
|
]),
|
|
5147
|
-
(
|
|
5148
|
-
|
|
5478
|
+
(Si = [
|
|
5479
|
+
S('The user message or task.'),
|
|
5149
5480
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
5150
5481
|
{
|
|
5151
5482
|
name: 'messages',
|
|
@@ -5226,9 +5557,9 @@ var mi,
|
|
|
5226
5557
|
description: 'Video frames read a second.',
|
|
5227
5558
|
},
|
|
5228
5559
|
]),
|
|
5229
|
-
(
|
|
5560
|
+
($i = ['gemini-3.8-flash', 'gemini-3.7-flash']));
|
|
5230
5561
|
((pe = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
|
|
5231
|
-
(
|
|
5562
|
+
(ut = [
|
|
5232
5563
|
{
|
|
5233
5564
|
name: 'prompt',
|
|
5234
5565
|
type: 'string',
|
|
@@ -5369,23 +5700,24 @@ var mi,
|
|
|
5369
5700
|
{
|
|
5370
5701
|
name: 'pass_faces',
|
|
5371
5702
|
type: 'boolean',
|
|
5372
|
-
default: !
|
|
5373
|
-
description:
|
|
5703
|
+
default: !0,
|
|
5704
|
+
description:
|
|
5705
|
+
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
5374
5706
|
},
|
|
5375
5707
|
]),
|
|
5376
|
-
(
|
|
5708
|
+
(kt = {
|
|
5377
5709
|
name: 'images',
|
|
5378
5710
|
type: 'string[]',
|
|
5379
5711
|
description:
|
|
5380
5712
|
'Reference images as public http(s) URLs or data URIs (up to 9). The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.',
|
|
5381
5713
|
}),
|
|
5382
|
-
(
|
|
5714
|
+
(xt = {
|
|
5383
5715
|
name: 'audios',
|
|
5384
5716
|
type: 'string[]',
|
|
5385
5717
|
description:
|
|
5386
5718
|
'Reference audio as public http(s) URLs or data URIs (up to 3; each 2 to 15s, combined 15s or less). Needs at least one photo in images. A first or last frame sent with it is used only as a reference image, with mode multi_reference. The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.',
|
|
5387
5719
|
}),
|
|
5388
|
-
(
|
|
5720
|
+
(mt = [
|
|
5389
5721
|
{
|
|
5390
5722
|
name: 'prompt',
|
|
5391
5723
|
type: 'string',
|
|
@@ -5463,8 +5795,8 @@ var mi,
|
|
|
5463
5795
|
description:
|
|
5464
5796
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
5465
5797
|
},
|
|
5466
|
-
|
|
5467
|
-
|
|
5798
|
+
kt,
|
|
5799
|
+
xt,
|
|
5468
5800
|
{
|
|
5469
5801
|
name: 'first_frame_image',
|
|
5470
5802
|
type: 'string',
|
|
@@ -5477,8 +5809,15 @@ var mi,
|
|
|
5477
5809
|
description:
|
|
5478
5810
|
'End frame image as a public http(s) URL or data URI. Sent with mode multi_reference it is used as a reference image (within the image limit); other reference modes do not use it. The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.',
|
|
5479
5811
|
},
|
|
5812
|
+
{
|
|
5813
|
+
name: 'pass_faces',
|
|
5814
|
+
type: 'boolean',
|
|
5815
|
+
default: !0,
|
|
5816
|
+
description:
|
|
5817
|
+
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
5818
|
+
},
|
|
5480
5819
|
]),
|
|
5481
|
-
(
|
|
5820
|
+
(Ai = [
|
|
5482
5821
|
{
|
|
5483
5822
|
name: 'prompt',
|
|
5484
5823
|
type: 'string',
|
|
@@ -5533,61 +5872,68 @@ var mi,
|
|
|
5533
5872
|
description:
|
|
5534
5873
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
5535
5874
|
},
|
|
5536
|
-
|
|
5537
|
-
|
|
5875
|
+
kt,
|
|
5876
|
+
xt,
|
|
5538
5877
|
{
|
|
5539
5878
|
name: 'first_frame_image',
|
|
5540
5879
|
type: 'string',
|
|
5541
5880
|
description:
|
|
5542
5881
|
'Start frame image as a public http(s) URL or data URI. It makes the run Image to Video, so it cannot be sent with images or audios. The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.',
|
|
5543
5882
|
},
|
|
5883
|
+
{
|
|
5884
|
+
name: 'pass_faces',
|
|
5885
|
+
type: 'boolean',
|
|
5886
|
+
default: !0,
|
|
5887
|
+
description:
|
|
5888
|
+
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
5889
|
+
},
|
|
5544
5890
|
]));
|
|
5545
|
-
de =
|
|
5891
|
+
de = Ri();
|
|
5546
5892
|
});
|
|
5547
5893
|
function ce(e) {
|
|
5548
5894
|
let t = '/v1/pricing/models',
|
|
5549
5895
|
i = e?.trim();
|
|
5550
5896
|
return i ? `${t}?model=${encodeURIComponent(i)}` : t;
|
|
5551
5897
|
}
|
|
5552
|
-
var
|
|
5898
|
+
var Ee = y(() => {
|
|
5553
5899
|
'use strict';
|
|
5554
5900
|
});
|
|
5555
|
-
function
|
|
5901
|
+
function qt(e) {
|
|
5556
5902
|
return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
|
|
5557
5903
|
}
|
|
5558
|
-
function
|
|
5904
|
+
function At(e) {
|
|
5559
5905
|
let t = ne().filter((s) => s.kind === e && s.unfiltered != null),
|
|
5560
5906
|
i = t.filter((s) => G.includes(s.api.model)).map((s) => s.name),
|
|
5561
5907
|
r = t.filter((s) => !G.includes(s.api.model)).map((s) => s.name);
|
|
5562
5908
|
return [
|
|
5563
5909
|
...(i.length
|
|
5564
|
-
? [`${
|
|
5910
|
+
? [`${qt(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
|
|
5565
5911
|
: []),
|
|
5566
|
-
...(r.length ? [`Not available yet on ${
|
|
5912
|
+
...(r.length ? [`Not available yet on ${qt(r)}: ${le}.`] : []),
|
|
5567
5913
|
'The Acceptable Use Policy applies.',
|
|
5568
5914
|
].join(' ');
|
|
5569
5915
|
}
|
|
5570
|
-
function
|
|
5571
|
-
if (
|
|
5916
|
+
function ar(e) {
|
|
5917
|
+
if (ir.has(e.name)) return e;
|
|
5572
5918
|
let t = e.inputSchema.properties;
|
|
5573
5919
|
return !t || t.callback_url
|
|
5574
5920
|
? e
|
|
5575
|
-
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url:
|
|
5921
|
+
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: tr } } };
|
|
5576
5922
|
}
|
|
5577
|
-
function
|
|
5923
|
+
function nr(e) {
|
|
5578
5924
|
let t = e.inputSchema.properties;
|
|
5579
5925
|
if (!t) return e;
|
|
5580
5926
|
let i = !1,
|
|
5581
5927
|
r = {};
|
|
5582
5928
|
for (let [n, s] of Object.entries(t))
|
|
5583
|
-
|
|
5929
|
+
Rt.has(n) && s.type === 'string' && !s.format
|
|
5584
5930
|
? ((r[n] = { ...s, format: 'uri' }), (i = !0))
|
|
5585
|
-
:
|
|
5931
|
+
: Rt.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
|
|
5586
5932
|
? ((r[n] = { ...s, items: { ...s.items, format: 'uri' } }), (i = !0))
|
|
5587
5933
|
: (r[n] = s);
|
|
5588
5934
|
return i ? { ...e, inputSchema: { ...e.inputSchema, properties: r } } : e;
|
|
5589
5935
|
}
|
|
5590
|
-
function
|
|
5936
|
+
function sr(e) {
|
|
5591
5937
|
switch (e.type) {
|
|
5592
5938
|
case 'string':
|
|
5593
5939
|
return {
|
|
@@ -5642,11 +5988,11 @@ function ir(e) {
|
|
|
5642
5988
|
return { type: 'string', description: e.description };
|
|
5643
5989
|
}
|
|
5644
5990
|
}
|
|
5645
|
-
function
|
|
5991
|
+
function or(e, t) {
|
|
5646
5992
|
let i = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
|
|
5647
5993
|
r = {},
|
|
5648
5994
|
n = [];
|
|
5649
|
-
for (let o of e.parameters) ((r[o.name] =
|
|
5995
|
+
for (let o of e.parameters) ((r[o.name] = sr(o)), o.required && n.push(o.name));
|
|
5650
5996
|
let s = {
|
|
5651
5997
|
type: 'object',
|
|
5652
5998
|
properties: r,
|
|
@@ -5659,7 +6005,7 @@ function rr(e, t) {
|
|
|
5659
6005
|
inputSchema: s,
|
|
5660
6006
|
};
|
|
5661
6007
|
}
|
|
5662
|
-
function
|
|
6008
|
+
function lr() {
|
|
5663
6009
|
let e = E().filter((c) => c.category === 'Image'),
|
|
5664
6010
|
t = E().filter((c) => c.category === 'Video'),
|
|
5665
6011
|
i = E().filter((c) => c.category === 'Text'),
|
|
@@ -5684,7 +6030,7 @@ function ar() {
|
|
|
5684
6030
|
aspect_ratio: {
|
|
5685
6031
|
type: 'string',
|
|
5686
6032
|
description:
|
|
5687
|
-
|
|
6033
|
+
"Aspect ratio where the model takes one (see each model tool for its list). GPT Image: 1:1, 16:9, 9:16, 21:9, 3:2, 2:3, 4:3, 3:4 or auto (an edit keeps its input image's ratio); the medium endpoint renders non-square at 1K only.",
|
|
5688
6034
|
},
|
|
5689
6035
|
resolution: {
|
|
5690
6036
|
type: 'string',
|
|
@@ -5703,14 +6049,14 @@ function ar() {
|
|
|
5703
6049
|
enum: ['dynamic', 'token', 'flat', 'medium'],
|
|
5704
6050
|
default: 'dynamic',
|
|
5705
6051
|
description:
|
|
5706
|
-
'GPT Image models only. dynamic: lowest price for this request; token: billed by tokens within published limits; flat: one price at any quality or prompt length; medium: gpt-image-2 only, medium quality at one price for any resolution.',
|
|
6052
|
+
'GPT Image models only. dynamic: lowest price for this request; token: billed by tokens within published limits; flat: one price at any quality or prompt length; medium: gpt-image-2 only, medium quality at one price for any resolution (non-square ratios at 1K only).',
|
|
5707
6053
|
},
|
|
5708
6054
|
quality: {
|
|
5709
6055
|
type: 'string',
|
|
5710
6056
|
enum: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
5711
6057
|
default: 'low',
|
|
5712
6058
|
description:
|
|
5713
|
-
'GPT Image models only. gpt-image-2 supports low, medium and high; the 2.5 models also xhigh and max.
|
|
6059
|
+
'GPT Image models only. gpt-image-2 supports low, medium and high; the 2.5 models also xhigh and max.',
|
|
5714
6060
|
},
|
|
5715
6061
|
n: {
|
|
5716
6062
|
type: 'number',
|
|
@@ -5755,7 +6101,7 @@ function ar() {
|
|
|
5755
6101
|
maximum: 2147483647,
|
|
5756
6102
|
description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
|
|
5757
6103
|
},
|
|
5758
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
6104
|
+
creative_mode: { type: 'boolean', default: !1, description: At('image') },
|
|
5759
6105
|
},
|
|
5760
6106
|
required: ['prompt'],
|
|
5761
6107
|
additionalProperties: !0,
|
|
@@ -5792,7 +6138,7 @@ function ar() {
|
|
|
5792
6138
|
default: '480p',
|
|
5793
6139
|
description: 'Video resolution (the lowest price is the default; see each model tool).',
|
|
5794
6140
|
},
|
|
5795
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
6141
|
+
creative_mode: { type: 'boolean', default: !1, description: At('video') },
|
|
5796
6142
|
priority: {
|
|
5797
6143
|
type: 'boolean',
|
|
5798
6144
|
default: !1,
|
|
@@ -5874,7 +6220,7 @@ function ar() {
|
|
|
5874
6220
|
endpoint: {
|
|
5875
6221
|
type: 'string',
|
|
5876
6222
|
description:
|
|
5877
|
-
'cheap (default) or stable on Claude; cheap on GPT-6 Astra
|
|
6223
|
+
'cheap (default) or stable on Claude; cheap (default) or stable on GPT-6 Astra. Unknown values use the default.',
|
|
5878
6224
|
},
|
|
5879
6225
|
},
|
|
5880
6226
|
required: ['prompt'],
|
|
@@ -5914,10 +6260,10 @@ function ar() {
|
|
|
5914
6260
|
additionalProperties: !0,
|
|
5915
6261
|
},
|
|
5916
6262
|
},
|
|
5917
|
-
d =
|
|
5918
|
-
return [n, s, o, u, p, d, l,
|
|
6263
|
+
d = pr();
|
|
6264
|
+
return [n, s, o, u, p, d, l, rr];
|
|
5919
6265
|
}
|
|
5920
|
-
function
|
|
6266
|
+
function pr() {
|
|
5921
6267
|
return {
|
|
5922
6268
|
name: 'upload_asset',
|
|
5923
6269
|
description:
|
|
@@ -5965,25 +6311,25 @@ function nr() {
|
|
|
5965
6311
|
};
|
|
5966
6312
|
}
|
|
5967
6313
|
function Le() {
|
|
5968
|
-
let e =
|
|
5969
|
-
t = E().map((i) =>
|
|
5970
|
-
return [...e, ...t].map(
|
|
6314
|
+
let e = lr(),
|
|
6315
|
+
t = E().map((i) => or(i));
|
|
6316
|
+
return [...e, ...t].map(ar).map(nr);
|
|
5971
6317
|
}
|
|
5972
|
-
var
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
|
|
5976
|
-
|
|
6318
|
+
var tr,
|
|
6319
|
+
ir,
|
|
6320
|
+
rr,
|
|
6321
|
+
Rt,
|
|
6322
|
+
Ot = y(() => {
|
|
5977
6323
|
'use strict';
|
|
5978
|
-
|
|
6324
|
+
L();
|
|
5979
6325
|
Te();
|
|
5980
6326
|
W();
|
|
5981
|
-
((
|
|
6327
|
+
((tr = {
|
|
5982
6328
|
type: 'string',
|
|
5983
6329
|
description:
|
|
5984
6330
|
'Optional HTTPS URL. Tein POSTs the finished job here when it succeeds, fails, expires, or is cancelled. The body matches GET /v1/jobs/:id and is signed with X-Tein-Signature.',
|
|
5985
6331
|
}),
|
|
5986
|
-
(
|
|
6332
|
+
(ir = new Set([
|
|
5987
6333
|
'upload_asset',
|
|
5988
6334
|
'upload_media',
|
|
5989
6335
|
'upload_image',
|
|
@@ -5991,7 +6337,7 @@ var Qi,
|
|
|
5991
6337
|
'check_status',
|
|
5992
6338
|
'get_pricing',
|
|
5993
6339
|
])),
|
|
5994
|
-
(
|
|
6340
|
+
(rr = {
|
|
5995
6341
|
name: 'get_pricing',
|
|
5996
6342
|
description:
|
|
5997
6343
|
'Published USD prices for every Tein model: Starter, Plus and Scale on each variant, plus Creative mode, Priority and draft tables where they are published, and Admin prices for models that are not on the board. No API key is required. Pass model to keep one catalog slug or API model id (for example seedance-2-5). The same payload as GET /v1/pricing/models.',
|
|
@@ -6006,7 +6352,7 @@ var Qi,
|
|
|
6006
6352
|
additionalProperties: !1,
|
|
6007
6353
|
},
|
|
6008
6354
|
}));
|
|
6009
|
-
|
|
6355
|
+
Rt = new Set([
|
|
6010
6356
|
'image',
|
|
6011
6357
|
'images',
|
|
6012
6358
|
'image_url',
|
|
@@ -6023,19 +6369,19 @@ var Qi,
|
|
|
6023
6369
|
'lipsyncing_audio',
|
|
6024
6370
|
]);
|
|
6025
6371
|
});
|
|
6026
|
-
var
|
|
6027
|
-
|
|
6028
|
-
forgetToolSchemas: () =>
|
|
6029
|
-
jsonRpcAnswer: () =>
|
|
6030
|
-
preprocessLocalFiles: () =>
|
|
6031
|
-
startStdioServer: () =>
|
|
6372
|
+
var Jt = {};
|
|
6373
|
+
ei(Jt, {
|
|
6374
|
+
forgetToolSchemas: () => fr,
|
|
6375
|
+
jsonRpcAnswer: () => Nt,
|
|
6376
|
+
preprocessLocalFiles: () => Ft,
|
|
6377
|
+
startStdioServer: () => Gt,
|
|
6032
6378
|
});
|
|
6033
|
-
function
|
|
6379
|
+
function dr(e) {
|
|
6034
6380
|
let t = (i) =>
|
|
6035
6381
|
!!i && typeof i == 'object' && i.jsonrpc === '2.0' && ('result' in i || 'error' in i);
|
|
6036
6382
|
return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
|
|
6037
6383
|
}
|
|
6038
|
-
function
|
|
6384
|
+
function Nt(e, t, i) {
|
|
6039
6385
|
let r = e?.id,
|
|
6040
6386
|
n = r == null,
|
|
6041
6387
|
s = null;
|
|
@@ -6044,7 +6390,7 @@ function Dt(e, t, i) {
|
|
|
6044
6390
|
} catch {
|
|
6045
6391
|
s = null;
|
|
6046
6392
|
}
|
|
6047
|
-
if (s !== null &&
|
|
6393
|
+
if (s !== null && dr(s)) return n ? null : s;
|
|
6048
6394
|
if (n) return null;
|
|
6049
6395
|
if (!i && t >= 200 && t < 300) return;
|
|
6050
6396
|
let o = s?.error,
|
|
@@ -6065,50 +6411,49 @@ function Dt(e, t, i) {
|
|
|
6065
6411
|
},
|
|
6066
6412
|
};
|
|
6067
6413
|
}
|
|
6068
|
-
function
|
|
6414
|
+
function cr() {
|
|
6069
6415
|
let e = process.argv.slice(2),
|
|
6070
6416
|
t = e.indexOf('--api-key');
|
|
6071
|
-
return
|
|
6417
|
+
return K(t >= 0 ? e[t + 1] : void 0);
|
|
6072
6418
|
}
|
|
6073
|
-
async function
|
|
6074
|
-
let r =
|
|
6419
|
+
async function Ut(e, t, i) {
|
|
6420
|
+
let r = N.default.resolve(e);
|
|
6075
6421
|
if (!A.default.existsSync(r) || !A.default.statSync(r).isFile())
|
|
6076
6422
|
throw new Error(`File not found: ${e}`);
|
|
6077
6423
|
let n = A.default.readFileSync(r),
|
|
6078
6424
|
s = n.toString('base64'),
|
|
6079
|
-
o =
|
|
6080
|
-
u =
|
|
6081
|
-
p =
|
|
6082
|
-
l = await fetch(p, {
|
|
6425
|
+
o = n.length,
|
|
6426
|
+
u = `${i.replace(/\/$/, '')}/v1/upload`,
|
|
6427
|
+
p = await fetch(u, {
|
|
6083
6428
|
method: 'POST',
|
|
6084
6429
|
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${t}` },
|
|
6085
|
-
body: JSON.stringify({ data: s
|
|
6430
|
+
body: JSON.stringify({ data: s }),
|
|
6086
6431
|
});
|
|
6087
|
-
if (!
|
|
6088
|
-
let
|
|
6432
|
+
if (!p.ok) {
|
|
6433
|
+
let d = `Upload failed (HTTP ${p.status})`;
|
|
6089
6434
|
try {
|
|
6090
|
-
let
|
|
6091
|
-
|
|
6435
|
+
let c = await p.json();
|
|
6436
|
+
d = (typeof c.error == 'string' ? c.error : c.error?.message) || c.message || d;
|
|
6092
6437
|
} catch {}
|
|
6093
|
-
throw new Error(
|
|
6438
|
+
throw new Error(d);
|
|
6094
6439
|
}
|
|
6095
|
-
let
|
|
6440
|
+
let l = await p.json();
|
|
6096
6441
|
return {
|
|
6097
|
-
url:
|
|
6098
|
-
key:
|
|
6099
|
-
sizeBytes:
|
|
6100
|
-
mimeType:
|
|
6442
|
+
url: l.url,
|
|
6443
|
+
key: l.key,
|
|
6444
|
+
sizeBytes: l.size_bytes || o,
|
|
6445
|
+
mimeType: l.mime_type || l.mimeType || 'image/png',
|
|
6101
6446
|
};
|
|
6102
6447
|
}
|
|
6103
|
-
function
|
|
6104
|
-
return
|
|
6448
|
+
function jt(e) {
|
|
6449
|
+
return ur.has(N.default.extname(e).toLowerCase());
|
|
6105
6450
|
}
|
|
6106
|
-
function
|
|
6451
|
+
function Bt(e) {
|
|
6107
6452
|
return new Error(
|
|
6108
|
-
`Tein uploads image, video and audio files only, and ${
|
|
6453
|
+
`Tein uploads image, video and audio files only, and ${N.default.basename(e)} is not one.`,
|
|
6109
6454
|
);
|
|
6110
6455
|
}
|
|
6111
|
-
function
|
|
6456
|
+
function mr(e) {
|
|
6112
6457
|
let t = e.trim();
|
|
6113
6458
|
if (
|
|
6114
6459
|
!t ||
|
|
@@ -6118,10 +6463,10 @@ function pr(e) {
|
|
|
6118
6463
|
`)
|
|
6119
6464
|
)
|
|
6120
6465
|
return null;
|
|
6121
|
-
let i =
|
|
6466
|
+
let i = N.default.resolve(t);
|
|
6122
6467
|
return A.default.existsSync(i) && A.default.statSync(i).isFile() ? i : null;
|
|
6123
6468
|
}
|
|
6124
|
-
function
|
|
6469
|
+
function Ne(e) {
|
|
6125
6470
|
if (Array.isArray(e))
|
|
6126
6471
|
for (let t of e) {
|
|
6127
6472
|
let i = t;
|
|
@@ -6131,12 +6476,12 @@ function Ve(e) {
|
|
|
6131
6476
|
Q.set(i.name, i.inputSchema);
|
|
6132
6477
|
}
|
|
6133
6478
|
}
|
|
6134
|
-
function
|
|
6135
|
-
(Q.clear(), (
|
|
6479
|
+
function fr() {
|
|
6480
|
+
(Q.clear(), (Ve = 0));
|
|
6136
6481
|
}
|
|
6137
|
-
async function
|
|
6138
|
-
if (!(Date.now() -
|
|
6139
|
-
|
|
6482
|
+
async function gr(e, t) {
|
|
6483
|
+
if (!(Date.now() - Ve < 6e4)) {
|
|
6484
|
+
Ve = Date.now();
|
|
6140
6485
|
try {
|
|
6141
6486
|
let r = await (
|
|
6142
6487
|
await fetch(e, {
|
|
@@ -6146,39 +6491,39 @@ async function cr(e, t) {
|
|
|
6146
6491
|
signal: AbortSignal.timeout(1e4),
|
|
6147
6492
|
})
|
|
6148
6493
|
).json();
|
|
6149
|
-
|
|
6494
|
+
Ne(r.result?.tools);
|
|
6150
6495
|
} catch {}
|
|
6151
6496
|
}
|
|
6152
6497
|
}
|
|
6153
|
-
function
|
|
6498
|
+
function hr(e) {
|
|
6154
6499
|
return e
|
|
6155
6500
|
? e.type === 'string'
|
|
6156
6501
|
? e.format === 'uri'
|
|
6157
6502
|
: e.type === 'array' && e.items?.format === 'uri'
|
|
6158
6503
|
: !1;
|
|
6159
6504
|
}
|
|
6160
|
-
async function
|
|
6505
|
+
async function Dt(e, t, i) {
|
|
6161
6506
|
if (typeof e != 'string') return e;
|
|
6162
|
-
let r =
|
|
6507
|
+
let r = mr(e);
|
|
6163
6508
|
if (!r) return e;
|
|
6164
|
-
if (!
|
|
6165
|
-
return (await
|
|
6509
|
+
if (!jt(r)) throw Bt(r);
|
|
6510
|
+
return (await Ut(r, t, i)).url;
|
|
6166
6511
|
}
|
|
6167
|
-
async function
|
|
6168
|
-
(Q.size === 0 &&
|
|
6512
|
+
async function Ft(e, t, i, r, n) {
|
|
6513
|
+
(Q.size === 0 && Ne(Le()), Q.has(e) || (await gr(n, i)));
|
|
6169
6514
|
let s = Q.get(e)?.properties;
|
|
6170
6515
|
if (!s) return t;
|
|
6171
6516
|
let o = { ...t };
|
|
6172
6517
|
for (let [u, p] of Object.entries(t))
|
|
6173
|
-
if (
|
|
6518
|
+
if (hr(s[u]))
|
|
6174
6519
|
if (Array.isArray(p)) {
|
|
6175
6520
|
let l = [];
|
|
6176
|
-
for (let d of p) l.push(await
|
|
6521
|
+
for (let d of p) l.push(await Dt(d, i, r));
|
|
6177
6522
|
o[u] = l;
|
|
6178
|
-
} else o[u] = await
|
|
6523
|
+
} else o[u] = await Dt(p, i, r);
|
|
6179
6524
|
return o;
|
|
6180
6525
|
}
|
|
6181
|
-
function
|
|
6526
|
+
function yr(e) {
|
|
6182
6527
|
let t = e.id ?? null;
|
|
6183
6528
|
switch (e.method) {
|
|
6184
6529
|
case 'initialize':
|
|
@@ -6219,13 +6564,13 @@ function mr(e) {
|
|
|
6219
6564
|
};
|
|
6220
6565
|
}
|
|
6221
6566
|
}
|
|
6222
|
-
async function
|
|
6223
|
-
if (
|
|
6224
|
-
|
|
6225
|
-
let e =
|
|
6226
|
-
t =
|
|
6567
|
+
async function Gt() {
|
|
6568
|
+
if (Lt) return;
|
|
6569
|
+
Lt = !0;
|
|
6570
|
+
let e = cr(),
|
|
6571
|
+
t = k(),
|
|
6227
6572
|
i = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
|
|
6228
|
-
(
|
|
6573
|
+
(Vt.default
|
|
6229
6574
|
.createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
|
|
6230
6575
|
.on('line', async (n) => {
|
|
6231
6576
|
let s = n.trim();
|
|
@@ -6284,10 +6629,10 @@ async function jt() {
|
|
|
6284
6629
|
!d.startsWith('data:')
|
|
6285
6630
|
)
|
|
6286
6631
|
try {
|
|
6287
|
-
let c =
|
|
6632
|
+
let c = N.default.resolve(d.trim());
|
|
6288
6633
|
if (A.default.existsSync(c) && A.default.statSync(c).isFile() && e) {
|
|
6289
|
-
if (!
|
|
6290
|
-
let m = await
|
|
6634
|
+
if (!jt(c)) throw Bt(c);
|
|
6635
|
+
let m = await Ut(c, e, t),
|
|
6291
6636
|
f = (m.sizeBytes / 1024).toFixed(1),
|
|
6292
6637
|
ue =
|
|
6293
6638
|
m.mimeType.startsWith('image/') ||
|
|
@@ -6343,7 +6688,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6343
6688
|
}
|
|
6344
6689
|
if (e)
|
|
6345
6690
|
try {
|
|
6346
|
-
o.params.arguments = await
|
|
6691
|
+
o.params.arguments = await Ft(String(p), l, e, t, i);
|
|
6347
6692
|
} catch (d) {
|
|
6348
6693
|
let c = d instanceof Error ? d.message : String(d);
|
|
6349
6694
|
process.stdout.write(
|
|
@@ -6374,10 +6719,10 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6374
6719
|
body: JSON.stringify(o),
|
|
6375
6720
|
}),
|
|
6376
6721
|
l = await p.text(),
|
|
6377
|
-
d =
|
|
6722
|
+
d = Nt(o, p.status, l);
|
|
6378
6723
|
if (d === null) return;
|
|
6379
6724
|
if (d) {
|
|
6380
|
-
(o?.method === 'tools/list' &&
|
|
6725
|
+
(o?.method === 'tools/list' && Ne(d.result?.tools),
|
|
6381
6726
|
process.stdout.write(
|
|
6382
6727
|
JSON.stringify(d) +
|
|
6383
6728
|
`
|
|
@@ -6386,7 +6731,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6386
6731
|
return;
|
|
6387
6732
|
}
|
|
6388
6733
|
} catch {}
|
|
6389
|
-
let u =
|
|
6734
|
+
let u = yr(o);
|
|
6390
6735
|
u !== null &&
|
|
6391
6736
|
process.stdout.write(
|
|
6392
6737
|
JSON.stringify(u) +
|
|
@@ -6410,21 +6755,21 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6410
6755
|
`));
|
|
6411
6756
|
}
|
|
6412
6757
|
var A,
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6758
|
+
N,
|
|
6759
|
+
Vt,
|
|
6760
|
+
ur,
|
|
6416
6761
|
Q,
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6762
|
+
Ve,
|
|
6763
|
+
Lt,
|
|
6764
|
+
Ht = y(() => {
|
|
6420
6765
|
'use strict';
|
|
6421
|
-
((A =
|
|
6422
|
-
(
|
|
6423
|
-
(
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6766
|
+
((A = v(require('node:fs'))),
|
|
6767
|
+
(N = v(require('node:path'))),
|
|
6768
|
+
(Vt = v(require('node:readline'))));
|
|
6769
|
+
Ee();
|
|
6770
|
+
Ot();
|
|
6771
|
+
C();
|
|
6772
|
+
ur = new Set([
|
|
6428
6773
|
'.png',
|
|
6429
6774
|
'.jpg',
|
|
6430
6775
|
'.jpeg',
|
|
@@ -6450,20 +6795,20 @@ var A,
|
|
|
6450
6795
|
'.flac',
|
|
6451
6796
|
'.opus',
|
|
6452
6797
|
]);
|
|
6453
|
-
((Q = new Map()), (
|
|
6454
|
-
|
|
6798
|
+
((Q = new Map()), (Ve = 0));
|
|
6799
|
+
Lt = !1;
|
|
6455
6800
|
require.main === module &&
|
|
6456
|
-
|
|
6801
|
+
Gt().catch((e) => {
|
|
6457
6802
|
(process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
|
|
6458
6803
|
`),
|
|
6459
6804
|
process.exit(1));
|
|
6460
6805
|
});
|
|
6461
6806
|
});
|
|
6462
|
-
var
|
|
6807
|
+
var ii =
|
|
6463
6808
|
!process.env.NO_COLOR &&
|
|
6464
6809
|
(process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
|
|
6465
6810
|
function b(e, t) {
|
|
6466
|
-
return (i) => (
|
|
6811
|
+
return (i) => (ii ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
|
|
6467
6812
|
}
|
|
6468
6813
|
var a = {
|
|
6469
6814
|
bold: b(1, 22),
|
|
@@ -6547,21 +6892,21 @@ var a = {
|
|
|
6547
6892
|
process.stdout.isTTY && process.stdout.write('\r\x1B[K'));
|
|
6548
6893
|
}
|
|
6549
6894
|
};
|
|
6550
|
-
var R =
|
|
6551
|
-
|
|
6552
|
-
var ee =
|
|
6553
|
-
Be =
|
|
6895
|
+
var R = v(require('node:fs')),
|
|
6896
|
+
q = v(require('node:path'));
|
|
6897
|
+
var ee = v(require('node:fs')),
|
|
6898
|
+
Be = v(require('node:path')),
|
|
6554
6899
|
Fe = require('node:stream/promises');
|
|
6555
6900
|
var Z = '1.1.7';
|
|
6556
|
-
var
|
|
6901
|
+
var ri = new Set([
|
|
6557
6902
|
'account_suspended',
|
|
6558
6903
|
'account_terminated',
|
|
6559
6904
|
'creative_mode_restricted',
|
|
6560
6905
|
'unfiltered_restricted',
|
|
6561
6906
|
'workspace_paused',
|
|
6562
6907
|
]),
|
|
6563
|
-
|
|
6564
|
-
|
|
6908
|
+
I = 1,
|
|
6909
|
+
ai = 3,
|
|
6565
6910
|
w = class extends Error {
|
|
6566
6911
|
constructor(t, i, r, n = {}) {
|
|
6567
6912
|
(super(i),
|
|
@@ -6571,10 +6916,10 @@ var ei = new Set([
|
|
|
6571
6916
|
(this.fields = n));
|
|
6572
6917
|
}
|
|
6573
6918
|
get exitCode() {
|
|
6574
|
-
return this.code &&
|
|
6919
|
+
return this.code && ri.has(this.code) ? ai : I;
|
|
6575
6920
|
}
|
|
6576
6921
|
};
|
|
6577
|
-
function
|
|
6922
|
+
function ni(e, t, i) {
|
|
6578
6923
|
let r = `HTTP ${e}${t ? ` ${t}` : ''}`;
|
|
6579
6924
|
if (!i || typeof i != 'object') return new w(e, r);
|
|
6580
6925
|
let n = i;
|
|
@@ -6601,7 +6946,7 @@ function M(e) {
|
|
|
6601
6946
|
let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
|
|
6602
6947
|
return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
|
|
6603
6948
|
}
|
|
6604
|
-
function
|
|
6949
|
+
function si(e) {
|
|
6605
6950
|
return /\.(mp4|webm|mov)(\?|$)/i.test(e)
|
|
6606
6951
|
? 'video'
|
|
6607
6952
|
: /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
|
|
@@ -6613,7 +6958,7 @@ function je(e) {
|
|
|
6613
6958
|
for (let i of e.data ?? [])
|
|
6614
6959
|
typeof i.message?.content == 'string'
|
|
6615
6960
|
? t.push({ type: 'text', text: i.message.content })
|
|
6616
|
-
: i.url && t.push({ type:
|
|
6961
|
+
: i.url && t.push({ type: si(i.url), url: i.url });
|
|
6617
6962
|
return t;
|
|
6618
6963
|
}
|
|
6619
6964
|
var T = class {
|
|
@@ -6639,7 +6984,7 @@ var T = class {
|
|
|
6639
6984
|
try {
|
|
6640
6985
|
s = await n.json();
|
|
6641
6986
|
} catch {}
|
|
6642
|
-
throw
|
|
6987
|
+
throw ni(n.status, n.statusText, s);
|
|
6643
6988
|
}
|
|
6644
6989
|
return await n.json();
|
|
6645
6990
|
}
|
|
@@ -6686,8 +7031,8 @@ var T = class {
|
|
|
6686
7031
|
};
|
|
6687
7032
|
});
|
|
6688
7033
|
}
|
|
6689
|
-
uploadAsset(t
|
|
6690
|
-
return this.send('POST', '/v1/upload', { data: t
|
|
7034
|
+
uploadAsset(t) {
|
|
7035
|
+
return this.send('POST', '/v1/upload', { data: t });
|
|
6691
7036
|
}
|
|
6692
7037
|
async downloadOutput(t, i) {
|
|
6693
7038
|
let r = await fetch(t);
|
|
@@ -6698,31 +7043,31 @@ var T = class {
|
|
|
6698
7043
|
return (await (0, Fe.pipeline)(r.body, s), i);
|
|
6699
7044
|
}
|
|
6700
7045
|
};
|
|
6701
|
-
|
|
7046
|
+
C();
|
|
6702
7047
|
W();
|
|
6703
|
-
var
|
|
6704
|
-
function
|
|
6705
|
-
for (let t of
|
|
7048
|
+
var It = ['images', 'input_images', 'videos', 'audios'];
|
|
7049
|
+
function Oi(e) {
|
|
7050
|
+
for (let t of It) typeof e[t] == 'string' && (e[t] = [e[t]]);
|
|
6706
7051
|
}
|
|
6707
|
-
function
|
|
7052
|
+
function Di(e) {
|
|
6708
7053
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
6709
|
-
let t =
|
|
7054
|
+
let t = q.default.resolve(e);
|
|
6710
7055
|
return R.default.existsSync(t) && R.default.statSync(t).isFile() ? t : null;
|
|
6711
7056
|
}
|
|
6712
|
-
async function
|
|
6713
|
-
for (let i of
|
|
7057
|
+
async function Li(e, t) {
|
|
7058
|
+
for (let i of It) {
|
|
6714
7059
|
if (!Array.isArray(e[i])) continue;
|
|
6715
7060
|
let r = [];
|
|
6716
7061
|
for (let n of e[i]) {
|
|
6717
7062
|
if (typeof n != 'string') continue;
|
|
6718
|
-
let s =
|
|
7063
|
+
let s = Di(n);
|
|
6719
7064
|
r.push(s ? await t(s) : n);
|
|
6720
7065
|
}
|
|
6721
7066
|
e[i] = r;
|
|
6722
7067
|
}
|
|
6723
7068
|
}
|
|
6724
7069
|
var z = { starter: 10, plus: 25, scale: 40, enterprise: 300 };
|
|
6725
|
-
function
|
|
7070
|
+
function Vi(e) {
|
|
6726
7071
|
if (e.count === void 0 || e.count === !0) return 1;
|
|
6727
7072
|
let t = typeof e.count == 'number' ? e.count : Number(e.count),
|
|
6728
7073
|
i = z.enterprise;
|
|
@@ -6735,7 +7080,7 @@ function Ri(e) {
|
|
|
6735
7080
|
t
|
|
6736
7081
|
);
|
|
6737
7082
|
}
|
|
6738
|
-
async function
|
|
7083
|
+
async function Ni(e, t, i, r, n) {
|
|
6739
7084
|
n.isJson ||
|
|
6740
7085
|
process.stderr.write(`Starting ${r} ${t} jobs together...
|
|
6741
7086
|
`);
|
|
@@ -6808,9 +7153,9 @@ async function Oi(e, t, i, r, n) {
|
|
|
6808
7153
|
}
|
|
6809
7154
|
(u.length ||
|
|
6810
7155
|
o.some((p) => p.status === 'failed' || p.status === 'expired' || p.status === 'cancelled')) &&
|
|
6811
|
-
process.exit(
|
|
7156
|
+
process.exit(I);
|
|
6812
7157
|
}
|
|
6813
|
-
function
|
|
7158
|
+
function _t(e) {
|
|
6814
7159
|
let t = {},
|
|
6815
7160
|
i = new Set(),
|
|
6816
7161
|
r = [];
|
|
@@ -6856,8 +7201,8 @@ function It(e) {
|
|
|
6856
7201
|
return { command: r[0] || '', subcommand: r[1], modelSlug: r[1] || r[0], options: t, flags: i };
|
|
6857
7202
|
}
|
|
6858
7203
|
async function Ce(e, t) {
|
|
6859
|
-
let i =
|
|
6860
|
-
r =
|
|
7204
|
+
let i = K(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
7205
|
+
r = k(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
6861
7206
|
(i ||
|
|
6862
7207
|
(process.stderr.write(`${a.red('Error:')} Authentication required.
|
|
6863
7208
|
`),
|
|
@@ -6877,7 +7222,7 @@ async function Ce(e, t) {
|
|
|
6877
7222
|
s = !!t.json,
|
|
6878
7223
|
o = !!(t.async || t.no_wait),
|
|
6879
7224
|
u = typeof t.output == 'string' ? t.output : void 0,
|
|
6880
|
-
p =
|
|
7225
|
+
p = Vi(t),
|
|
6881
7226
|
l = { ...t };
|
|
6882
7227
|
if (
|
|
6883
7228
|
(delete l.json,
|
|
@@ -6892,9 +7237,9 @@ async function Ce(e, t) {
|
|
|
6892
7237
|
for (let h of n.parameters)
|
|
6893
7238
|
h.default !== void 0 &&
|
|
6894
7239
|
l[h.name] === void 0 &&
|
|
6895
|
-
|
|
7240
|
+
vt(n.slug, h.name, t) &&
|
|
6896
7241
|
(l[h.name] = h.default);
|
|
6897
|
-
(
|
|
7242
|
+
(Oi(l),
|
|
6898
7243
|
typeof l.image == 'string' && !l.images && ((l.images = [l.image]), delete l.image),
|
|
6899
7244
|
l.image_url &&
|
|
6900
7245
|
!l.first_frame_image &&
|
|
@@ -6905,14 +7250,14 @@ async function Ce(e, t) {
|
|
|
6905
7250
|
for (let h of c) {
|
|
6906
7251
|
let g = l[h];
|
|
6907
7252
|
if (typeof g == 'string' && !g.startsWith('http://') && !g.startsWith('https://')) {
|
|
6908
|
-
let
|
|
6909
|
-
if (R.default.existsSync(
|
|
6910
|
-
let
|
|
6911
|
-
s ||
|
|
7253
|
+
let x = q.default.resolve(g);
|
|
7254
|
+
if (R.default.existsSync(x) && R.default.statSync(x).isFile()) {
|
|
7255
|
+
let _ = new P(`Uploading local file ${q.default.basename(x)} to CDN...`);
|
|
7256
|
+
s || _.start();
|
|
6912
7257
|
try {
|
|
6913
|
-
let j = R.default.readFileSync(
|
|
6914
|
-
X = await d.uploadAsset(j.toString('base64')
|
|
6915
|
-
((l[h] = X.url), s ||
|
|
7258
|
+
let j = R.default.readFileSync(x),
|
|
7259
|
+
X = await d.uploadAsset(j.toString('base64'));
|
|
7260
|
+
((l[h] = X.url), s || _.succeed(`Uploaded ${q.default.basename(x)} to CDN`));
|
|
6916
7261
|
} catch (j) {
|
|
6917
7262
|
let X = j instanceof Error ? j.message : String(j);
|
|
6918
7263
|
(s
|
|
@@ -6921,28 +7266,28 @@ async function Ce(e, t) {
|
|
|
6921
7266
|
`
|
|
6922
7267
|
`,
|
|
6923
7268
|
)
|
|
6924
|
-
:
|
|
7269
|
+
: _.fail(`Upload failed: ${X}`),
|
|
6925
7270
|
process.exit(1));
|
|
6926
7271
|
}
|
|
6927
7272
|
}
|
|
6928
7273
|
}
|
|
6929
7274
|
}
|
|
6930
|
-
await
|
|
6931
|
-
let g = new P(`Uploading local file ${
|
|
7275
|
+
await Li(l, async (h) => {
|
|
7276
|
+
let g = new P(`Uploading local file ${q.default.basename(h)} to CDN...`);
|
|
6932
7277
|
s || g.start();
|
|
6933
7278
|
try {
|
|
6934
|
-
let
|
|
6935
|
-
|
|
6936
|
-
return (s || g.succeed(`Uploaded ${
|
|
6937
|
-
} catch (
|
|
6938
|
-
let
|
|
7279
|
+
let x = R.default.readFileSync(h),
|
|
7280
|
+
_ = await d.uploadAsset(x.toString('base64'));
|
|
7281
|
+
return (s || g.succeed(`Uploaded ${q.default.basename(h)} to CDN`), _.url);
|
|
7282
|
+
} catch (x) {
|
|
7283
|
+
let _ = x instanceof Error ? x.message : String(x);
|
|
6939
7284
|
(s
|
|
6940
7285
|
? process.stdout.write(
|
|
6941
|
-
JSON.stringify({ error:
|
|
7286
|
+
JSON.stringify({ error: _ }) +
|
|
6942
7287
|
`
|
|
6943
7288
|
`,
|
|
6944
7289
|
)
|
|
6945
|
-
: g.fail(`Upload failed: ${
|
|
7290
|
+
: g.fail(`Upload failed: ${_}`),
|
|
6946
7291
|
process.exit(1));
|
|
6947
7292
|
}
|
|
6948
7293
|
});
|
|
@@ -6951,7 +7296,7 @@ async function Ce(e, t) {
|
|
|
6951
7296
|
let f;
|
|
6952
7297
|
try {
|
|
6953
7298
|
if (p > 1) {
|
|
6954
|
-
await
|
|
7299
|
+
await Ni(d, e, l, p, { isJson: s, isAsync: o });
|
|
6955
7300
|
return;
|
|
6956
7301
|
}
|
|
6957
7302
|
f = await d.queueJob(e, l);
|
|
@@ -6975,7 +7320,7 @@ async function Ce(e, t) {
|
|
|
6975
7320
|
`)
|
|
6976
7321
|
: `Failed to start generation: ${h instanceof Error ? h.message : h}`,
|
|
6977
7322
|
),
|
|
6978
|
-
process.exit(g ? g.exitCode :
|
|
7323
|
+
process.exit(g ? g.exitCode : I));
|
|
6979
7324
|
}
|
|
6980
7325
|
if (o) {
|
|
6981
7326
|
s
|
|
@@ -6999,7 +7344,7 @@ async function Ce(e, t) {
|
|
|
6999
7344
|
f = await d.getStatus(f.request_id);
|
|
7000
7345
|
} catch (g) {
|
|
7001
7346
|
g instanceof w &&
|
|
7002
|
-
g.exitCode !==
|
|
7347
|
+
g.exitCode !== I &&
|
|
7003
7348
|
(s ||
|
|
7004
7349
|
m.fail(
|
|
7005
7350
|
M(g).join(`
|
|
@@ -7017,7 +7362,7 @@ async function Ce(e, t) {
|
|
|
7017
7362
|
`,
|
|
7018
7363
|
)
|
|
7019
7364
|
: m.fail(`Generation ${f.status}: ${f.error || 'Something failed on our side.'}`),
|
|
7020
|
-
process.exit(
|
|
7365
|
+
process.exit(I)),
|
|
7021
7366
|
s || m.succeed(`Generation completed for ${a.bold(n?.name || e)}!`),
|
|
7022
7367
|
s)
|
|
7023
7368
|
) {
|
|
@@ -7051,12 +7396,12 @@ ${a.bold('Outputs:')}
|
|
|
7051
7396
|
`),
|
|
7052
7397
|
u)
|
|
7053
7398
|
) {
|
|
7054
|
-
let
|
|
7399
|
+
let x = new P(`Downloading output to ${u}...`).start();
|
|
7055
7400
|
try {
|
|
7056
|
-
(await d.downloadOutput(g.url,
|
|
7057
|
-
|
|
7058
|
-
} catch (
|
|
7059
|
-
|
|
7401
|
+
(await d.downloadOutput(g.url, q.default.resolve(process.cwd(), u)),
|
|
7402
|
+
x.succeed(`Saved to ${a.bold(u)}`));
|
|
7403
|
+
} catch (_) {
|
|
7404
|
+
x.fail(`Failed to download: ${_ instanceof Error ? _.message : _}`);
|
|
7060
7405
|
}
|
|
7061
7406
|
}
|
|
7062
7407
|
} else
|
|
@@ -7069,11 +7414,11 @@ ${g.text}
|
|
|
7069
7414
|
process.stdout.write(`
|
|
7070
7415
|
`);
|
|
7071
7416
|
}
|
|
7072
|
-
var
|
|
7073
|
-
|
|
7074
|
-
async function
|
|
7417
|
+
var Pt = v(require('node:readline'));
|
|
7418
|
+
C();
|
|
7419
|
+
async function Ui(e) {
|
|
7075
7420
|
try {
|
|
7076
|
-
return (await new T(e,
|
|
7421
|
+
return (await new T(e, k()).checkKey(), 'ok');
|
|
7077
7422
|
} catch (t) {
|
|
7078
7423
|
if (t instanceof w) {
|
|
7079
7424
|
if (t.status === 401) return 'invalid';
|
|
@@ -7082,8 +7427,8 @@ async function Di(e) {
|
|
|
7082
7427
|
return 'unchecked';
|
|
7083
7428
|
}
|
|
7084
7429
|
}
|
|
7085
|
-
function
|
|
7086
|
-
let t =
|
|
7430
|
+
function ji(e) {
|
|
7431
|
+
let t = Pt.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
7087
7432
|
return new Promise((i) => {
|
|
7088
7433
|
t.question(e, (r) => {
|
|
7089
7434
|
(t.close(), i(r.trim()));
|
|
@@ -7102,14 +7447,14 @@ ${a.bold('Tein AI Authentication')}
|
|
|
7102
7447
|
process.stdout.write(`Get your API key at: ${a.cyan('https://tein.ai/dashboard/keys')}
|
|
7103
7448
|
|
|
7104
7449
|
`),
|
|
7105
|
-
(i = await
|
|
7450
|
+
(i = await ji('Enter your Tein API Key (sk_live_...): '))),
|
|
7106
7451
|
!i.startsWith('sk_live_') &&
|
|
7107
7452
|
!i.startsWith('sk_test_') &&
|
|
7108
7453
|
(process.stderr
|
|
7109
7454
|
.write(`${a.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
|
|
7110
7455
|
`),
|
|
7111
7456
|
process.exit(1)));
|
|
7112
|
-
let r = await
|
|
7457
|
+
let r = await Ui(i);
|
|
7113
7458
|
(r === 'invalid' &&
|
|
7114
7459
|
(process.stderr
|
|
7115
7460
|
.write(`${a.red('Error:')} Tein did not accept this key. Copy it again from ${a.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
|
|
@@ -7134,7 +7479,7 @@ ${a.green('\u2713')} API key saved to ${a.dim(ie())}
|
|
|
7134
7479
|
break;
|
|
7135
7480
|
}
|
|
7136
7481
|
case 'logout': {
|
|
7137
|
-
if (!
|
|
7482
|
+
if (!D().apiKey) {
|
|
7138
7483
|
process.stdout
|
|
7139
7484
|
.write(`${a.yellow('\u2139')} No active API key found. You are already logged out.
|
|
7140
7485
|
`);
|
|
@@ -7147,9 +7492,9 @@ ${a.green('\u2713')} API key saved to ${a.dim(ie())}
|
|
|
7147
7492
|
break;
|
|
7148
7493
|
}
|
|
7149
7494
|
default: {
|
|
7150
|
-
let i =
|
|
7151
|
-
r =
|
|
7152
|
-
n =
|
|
7495
|
+
let i = K(),
|
|
7496
|
+
r = k(),
|
|
7497
|
+
n = D();
|
|
7153
7498
|
if (
|
|
7154
7499
|
(process.stdout.write(`
|
|
7155
7500
|
${a.bold('Tein AI CLI Configuration')}
|
|
@@ -7178,13 +7523,13 @@ ${a.bold('Tein AI CLI Configuration')}
|
|
|
7178
7523
|
}
|
|
7179
7524
|
}
|
|
7180
7525
|
}
|
|
7181
|
-
|
|
7526
|
+
C();
|
|
7182
7527
|
he();
|
|
7183
7528
|
W();
|
|
7184
|
-
var
|
|
7185
|
-
async function
|
|
7529
|
+
var Bi = 3e3;
|
|
7530
|
+
async function Tt(e) {
|
|
7186
7531
|
try {
|
|
7187
|
-
let t = await fetch(`${
|
|
7532
|
+
let t = await fetch(`${k(e)}/v1/pricing`, { signal: AbortSignal.timeout(Bi) });
|
|
7188
7533
|
if (!t.ok) return;
|
|
7189
7534
|
let i = await t.json(),
|
|
7190
7535
|
r = {};
|
|
@@ -7192,18 +7537,18 @@ async function _t(e) {
|
|
|
7192
7537
|
let s = String(n.modelSlug ?? '');
|
|
7193
7538
|
B.has(s) && (r[s] ??= []).push(Number(n.starterPrice));
|
|
7194
7539
|
}
|
|
7195
|
-
|
|
7540
|
+
ft(r);
|
|
7196
7541
|
} catch {}
|
|
7197
7542
|
}
|
|
7198
|
-
var
|
|
7199
|
-
|
|
7200
|
-
async function
|
|
7201
|
-
await
|
|
7543
|
+
var Fi = new Set(['video', 'image', 'text', 'audio', '3d']),
|
|
7544
|
+
Gi = { llm: 'text', chat: 'text', reasoning: 'text' };
|
|
7545
|
+
async function Mt(e, t) {
|
|
7546
|
+
await Tt(t);
|
|
7202
7547
|
let i = E();
|
|
7203
7548
|
if (e) {
|
|
7204
7549
|
let s = e.toLowerCase(),
|
|
7205
|
-
o =
|
|
7206
|
-
i =
|
|
7550
|
+
o = Gi[s] ?? s;
|
|
7551
|
+
i = Fi.has(o)
|
|
7207
7552
|
? i.filter((u) => u.category.toLowerCase() === o)
|
|
7208
7553
|
: i.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
|
|
7209
7554
|
}
|
|
@@ -7241,8 +7586,8 @@ ${a.bold('Tein AI Models Catalog')} (${i.length} available)
|
|
|
7241
7586
|
|
|
7242
7587
|
`);
|
|
7243
7588
|
}
|
|
7244
|
-
async function
|
|
7245
|
-
B.has(e) && (await
|
|
7589
|
+
async function Kt(e, t) {
|
|
7590
|
+
B.has(e) && (await Tt(t));
|
|
7246
7591
|
let i = V(e);
|
|
7247
7592
|
(i ||
|
|
7248
7593
|
(process.stderr.write(`${a.red('Error:')} Model "${e}" not found in Tein AI registry.
|
|
@@ -7322,9 +7667,9 @@ ${a.bold(a.cyan(i.name))} (${a.bold(i.slug)})
|
|
|
7322
7667
|
|
|
7323
7668
|
`);
|
|
7324
7669
|
}
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
var
|
|
7670
|
+
C();
|
|
7671
|
+
Ee();
|
|
7672
|
+
var Ji = 1e4,
|
|
7328
7673
|
Ae = {
|
|
7329
7674
|
price: '',
|
|
7330
7675
|
creativeMode: 'Creative mode',
|
|
@@ -7335,22 +7680,22 @@ var ji = 1e4,
|
|
|
7335
7680
|
priorityDraft: 'Priority + Draft',
|
|
7336
7681
|
creativeModePriorityDraft: 'Creative mode + Priority + Draft',
|
|
7337
7682
|
},
|
|
7338
|
-
|
|
7339
|
-
|
|
7683
|
+
Hi = Object.keys(Ae),
|
|
7684
|
+
Wi = {
|
|
7340
7685
|
creativeMode: 'unfiltered',
|
|
7341
7686
|
creativeModePriority: 'unfilteredPriority',
|
|
7342
7687
|
creativeModeDraft: 'unfilteredDraft',
|
|
7343
7688
|
creativeModePriorityDraft: 'unfilteredPriorityDraft',
|
|
7344
7689
|
};
|
|
7345
|
-
function
|
|
7346
|
-
let i =
|
|
7690
|
+
function zi(e, t) {
|
|
7691
|
+
let i = Wi[t];
|
|
7347
7692
|
return e[t] ?? (i ? e[i] : void 0);
|
|
7348
7693
|
}
|
|
7349
|
-
async function
|
|
7350
|
-
let i = `${
|
|
7694
|
+
async function Yi(e, t) {
|
|
7695
|
+
let i = `${k(e)}${ce(t)}`,
|
|
7351
7696
|
r;
|
|
7352
7697
|
try {
|
|
7353
|
-
r = await fetch(i, { signal: AbortSignal.timeout(
|
|
7698
|
+
r = await fetch(i, { signal: AbortSignal.timeout(Ji) });
|
|
7354
7699
|
} catch {
|
|
7355
7700
|
throw new Error(`Could not reach ${i}`);
|
|
7356
7701
|
}
|
|
@@ -7366,7 +7711,7 @@ async function Ji(e, t) {
|
|
|
7366
7711
|
}
|
|
7367
7712
|
return n;
|
|
7368
7713
|
}
|
|
7369
|
-
function
|
|
7714
|
+
function qe(e) {
|
|
7370
7715
|
let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
|
|
7371
7716
|
[i, r = ''] = t.split('.');
|
|
7372
7717
|
return `$${i}.${r.padEnd(2, '0')}`;
|
|
@@ -7375,9 +7720,9 @@ function Re(e) {
|
|
|
7375
7720
|
if (!e || typeof e.starter != 'number') return null;
|
|
7376
7721
|
let t = typeof e.plus == 'number' ? e.plus : e.starter,
|
|
7377
7722
|
i = typeof e.scale == 'number' ? e.scale : t;
|
|
7378
|
-
return `Starter ${
|
|
7723
|
+
return `Starter ${qe(e.starter)} Plus ${qe(t)} Scale ${qe(i)}`;
|
|
7379
7724
|
}
|
|
7380
|
-
function
|
|
7725
|
+
function Qi(e) {
|
|
7381
7726
|
if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
|
|
7382
7727
|
let t = [];
|
|
7383
7728
|
for (let i of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
|
|
@@ -7389,21 +7734,21 @@ function Hi(e) {
|
|
|
7389
7734
|
t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
|
|
7390
7735
|
);
|
|
7391
7736
|
}
|
|
7392
|
-
function
|
|
7393
|
-
let i =
|
|
7394
|
-
for (let r of
|
|
7395
|
-
let n = Re(
|
|
7737
|
+
function Xi(e, t) {
|
|
7738
|
+
let i = Qi(e);
|
|
7739
|
+
for (let r of Hi) {
|
|
7740
|
+
let n = Re(zi(e, r));
|
|
7396
7741
|
if (!n) continue;
|
|
7397
7742
|
let s = Ae[r] ? ` (${Ae[r]})` : '';
|
|
7398
7743
|
t.push(` ${i}${s} ${n}`);
|
|
7399
7744
|
}
|
|
7400
7745
|
}
|
|
7401
|
-
function
|
|
7746
|
+
function Zi(e, t) {
|
|
7402
7747
|
let i = e.quality ? ` quality=${e.quality}` : '';
|
|
7403
7748
|
t.push(
|
|
7404
7749
|
` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${i}`)}`,
|
|
7405
7750
|
);
|
|
7406
|
-
for (let n of e.variants ?? [])
|
|
7751
|
+
for (let n of e.variants ?? []) Xi(n, t);
|
|
7407
7752
|
let r = e.addons;
|
|
7408
7753
|
if (Array.isArray(r))
|
|
7409
7754
|
for (let n of r) {
|
|
@@ -7415,7 +7760,7 @@ function zi(e, t) {
|
|
|
7415
7760
|
}
|
|
7416
7761
|
t.push('');
|
|
7417
7762
|
}
|
|
7418
|
-
function
|
|
7763
|
+
function er(e) {
|
|
7419
7764
|
let t = [],
|
|
7420
7765
|
i = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
7421
7766
|
(t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${i}`),
|
|
@@ -7437,7 +7782,7 @@ function Yi(e) {
|
|
|
7437
7782
|
});
|
|
7438
7783
|
for (let p of s) {
|
|
7439
7784
|
t.push(`${a.bold(a.cyan(`\u2500\u2500 ${p} \u2500\u2500`))}`);
|
|
7440
|
-
for (let l of r.get(p) ?? [])
|
|
7785
|
+
for (let l of r.get(p) ?? []) Zi(l, t);
|
|
7441
7786
|
}
|
|
7442
7787
|
let o = new Set(e.board.models.map((p) => p.slug.toLowerCase())),
|
|
7443
7788
|
u = (e.configs ?? []).filter((p) => !o.has(String(p.modelSlug ?? '').toLowerCase()));
|
|
@@ -7467,10 +7812,10 @@ function Yi(e) {
|
|
|
7467
7812
|
`
|
|
7468
7813
|
);
|
|
7469
7814
|
}
|
|
7470
|
-
async function
|
|
7815
|
+
async function St(e) {
|
|
7471
7816
|
let t;
|
|
7472
7817
|
try {
|
|
7473
|
-
t = await
|
|
7818
|
+
t = await Yi(e.apiUrl, e.model);
|
|
7474
7819
|
} catch (i) {
|
|
7475
7820
|
let r = i instanceof Error ? i.message : String(i);
|
|
7476
7821
|
(process.stderr.write(`${a.red('Error:')} ${r}
|
|
@@ -7481,14 +7826,14 @@ async function Tt(e) {
|
|
|
7481
7826
|
e.json
|
|
7482
7827
|
? `${JSON.stringify(t, null, 2)}
|
|
7483
7828
|
`
|
|
7484
|
-
:
|
|
7829
|
+
: er(t),
|
|
7485
7830
|
);
|
|
7486
7831
|
}
|
|
7487
|
-
var
|
|
7488
|
-
|
|
7489
|
-
async function
|
|
7490
|
-
let i =
|
|
7491
|
-
r =
|
|
7832
|
+
var $t = v(require('node:path'));
|
|
7833
|
+
C();
|
|
7834
|
+
async function Ct(e, t) {
|
|
7835
|
+
let i = K(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
7836
|
+
r = k(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
7492
7837
|
(i ||
|
|
7493
7838
|
(process.stderr.write(`${a.red('Error:')} Authentication required.
|
|
7494
7839
|
`),
|
|
@@ -7529,7 +7874,7 @@ async function St(e, t) {
|
|
|
7529
7874
|
),
|
|
7530
7875
|
process.exit(d.exitCode)),
|
|
7531
7876
|
n || p.fail(d instanceof Error ? d.message : String(d)),
|
|
7532
|
-
process.exit(
|
|
7877
|
+
process.exit(I));
|
|
7533
7878
|
}
|
|
7534
7879
|
if (s && l.status === 'processing') {
|
|
7535
7880
|
let d = Date.now();
|
|
@@ -7581,7 +7926,7 @@ ${a.bold('Outputs:')}
|
|
|
7581
7926
|
) {
|
|
7582
7927
|
let c = new P(`Downloading output to ${o}...`).start();
|
|
7583
7928
|
try {
|
|
7584
|
-
(await u.downloadOutput(d.url,
|
|
7929
|
+
(await u.downloadOutput(d.url, $t.default.resolve(process.cwd(), o)),
|
|
7585
7930
|
c.succeed(`Saved to ${a.bold(o)}`));
|
|
7586
7931
|
} catch (m) {
|
|
7587
7932
|
c.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
|
|
@@ -7596,12 +7941,12 @@ ${d.text}
|
|
|
7596
7941
|
process.stdout.write(`
|
|
7597
7942
|
`);
|
|
7598
7943
|
}
|
|
7599
|
-
var Oe =
|
|
7600
|
-
De =
|
|
7601
|
-
|
|
7602
|
-
async function
|
|
7603
|
-
let i =
|
|
7604
|
-
r =
|
|
7944
|
+
var Oe = v(require('node:fs')),
|
|
7945
|
+
De = v(require('node:path'));
|
|
7946
|
+
C();
|
|
7947
|
+
async function Et(e, t = {}) {
|
|
7948
|
+
let i = K(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
7949
|
+
r = k(typeof t.api_url == 'string' ? t.api_url : void 0),
|
|
7605
7950
|
n = !!t.json;
|
|
7606
7951
|
(i ||
|
|
7607
7952
|
(process.stderr.write(`${a.red('Error:')} Authentication required.
|
|
@@ -7627,7 +7972,7 @@ async function $t(e, t = {}) {
|
|
|
7627
7972
|
d = new P(`Uploading ${a.bold(o)} to Tein AI CDN...`);
|
|
7628
7973
|
n || d.start();
|
|
7629
7974
|
try {
|
|
7630
|
-
let c = await l.uploadAsset(p
|
|
7975
|
+
let c = await l.uploadAsset(p);
|
|
7631
7976
|
n
|
|
7632
7977
|
? process.stdout.write(
|
|
7633
7978
|
JSON.stringify(c, null, 2) +
|
|
@@ -7660,12 +8005,12 @@ ${a.bold('CDN URL:')} ${a.green(c.url)}
|
|
|
7660
8005
|
`,
|
|
7661
8006
|
)
|
|
7662
8007
|
: d.fail(`Upload failed: ${f}`),
|
|
7663
|
-
process.exit(m ? m.exitCode :
|
|
8008
|
+
process.exit(m ? m.exitCode : I));
|
|
7664
8009
|
}
|
|
7665
8010
|
}
|
|
7666
8011
|
W();
|
|
7667
|
-
|
|
7668
|
-
function
|
|
8012
|
+
_e();
|
|
8013
|
+
function Wt() {
|
|
7669
8014
|
process.stdout.write(`
|
|
7670
8015
|
${a.bold(a.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
|
|
7671
8016
|
|
|
@@ -7722,11 +8067,11 @@ ${a.bold('EXAMPLES:')}
|
|
|
7722
8067
|
|
|
7723
8068
|
`);
|
|
7724
8069
|
}
|
|
7725
|
-
async function
|
|
8070
|
+
async function br() {
|
|
7726
8071
|
let e = process.argv.slice(2),
|
|
7727
|
-
t =
|
|
8072
|
+
t = _t(e);
|
|
7728
8073
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
7729
|
-
|
|
8074
|
+
Wt();
|
|
7730
8075
|
return;
|
|
7731
8076
|
}
|
|
7732
8077
|
if (t.flags.has('version') || t.options.version || t.command === 'version') {
|
|
@@ -7753,14 +8098,14 @@ async function fr() {
|
|
|
7753
8098
|
}
|
|
7754
8099
|
case 'models':
|
|
7755
8100
|
case 'list': {
|
|
7756
|
-
await
|
|
8101
|
+
await Mt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
|
|
7757
8102
|
break;
|
|
7758
8103
|
}
|
|
7759
8104
|
case 'pricing':
|
|
7760
8105
|
case 'prices': {
|
|
7761
8106
|
let i = t.options.model,
|
|
7762
8107
|
r = t.subcommand || (typeof i == 'string' ? i : void 0);
|
|
7763
|
-
await
|
|
8108
|
+
await St({
|
|
7764
8109
|
model: r,
|
|
7765
8110
|
json: !!t.options.json,
|
|
7766
8111
|
apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
|
|
@@ -7775,12 +8120,12 @@ async function fr() {
|
|
|
7775
8120
|
process.stderr.write(`Usage: ${a.cyan('tein info <model-slug>')}
|
|
7776
8121
|
`),
|
|
7777
8122
|
process.exit(1)),
|
|
7778
|
-
await
|
|
8123
|
+
await Kt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
|
|
7779
8124
|
break;
|
|
7780
8125
|
}
|
|
7781
8126
|
case 'upload': {
|
|
7782
8127
|
let i = t.subcommand || '';
|
|
7783
|
-
await
|
|
8128
|
+
await Et(i, t.options);
|
|
7784
8129
|
break;
|
|
7785
8130
|
}
|
|
7786
8131
|
case 'run':
|
|
@@ -7791,11 +8136,11 @@ async function fr() {
|
|
|
7791
8136
|
}
|
|
7792
8137
|
case 'status': {
|
|
7793
8138
|
let i = t.subcommand || '';
|
|
7794
|
-
await
|
|
8139
|
+
await Ct(i, t.options);
|
|
7795
8140
|
break;
|
|
7796
8141
|
}
|
|
7797
8142
|
case 'mcp': {
|
|
7798
|
-
let { startStdioServer: i } = await Promise.resolve().then(() => (
|
|
8143
|
+
let { startStdioServer: i } = await Promise.resolve().then(() => (Ht(), Jt));
|
|
7799
8144
|
await i();
|
|
7800
8145
|
break;
|
|
7801
8146
|
}
|
|
@@ -7807,16 +8152,16 @@ async function fr() {
|
|
|
7807
8152
|
${a.red('Error:')} Unknown command or model "${t.command}".
|
|
7808
8153
|
Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for the model slugs.
|
|
7809
8154
|
`),
|
|
7810
|
-
process.exit(
|
|
8155
|
+
process.exit(I)),
|
|
7811
8156
|
await Ce(t.command, t.options));
|
|
7812
8157
|
return;
|
|
7813
8158
|
}
|
|
7814
|
-
|
|
8159
|
+
Wt();
|
|
7815
8160
|
break;
|
|
7816
8161
|
}
|
|
7817
8162
|
}
|
|
7818
8163
|
}
|
|
7819
|
-
|
|
8164
|
+
br().catch((e) => {
|
|
7820
8165
|
(e instanceof w &&
|
|
7821
8166
|
(process.stderr.write(`
|
|
7822
8167
|
${a.red('Error:')} ${M(e).join(`
|
|
@@ -7826,5 +8171,5 @@ ${a.red('Error:')} ${M(e).join(`
|
|
|
7826
8171
|
process.stderr.write(`
|
|
7827
8172
|
${a.red('Fatal error:')} ${e instanceof Error ? e.message : e}
|
|
7828
8173
|
`),
|
|
7829
|
-
process.exit(
|
|
8174
|
+
process.exit(I));
|
|
7830
8175
|
});
|