@teinai/cli 1.1.18 → 1.1.20
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 +2144 -1080
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,107 +1,107 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
if (
|
|
3
|
+
var sr = Object.create;
|
|
4
|
+
var ye = Object.defineProperty;
|
|
5
|
+
var nr = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var or = Object.getOwnPropertyNames;
|
|
7
|
+
var lr = Object.getPrototypeOf,
|
|
8
|
+
pr = Object.prototype.hasOwnProperty;
|
|
9
|
+
var y = (e, t, r) => () => {
|
|
10
|
+
if (r) throw r[0];
|
|
11
11
|
try {
|
|
12
12
|
return (e && (t = e((e = 0))), t);
|
|
13
|
-
} catch (
|
|
14
|
-
throw ((
|
|
13
|
+
} catch (i) {
|
|
14
|
+
throw ((r = [i]), i);
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
var
|
|
18
|
-
for (var
|
|
17
|
+
var dr = (e, t) => {
|
|
18
|
+
for (var r in t) ye(e, r, { get: t[r], enumerable: !0 });
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
cr = (e, t, r, i) => {
|
|
21
21
|
if ((t && typeof t == 'object') || typeof t == 'function')
|
|
22
|
-
for (let
|
|
23
|
-
!
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
for (let s of or(t))
|
|
23
|
+
!pr.call(e, s) &&
|
|
24
|
+
s !== r &&
|
|
25
|
+
ye(e, s, { get: () => t[s], enumerable: !(i = nr(t, s)) || i.enumerable });
|
|
26
26
|
return e;
|
|
27
27
|
};
|
|
28
|
-
var
|
|
29
|
-
(
|
|
30
|
-
|
|
28
|
+
var T = (e, t, r) => (
|
|
29
|
+
(r = e != null ? sr(lr(e)) : {}),
|
|
30
|
+
cr(t || !e || !e.__esModule ? ye(r, 'default', { value: e, enumerable: !0 }) : r, e)
|
|
31
31
|
);
|
|
32
|
-
function
|
|
32
|
+
function U() {
|
|
33
33
|
try {
|
|
34
|
-
if (
|
|
35
|
-
let e =
|
|
34
|
+
if (E.default.existsSync(N)) {
|
|
35
|
+
let e = E.default.readFileSync(N, 'utf-8');
|
|
36
36
|
return JSON.parse(e);
|
|
37
37
|
}
|
|
38
38
|
} catch {}
|
|
39
39
|
return {};
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function ke(e) {
|
|
42
42
|
try {
|
|
43
|
-
|
|
44
|
-
let
|
|
45
|
-
(
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
E.default.existsSync(te) || E.default.mkdirSync(te, { recursive: !0, mode: 448 });
|
|
44
|
+
let r = { ...U(), ...e };
|
|
45
|
+
(E.default.writeFileSync(N, JSON.stringify(r, null, 2), { encoding: 'utf-8', mode: 384 }),
|
|
46
|
+
E.default.chmodSync(te, 448),
|
|
47
|
+
E.default.chmodSync(N, 384));
|
|
48
48
|
} catch (t) {
|
|
49
|
-
throw new Error(`Failed to save config to ${
|
|
49
|
+
throw new Error(`Failed to save config to ${N}: ${t}`);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function q(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
|
|
57
|
-
return
|
|
56
|
+
let r = U();
|
|
57
|
+
return r.apiKey && r.apiKey.trim() ? r.apiKey.trim() : '';
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function P(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
|
|
64
|
-
return
|
|
63
|
+
let r = U();
|
|
64
|
+
return r.apiUrl && r.apiUrl.trim() ? r.apiUrl.trim().replace(/\/+$/, '') : 'https://api.tein.ai';
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
return
|
|
66
|
+
function re() {
|
|
67
|
+
return N;
|
|
68
68
|
}
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
var E,
|
|
70
|
+
Ze,
|
|
71
|
+
be,
|
|
72
72
|
te,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
N,
|
|
74
|
+
A = y(() => {
|
|
75
75
|
'use strict';
|
|
76
|
-
((
|
|
77
|
-
(
|
|
78
|
-
(
|
|
79
|
-
(te =
|
|
80
|
-
(
|
|
76
|
+
((E = T(require('node:fs'))),
|
|
77
|
+
(Ze = T(require('node:os'))),
|
|
78
|
+
(be = T(require('node:path'))),
|
|
79
|
+
(te = be.default.join(Ze.default.homedir(), '.tein')),
|
|
80
|
+
(N = be.default.join(te, 'config.json')));
|
|
81
81
|
});
|
|
82
|
-
var
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
var yr,
|
|
83
|
+
et,
|
|
84
|
+
tt,
|
|
85
|
+
rt = y(() => {
|
|
86
86
|
'use strict';
|
|
87
|
-
((
|
|
88
|
-
(
|
|
89
|
-
(
|
|
87
|
+
((yr = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4']),
|
|
88
|
+
(et = [...yr, 'auto']),
|
|
89
|
+
(tt =
|
|
90
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.'));
|
|
91
91
|
});
|
|
92
|
-
var
|
|
93
|
-
|
|
92
|
+
var G,
|
|
93
|
+
xe = y(() => {
|
|
94
94
|
'use strict';
|
|
95
|
-
|
|
95
|
+
G = new Set(['nano-banana-2.1', 'seedance-2-lite', 'seedance-2-5-lite']);
|
|
96
96
|
});
|
|
97
|
-
function
|
|
97
|
+
function ie(e) {
|
|
98
98
|
return !1;
|
|
99
99
|
}
|
|
100
|
-
var
|
|
100
|
+
var it = y(() => {
|
|
101
101
|
'use strict';
|
|
102
102
|
});
|
|
103
103
|
var ae,
|
|
104
|
-
|
|
104
|
+
at = y(() => {
|
|
105
105
|
'use strict';
|
|
106
106
|
ae = {
|
|
107
107
|
source: 'TEIN Price Board',
|
|
@@ -134,7 +134,7 @@ var ae,
|
|
|
134
134
|
'seedance-2-mini',
|
|
135
135
|
],
|
|
136
136
|
},
|
|
137
|
-
{ slug: 'seedream', name: 'Seedream', models: ['seedream-5-pro'] },
|
|
137
|
+
{ slug: 'seedream', name: 'Seedream', models: ['seedream-5-pro', 'seedream-5-5'] },
|
|
138
138
|
{ slug: 'seed', name: 'Seed', models: ['seed-audio-1-0', 'seed-2-1-turbo'] },
|
|
139
139
|
{ slug: 'wan', name: 'Wan', models: ['wan-3-0', 'wan-3-0-prime'] },
|
|
140
140
|
{ slug: 'happy-horse', name: 'HappyHorse', models: ['happy-horse-1-1', 'happy-horse-1-0'] },
|
|
@@ -149,7 +149,13 @@ var ae,
|
|
|
149
149
|
{
|
|
150
150
|
slug: 'gpt-image',
|
|
151
151
|
name: 'GPT Image',
|
|
152
|
-
models: [
|
|
152
|
+
models: [
|
|
153
|
+
'gpt-image-2',
|
|
154
|
+
'gpt-image-2.5-flare',
|
|
155
|
+
'gpt-image-2.5-sunburst',
|
|
156
|
+
'gpt-image-2.6-flare',
|
|
157
|
+
'gpt-image-2.6-sunburst',
|
|
158
|
+
],
|
|
153
159
|
},
|
|
154
160
|
{ slug: 'gpt', name: 'GPT', models: ['gpt-6-astra'] },
|
|
155
161
|
{
|
|
@@ -1250,6 +1256,53 @@ var ae,
|
|
|
1250
1256
|
axes: { resolution: ['1K', '2K'] },
|
|
1251
1257
|
from: { variant: '1k' },
|
|
1252
1258
|
},
|
|
1259
|
+
{
|
|
1260
|
+
slug: 'seedream-5-5',
|
|
1261
|
+
name: 'Seedream 5.5',
|
|
1262
|
+
family: 'seedream',
|
|
1263
|
+
vendor: 'ByteDance',
|
|
1264
|
+
desc: "ByteDance's newest image model: sharper realism and steadier multi-turn edits than 5.0 Pro, native transparent PNGs, and layer decomposition into a base image and up to 99 editable layers with typeset-text recognition. Creative mode available. Every input image is billed.",
|
|
1265
|
+
kind: 'image',
|
|
1266
|
+
unit: '/img',
|
|
1267
|
+
api: { model: 'seedream-5-5' },
|
|
1268
|
+
variants: [
|
|
1269
|
+
{
|
|
1270
|
+
id: '1k',
|
|
1271
|
+
price: { starter: 0.012, plus: 0.0114, scale: 0.0102 },
|
|
1272
|
+
label: '1K',
|
|
1273
|
+
resolution: '1K',
|
|
1274
|
+
unfiltered: { starter: 0.0126, plus: 0.0119, scale: 0.0107 },
|
|
1275
|
+
},
|
|
1276
|
+
{
|
|
1277
|
+
id: '1.5k',
|
|
1278
|
+
price: { starter: 0.012, plus: 0.0114, scale: 0.0102 },
|
|
1279
|
+
label: '1.5K',
|
|
1280
|
+
resolution: '1.5K',
|
|
1281
|
+
unfiltered: { starter: 0.0126, plus: 0.0119, scale: 0.0107 },
|
|
1282
|
+
},
|
|
1283
|
+
{
|
|
1284
|
+
id: '2k',
|
|
1285
|
+
price: { starter: 0.021, plus: 0.0199, scale: 0.0178 },
|
|
1286
|
+
label: '2K',
|
|
1287
|
+
resolution: '2K',
|
|
1288
|
+
unfiltered: { starter: 0.022, plus: 0.0208, scale: 0.0186 },
|
|
1289
|
+
},
|
|
1290
|
+
],
|
|
1291
|
+
unfiltered: 0.05,
|
|
1292
|
+
priority: null,
|
|
1293
|
+
draft: null,
|
|
1294
|
+
addons: [
|
|
1295
|
+
{
|
|
1296
|
+
id: 'image-input',
|
|
1297
|
+
price: { starter: 0.0048, plus: 0.0045, scale: 0.004 },
|
|
1298
|
+
label: 'Each input image',
|
|
1299
|
+
unit: '/input image',
|
|
1300
|
+
unfiltered: { starter: 0.005, plus: 0.0047, scale: 0.0042 },
|
|
1301
|
+
},
|
|
1302
|
+
],
|
|
1303
|
+
axes: { resolution: ['1K', '1.5K', '2K'] },
|
|
1304
|
+
from: { variant: '1k' },
|
|
1305
|
+
},
|
|
1253
1306
|
{
|
|
1254
1307
|
slug: 'seed-audio-1-0',
|
|
1255
1308
|
name: 'Seed Audio 1.0',
|
|
@@ -3270,99 +3323,989 @@ var ae,
|
|
|
3270
3323
|
},
|
|
3271
3324
|
},
|
|
3272
3325
|
{
|
|
3273
|
-
id: 'token-2k-low',
|
|
3274
|
-
price: { starter: 0.0125, plus: 0.0119, scale: 0.0107 },
|
|
3275
|
-
label: '2K \xB7 low',
|
|
3276
|
-
endpoint: 'token',
|
|
3326
|
+
id: 'token-2k-low',
|
|
3327
|
+
price: { starter: 0.0125, plus: 0.0119, scale: 0.0107 },
|
|
3328
|
+
label: '2K \xB7 low',
|
|
3329
|
+
endpoint: 'token',
|
|
3330
|
+
resolution: '2K',
|
|
3331
|
+
quality: 'low',
|
|
3332
|
+
mode: 'edit',
|
|
3333
|
+
acceptsImages: !0,
|
|
3334
|
+
note: '150-token prompt, no input images',
|
|
3335
|
+
token: {
|
|
3336
|
+
listTextInPerM: 5,
|
|
3337
|
+
listImageOutPerM: 30,
|
|
3338
|
+
listImageInPerM: 8,
|
|
3339
|
+
textInPerM: 4.95,
|
|
3340
|
+
imageOutPerM: 29.7,
|
|
3341
|
+
imageInPerM: 7.92,
|
|
3342
|
+
inputImageTokens: 256,
|
|
3343
|
+
promptTokens: 150,
|
|
3344
|
+
outputTokens: 397,
|
|
3345
|
+
maxPromptTokens: 1362,
|
|
3346
|
+
maxRefs: 2,
|
|
3347
|
+
},
|
|
3348
|
+
},
|
|
3349
|
+
{
|
|
3350
|
+
id: 'token-1k-medium',
|
|
3351
|
+
price: { starter: 0.0137, plus: 0.013, scale: 0.0117 },
|
|
3352
|
+
label: '1K \xB7 medium',
|
|
3353
|
+
endpoint: 'token',
|
|
3354
|
+
resolution: '1K',
|
|
3355
|
+
quality: 'medium',
|
|
3356
|
+
mode: 'edit',
|
|
3357
|
+
acceptsImages: !0,
|
|
3358
|
+
note: '150-token prompt, no input images',
|
|
3359
|
+
token: {
|
|
3360
|
+
listTextInPerM: 5,
|
|
3361
|
+
listImageOutPerM: 30,
|
|
3362
|
+
listImageInPerM: 8,
|
|
3363
|
+
textInPerM: 4.95,
|
|
3364
|
+
imageOutPerM: 29.7,
|
|
3365
|
+
imageInPerM: 7.92,
|
|
3366
|
+
inputImageTokens: 256,
|
|
3367
|
+
promptTokens: 150,
|
|
3368
|
+
outputTokens: 439,
|
|
3369
|
+
maxPromptTokens: 1109,
|
|
3370
|
+
maxRefs: 2,
|
|
3371
|
+
},
|
|
3372
|
+
},
|
|
3373
|
+
{
|
|
3374
|
+
id: 'flat-1k-any',
|
|
3375
|
+
price: { starter: 0.0274, plus: 0.026, scale: 0.0233 },
|
|
3376
|
+
label: '1K \xB7 any quality',
|
|
3377
|
+
endpoint: 'flat',
|
|
3378
|
+
resolution: '1K',
|
|
3379
|
+
quality: 'any',
|
|
3380
|
+
mode: 'edit',
|
|
3381
|
+
acceptsImages: !0,
|
|
3382
|
+
perInputImage: 0,
|
|
3383
|
+
},
|
|
3384
|
+
{
|
|
3385
|
+
id: 'flat-2k-any',
|
|
3386
|
+
price: { starter: 0.0457, plus: 0.0434, scale: 0.0389 },
|
|
3387
|
+
label: '2K \xB7 any quality',
|
|
3388
|
+
endpoint: 'flat',
|
|
3389
|
+
resolution: '2K',
|
|
3390
|
+
quality: 'any',
|
|
3391
|
+
mode: 'edit',
|
|
3392
|
+
acceptsImages: !0,
|
|
3393
|
+
perInputImage: 0,
|
|
3394
|
+
},
|
|
3395
|
+
{
|
|
3396
|
+
id: 'flat-4k-any',
|
|
3397
|
+
price: { starter: 0.0731, plus: 0.0694, scale: 0.0622 },
|
|
3398
|
+
label: '4K \xB7 any quality',
|
|
3399
|
+
endpoint: 'flat',
|
|
3400
|
+
resolution: '4K',
|
|
3401
|
+
quality: 'any',
|
|
3402
|
+
mode: 'edit',
|
|
3403
|
+
acceptsImages: !0,
|
|
3404
|
+
perInputImage: 0,
|
|
3405
|
+
},
|
|
3406
|
+
],
|
|
3407
|
+
endpoints: [
|
|
3408
|
+
{ id: 'token', label: 'Token', recommended: !0 },
|
|
3409
|
+
{ id: 'dynamic', label: 'Dynamic' },
|
|
3410
|
+
{ id: 'flat', label: 'Flat', verified: !0 },
|
|
3411
|
+
],
|
|
3412
|
+
defaultEndpoint: 'token',
|
|
3413
|
+
axes: {
|
|
3414
|
+
quality: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
3415
|
+
resolution: ['1K', '2K', '4K'],
|
|
3416
|
+
mode: ['text-to-image', 'edit'],
|
|
3417
|
+
},
|
|
3418
|
+
from: { variant: 'token-1k-low' },
|
|
3419
|
+
},
|
|
3420
|
+
{
|
|
3421
|
+
slug: 'gpt-image-2.6-flare',
|
|
3422
|
+
name: 'GPT Image 2.6 Flare',
|
|
3423
|
+
family: 'gpt-image',
|
|
3424
|
+
vendor: 'OpenAI',
|
|
3425
|
+
desc: "GPT Image 2.6 Flare \u2014 OpenAI's GPT Image 2.6, served by OpenAI. One price per quality and size.",
|
|
3426
|
+
kind: 'image',
|
|
3427
|
+
unit: '/img',
|
|
3428
|
+
api: { model: 'gpt-image-2.6-flare' },
|
|
3429
|
+
variants: [
|
|
3430
|
+
{
|
|
3431
|
+
id: 'dynamic-1k-low',
|
|
3432
|
+
price: { starter: 0.0323, plus: 0.0298, scale: 0.0285 },
|
|
3433
|
+
label: '1K \xB7 low',
|
|
3434
|
+
endpoint: 'dynamic',
|
|
3435
|
+
resolution: '1K',
|
|
3436
|
+
quality: 'low',
|
|
3437
|
+
mode: 'text-to-image',
|
|
3438
|
+
acceptsImages: !1,
|
|
3439
|
+
promptIncludedTokens: 144,
|
|
3440
|
+
extraPromptPerM: 6.5,
|
|
3441
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3442
|
+
},
|
|
3443
|
+
{
|
|
3444
|
+
id: 'dynamic-2k-low',
|
|
3445
|
+
price: { starter: 0.0652, plus: 0.0602, scale: 0.0577 },
|
|
3446
|
+
label: '2K \xB7 low',
|
|
3447
|
+
endpoint: 'dynamic',
|
|
3448
|
+
resolution: '2K',
|
|
3449
|
+
quality: 'low',
|
|
3450
|
+
mode: 'text-to-image',
|
|
3451
|
+
acceptsImages: !1,
|
|
3452
|
+
promptIncludedTokens: 144,
|
|
3453
|
+
extraPromptPerM: 6.5,
|
|
3454
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3455
|
+
},
|
|
3456
|
+
{
|
|
3457
|
+
id: 'dynamic-4k-low',
|
|
3458
|
+
price: { starter: 0.1081, plus: 0.0998, scale: 0.0956 },
|
|
3459
|
+
label: '4K \xB7 low',
|
|
3460
|
+
endpoint: 'dynamic',
|
|
3461
|
+
resolution: '4K',
|
|
3462
|
+
quality: 'low',
|
|
3463
|
+
mode: 'text-to-image',
|
|
3464
|
+
acceptsImages: !1,
|
|
3465
|
+
promptIncludedTokens: 144,
|
|
3466
|
+
extraPromptPerM: 6.5,
|
|
3467
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3468
|
+
},
|
|
3469
|
+
{
|
|
3470
|
+
id: 'dynamic-1k-medium',
|
|
3471
|
+
price: { starter: 0.0566, plus: 0.0523, scale: 0.0501 },
|
|
3472
|
+
label: '1K \xB7 medium',
|
|
3473
|
+
endpoint: 'dynamic',
|
|
3474
|
+
resolution: '1K',
|
|
3475
|
+
quality: 'medium',
|
|
3476
|
+
mode: 'text-to-image',
|
|
3477
|
+
acceptsImages: !1,
|
|
3478
|
+
promptIncludedTokens: 144,
|
|
3479
|
+
extraPromptPerM: 6.5,
|
|
3480
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3481
|
+
},
|
|
3482
|
+
{
|
|
3483
|
+
id: 'dynamic-2k-medium',
|
|
3484
|
+
price: { starter: 0.1149, plus: 0.1061, scale: 0.1017 },
|
|
3485
|
+
label: '2K \xB7 medium',
|
|
3486
|
+
endpoint: 'dynamic',
|
|
3487
|
+
resolution: '2K',
|
|
3488
|
+
quality: 'medium',
|
|
3489
|
+
mode: 'text-to-image',
|
|
3490
|
+
acceptsImages: !1,
|
|
3491
|
+
promptIncludedTokens: 144,
|
|
3492
|
+
extraPromptPerM: 6.5,
|
|
3493
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3494
|
+
},
|
|
3495
|
+
{
|
|
3496
|
+
id: 'dynamic-4k-medium',
|
|
3497
|
+
price: { starter: 0.191, plus: 0.1763, scale: 0.169 },
|
|
3498
|
+
label: '4K \xB7 medium',
|
|
3499
|
+
endpoint: 'dynamic',
|
|
3500
|
+
resolution: '4K',
|
|
3501
|
+
quality: 'medium',
|
|
3502
|
+
mode: 'text-to-image',
|
|
3503
|
+
acceptsImages: !1,
|
|
3504
|
+
promptIncludedTokens: 144,
|
|
3505
|
+
extraPromptPerM: 6.5,
|
|
3506
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3507
|
+
},
|
|
3508
|
+
{
|
|
3509
|
+
id: 'dynamic-1k-high',
|
|
3510
|
+
price: { starter: 0.0687, plus: 0.0634, scale: 0.0607 },
|
|
3511
|
+
label: '1K \xB7 high',
|
|
3512
|
+
endpoint: 'dynamic',
|
|
3513
|
+
resolution: '1K',
|
|
3514
|
+
quality: 'high',
|
|
3515
|
+
mode: 'text-to-image',
|
|
3516
|
+
acceptsImages: !1,
|
|
3517
|
+
promptIncludedTokens: 144,
|
|
3518
|
+
extraPromptPerM: 6.5,
|
|
3519
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3520
|
+
},
|
|
3521
|
+
{
|
|
3522
|
+
id: 'dynamic-2k-high',
|
|
3523
|
+
price: { starter: 0.1393, plus: 0.1286, scale: 0.1232 },
|
|
3524
|
+
label: '2K \xB7 high',
|
|
3525
|
+
endpoint: 'dynamic',
|
|
3526
|
+
resolution: '2K',
|
|
3527
|
+
quality: 'high',
|
|
3528
|
+
mode: 'text-to-image',
|
|
3529
|
+
acceptsImages: !1,
|
|
3530
|
+
promptIncludedTokens: 144,
|
|
3531
|
+
extraPromptPerM: 6.5,
|
|
3532
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3533
|
+
},
|
|
3534
|
+
{
|
|
3535
|
+
id: 'dynamic-4k-high',
|
|
3536
|
+
price: { starter: 0.2314, plus: 0.2136, scale: 0.2047 },
|
|
3537
|
+
label: '4K \xB7 high',
|
|
3538
|
+
endpoint: 'dynamic',
|
|
3539
|
+
resolution: '4K',
|
|
3540
|
+
quality: 'high',
|
|
3541
|
+
mode: 'text-to-image',
|
|
3542
|
+
acceptsImages: !1,
|
|
3543
|
+
promptIncludedTokens: 144,
|
|
3544
|
+
extraPromptPerM: 6.5,
|
|
3545
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3546
|
+
},
|
|
3547
|
+
{
|
|
3548
|
+
id: 'dynamic-1k-xhigh',
|
|
3549
|
+
price: { starter: 0.1219, plus: 0.1125, scale: 0.1078 },
|
|
3550
|
+
label: '1K \xB7 xhigh',
|
|
3551
|
+
endpoint: 'dynamic',
|
|
3552
|
+
resolution: '1K',
|
|
3553
|
+
quality: 'xhigh',
|
|
3554
|
+
mode: 'text-to-image',
|
|
3555
|
+
acceptsImages: !1,
|
|
3556
|
+
promptIncludedTokens: 144,
|
|
3557
|
+
extraPromptPerM: 6.5,
|
|
3558
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3559
|
+
},
|
|
3560
|
+
{
|
|
3561
|
+
id: 'dynamic-2k-xhigh',
|
|
3562
|
+
price: { starter: 0.2475, plus: 0.2285, scale: 0.2189 },
|
|
3563
|
+
label: '2K \xB7 xhigh',
|
|
3564
|
+
endpoint: 'dynamic',
|
|
3565
|
+
resolution: '2K',
|
|
3566
|
+
quality: 'xhigh',
|
|
3567
|
+
mode: 'text-to-image',
|
|
3568
|
+
acceptsImages: !1,
|
|
3569
|
+
promptIncludedTokens: 144,
|
|
3570
|
+
extraPromptPerM: 6.5,
|
|
3571
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3572
|
+
},
|
|
3573
|
+
{
|
|
3574
|
+
id: 'dynamic-4k-xhigh',
|
|
3575
|
+
price: { starter: 0.4113, plus: 0.3796, scale: 0.3638 },
|
|
3576
|
+
label: '4K \xB7 xhigh',
|
|
3577
|
+
endpoint: 'dynamic',
|
|
3578
|
+
resolution: '4K',
|
|
3579
|
+
quality: 'xhigh',
|
|
3580
|
+
mode: 'text-to-image',
|
|
3581
|
+
acceptsImages: !1,
|
|
3582
|
+
promptIncludedTokens: 144,
|
|
3583
|
+
extraPromptPerM: 6.5,
|
|
3584
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3585
|
+
},
|
|
3586
|
+
{
|
|
3587
|
+
id: 'dynamic-1k-max',
|
|
3588
|
+
price: { starter: 0.2741, plus: 0.253, scale: 0.2424 },
|
|
3589
|
+
label: '1K \xB7 max',
|
|
3590
|
+
endpoint: 'dynamic',
|
|
3591
|
+
resolution: '1K',
|
|
3592
|
+
quality: 'max',
|
|
3593
|
+
mode: 'text-to-image',
|
|
3594
|
+
acceptsImages: !1,
|
|
3595
|
+
promptIncludedTokens: 144,
|
|
3596
|
+
extraPromptPerM: 6.5,
|
|
3597
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3598
|
+
},
|
|
3599
|
+
{
|
|
3600
|
+
id: 'dynamic-2k-max',
|
|
3601
|
+
price: { starter: 0.5567, plus: 0.5139, scale: 0.4925 },
|
|
3602
|
+
label: '2K \xB7 max',
|
|
3603
|
+
endpoint: 'dynamic',
|
|
3604
|
+
resolution: '2K',
|
|
3605
|
+
quality: 'max',
|
|
3606
|
+
mode: 'text-to-image',
|
|
3607
|
+
acceptsImages: !1,
|
|
3608
|
+
promptIncludedTokens: 144,
|
|
3609
|
+
extraPromptPerM: 6.5,
|
|
3610
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3611
|
+
},
|
|
3612
|
+
{
|
|
3613
|
+
id: 'dynamic-4k-max',
|
|
3614
|
+
price: { starter: 0.9252, plus: 0.854, scale: 0.8184 },
|
|
3615
|
+
label: '4K \xB7 max',
|
|
3616
|
+
endpoint: 'dynamic',
|
|
3617
|
+
resolution: '4K',
|
|
3618
|
+
quality: 'max',
|
|
3619
|
+
mode: 'text-to-image',
|
|
3620
|
+
acceptsImages: !1,
|
|
3621
|
+
promptIncludedTokens: 144,
|
|
3622
|
+
extraPromptPerM: 6.5,
|
|
3623
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3624
|
+
},
|
|
3625
|
+
],
|
|
3626
|
+
unfiltered: null,
|
|
3627
|
+
priority: null,
|
|
3628
|
+
draft: null,
|
|
3629
|
+
editVariants: [
|
|
3630
|
+
{
|
|
3631
|
+
id: 'dynamic-1k-low',
|
|
3632
|
+
price: { starter: 0.0323, plus: 0.0298, scale: 0.0285 },
|
|
3633
|
+
label: '1K \xB7 low',
|
|
3634
|
+
endpoint: 'dynamic',
|
|
3635
|
+
resolution: '1K',
|
|
3636
|
+
quality: 'low',
|
|
3637
|
+
mode: 'edit',
|
|
3638
|
+
acceptsImages: !0,
|
|
3639
|
+
perInputImage: 0.0027,
|
|
3640
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3641
|
+
promptIncludedTokens: 144,
|
|
3642
|
+
extraPromptPerM: 6.5,
|
|
3643
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3644
|
+
},
|
|
3645
|
+
{
|
|
3646
|
+
id: 'dynamic-2k-low',
|
|
3647
|
+
price: { starter: 0.0652, plus: 0.0602, scale: 0.0577 },
|
|
3648
|
+
label: '2K \xB7 low',
|
|
3649
|
+
endpoint: 'dynamic',
|
|
3650
|
+
resolution: '2K',
|
|
3651
|
+
quality: 'low',
|
|
3652
|
+
mode: 'edit',
|
|
3653
|
+
acceptsImages: !0,
|
|
3654
|
+
perInputImage: 0.0027,
|
|
3655
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3656
|
+
promptIncludedTokens: 144,
|
|
3657
|
+
extraPromptPerM: 6.5,
|
|
3658
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3659
|
+
},
|
|
3660
|
+
{
|
|
3661
|
+
id: 'dynamic-4k-low',
|
|
3662
|
+
price: { starter: 0.1081, plus: 0.0998, scale: 0.0956 },
|
|
3663
|
+
label: '4K \xB7 low',
|
|
3664
|
+
endpoint: 'dynamic',
|
|
3665
|
+
resolution: '4K',
|
|
3666
|
+
quality: 'low',
|
|
3667
|
+
mode: 'edit',
|
|
3668
|
+
acceptsImages: !0,
|
|
3669
|
+
perInputImage: 0.0027,
|
|
3670
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3671
|
+
promptIncludedTokens: 144,
|
|
3672
|
+
extraPromptPerM: 6.5,
|
|
3673
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3674
|
+
},
|
|
3675
|
+
{
|
|
3676
|
+
id: 'dynamic-1k-medium',
|
|
3677
|
+
price: { starter: 0.0566, plus: 0.0523, scale: 0.0501 },
|
|
3678
|
+
label: '1K \xB7 medium',
|
|
3679
|
+
endpoint: 'dynamic',
|
|
3680
|
+
resolution: '1K',
|
|
3681
|
+
quality: 'medium',
|
|
3682
|
+
mode: 'edit',
|
|
3683
|
+
acceptsImages: !0,
|
|
3684
|
+
perInputImage: 0.0027,
|
|
3685
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3686
|
+
promptIncludedTokens: 144,
|
|
3687
|
+
extraPromptPerM: 6.5,
|
|
3688
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3689
|
+
},
|
|
3690
|
+
{
|
|
3691
|
+
id: 'dynamic-2k-medium',
|
|
3692
|
+
price: { starter: 0.1149, plus: 0.1061, scale: 0.1017 },
|
|
3693
|
+
label: '2K \xB7 medium',
|
|
3694
|
+
endpoint: 'dynamic',
|
|
3695
|
+
resolution: '2K',
|
|
3696
|
+
quality: 'medium',
|
|
3697
|
+
mode: 'edit',
|
|
3698
|
+
acceptsImages: !0,
|
|
3699
|
+
perInputImage: 0.0027,
|
|
3700
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3701
|
+
promptIncludedTokens: 144,
|
|
3702
|
+
extraPromptPerM: 6.5,
|
|
3703
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3704
|
+
},
|
|
3705
|
+
{
|
|
3706
|
+
id: 'dynamic-4k-medium',
|
|
3707
|
+
price: { starter: 0.191, plus: 0.1763, scale: 0.169 },
|
|
3708
|
+
label: '4K \xB7 medium',
|
|
3709
|
+
endpoint: 'dynamic',
|
|
3710
|
+
resolution: '4K',
|
|
3711
|
+
quality: 'medium',
|
|
3712
|
+
mode: 'edit',
|
|
3713
|
+
acceptsImages: !0,
|
|
3714
|
+
perInputImage: 0.0027,
|
|
3715
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3716
|
+
promptIncludedTokens: 144,
|
|
3717
|
+
extraPromptPerM: 6.5,
|
|
3718
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3719
|
+
},
|
|
3720
|
+
{
|
|
3721
|
+
id: 'dynamic-1k-high',
|
|
3722
|
+
price: { starter: 0.0687, plus: 0.0634, scale: 0.0607 },
|
|
3723
|
+
label: '1K \xB7 high',
|
|
3724
|
+
endpoint: 'dynamic',
|
|
3725
|
+
resolution: '1K',
|
|
3726
|
+
quality: 'high',
|
|
3727
|
+
mode: 'edit',
|
|
3728
|
+
acceptsImages: !0,
|
|
3729
|
+
perInputImage: 0.0027,
|
|
3730
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3731
|
+
promptIncludedTokens: 144,
|
|
3732
|
+
extraPromptPerM: 6.5,
|
|
3733
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3734
|
+
},
|
|
3735
|
+
{
|
|
3736
|
+
id: 'dynamic-2k-high',
|
|
3737
|
+
price: { starter: 0.1393, plus: 0.1286, scale: 0.1232 },
|
|
3738
|
+
label: '2K \xB7 high',
|
|
3739
|
+
endpoint: 'dynamic',
|
|
3740
|
+
resolution: '2K',
|
|
3741
|
+
quality: 'high',
|
|
3742
|
+
mode: 'edit',
|
|
3743
|
+
acceptsImages: !0,
|
|
3744
|
+
perInputImage: 0.0027,
|
|
3745
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3746
|
+
promptIncludedTokens: 144,
|
|
3747
|
+
extraPromptPerM: 6.5,
|
|
3748
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3749
|
+
},
|
|
3750
|
+
{
|
|
3751
|
+
id: 'dynamic-4k-high',
|
|
3752
|
+
price: { starter: 0.2314, plus: 0.2136, scale: 0.2047 },
|
|
3753
|
+
label: '4K \xB7 high',
|
|
3754
|
+
endpoint: 'dynamic',
|
|
3755
|
+
resolution: '4K',
|
|
3756
|
+
quality: 'high',
|
|
3757
|
+
mode: 'edit',
|
|
3758
|
+
acceptsImages: !0,
|
|
3759
|
+
perInputImage: 0.0027,
|
|
3760
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3761
|
+
promptIncludedTokens: 144,
|
|
3762
|
+
extraPromptPerM: 6.5,
|
|
3763
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3764
|
+
},
|
|
3765
|
+
{
|
|
3766
|
+
id: 'dynamic-1k-xhigh',
|
|
3767
|
+
price: { starter: 0.1219, plus: 0.1125, scale: 0.1078 },
|
|
3768
|
+
label: '1K \xB7 xhigh',
|
|
3769
|
+
endpoint: 'dynamic',
|
|
3770
|
+
resolution: '1K',
|
|
3771
|
+
quality: 'xhigh',
|
|
3772
|
+
mode: 'edit',
|
|
3773
|
+
acceptsImages: !0,
|
|
3774
|
+
perInputImage: 0.0027,
|
|
3775
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3776
|
+
promptIncludedTokens: 144,
|
|
3777
|
+
extraPromptPerM: 6.5,
|
|
3778
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3779
|
+
},
|
|
3780
|
+
{
|
|
3781
|
+
id: 'dynamic-2k-xhigh',
|
|
3782
|
+
price: { starter: 0.2475, plus: 0.2285, scale: 0.2189 },
|
|
3783
|
+
label: '2K \xB7 xhigh',
|
|
3784
|
+
endpoint: 'dynamic',
|
|
3785
|
+
resolution: '2K',
|
|
3786
|
+
quality: 'xhigh',
|
|
3787
|
+
mode: 'edit',
|
|
3788
|
+
acceptsImages: !0,
|
|
3789
|
+
perInputImage: 0.0027,
|
|
3790
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3791
|
+
promptIncludedTokens: 144,
|
|
3792
|
+
extraPromptPerM: 6.5,
|
|
3793
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3794
|
+
},
|
|
3795
|
+
{
|
|
3796
|
+
id: 'dynamic-4k-xhigh',
|
|
3797
|
+
price: { starter: 0.4113, plus: 0.3796, scale: 0.3638 },
|
|
3798
|
+
label: '4K \xB7 xhigh',
|
|
3799
|
+
endpoint: 'dynamic',
|
|
3800
|
+
resolution: '4K',
|
|
3801
|
+
quality: 'xhigh',
|
|
3802
|
+
mode: 'edit',
|
|
3803
|
+
acceptsImages: !0,
|
|
3804
|
+
perInputImage: 0.0027,
|
|
3805
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3806
|
+
promptIncludedTokens: 144,
|
|
3807
|
+
extraPromptPerM: 6.5,
|
|
3808
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3809
|
+
},
|
|
3810
|
+
{
|
|
3811
|
+
id: 'dynamic-1k-max',
|
|
3812
|
+
price: { starter: 0.2741, plus: 0.253, scale: 0.2424 },
|
|
3813
|
+
label: '1K \xB7 max',
|
|
3814
|
+
endpoint: 'dynamic',
|
|
3815
|
+
resolution: '1K',
|
|
3816
|
+
quality: 'max',
|
|
3817
|
+
mode: 'edit',
|
|
3818
|
+
acceptsImages: !0,
|
|
3819
|
+
perInputImage: 0.0027,
|
|
3820
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3821
|
+
promptIncludedTokens: 144,
|
|
3822
|
+
extraPromptPerM: 6.5,
|
|
3823
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3824
|
+
},
|
|
3825
|
+
{
|
|
3826
|
+
id: 'dynamic-2k-max',
|
|
3827
|
+
price: { starter: 0.5567, plus: 0.5139, scale: 0.4925 },
|
|
3828
|
+
label: '2K \xB7 max',
|
|
3829
|
+
endpoint: 'dynamic',
|
|
3830
|
+
resolution: '2K',
|
|
3831
|
+
quality: 'max',
|
|
3832
|
+
mode: 'edit',
|
|
3833
|
+
acceptsImages: !0,
|
|
3834
|
+
perInputImage: 0.0027,
|
|
3835
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3836
|
+
promptIncludedTokens: 144,
|
|
3837
|
+
extraPromptPerM: 6.5,
|
|
3838
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3839
|
+
},
|
|
3840
|
+
{
|
|
3841
|
+
id: 'dynamic-4k-max',
|
|
3842
|
+
price: { starter: 0.9252, plus: 0.854, scale: 0.8184 },
|
|
3843
|
+
label: '4K \xB7 max',
|
|
3844
|
+
endpoint: 'dynamic',
|
|
3845
|
+
resolution: '4K',
|
|
3846
|
+
quality: 'max',
|
|
3847
|
+
mode: 'edit',
|
|
3848
|
+
acceptsImages: !0,
|
|
3849
|
+
perInputImage: 0.0027,
|
|
3850
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3851
|
+
promptIncludedTokens: 144,
|
|
3852
|
+
extraPromptPerM: 6.5,
|
|
3853
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3854
|
+
},
|
|
3855
|
+
],
|
|
3856
|
+
endpoints: [{ id: 'dynamic', label: 'Dynamic', recommended: !0 }],
|
|
3857
|
+
defaultEndpoint: 'dynamic',
|
|
3858
|
+
axes: {
|
|
3859
|
+
quality: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
3860
|
+
resolution: ['1K', '2K', '4K'],
|
|
3861
|
+
mode: ['text-to-image', 'edit'],
|
|
3862
|
+
},
|
|
3863
|
+
from: { variant: 'dynamic-1k-low' },
|
|
3864
|
+
},
|
|
3865
|
+
{
|
|
3866
|
+
slug: 'gpt-image-2.6-sunburst',
|
|
3867
|
+
name: 'GPT Image 2.6 Sunburst',
|
|
3868
|
+
family: 'gpt-image',
|
|
3869
|
+
vendor: 'OpenAI',
|
|
3870
|
+
desc: "GPT Image 2.6 Sunburst \u2014 OpenAI's GPT Image 2.6, served by OpenAI. One price per quality and size.",
|
|
3871
|
+
kind: 'image',
|
|
3872
|
+
unit: '/img',
|
|
3873
|
+
api: { model: 'gpt-image-2.6-sunburst' },
|
|
3874
|
+
variants: [
|
|
3875
|
+
{
|
|
3876
|
+
id: 'dynamic-1k-low',
|
|
3877
|
+
price: { starter: 0.0323, plus: 0.0298, scale: 0.0285 },
|
|
3878
|
+
label: '1K \xB7 low',
|
|
3879
|
+
endpoint: 'dynamic',
|
|
3880
|
+
resolution: '1K',
|
|
3881
|
+
quality: 'low',
|
|
3882
|
+
mode: 'text-to-image',
|
|
3883
|
+
acceptsImages: !1,
|
|
3884
|
+
promptIncludedTokens: 144,
|
|
3885
|
+
extraPromptPerM: 6.5,
|
|
3886
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3887
|
+
},
|
|
3888
|
+
{
|
|
3889
|
+
id: 'dynamic-2k-low',
|
|
3890
|
+
price: { starter: 0.0652, plus: 0.0602, scale: 0.0577 },
|
|
3891
|
+
label: '2K \xB7 low',
|
|
3892
|
+
endpoint: 'dynamic',
|
|
3893
|
+
resolution: '2K',
|
|
3894
|
+
quality: 'low',
|
|
3895
|
+
mode: 'text-to-image',
|
|
3896
|
+
acceptsImages: !1,
|
|
3897
|
+
promptIncludedTokens: 144,
|
|
3898
|
+
extraPromptPerM: 6.5,
|
|
3899
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3900
|
+
},
|
|
3901
|
+
{
|
|
3902
|
+
id: 'dynamic-4k-low',
|
|
3903
|
+
price: { starter: 0.1081, plus: 0.0998, scale: 0.0956 },
|
|
3904
|
+
label: '4K \xB7 low',
|
|
3905
|
+
endpoint: 'dynamic',
|
|
3906
|
+
resolution: '4K',
|
|
3907
|
+
quality: 'low',
|
|
3908
|
+
mode: 'text-to-image',
|
|
3909
|
+
acceptsImages: !1,
|
|
3910
|
+
promptIncludedTokens: 144,
|
|
3911
|
+
extraPromptPerM: 6.5,
|
|
3912
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3913
|
+
},
|
|
3914
|
+
{
|
|
3915
|
+
id: 'dynamic-1k-medium',
|
|
3916
|
+
price: { starter: 0.0566, plus: 0.0523, scale: 0.0501 },
|
|
3917
|
+
label: '1K \xB7 medium',
|
|
3918
|
+
endpoint: 'dynamic',
|
|
3919
|
+
resolution: '1K',
|
|
3920
|
+
quality: 'medium',
|
|
3921
|
+
mode: 'text-to-image',
|
|
3922
|
+
acceptsImages: !1,
|
|
3923
|
+
promptIncludedTokens: 144,
|
|
3924
|
+
extraPromptPerM: 6.5,
|
|
3925
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3926
|
+
},
|
|
3927
|
+
{
|
|
3928
|
+
id: 'dynamic-2k-medium',
|
|
3929
|
+
price: { starter: 0.1149, plus: 0.1061, scale: 0.1017 },
|
|
3930
|
+
label: '2K \xB7 medium',
|
|
3931
|
+
endpoint: 'dynamic',
|
|
3932
|
+
resolution: '2K',
|
|
3933
|
+
quality: 'medium',
|
|
3934
|
+
mode: 'text-to-image',
|
|
3935
|
+
acceptsImages: !1,
|
|
3936
|
+
promptIncludedTokens: 144,
|
|
3937
|
+
extraPromptPerM: 6.5,
|
|
3938
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3939
|
+
},
|
|
3940
|
+
{
|
|
3941
|
+
id: 'dynamic-4k-medium',
|
|
3942
|
+
price: { starter: 0.191, plus: 0.1763, scale: 0.169 },
|
|
3943
|
+
label: '4K \xB7 medium',
|
|
3944
|
+
endpoint: 'dynamic',
|
|
3945
|
+
resolution: '4K',
|
|
3946
|
+
quality: 'medium',
|
|
3947
|
+
mode: 'text-to-image',
|
|
3948
|
+
acceptsImages: !1,
|
|
3949
|
+
promptIncludedTokens: 144,
|
|
3950
|
+
extraPromptPerM: 6.5,
|
|
3951
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3952
|
+
},
|
|
3953
|
+
{
|
|
3954
|
+
id: 'dynamic-1k-high',
|
|
3955
|
+
price: { starter: 0.0687, plus: 0.0634, scale: 0.0607 },
|
|
3956
|
+
label: '1K \xB7 high',
|
|
3957
|
+
endpoint: 'dynamic',
|
|
3958
|
+
resolution: '1K',
|
|
3959
|
+
quality: 'high',
|
|
3960
|
+
mode: 'text-to-image',
|
|
3961
|
+
acceptsImages: !1,
|
|
3962
|
+
promptIncludedTokens: 144,
|
|
3963
|
+
extraPromptPerM: 6.5,
|
|
3964
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3965
|
+
},
|
|
3966
|
+
{
|
|
3967
|
+
id: 'dynamic-2k-high',
|
|
3968
|
+
price: { starter: 0.1393, plus: 0.1286, scale: 0.1232 },
|
|
3969
|
+
label: '2K \xB7 high',
|
|
3970
|
+
endpoint: 'dynamic',
|
|
3971
|
+
resolution: '2K',
|
|
3972
|
+
quality: 'high',
|
|
3973
|
+
mode: 'text-to-image',
|
|
3974
|
+
acceptsImages: !1,
|
|
3975
|
+
promptIncludedTokens: 144,
|
|
3976
|
+
extraPromptPerM: 6.5,
|
|
3977
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3978
|
+
},
|
|
3979
|
+
{
|
|
3980
|
+
id: 'dynamic-4k-high',
|
|
3981
|
+
price: { starter: 0.2314, plus: 0.2136, scale: 0.2047 },
|
|
3982
|
+
label: '4K \xB7 high',
|
|
3983
|
+
endpoint: 'dynamic',
|
|
3984
|
+
resolution: '4K',
|
|
3985
|
+
quality: 'high',
|
|
3986
|
+
mode: 'text-to-image',
|
|
3987
|
+
acceptsImages: !1,
|
|
3988
|
+
promptIncludedTokens: 144,
|
|
3989
|
+
extraPromptPerM: 6.5,
|
|
3990
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3991
|
+
},
|
|
3992
|
+
{
|
|
3993
|
+
id: 'dynamic-1k-xhigh',
|
|
3994
|
+
price: { starter: 0.1219, plus: 0.1125, scale: 0.1078 },
|
|
3995
|
+
label: '1K \xB7 xhigh',
|
|
3996
|
+
endpoint: 'dynamic',
|
|
3997
|
+
resolution: '1K',
|
|
3998
|
+
quality: 'xhigh',
|
|
3999
|
+
mode: 'text-to-image',
|
|
4000
|
+
acceptsImages: !1,
|
|
4001
|
+
promptIncludedTokens: 144,
|
|
4002
|
+
extraPromptPerM: 6.5,
|
|
4003
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4004
|
+
},
|
|
4005
|
+
{
|
|
4006
|
+
id: 'dynamic-2k-xhigh',
|
|
4007
|
+
price: { starter: 0.2475, plus: 0.2285, scale: 0.2189 },
|
|
4008
|
+
label: '2K \xB7 xhigh',
|
|
4009
|
+
endpoint: 'dynamic',
|
|
4010
|
+
resolution: '2K',
|
|
4011
|
+
quality: 'xhigh',
|
|
4012
|
+
mode: 'text-to-image',
|
|
4013
|
+
acceptsImages: !1,
|
|
4014
|
+
promptIncludedTokens: 144,
|
|
4015
|
+
extraPromptPerM: 6.5,
|
|
4016
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4017
|
+
},
|
|
4018
|
+
{
|
|
4019
|
+
id: 'dynamic-4k-xhigh',
|
|
4020
|
+
price: { starter: 0.4113, plus: 0.3796, scale: 0.3638 },
|
|
4021
|
+
label: '4K \xB7 xhigh',
|
|
4022
|
+
endpoint: 'dynamic',
|
|
4023
|
+
resolution: '4K',
|
|
4024
|
+
quality: 'xhigh',
|
|
4025
|
+
mode: 'text-to-image',
|
|
4026
|
+
acceptsImages: !1,
|
|
4027
|
+
promptIncludedTokens: 144,
|
|
4028
|
+
extraPromptPerM: 6.5,
|
|
4029
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4030
|
+
},
|
|
4031
|
+
{
|
|
4032
|
+
id: 'dynamic-1k-max',
|
|
4033
|
+
price: { starter: 0.2741, plus: 0.253, scale: 0.2424 },
|
|
4034
|
+
label: '1K \xB7 max',
|
|
4035
|
+
endpoint: 'dynamic',
|
|
4036
|
+
resolution: '1K',
|
|
4037
|
+
quality: 'max',
|
|
4038
|
+
mode: 'text-to-image',
|
|
4039
|
+
acceptsImages: !1,
|
|
4040
|
+
promptIncludedTokens: 144,
|
|
4041
|
+
extraPromptPerM: 6.5,
|
|
4042
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4043
|
+
},
|
|
4044
|
+
{
|
|
4045
|
+
id: 'dynamic-2k-max',
|
|
4046
|
+
price: { starter: 0.5567, plus: 0.5139, scale: 0.4925 },
|
|
4047
|
+
label: '2K \xB7 max',
|
|
4048
|
+
endpoint: 'dynamic',
|
|
4049
|
+
resolution: '2K',
|
|
4050
|
+
quality: 'max',
|
|
4051
|
+
mode: 'text-to-image',
|
|
4052
|
+
acceptsImages: !1,
|
|
4053
|
+
promptIncludedTokens: 144,
|
|
4054
|
+
extraPromptPerM: 6.5,
|
|
4055
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4056
|
+
},
|
|
4057
|
+
{
|
|
4058
|
+
id: 'dynamic-4k-max',
|
|
4059
|
+
price: { starter: 0.9252, plus: 0.854, scale: 0.8184 },
|
|
4060
|
+
label: '4K \xB7 max',
|
|
4061
|
+
endpoint: 'dynamic',
|
|
4062
|
+
resolution: '4K',
|
|
4063
|
+
quality: 'max',
|
|
4064
|
+
mode: 'text-to-image',
|
|
4065
|
+
acceptsImages: !1,
|
|
4066
|
+
promptIncludedTokens: 144,
|
|
4067
|
+
extraPromptPerM: 6.5,
|
|
4068
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4069
|
+
},
|
|
4070
|
+
],
|
|
4071
|
+
unfiltered: null,
|
|
4072
|
+
priority: null,
|
|
4073
|
+
draft: null,
|
|
4074
|
+
editVariants: [
|
|
4075
|
+
{
|
|
4076
|
+
id: 'dynamic-1k-low',
|
|
4077
|
+
price: { starter: 0.0323, plus: 0.0298, scale: 0.0285 },
|
|
4078
|
+
label: '1K \xB7 low',
|
|
4079
|
+
endpoint: 'dynamic',
|
|
4080
|
+
resolution: '1K',
|
|
4081
|
+
quality: 'low',
|
|
4082
|
+
mode: 'edit',
|
|
4083
|
+
acceptsImages: !0,
|
|
4084
|
+
perInputImage: 0.0027,
|
|
4085
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4086
|
+
promptIncludedTokens: 144,
|
|
4087
|
+
extraPromptPerM: 6.5,
|
|
4088
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4089
|
+
},
|
|
4090
|
+
{
|
|
4091
|
+
id: 'dynamic-2k-low',
|
|
4092
|
+
price: { starter: 0.0652, plus: 0.0602, scale: 0.0577 },
|
|
4093
|
+
label: '2K \xB7 low',
|
|
4094
|
+
endpoint: 'dynamic',
|
|
4095
|
+
resolution: '2K',
|
|
4096
|
+
quality: 'low',
|
|
4097
|
+
mode: 'edit',
|
|
4098
|
+
acceptsImages: !0,
|
|
4099
|
+
perInputImage: 0.0027,
|
|
4100
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4101
|
+
promptIncludedTokens: 144,
|
|
4102
|
+
extraPromptPerM: 6.5,
|
|
4103
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4104
|
+
},
|
|
4105
|
+
{
|
|
4106
|
+
id: 'dynamic-4k-low',
|
|
4107
|
+
price: { starter: 0.1081, plus: 0.0998, scale: 0.0956 },
|
|
4108
|
+
label: '4K \xB7 low',
|
|
4109
|
+
endpoint: 'dynamic',
|
|
4110
|
+
resolution: '4K',
|
|
4111
|
+
quality: 'low',
|
|
4112
|
+
mode: 'edit',
|
|
4113
|
+
acceptsImages: !0,
|
|
4114
|
+
perInputImage: 0.0027,
|
|
4115
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4116
|
+
promptIncludedTokens: 144,
|
|
4117
|
+
extraPromptPerM: 6.5,
|
|
4118
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4119
|
+
},
|
|
4120
|
+
{
|
|
4121
|
+
id: 'dynamic-1k-medium',
|
|
4122
|
+
price: { starter: 0.0566, plus: 0.0523, scale: 0.0501 },
|
|
4123
|
+
label: '1K \xB7 medium',
|
|
4124
|
+
endpoint: 'dynamic',
|
|
4125
|
+
resolution: '1K',
|
|
4126
|
+
quality: 'medium',
|
|
4127
|
+
mode: 'edit',
|
|
4128
|
+
acceptsImages: !0,
|
|
4129
|
+
perInputImage: 0.0027,
|
|
4130
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4131
|
+
promptIncludedTokens: 144,
|
|
4132
|
+
extraPromptPerM: 6.5,
|
|
4133
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4134
|
+
},
|
|
4135
|
+
{
|
|
4136
|
+
id: 'dynamic-2k-medium',
|
|
4137
|
+
price: { starter: 0.1149, plus: 0.1061, scale: 0.1017 },
|
|
4138
|
+
label: '2K \xB7 medium',
|
|
4139
|
+
endpoint: 'dynamic',
|
|
4140
|
+
resolution: '2K',
|
|
4141
|
+
quality: 'medium',
|
|
4142
|
+
mode: 'edit',
|
|
4143
|
+
acceptsImages: !0,
|
|
4144
|
+
perInputImage: 0.0027,
|
|
4145
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4146
|
+
promptIncludedTokens: 144,
|
|
4147
|
+
extraPromptPerM: 6.5,
|
|
4148
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4149
|
+
},
|
|
4150
|
+
{
|
|
4151
|
+
id: 'dynamic-4k-medium',
|
|
4152
|
+
price: { starter: 0.191, plus: 0.1763, scale: 0.169 },
|
|
4153
|
+
label: '4K \xB7 medium',
|
|
4154
|
+
endpoint: 'dynamic',
|
|
4155
|
+
resolution: '4K',
|
|
4156
|
+
quality: 'medium',
|
|
4157
|
+
mode: 'edit',
|
|
4158
|
+
acceptsImages: !0,
|
|
4159
|
+
perInputImage: 0.0027,
|
|
4160
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4161
|
+
promptIncludedTokens: 144,
|
|
4162
|
+
extraPromptPerM: 6.5,
|
|
4163
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4164
|
+
},
|
|
4165
|
+
{
|
|
4166
|
+
id: 'dynamic-1k-high',
|
|
4167
|
+
price: { starter: 0.0687, plus: 0.0634, scale: 0.0607 },
|
|
4168
|
+
label: '1K \xB7 high',
|
|
4169
|
+
endpoint: 'dynamic',
|
|
4170
|
+
resolution: '1K',
|
|
4171
|
+
quality: 'high',
|
|
4172
|
+
mode: 'edit',
|
|
4173
|
+
acceptsImages: !0,
|
|
4174
|
+
perInputImage: 0.0027,
|
|
4175
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4176
|
+
promptIncludedTokens: 144,
|
|
4177
|
+
extraPromptPerM: 6.5,
|
|
4178
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4179
|
+
},
|
|
4180
|
+
{
|
|
4181
|
+
id: 'dynamic-2k-high',
|
|
4182
|
+
price: { starter: 0.1393, plus: 0.1286, scale: 0.1232 },
|
|
4183
|
+
label: '2K \xB7 high',
|
|
4184
|
+
endpoint: 'dynamic',
|
|
4185
|
+
resolution: '2K',
|
|
4186
|
+
quality: 'high',
|
|
4187
|
+
mode: 'edit',
|
|
4188
|
+
acceptsImages: !0,
|
|
4189
|
+
perInputImage: 0.0027,
|
|
4190
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4191
|
+
promptIncludedTokens: 144,
|
|
4192
|
+
extraPromptPerM: 6.5,
|
|
4193
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4194
|
+
},
|
|
4195
|
+
{
|
|
4196
|
+
id: 'dynamic-4k-high',
|
|
4197
|
+
price: { starter: 0.2314, plus: 0.2136, scale: 0.2047 },
|
|
4198
|
+
label: '4K \xB7 high',
|
|
4199
|
+
endpoint: 'dynamic',
|
|
4200
|
+
resolution: '4K',
|
|
4201
|
+
quality: 'high',
|
|
4202
|
+
mode: 'edit',
|
|
4203
|
+
acceptsImages: !0,
|
|
4204
|
+
perInputImage: 0.0027,
|
|
4205
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4206
|
+
promptIncludedTokens: 144,
|
|
4207
|
+
extraPromptPerM: 6.5,
|
|
4208
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4209
|
+
},
|
|
4210
|
+
{
|
|
4211
|
+
id: 'dynamic-1k-xhigh',
|
|
4212
|
+
price: { starter: 0.1219, plus: 0.1125, scale: 0.1078 },
|
|
4213
|
+
label: '1K \xB7 xhigh',
|
|
4214
|
+
endpoint: 'dynamic',
|
|
4215
|
+
resolution: '1K',
|
|
4216
|
+
quality: 'xhigh',
|
|
4217
|
+
mode: 'edit',
|
|
4218
|
+
acceptsImages: !0,
|
|
4219
|
+
perInputImage: 0.0027,
|
|
4220
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4221
|
+
promptIncludedTokens: 144,
|
|
4222
|
+
extraPromptPerM: 6.5,
|
|
4223
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4224
|
+
},
|
|
4225
|
+
{
|
|
4226
|
+
id: 'dynamic-2k-xhigh',
|
|
4227
|
+
price: { starter: 0.2475, plus: 0.2285, scale: 0.2189 },
|
|
4228
|
+
label: '2K \xB7 xhigh',
|
|
4229
|
+
endpoint: 'dynamic',
|
|
3277
4230
|
resolution: '2K',
|
|
3278
|
-
quality: '
|
|
4231
|
+
quality: 'xhigh',
|
|
3279
4232
|
mode: 'edit',
|
|
3280
4233
|
acceptsImages: !0,
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
textInPerM: 4.95,
|
|
3287
|
-
imageOutPerM: 29.7,
|
|
3288
|
-
imageInPerM: 7.92,
|
|
3289
|
-
inputImageTokens: 256,
|
|
3290
|
-
promptTokens: 150,
|
|
3291
|
-
outputTokens: 397,
|
|
3292
|
-
maxPromptTokens: 1362,
|
|
3293
|
-
maxRefs: 2,
|
|
3294
|
-
},
|
|
4234
|
+
perInputImage: 0.0027,
|
|
4235
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4236
|
+
promptIncludedTokens: 144,
|
|
4237
|
+
extraPromptPerM: 6.5,
|
|
4238
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3295
4239
|
},
|
|
3296
4240
|
{
|
|
3297
|
-
id: '
|
|
3298
|
-
price: { starter: 0.
|
|
3299
|
-
label: '
|
|
3300
|
-
endpoint: '
|
|
3301
|
-
resolution: '
|
|
3302
|
-
quality: '
|
|
4241
|
+
id: 'dynamic-4k-xhigh',
|
|
4242
|
+
price: { starter: 0.4113, plus: 0.3796, scale: 0.3638 },
|
|
4243
|
+
label: '4K \xB7 xhigh',
|
|
4244
|
+
endpoint: 'dynamic',
|
|
4245
|
+
resolution: '4K',
|
|
4246
|
+
quality: 'xhigh',
|
|
3303
4247
|
mode: 'edit',
|
|
3304
4248
|
acceptsImages: !0,
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
textInPerM: 4.95,
|
|
3311
|
-
imageOutPerM: 29.7,
|
|
3312
|
-
imageInPerM: 7.92,
|
|
3313
|
-
inputImageTokens: 256,
|
|
3314
|
-
promptTokens: 150,
|
|
3315
|
-
outputTokens: 439,
|
|
3316
|
-
maxPromptTokens: 1109,
|
|
3317
|
-
maxRefs: 2,
|
|
3318
|
-
},
|
|
4249
|
+
perInputImage: 0.0027,
|
|
4250
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4251
|
+
promptIncludedTokens: 144,
|
|
4252
|
+
extraPromptPerM: 6.5,
|
|
4253
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3319
4254
|
},
|
|
3320
4255
|
{
|
|
3321
|
-
id: '
|
|
3322
|
-
price: { starter: 0.
|
|
3323
|
-
label: '1K \xB7
|
|
3324
|
-
endpoint: '
|
|
4256
|
+
id: 'dynamic-1k-max',
|
|
4257
|
+
price: { starter: 0.2741, plus: 0.253, scale: 0.2424 },
|
|
4258
|
+
label: '1K \xB7 max',
|
|
4259
|
+
endpoint: 'dynamic',
|
|
3325
4260
|
resolution: '1K',
|
|
3326
|
-
quality: '
|
|
4261
|
+
quality: 'max',
|
|
3327
4262
|
mode: 'edit',
|
|
3328
4263
|
acceptsImages: !0,
|
|
3329
|
-
perInputImage: 0,
|
|
4264
|
+
perInputImage: 0.0027,
|
|
4265
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4266
|
+
promptIncludedTokens: 144,
|
|
4267
|
+
extraPromptPerM: 6.5,
|
|
4268
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3330
4269
|
},
|
|
3331
4270
|
{
|
|
3332
|
-
id: '
|
|
3333
|
-
price: { starter: 0.
|
|
3334
|
-
label: '2K \xB7
|
|
3335
|
-
endpoint: '
|
|
4271
|
+
id: 'dynamic-2k-max',
|
|
4272
|
+
price: { starter: 0.5567, plus: 0.5139, scale: 0.4925 },
|
|
4273
|
+
label: '2K \xB7 max',
|
|
4274
|
+
endpoint: 'dynamic',
|
|
3336
4275
|
resolution: '2K',
|
|
3337
|
-
quality: '
|
|
4276
|
+
quality: 'max',
|
|
3338
4277
|
mode: 'edit',
|
|
3339
4278
|
acceptsImages: !0,
|
|
3340
|
-
perInputImage: 0,
|
|
4279
|
+
perInputImage: 0.0027,
|
|
4280
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4281
|
+
promptIncludedTokens: 144,
|
|
4282
|
+
extraPromptPerM: 6.5,
|
|
4283
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3341
4284
|
},
|
|
3342
4285
|
{
|
|
3343
|
-
id: '
|
|
3344
|
-
price: { starter: 0.
|
|
3345
|
-
label: '4K \xB7
|
|
3346
|
-
endpoint: '
|
|
4286
|
+
id: 'dynamic-4k-max',
|
|
4287
|
+
price: { starter: 0.9252, plus: 0.854, scale: 0.8184 },
|
|
4288
|
+
label: '4K \xB7 max',
|
|
4289
|
+
endpoint: 'dynamic',
|
|
3347
4290
|
resolution: '4K',
|
|
3348
|
-
quality: '
|
|
4291
|
+
quality: 'max',
|
|
3349
4292
|
mode: 'edit',
|
|
3350
4293
|
acceptsImages: !0,
|
|
3351
|
-
perInputImage: 0,
|
|
4294
|
+
perInputImage: 0.0027,
|
|
4295
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4296
|
+
promptIncludedTokens: 144,
|
|
4297
|
+
extraPromptPerM: 6.5,
|
|
4298
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3352
4299
|
},
|
|
3353
4300
|
],
|
|
3354
|
-
endpoints: [
|
|
3355
|
-
|
|
3356
|
-
{ id: 'dynamic', label: 'Dynamic' },
|
|
3357
|
-
{ id: 'flat', label: 'Flat', verified: !0 },
|
|
3358
|
-
],
|
|
3359
|
-
defaultEndpoint: 'token',
|
|
4301
|
+
endpoints: [{ id: 'dynamic', label: 'Dynamic', recommended: !0 }],
|
|
4302
|
+
defaultEndpoint: 'dynamic',
|
|
3360
4303
|
axes: {
|
|
3361
4304
|
quality: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
3362
4305
|
resolution: ['1K', '2K', '4K'],
|
|
3363
4306
|
mode: ['text-to-image', 'edit'],
|
|
3364
4307
|
},
|
|
3365
|
-
from: { variant: '
|
|
4308
|
+
from: { variant: 'dynamic-1k-low' },
|
|
3366
4309
|
},
|
|
3367
4310
|
{
|
|
3368
4311
|
slug: 'gpt-6-astra',
|
|
@@ -4659,105 +5602,142 @@ var ae,
|
|
|
4659
5602
|
],
|
|
4660
5603
|
};
|
|
4661
5604
|
});
|
|
4662
|
-
var
|
|
4663
|
-
|
|
4664
|
-
|
|
5605
|
+
var st,
|
|
5606
|
+
se,
|
|
5607
|
+
Ie = y(() => {
|
|
4665
5608
|
'use strict';
|
|
4666
|
-
((
|
|
5609
|
+
((st = { slug: 'tein', name: 'Tein', models: ['tein-video-upscaler'] }),
|
|
5610
|
+
(se = [
|
|
5611
|
+
{
|
|
5612
|
+
slug: 'tein-video-upscaler',
|
|
5613
|
+
name: 'Tein Video Upscaler',
|
|
5614
|
+
family: 'tein',
|
|
5615
|
+
vendor: 'Tein',
|
|
5616
|
+
desc: 'Upscales a video to 1080p, 2K or 4K, keeping faces and details as they are, with optional film grain. Clips up to 30 seconds. Billed on the result: $0.11 per megapixel per second of output, the same on every plan.',
|
|
5617
|
+
kind: 'video',
|
|
5618
|
+
unit: '/sec',
|
|
5619
|
+
api: { model: 'tein-video-upscaler' },
|
|
5620
|
+
variants: [
|
|
5621
|
+
{
|
|
5622
|
+
id: '1080p',
|
|
5623
|
+
label: '1080p',
|
|
5624
|
+
resolution: '1080p',
|
|
5625
|
+
price: { starter: 0.2281, plus: 0.2281, scale: 0.2281 },
|
|
5626
|
+
},
|
|
5627
|
+
{
|
|
5628
|
+
id: '2k',
|
|
5629
|
+
label: '2K',
|
|
5630
|
+
resolution: '2k',
|
|
5631
|
+
price: { starter: 0.4055, plus: 0.4055, scale: 0.4055 },
|
|
5632
|
+
},
|
|
5633
|
+
{
|
|
5634
|
+
id: '4k',
|
|
5635
|
+
label: '4K',
|
|
5636
|
+
resolution: '4k',
|
|
5637
|
+
price: { starter: 0.9124, plus: 0.9124, scale: 0.9124 },
|
|
5638
|
+
},
|
|
5639
|
+
],
|
|
5640
|
+
unfiltered: null,
|
|
5641
|
+
priority: null,
|
|
5642
|
+
draft: null,
|
|
5643
|
+
axes: { resolution: ['1080p', '2k', '4k'] },
|
|
5644
|
+
from: { variant: '1080p' },
|
|
5645
|
+
},
|
|
5646
|
+
]));
|
|
4667
5647
|
});
|
|
4668
|
-
function
|
|
5648
|
+
function Me(e, t) {
|
|
4669
5649
|
return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
|
|
4670
5650
|
}
|
|
4671
|
-
function
|
|
5651
|
+
function wr(e, t) {
|
|
4672
5652
|
if (e === 'seedance-2-mini') return 'mini';
|
|
4673
5653
|
if (e !== 'seedance-2') return;
|
|
4674
|
-
let
|
|
4675
|
-
return
|
|
4676
|
-
?
|
|
5654
|
+
let r = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
|
|
5655
|
+
return r === 'fast' || r === 'mini' || r === 'standard'
|
|
5656
|
+
? r
|
|
4677
5657
|
: t?.fast_mode === !0
|
|
4678
5658
|
? 'fast'
|
|
4679
5659
|
: 'standard';
|
|
4680
5660
|
}
|
|
4681
|
-
function
|
|
4682
|
-
let
|
|
5661
|
+
function xr(e, t) {
|
|
5662
|
+
let r = e
|
|
4683
5663
|
.trim()
|
|
4684
5664
|
.toLowerCase()
|
|
4685
5665
|
.replace(/-(?:unfiltered|uncensored)$/, '');
|
|
4686
|
-
if (
|
|
4687
|
-
let
|
|
4688
|
-
|
|
4689
|
-
return
|
|
5666
|
+
if (r === 'seedance-2' || r === 'seedance-2-mini') {
|
|
5667
|
+
let s = wr(r, t),
|
|
5668
|
+
n = ve.get(Me('seedance-2', s));
|
|
5669
|
+
return n ? n.slug : null;
|
|
4690
5670
|
}
|
|
4691
|
-
let
|
|
4692
|
-
return
|
|
5671
|
+
let i = ne.get(r) ?? ve.get(Me(r));
|
|
5672
|
+
return i ? i.slug : null;
|
|
4693
5673
|
}
|
|
4694
|
-
function
|
|
4695
|
-
return
|
|
5674
|
+
function Pr(e, t) {
|
|
5675
|
+
return ne.has(e) && !(Ir.has(e) && t) ? e : xr(e, t);
|
|
4696
5676
|
}
|
|
4697
|
-
function
|
|
4698
|
-
let
|
|
4699
|
-
return
|
|
5677
|
+
function z(e, t) {
|
|
5678
|
+
let r = Pr(e, t);
|
|
5679
|
+
return r ? (ne.get(r) ?? null) : null;
|
|
4700
5680
|
}
|
|
4701
5681
|
function oe() {
|
|
4702
|
-
return
|
|
5682
|
+
return ot;
|
|
4703
5683
|
}
|
|
4704
|
-
var
|
|
4705
|
-
|
|
5684
|
+
var Pe,
|
|
5685
|
+
Te,
|
|
5686
|
+
ot,
|
|
5687
|
+
br,
|
|
5688
|
+
ne,
|
|
5689
|
+
ve,
|
|
4706
5690
|
nt,
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
yi,
|
|
4712
|
-
Pe,
|
|
4713
|
-
ki,
|
|
4714
|
-
N = b(() => {
|
|
5691
|
+
kr,
|
|
5692
|
+
_e,
|
|
5693
|
+
Ir,
|
|
5694
|
+
B = y(() => {
|
|
4715
5695
|
'use strict';
|
|
4716
|
-
tt();
|
|
4717
5696
|
it();
|
|
4718
|
-
|
|
4719
|
-
(
|
|
5697
|
+
at();
|
|
5698
|
+
Ie();
|
|
5699
|
+
((Pe = {
|
|
4720
5700
|
...ae,
|
|
4721
|
-
families: ae.families.map((e) => ({ ...e, models: e.models.filter((t) => !
|
|
4722
|
-
models: ae.models.filter((e) => !
|
|
5701
|
+
families: ae.families.map((e) => ({ ...e, models: e.models.filter((t) => !ie(t)) })),
|
|
5702
|
+
models: ae.models.filter((e) => !ie(e.slug)),
|
|
4723
5703
|
}),
|
|
4724
|
-
(
|
|
4725
|
-
(
|
|
4726
|
-
(
|
|
4727
|
-
(
|
|
4728
|
-
(
|
|
4729
|
-
(
|
|
4730
|
-
(
|
|
4731
|
-
(
|
|
4732
|
-
for (let e of
|
|
4733
|
-
(
|
|
4734
|
-
for (let t of e.variants)
|
|
5704
|
+
(Te = se.filter((e) => !ie(e.slug))),
|
|
5705
|
+
(ot = [...Pe.models, ...Te]),
|
|
5706
|
+
(br = Te.length ? [...Pe.families, { ...st, models: Te.map((e) => e.slug) }] : Pe.families),
|
|
5707
|
+
(ne = new Map()),
|
|
5708
|
+
(ve = new Map()),
|
|
5709
|
+
(nt = new Map()),
|
|
5710
|
+
(kr = new Map()),
|
|
5711
|
+
(_e = new Map()));
|
|
5712
|
+
for (let e of ot) {
|
|
5713
|
+
(ne.set(e.slug, e), ve.set(Me(e.api.model, e.api.quality), e));
|
|
5714
|
+
for (let t of e.variants) nt.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
|
|
4735
5715
|
for (let t of e.editVariants ?? [])
|
|
4736
|
-
|
|
4737
|
-
for (let t of e.addons ?? [])
|
|
4738
|
-
|
|
5716
|
+
nt.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
|
|
5717
|
+
for (let t of e.addons ?? []) kr.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
|
|
5718
|
+
_e.set(e.slug, e.family);
|
|
4739
5719
|
}
|
|
4740
|
-
for (let e of
|
|
4741
|
-
|
|
5720
|
+
for (let e of br) for (let t of e.models) _e.has(t) || _e.set(t, e.slug);
|
|
5721
|
+
Ir = new Set(['seedance-2']);
|
|
4742
5722
|
});
|
|
4743
5723
|
function le(e) {
|
|
4744
5724
|
let t = e.from?.variant;
|
|
4745
|
-
return (t && e.variants.find((
|
|
5725
|
+
return (t && e.variants.find((r) => r.id === t)) || e.variants[0];
|
|
4746
5726
|
}
|
|
4747
|
-
function
|
|
5727
|
+
function Ke(e) {
|
|
4748
5728
|
if (e.endpoints?.length)
|
|
4749
|
-
return e.editVariants?.length && e.endpoints.some((t) => t.id ===
|
|
4750
|
-
?
|
|
5729
|
+
return e.editVariants?.length && e.endpoints.some((t) => t.id === lt)
|
|
5730
|
+
? lt
|
|
4751
5731
|
: (e.defaultEndpoint ?? e.endpoints[0].id);
|
|
4752
5732
|
}
|
|
4753
|
-
var
|
|
4754
|
-
|
|
5733
|
+
var lt,
|
|
5734
|
+
Se = y(() => {
|
|
4755
5735
|
'use strict';
|
|
4756
|
-
|
|
4757
|
-
|
|
5736
|
+
B();
|
|
5737
|
+
lt = 'dynamic';
|
|
4758
5738
|
});
|
|
4759
5739
|
var pe,
|
|
4760
|
-
|
|
5740
|
+
qe = y(() => {
|
|
4761
5741
|
'use strict';
|
|
4762
5742
|
pe = {
|
|
4763
5743
|
'gemini-3-8-flash': 'gemini-3.8-flash',
|
|
@@ -4765,31 +5745,33 @@ var pe,
|
|
|
4765
5745
|
'gemini-3-1-pro-preview': 'gemini-3.1-pro-preview',
|
|
4766
5746
|
'gpt-image-2-5-flare': 'gpt-image-2.5-flare',
|
|
4767
5747
|
'gpt-image-2-5-sunburst': 'gpt-image-2.5-sunburst',
|
|
5748
|
+
'gpt-image-2-6-flare': 'gpt-image-2.6-flare',
|
|
5749
|
+
'gpt-image-2-6-sunburst': 'gpt-image-2.6-sunburst',
|
|
4768
5750
|
};
|
|
4769
5751
|
});
|
|
4770
|
-
var
|
|
5752
|
+
var pt = y(() => {
|
|
4771
5753
|
'use strict';
|
|
4772
5754
|
});
|
|
4773
|
-
function
|
|
4774
|
-
return typeof t == 'string' && (
|
|
5755
|
+
function dt(e, t) {
|
|
5756
|
+
return typeof t == 'string' && (Tr[e]?.includes(t) ?? !1);
|
|
4775
5757
|
}
|
|
4776
|
-
var
|
|
4777
|
-
|
|
5758
|
+
var Tr,
|
|
5759
|
+
ct = y(() => {
|
|
4778
5760
|
'use strict';
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
5761
|
+
B();
|
|
5762
|
+
Se();
|
|
5763
|
+
pt();
|
|
5764
|
+
Tr = {};
|
|
4783
5765
|
});
|
|
4784
|
-
function
|
|
4785
|
-
return e === 'nano-banana-pro' ?
|
|
5766
|
+
function ut(e) {
|
|
5767
|
+
return e === 'nano-banana-pro' ? vr : _r;
|
|
4786
5768
|
}
|
|
4787
|
-
var
|
|
4788
|
-
|
|
4789
|
-
|
|
5769
|
+
var vr,
|
|
5770
|
+
_r,
|
|
5771
|
+
mt = y(() => {
|
|
4790
5772
|
'use strict';
|
|
4791
|
-
((
|
|
4792
|
-
(
|
|
5773
|
+
((vr = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
|
|
5774
|
+
(_r = [
|
|
4793
5775
|
'auto',
|
|
4794
5776
|
'1:1',
|
|
4795
5777
|
'1:4',
|
|
@@ -4807,10 +5789,10 @@ var _i,
|
|
|
4807
5789
|
'21:9',
|
|
4808
5790
|
]));
|
|
4809
5791
|
});
|
|
4810
|
-
var
|
|
4811
|
-
|
|
5792
|
+
var ft,
|
|
5793
|
+
gt = y(() => {
|
|
4812
5794
|
'use strict';
|
|
4813
|
-
|
|
5795
|
+
ft = [
|
|
4814
5796
|
'prompt',
|
|
4815
5797
|
'system',
|
|
4816
5798
|
'messages',
|
|
@@ -4824,10 +5806,10 @@ var ut,
|
|
|
4824
5806
|
'endpoint',
|
|
4825
5807
|
];
|
|
4826
5808
|
});
|
|
4827
|
-
var
|
|
4828
|
-
|
|
5809
|
+
var ht,
|
|
5810
|
+
yt = y(() => {
|
|
4829
5811
|
'use strict';
|
|
4830
|
-
|
|
5812
|
+
ht = [
|
|
4831
5813
|
{
|
|
4832
5814
|
slug: 'claude-fable-5-1',
|
|
4833
5815
|
family: 'fable-5-1',
|
|
@@ -4896,13 +5878,13 @@ var ft,
|
|
|
4896
5878
|
},
|
|
4897
5879
|
];
|
|
4898
5880
|
});
|
|
4899
|
-
function
|
|
5881
|
+
function bt(e) {
|
|
4900
5882
|
return `$${e}`;
|
|
4901
5883
|
}
|
|
4902
|
-
function $e(e, t,
|
|
4903
|
-
return
|
|
5884
|
+
function $e(e, t, r) {
|
|
5885
|
+
return z(e)?.variants.find((s) => s.endpoint === t && s.component === r)?.price.starter ?? null;
|
|
4904
5886
|
}
|
|
4905
|
-
function
|
|
5887
|
+
function Mr(e) {
|
|
4906
5888
|
return [
|
|
4907
5889
|
{
|
|
4908
5890
|
name: 'prompt',
|
|
@@ -4968,134 +5950,135 @@ function Pi(e) {
|
|
|
4968
5950
|
},
|
|
4969
5951
|
];
|
|
4970
5952
|
}
|
|
4971
|
-
function
|
|
5953
|
+
function kt() {
|
|
4972
5954
|
return Object.fromEntries(
|
|
4973
|
-
|
|
5955
|
+
ht.map((e) => {
|
|
4974
5956
|
let t = $e(e.slug, 'cheap', 'input'),
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
5957
|
+
r = $e(e.slug, 'cheap', 'output'),
|
|
5958
|
+
i = $e(e.slug, 'stable', 'input') != null,
|
|
5959
|
+
s = t != null && r != null ? `${bt(t)}/M in \xB7 ${bt(r)}/M out` : '',
|
|
5960
|
+
n = {
|
|
4979
5961
|
slug: e.slug,
|
|
4980
5962
|
name: e.name,
|
|
4981
5963
|
category: 'Text',
|
|
4982
5964
|
kind: 'Reasoning (LLM)',
|
|
4983
5965
|
vendor: 'Anthropic',
|
|
4984
5966
|
description: e.description,
|
|
4985
|
-
priceFormatted:
|
|
5967
|
+
priceFormatted: s,
|
|
4986
5968
|
unit: '/M tokens',
|
|
4987
5969
|
primaryToolName: 'run_task',
|
|
4988
|
-
parameters:
|
|
5970
|
+
parameters: Mr(i),
|
|
4989
5971
|
};
|
|
4990
|
-
return [e.slug,
|
|
5972
|
+
return [e.slug, n];
|
|
4991
5973
|
}),
|
|
4992
5974
|
);
|
|
4993
5975
|
}
|
|
4994
|
-
var
|
|
5976
|
+
var wt = y(() => {
|
|
4995
5977
|
'use strict';
|
|
4996
|
-
|
|
4997
|
-
|
|
5978
|
+
yt();
|
|
5979
|
+
B();
|
|
4998
5980
|
});
|
|
4999
5981
|
var J,
|
|
5000
5982
|
de,
|
|
5001
|
-
Ce =
|
|
5983
|
+
Ce = y(() => {
|
|
5002
5984
|
'use strict';
|
|
5003
5985
|
((J = [
|
|
5004
5986
|
'seedance-2-5',
|
|
5005
5987
|
'seedance-2',
|
|
5006
5988
|
'seedance-2-mini',
|
|
5007
5989
|
'seedream-5-pro',
|
|
5990
|
+
'seedream-5-5',
|
|
5008
5991
|
'wan-3-0',
|
|
5009
5992
|
'z-image-pro',
|
|
5010
5993
|
]),
|
|
5011
5994
|
(de =
|
|
5012
5995
|
'a request with creative_mode: true answers 503 checkpoint_unavailable and nothing is charged'));
|
|
5013
5996
|
});
|
|
5014
|
-
function
|
|
5997
|
+
function H(e) {
|
|
5015
5998
|
return `$${Number(e.toFixed(5))}`;
|
|
5016
5999
|
}
|
|
5017
|
-
function
|
|
6000
|
+
function $r(e) {
|
|
5018
6001
|
if (e.kind === 'llm') {
|
|
5019
6002
|
let t = e.defaultEndpoint,
|
|
5020
|
-
|
|
6003
|
+
r = (n) =>
|
|
5021
6004
|
e.variants.find(
|
|
5022
6005
|
(o) =>
|
|
5023
|
-
o.component ===
|
|
6006
|
+
o.component === n &&
|
|
5024
6007
|
(!t || !o.endpoint || o.endpoint === t) &&
|
|
5025
6008
|
(!o.context || o.context === '0\u201332K'),
|
|
5026
6009
|
),
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
return
|
|
5030
|
-
? `${
|
|
5031
|
-
: `from ${
|
|
6010
|
+
i = r('input'),
|
|
6011
|
+
s = r('output');
|
|
6012
|
+
return i && s
|
|
6013
|
+
? `${H(i.price.starter)}/M in \xB7 ${H(s.price.starter)}/M out`
|
|
6014
|
+
: `from ${H(le(e).price.starter)}/M tokens`;
|
|
5032
6015
|
}
|
|
5033
|
-
return `from ${
|
|
6016
|
+
return `from ${H(le(e).price.starter)}${e.unit}`;
|
|
5034
6017
|
}
|
|
5035
|
-
function
|
|
5036
|
-
let
|
|
5037
|
-
return
|
|
6018
|
+
function Cr(e, t) {
|
|
6019
|
+
let r = t.filter((i) => Number.isFinite(i) && i > 0);
|
|
6020
|
+
return r.length ? `from ${H(Math.min(...r))}${e}` : null;
|
|
5038
6021
|
}
|
|
5039
|
-
function
|
|
5040
|
-
for (let t of
|
|
5041
|
-
let
|
|
5042
|
-
|
|
5043
|
-
|
|
6022
|
+
function vt(e) {
|
|
6023
|
+
for (let t of G) {
|
|
6024
|
+
let r = ue[t],
|
|
6025
|
+
i = r ? Cr(r.unit, e[t] ?? []) : null;
|
|
6026
|
+
r && i && (r.priceFormatted = i);
|
|
5044
6027
|
}
|
|
5045
6028
|
}
|
|
5046
6029
|
function O(e, t) {
|
|
5047
|
-
let
|
|
5048
|
-
...new Set(e.variants.map((
|
|
6030
|
+
let r = e.axes?.resolution ?? [
|
|
6031
|
+
...new Set(e.variants.map((i) => i.resolution).filter((i) => !!i)),
|
|
5049
6032
|
];
|
|
5050
6033
|
return {
|
|
5051
6034
|
name: 'resolution',
|
|
5052
6035
|
type: 'select',
|
|
5053
|
-
default: le(e).resolution ??
|
|
5054
|
-
options:
|
|
6036
|
+
default: le(e).resolution ?? r[0],
|
|
6037
|
+
options: r,
|
|
5055
6038
|
...(t ? { description: t } : {}),
|
|
5056
6039
|
};
|
|
5057
6040
|
}
|
|
5058
|
-
function
|
|
6041
|
+
function _t(e) {
|
|
5059
6042
|
if (!e.endpoints?.length) return null;
|
|
5060
|
-
let t = e.endpoints.filter((
|
|
6043
|
+
let t = e.endpoints.filter((r) => dt(e.slug, r.id));
|
|
5061
6044
|
return {
|
|
5062
6045
|
name: 'endpoint',
|
|
5063
6046
|
type: 'select',
|
|
5064
|
-
default:
|
|
5065
|
-
options: e.endpoints.filter((
|
|
6047
|
+
default: Ke(e),
|
|
6048
|
+
options: e.endpoints.filter((r) => !t.includes(r)).map((r) => r.id),
|
|
5066
6049
|
description:
|
|
5067
6050
|
(e.slug === 'gemini-3.1-pro-preview'
|
|
5068
6051
|
? 'Where the request is served; a missing endpoint is the default, the lowest price, and an unknown one is refused.'
|
|
5069
6052
|
: 'Where the request is served; a missing or unknown endpoint is the default, the lowest price.') +
|
|
5070
|
-
(t.length ? ` ${t.map((
|
|
6053
|
+
(t.length ? ` ${t.map((r) => r.label).join(' and ')}: coming soon.` : ''),
|
|
5071
6054
|
};
|
|
5072
6055
|
}
|
|
5073
|
-
function
|
|
5074
|
-
if (e.unfiltered == null || t.some((
|
|
5075
|
-
let
|
|
5076
|
-
return [...t.filter((
|
|
6056
|
+
function Or(e, t) {
|
|
6057
|
+
if (e.unfiltered == null || t.some((i) => i.name === 'creative_mode')) return t;
|
|
6058
|
+
let r = J.includes(e.api.model);
|
|
6059
|
+
return [...t.filter((i) => !Re.has(i.name)), r ? Mt : Er];
|
|
5077
6060
|
}
|
|
5078
6061
|
function Ee(e, t) {
|
|
5079
|
-
let
|
|
5080
|
-
|
|
5081
|
-
return (
|
|
6062
|
+
let r = e.filter((s) => !Re.has(s.name)),
|
|
6063
|
+
i = [Mt, Ar];
|
|
6064
|
+
return (i.push(Kt, St), [...r, ...i]);
|
|
5082
6065
|
}
|
|
5083
|
-
function
|
|
6066
|
+
function xt(e, t = {}) {
|
|
5084
6067
|
return [
|
|
5085
6068
|
...e
|
|
5086
|
-
.filter((
|
|
5087
|
-
.map((
|
|
5088
|
-
|
|
5089
|
-
? { ...
|
|
5090
|
-
:
|
|
6069
|
+
.filter((r) => !Rr.has(r.name) && !Re.has(r.name))
|
|
6070
|
+
.map((r) =>
|
|
6071
|
+
r.name === 'prompt'
|
|
6072
|
+
? { ...r, required: !0 }
|
|
6073
|
+
: r.name === 'resolution'
|
|
5091
6074
|
? {
|
|
5092
|
-
...
|
|
5093
|
-
...(t.no4k &&
|
|
5094
|
-
? { options:
|
|
6075
|
+
...r,
|
|
6076
|
+
...(t.no4k && r.options
|
|
6077
|
+
? { options: r.options.filter((i) => String(i).toLowerCase() !== '4k') }
|
|
5095
6078
|
: {}),
|
|
5096
6079
|
description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${ce}`,
|
|
5097
6080
|
}
|
|
5098
|
-
:
|
|
6081
|
+
: r,
|
|
5099
6082
|
),
|
|
5100
6083
|
{
|
|
5101
6084
|
name: 'bitrate_mode',
|
|
@@ -5104,13 +6087,13 @@ function wt(e, t = {}) {
|
|
|
5104
6087
|
options: ['standard'],
|
|
5105
6088
|
description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
|
|
5106
6089
|
},
|
|
5107
|
-
|
|
5108
|
-
|
|
6090
|
+
Kt,
|
|
6091
|
+
St,
|
|
5109
6092
|
];
|
|
5110
6093
|
}
|
|
5111
|
-
function
|
|
6094
|
+
function Ae(e, t) {
|
|
5112
6095
|
return [
|
|
5113
|
-
|
|
6096
|
+
M('Text prompt describing the video.'),
|
|
5114
6097
|
{ name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
|
|
5115
6098
|
{
|
|
5116
6099
|
name: 'duration',
|
|
@@ -5122,25 +6105,25 @@ function qe(e, t) {
|
|
|
5122
6105
|
},
|
|
5123
6106
|
O(e),
|
|
5124
6107
|
{ name: 'aspect_ratio', type: 'select', default: t.aspects[0], options: t.aspects },
|
|
5125
|
-
...t.references.map((
|
|
5126
|
-
|
|
6108
|
+
...t.references.map((r) =>
|
|
6109
|
+
r.endsWith('s')
|
|
5127
6110
|
? {
|
|
5128
|
-
name:
|
|
6111
|
+
name: r,
|
|
5129
6112
|
type: 'string[]',
|
|
5130
|
-
description: `${
|
|
6113
|
+
description: `${r} as public http(s) URLs or data URIs. The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.`,
|
|
5131
6114
|
}
|
|
5132
6115
|
: {
|
|
5133
|
-
name:
|
|
6116
|
+
name: r,
|
|
5134
6117
|
type: 'string',
|
|
5135
|
-
description: `${
|
|
6118
|
+
description: `${r} as a public http(s) URL or data URI. The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.`,
|
|
5136
6119
|
},
|
|
5137
6120
|
),
|
|
5138
6121
|
];
|
|
5139
6122
|
}
|
|
5140
|
-
function
|
|
5141
|
-
let t =
|
|
6123
|
+
function Dr(e) {
|
|
6124
|
+
let t = _t(e);
|
|
5142
6125
|
return [
|
|
5143
|
-
|
|
6126
|
+
M('Image prompt text. Supports complex composition and text instructions.'),
|
|
5144
6127
|
...(t ? [t] : []),
|
|
5145
6128
|
{
|
|
5146
6129
|
name: 'quality',
|
|
@@ -5151,14 +6134,14 @@ function Ri(e) {
|
|
|
5151
6134
|
O(
|
|
5152
6135
|
e,
|
|
5153
6136
|
e.slug === 'gpt-image-2'
|
|
5154
|
-
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${
|
|
6137
|
+
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${tt}`
|
|
5155
6138
|
: '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
|
|
5156
6139
|
),
|
|
5157
6140
|
{
|
|
5158
6141
|
name: 'aspect_ratio',
|
|
5159
6142
|
type: 'select',
|
|
5160
6143
|
default: 'auto',
|
|
5161
|
-
options: [...
|
|
6144
|
+
options: [...et],
|
|
5162
6145
|
description:
|
|
5163
6146
|
"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.",
|
|
5164
6147
|
},
|
|
@@ -5205,15 +6188,15 @@ function Ri(e) {
|
|
|
5205
6188
|
},
|
|
5206
6189
|
];
|
|
5207
6190
|
}
|
|
5208
|
-
function
|
|
6191
|
+
function Lr(e) {
|
|
5209
6192
|
return [
|
|
5210
|
-
|
|
6193
|
+
M('Image prompt text.'),
|
|
5211
6194
|
{
|
|
5212
6195
|
name: 'input_images',
|
|
5213
6196
|
type: 'string[]',
|
|
5214
6197
|
description: 'Images to edit or use as reference (up to 14).',
|
|
5215
6198
|
},
|
|
5216
|
-
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...
|
|
6199
|
+
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...ut(e.slug)] },
|
|
5217
6200
|
O(e),
|
|
5218
6201
|
{
|
|
5219
6202
|
name: 'n',
|
|
@@ -5239,22 +6222,22 @@ function Oi(e) {
|
|
|
5239
6222
|
},
|
|
5240
6223
|
];
|
|
5241
6224
|
}
|
|
5242
|
-
function
|
|
5243
|
-
let e =
|
|
6225
|
+
function Br() {
|
|
6226
|
+
let e = ft,
|
|
5244
6227
|
t = [];
|
|
5245
|
-
for (let
|
|
5246
|
-
e.includes(
|
|
6228
|
+
for (let r of De(!0))
|
|
6229
|
+
e.includes(r.name) &&
|
|
5247
6230
|
(t.push({
|
|
5248
|
-
...
|
|
5249
|
-
...(
|
|
5250
|
-
...(
|
|
6231
|
+
...r,
|
|
6232
|
+
...(r.name === 'max_tokens' ? { min: 64 } : {}),
|
|
6233
|
+
...(r.name === 'messages'
|
|
5251
6234
|
? {
|
|
5252
6235
|
description:
|
|
5253
6236
|
'Chat history: system, developer, user (text and image_url parts) and assistant turns; no tool turns.',
|
|
5254
6237
|
}
|
|
5255
6238
|
: {}),
|
|
5256
6239
|
}),
|
|
5257
|
-
|
|
6240
|
+
r.name === 'top_p' &&
|
|
5258
6241
|
t.push({
|
|
5259
6242
|
name: 'top_k',
|
|
5260
6243
|
type: 'number',
|
|
@@ -5264,14 +6247,14 @@ function Ni() {
|
|
|
5264
6247
|
}));
|
|
5265
6248
|
return t;
|
|
5266
6249
|
}
|
|
5267
|
-
function
|
|
5268
|
-
return
|
|
6250
|
+
function jr() {
|
|
6251
|
+
return De(!0).map((e) =>
|
|
5269
6252
|
e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
|
|
5270
6253
|
);
|
|
5271
6254
|
}
|
|
5272
|
-
function
|
|
6255
|
+
function De(e) {
|
|
5273
6256
|
return [
|
|
5274
|
-
|
|
6257
|
+
M('The user message or task.'),
|
|
5275
6258
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
5276
6259
|
{
|
|
5277
6260
|
name: 'messages',
|
|
@@ -5364,21 +6347,21 @@ function Oe(e) {
|
|
|
5364
6347
|
},
|
|
5365
6348
|
];
|
|
5366
6349
|
}
|
|
5367
|
-
function
|
|
5368
|
-
if (e.slug === 'seed-2-1-turbo') return
|
|
5369
|
-
let t =
|
|
6350
|
+
function Fr(e) {
|
|
6351
|
+
if (e.slug === 'seed-2-1-turbo') return Nr;
|
|
6352
|
+
let t = _t(e);
|
|
5370
6353
|
return [
|
|
5371
6354
|
...(e.slug === 'gemini-3.1-pro-preview'
|
|
5372
|
-
?
|
|
6355
|
+
? Br()
|
|
5373
6356
|
: e.slug === 'gemini-3.7-flash'
|
|
5374
|
-
?
|
|
5375
|
-
: e.slug === 'gpt-6-astra' ||
|
|
5376
|
-
?
|
|
5377
|
-
:
|
|
6357
|
+
? jr()
|
|
6358
|
+
: e.slug === 'gpt-6-astra' || Ur.includes(e.slug)
|
|
6359
|
+
? De(e.slug !== 'gpt-6-astra')
|
|
6360
|
+
: Vr),
|
|
5378
6361
|
...(t ? [t] : []),
|
|
5379
6362
|
];
|
|
5380
6363
|
}
|
|
5381
|
-
function
|
|
6364
|
+
function Gr(e) {
|
|
5382
6365
|
return [
|
|
5383
6366
|
{
|
|
5384
6367
|
name: 'video_url',
|
|
@@ -5400,29 +6383,29 @@ function ji(e) {
|
|
|
5400
6383
|
},
|
|
5401
6384
|
];
|
|
5402
6385
|
}
|
|
5403
|
-
function
|
|
6386
|
+
function zr(e) {
|
|
5404
6387
|
let t = e.slug;
|
|
5405
|
-
if (
|
|
5406
|
-
if (e.kind === 'llm') return
|
|
5407
|
-
if (e.editVariants?.length) return
|
|
6388
|
+
if (se.some((r) => r.slug === t)) return Gr(e);
|
|
6389
|
+
if (e.kind === 'llm') return Fr(e);
|
|
6390
|
+
if (e.editVariants?.length) return Dr(e);
|
|
5408
6391
|
switch (t) {
|
|
5409
6392
|
case 'seedance-2-5':
|
|
5410
|
-
return Ee(
|
|
6393
|
+
return Ee(It, t);
|
|
5411
6394
|
case 'seedance-2-5-lite':
|
|
5412
|
-
return
|
|
6395
|
+
return xt(It, { no4k: !0 });
|
|
5413
6396
|
case 'seedance-2':
|
|
5414
|
-
return Ee(
|
|
6397
|
+
return Ee(Pt, t);
|
|
5415
6398
|
case 'seedance-2-lite':
|
|
5416
|
-
return
|
|
6399
|
+
return xt(Pt);
|
|
5417
6400
|
case 'seedance-2-mini':
|
|
5418
|
-
return Ee(
|
|
6401
|
+
return Ee(Jr, t);
|
|
5419
6402
|
case 'nano-banana-2':
|
|
5420
6403
|
case 'nano-banana-2.1':
|
|
5421
6404
|
case 'nano-banana-pro':
|
|
5422
|
-
return
|
|
6405
|
+
return Lr(e);
|
|
5423
6406
|
case 'seedream-5-pro':
|
|
5424
6407
|
return [
|
|
5425
|
-
|
|
6408
|
+
M('Detailed description of the image to generate.'),
|
|
5426
6409
|
{ name: 'images', type: 'string[]', description: 'Reference images (the first is free).' },
|
|
5427
6410
|
O(e),
|
|
5428
6411
|
{
|
|
@@ -5433,10 +6416,66 @@ function Fi(e) {
|
|
|
5433
6416
|
},
|
|
5434
6417
|
{ name: 'output_format', type: 'select', default: 'jpeg', options: ['jpeg', 'png'] },
|
|
5435
6418
|
];
|
|
6419
|
+
case 'seedream-5-5':
|
|
6420
|
+
return [
|
|
6421
|
+
{
|
|
6422
|
+
name: 'mode',
|
|
6423
|
+
type: 'select',
|
|
6424
|
+
default: 'text_to_image',
|
|
6425
|
+
options: ['text_to_image', 'image_to_image', 'layer_decomposition'],
|
|
6426
|
+
description:
|
|
6427
|
+
'text_to_image, image_to_image (up to 10 reference images) or layer_decomposition (split one image into a base image and editable transparent layers).',
|
|
6428
|
+
},
|
|
6429
|
+
M(
|
|
6430
|
+
'What to make or change. Optional for layer_decomposition, where it can say how to split the image (for example "keep the logo as one layer").',
|
|
6431
|
+
),
|
|
6432
|
+
{
|
|
6433
|
+
name: 'images',
|
|
6434
|
+
type: 'string[]',
|
|
6435
|
+
description:
|
|
6436
|
+
'Reference images (up to 10), or for layer_decomposition the one JPEG or PNG to split (at least 512x512). Each input image is billed.',
|
|
6437
|
+
},
|
|
6438
|
+
O(
|
|
6439
|
+
e,
|
|
6440
|
+
'1K and 1.5K are one price, 2K the next. layer_decomposition also takes auto (keep the input size), billed at the 2K price.',
|
|
6441
|
+
),
|
|
6442
|
+
{
|
|
6443
|
+
name: 'aspect_ratio',
|
|
6444
|
+
type: 'select',
|
|
6445
|
+
default: '1:1',
|
|
6446
|
+
options: ['1:1', '4:3', '3:4', '16:9', '9:16', '3:2', '2:3', '21:9', 'adaptive'],
|
|
6447
|
+
description: 'Not used by layer_decomposition. adaptive lets the prompt pick the shape.',
|
|
6448
|
+
},
|
|
6449
|
+
{
|
|
6450
|
+
name: 'background',
|
|
6451
|
+
type: 'select',
|
|
6452
|
+
default: 'auto',
|
|
6453
|
+
options: ['auto', 'transparent', 'opaque'],
|
|
6454
|
+
description:
|
|
6455
|
+
'transparent makes a PNG with an alpha channel (needs output_format png). auto decides from the prompt. Not used by layer_decomposition.',
|
|
6456
|
+
},
|
|
6457
|
+
{ name: 'output_format', type: 'select', default: 'png', options: ['png', 'jpeg'] },
|
|
6458
|
+
{
|
|
6459
|
+
name: 'max_layers',
|
|
6460
|
+
type: 'slider',
|
|
6461
|
+
default: 30,
|
|
6462
|
+
min: 2,
|
|
6463
|
+
max: 100,
|
|
6464
|
+
description:
|
|
6465
|
+
'layer_decomposition only: most images to return, the base image included. Held for this many; you pay for the layers made.',
|
|
6466
|
+
},
|
|
6467
|
+
{
|
|
6468
|
+
name: 'text_recognition',
|
|
6469
|
+
type: 'boolean',
|
|
6470
|
+
default: !1,
|
|
6471
|
+
description:
|
|
6472
|
+
'layer_decomposition only: return the text, lines, font and style of each typeset text layer (layer.text_recognition).',
|
|
6473
|
+
},
|
|
6474
|
+
];
|
|
5436
6475
|
case 'qwen-3':
|
|
5437
6476
|
case 'qwen-3-pro':
|
|
5438
6477
|
return [
|
|
5439
|
-
|
|
6478
|
+
M('Image prompt text; dense layouts and multilingual text work well.'),
|
|
5440
6479
|
{
|
|
5441
6480
|
name: 'images',
|
|
5442
6481
|
type: 'string[]',
|
|
@@ -5460,7 +6499,7 @@ function Fi(e) {
|
|
|
5460
6499
|
];
|
|
5461
6500
|
case 'z-image-pro':
|
|
5462
6501
|
return [
|
|
5463
|
-
|
|
6502
|
+
M('Image prompt text: subject, scene, style, composition and lighting.'),
|
|
5464
6503
|
O(e, 'Long edge: 1K is 1024 px, 2K is 2048 px. Same price.'),
|
|
5465
6504
|
{
|
|
5466
6505
|
name: 'aspect_ratio',
|
|
@@ -5514,7 +6553,7 @@ function Fi(e) {
|
|
|
5514
6553
|
];
|
|
5515
6554
|
case 'wan-3-0':
|
|
5516
6555
|
case 'wan-3-0-prime':
|
|
5517
|
-
return
|
|
6556
|
+
return Ae(e, {
|
|
5518
6557
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
5519
6558
|
aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
|
|
5520
6559
|
minSec: 2,
|
|
@@ -5524,7 +6563,7 @@ function Fi(e) {
|
|
|
5524
6563
|
});
|
|
5525
6564
|
case 'happy-horse-1-1':
|
|
5526
6565
|
case 'happy-horse-1-0':
|
|
5527
|
-
return
|
|
6566
|
+
return Ae(e, {
|
|
5528
6567
|
modes:
|
|
5529
6568
|
t === 'happy-horse-1-0'
|
|
5530
6569
|
? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
|
|
@@ -5535,7 +6574,7 @@ function Fi(e) {
|
|
|
5535
6574
|
references: t === 'happy-horse-1-0' ? ['images', 'videos'] : ['images'],
|
|
5536
6575
|
});
|
|
5537
6576
|
case 'minimax-h3':
|
|
5538
|
-
return
|
|
6577
|
+
return Ae(e, {
|
|
5539
6578
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
5540
6579
|
aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
|
|
5541
6580
|
minSec: 4,
|
|
@@ -5543,151 +6582,151 @@ function Fi(e) {
|
|
|
5543
6582
|
references: ['images', 'videos', 'audios', 'first_frame_image', 'last_frame_image'],
|
|
5544
6583
|
});
|
|
5545
6584
|
default:
|
|
5546
|
-
return [
|
|
6585
|
+
return [M('Prompt text.')];
|
|
5547
6586
|
}
|
|
5548
6587
|
}
|
|
5549
|
-
function
|
|
6588
|
+
function Oe(e, t = e.api.model) {
|
|
5550
6589
|
return {
|
|
5551
6590
|
slug: t,
|
|
5552
6591
|
name: e.name,
|
|
5553
|
-
category:
|
|
5554
|
-
kind:
|
|
6592
|
+
category: Kr[e.kind],
|
|
6593
|
+
kind: qr[e.kind],
|
|
5555
6594
|
vendor: e.vendor ?? '',
|
|
5556
6595
|
description: e.desc ?? e.name,
|
|
5557
|
-
priceFormatted:
|
|
6596
|
+
priceFormatted: $r(e),
|
|
5558
6597
|
unit: e.unit,
|
|
5559
|
-
primaryToolName:
|
|
5560
|
-
parameters:
|
|
6598
|
+
primaryToolName: Sr[e.kind],
|
|
6599
|
+
parameters: Or(e, zr(e)),
|
|
5561
6600
|
};
|
|
5562
6601
|
}
|
|
5563
|
-
function
|
|
6602
|
+
function Hr() {
|
|
5564
6603
|
let e = {};
|
|
5565
6604
|
for (let t of oe())
|
|
5566
6605
|
if (t.slug !== 'seedance-2-fast') {
|
|
5567
6606
|
if (t.slug === 'seedance-2-mini') {
|
|
5568
|
-
e['seedance-2-mini'] =
|
|
6607
|
+
e['seedance-2-mini'] = Oe(t, 'seedance-2-mini');
|
|
5569
6608
|
continue;
|
|
5570
6609
|
}
|
|
5571
6610
|
if (t.slug === 'seedance-2') {
|
|
5572
|
-
let
|
|
5573
|
-
((
|
|
5574
|
-
(e['seedance-2'] =
|
|
6611
|
+
let r = Oe(t);
|
|
6612
|
+
((r.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
|
|
6613
|
+
(e['seedance-2'] = r));
|
|
5575
6614
|
continue;
|
|
5576
6615
|
}
|
|
5577
|
-
t.slug.startsWith('claude-') || (e[t.api.model] =
|
|
6616
|
+
t.slug.startsWith('claude-') || (e[t.api.model] = Oe(t));
|
|
5578
6617
|
}
|
|
5579
|
-
Object.assign(e,
|
|
5580
|
-
for (let [t,
|
|
5581
|
-
e[
|
|
6618
|
+
Object.assign(e, kt());
|
|
6619
|
+
for (let [t, r] of Object.entries(pe))
|
|
6620
|
+
e[r] && Object.defineProperty(e, t, { value: e[r], enumerable: !1 });
|
|
5582
6621
|
return e;
|
|
5583
6622
|
}
|
|
5584
|
-
function
|
|
6623
|
+
function j(e) {
|
|
5585
6624
|
return ue[e] ?? null;
|
|
5586
6625
|
}
|
|
5587
|
-
function
|
|
6626
|
+
function Wr(e, t, r) {
|
|
5588
6627
|
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite') && t === 'duration') {
|
|
5589
|
-
let
|
|
5590
|
-
if (r
|
|
6628
|
+
let i = (s) => (typeof s == 'string' ? s.trim().toLowerCase() : '');
|
|
6629
|
+
if (i(r.mode) === 'edit' || i(r.omni_reference_task_type) === 'edit') return !1;
|
|
5591
6630
|
}
|
|
5592
6631
|
return !(
|
|
5593
|
-
(t === 'max_tokens' &&
|
|
5594
|
-
(t === 'max_completion_tokens' &&
|
|
6632
|
+
(t === 'max_tokens' && Tt(r.max_completion_tokens)) ||
|
|
6633
|
+
(t === 'max_completion_tokens' && Tt(r.max_tokens))
|
|
5595
6634
|
);
|
|
5596
6635
|
}
|
|
5597
|
-
function
|
|
6636
|
+
function Tt(e) {
|
|
5598
6637
|
return e != null && e !== '';
|
|
5599
6638
|
}
|
|
5600
|
-
function
|
|
5601
|
-
let
|
|
6639
|
+
function Ct(e, t) {
|
|
6640
|
+
let r = { ...t };
|
|
5602
6641
|
if (e?.slug === 'seedance-2-5') {
|
|
5603
|
-
let
|
|
5604
|
-
for (let
|
|
5605
|
-
if (!r
|
|
6642
|
+
let i = (s) => typeof s != 'string' || !s.trim();
|
|
6643
|
+
for (let s of Yr) (i(r.finalize) && !i(r[s]) && (r.finalize = r[s]), delete r[s]);
|
|
6644
|
+
if (!i(r.finalize)) return r;
|
|
5606
6645
|
}
|
|
5607
|
-
for (let
|
|
5608
|
-
|
|
5609
|
-
i
|
|
5610
|
-
|
|
5611
|
-
(i
|
|
5612
|
-
return
|
|
6646
|
+
for (let i of e?.parameters ?? [])
|
|
6647
|
+
i.default !== void 0 &&
|
|
6648
|
+
r[i.name] === void 0 &&
|
|
6649
|
+
Wr(e.slug, i.name, t) &&
|
|
6650
|
+
(r[i.name] = i.default);
|
|
6651
|
+
return r;
|
|
5613
6652
|
}
|
|
5614
|
-
function
|
|
6653
|
+
function R() {
|
|
5615
6654
|
return Object.values(ue);
|
|
5616
6655
|
}
|
|
5617
|
-
var
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
Pt,
|
|
5622
|
-
Ci,
|
|
5623
|
-
Ei,
|
|
5624
|
-
Tt,
|
|
6656
|
+
var Kr,
|
|
6657
|
+
Sr,
|
|
6658
|
+
qr,
|
|
6659
|
+
M,
|
|
5625
6660
|
Mt,
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
Di,
|
|
5629
|
-
Li,
|
|
5630
|
-
Vi,
|
|
5631
|
-
ce,
|
|
5632
|
-
kt,
|
|
6661
|
+
Er,
|
|
6662
|
+
Ar,
|
|
5633
6663
|
Kt,
|
|
5634
6664
|
St,
|
|
5635
|
-
|
|
5636
|
-
|
|
6665
|
+
Re,
|
|
6666
|
+
Rr,
|
|
6667
|
+
Vr,
|
|
6668
|
+
Nr,
|
|
6669
|
+
Ur,
|
|
6670
|
+
ce,
|
|
6671
|
+
It,
|
|
6672
|
+
qt,
|
|
6673
|
+
$t,
|
|
6674
|
+
Pt,
|
|
6675
|
+
Jr,
|
|
5637
6676
|
ue,
|
|
5638
|
-
|
|
5639
|
-
|
|
6677
|
+
Yr,
|
|
6678
|
+
W = y(() => {
|
|
5640
6679
|
'use strict';
|
|
5641
|
-
|
|
5642
|
-
ke();
|
|
5643
|
-
N();
|
|
5644
|
-
Ke();
|
|
6680
|
+
rt();
|
|
5645
6681
|
xe();
|
|
6682
|
+
B();
|
|
5646
6683
|
Se();
|
|
5647
|
-
|
|
6684
|
+
Ie();
|
|
6685
|
+
qe();
|
|
5648
6686
|
ct();
|
|
5649
6687
|
mt();
|
|
5650
|
-
|
|
6688
|
+
gt();
|
|
6689
|
+
wt();
|
|
5651
6690
|
Ce();
|
|
5652
|
-
((
|
|
5653
|
-
(
|
|
6691
|
+
((Kr = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
|
|
6692
|
+
(Sr = {
|
|
5654
6693
|
video: 'generate_video',
|
|
5655
6694
|
image: 'generate_image',
|
|
5656
6695
|
audio: 'generate_audio',
|
|
5657
6696
|
llm: 'run_task',
|
|
5658
6697
|
}),
|
|
5659
|
-
(
|
|
6698
|
+
(qr = {
|
|
5660
6699
|
video: 'Text-to-Video',
|
|
5661
6700
|
image: 'Text-to-Image',
|
|
5662
6701
|
audio: 'Text-to-Audio',
|
|
5663
6702
|
llm: 'Reasoning (LLM)',
|
|
5664
6703
|
}));
|
|
5665
|
-
|
|
5666
|
-
((
|
|
6704
|
+
M = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
|
|
6705
|
+
((Mt = {
|
|
5667
6706
|
name: 'creative_mode',
|
|
5668
6707
|
type: 'boolean',
|
|
5669
6708
|
default: !1,
|
|
5670
6709
|
description:
|
|
5671
6710
|
'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
|
|
5672
6711
|
}),
|
|
5673
|
-
(
|
|
6712
|
+
(Er = {
|
|
5674
6713
|
name: 'creative_mode',
|
|
5675
6714
|
type: 'boolean',
|
|
5676
6715
|
default: !1,
|
|
5677
6716
|
description: `Not available yet on this model: ${de}.`,
|
|
5678
6717
|
}),
|
|
5679
|
-
(
|
|
6718
|
+
(Ar = {
|
|
5680
6719
|
name: 'priority',
|
|
5681
6720
|
type: 'boolean',
|
|
5682
6721
|
default: !1,
|
|
5683
6722
|
description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
|
|
5684
6723
|
}),
|
|
5685
|
-
(
|
|
6724
|
+
(Kt = {
|
|
5686
6725
|
name: 'reference_roles',
|
|
5687
6726
|
type: 'json',
|
|
5688
6727
|
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).`,
|
|
5689
6728
|
}),
|
|
5690
|
-
(
|
|
6729
|
+
(St = {
|
|
5691
6730
|
name: 'auto_fit_images',
|
|
5692
6731
|
type: 'boolean',
|
|
5693
6732
|
default: !1,
|
|
@@ -5695,7 +6734,7 @@ var Ti,
|
|
|
5695
6734
|
'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.',
|
|
5696
6735
|
}),
|
|
5697
6736
|
(Re = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
|
|
5698
|
-
|
|
6737
|
+
Rr = new Set([
|
|
5699
6738
|
'quality',
|
|
5700
6739
|
'bitrate_mode',
|
|
5701
6740
|
'draft',
|
|
@@ -5704,8 +6743,8 @@ var Ti,
|
|
|
5704
6743
|
'draft_generation_id',
|
|
5705
6744
|
'pass_faces',
|
|
5706
6745
|
]);
|
|
5707
|
-
((
|
|
5708
|
-
|
|
6746
|
+
((Vr = [
|
|
6747
|
+
M('The user message or task.'),
|
|
5709
6748
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
5710
6749
|
{
|
|
5711
6750
|
name: 'messages',
|
|
@@ -5722,8 +6761,8 @@ var Ti,
|
|
|
5722
6761
|
{ name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
|
|
5723
6762
|
{ name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
|
|
5724
6763
|
]),
|
|
5725
|
-
(
|
|
5726
|
-
|
|
6764
|
+
(Nr = [
|
|
6765
|
+
M('The user message or task.'),
|
|
5727
6766
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
5728
6767
|
{
|
|
5729
6768
|
name: 'messages',
|
|
@@ -5804,9 +6843,9 @@ var Ti,
|
|
|
5804
6843
|
description: 'Video frames read a second.',
|
|
5805
6844
|
},
|
|
5806
6845
|
]),
|
|
5807
|
-
(
|
|
6846
|
+
(Ur = ['gemini-3.8-flash', 'gemini-3.7-flash']));
|
|
5808
6847
|
((ce = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
|
|
5809
|
-
(
|
|
6848
|
+
(It = [
|
|
5810
6849
|
{
|
|
5811
6850
|
name: 'prompt',
|
|
5812
6851
|
type: 'string',
|
|
@@ -5955,19 +6994,19 @@ var Ti,
|
|
|
5955
6994
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
5956
6995
|
},
|
|
5957
6996
|
]),
|
|
5958
|
-
(
|
|
6997
|
+
(qt = {
|
|
5959
6998
|
name: 'images',
|
|
5960
6999
|
type: 'string[]',
|
|
5961
7000
|
description:
|
|
5962
7001
|
'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.',
|
|
5963
7002
|
}),
|
|
5964
|
-
(
|
|
7003
|
+
($t = {
|
|
5965
7004
|
name: 'audios',
|
|
5966
7005
|
type: 'string[]',
|
|
5967
7006
|
description:
|
|
5968
7007
|
'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.',
|
|
5969
7008
|
}),
|
|
5970
|
-
(
|
|
7009
|
+
(Pt = [
|
|
5971
7010
|
{
|
|
5972
7011
|
name: 'prompt',
|
|
5973
7012
|
type: 'string',
|
|
@@ -6045,8 +7084,8 @@ var Ti,
|
|
|
6045
7084
|
description:
|
|
6046
7085
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
6047
7086
|
},
|
|
6048
|
-
|
|
6049
|
-
|
|
7087
|
+
qt,
|
|
7088
|
+
$t,
|
|
6050
7089
|
{
|
|
6051
7090
|
name: 'first_frame_image',
|
|
6052
7091
|
type: 'string',
|
|
@@ -6067,7 +7106,7 @@ var Ti,
|
|
|
6067
7106
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
6068
7107
|
},
|
|
6069
7108
|
]),
|
|
6070
|
-
(
|
|
7109
|
+
(Jr = [
|
|
6071
7110
|
{
|
|
6072
7111
|
name: 'prompt',
|
|
6073
7112
|
type: 'string',
|
|
@@ -6122,8 +7161,8 @@ var Ti,
|
|
|
6122
7161
|
description:
|
|
6123
7162
|
'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
|
|
6124
7163
|
},
|
|
6125
|
-
|
|
6126
|
-
|
|
7164
|
+
qt,
|
|
7165
|
+
$t,
|
|
6127
7166
|
{
|
|
6128
7167
|
name: 'first_frame_image',
|
|
6129
7168
|
type: 'string',
|
|
@@ -6138,53 +7177,53 @@ var Ti,
|
|
|
6138
7177
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
6139
7178
|
},
|
|
6140
7179
|
]));
|
|
6141
|
-
ue =
|
|
6142
|
-
|
|
7180
|
+
ue = Hr();
|
|
7181
|
+
Yr = ['draft_task_id', 'draft_generation_id'];
|
|
6143
7182
|
});
|
|
6144
7183
|
function me(e) {
|
|
6145
7184
|
let t = '/v1/pricing/models',
|
|
6146
|
-
|
|
6147
|
-
return
|
|
7185
|
+
r = e?.trim();
|
|
7186
|
+
return r ? `${t}?model=${encodeURIComponent(r)}` : t;
|
|
6148
7187
|
}
|
|
6149
|
-
var
|
|
7188
|
+
var Ve = y(() => {
|
|
6150
7189
|
'use strict';
|
|
6151
7190
|
});
|
|
6152
|
-
function
|
|
7191
|
+
function jt(e) {
|
|
6153
7192
|
return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
|
|
6154
7193
|
}
|
|
6155
|
-
function
|
|
6156
|
-
let t = oe().filter((
|
|
6157
|
-
|
|
6158
|
-
|
|
7194
|
+
function Ft(e) {
|
|
7195
|
+
let t = oe().filter((n) => n.kind === e && n.unfiltered != null),
|
|
7196
|
+
r = t.filter((n) => J.includes(n.api.model)).map((n) => n.name),
|
|
7197
|
+
i = t.filter((n) => !J.includes(n.api.model)).map((n) => n.name);
|
|
6159
7198
|
return [
|
|
6160
|
-
...(
|
|
6161
|
-
? [`${
|
|
7199
|
+
...(r.length
|
|
7200
|
+
? [`${jt(r)}: runs the Creative mode checkpoint at its published price (+5%).`]
|
|
6162
7201
|
: []),
|
|
6163
|
-
...(
|
|
7202
|
+
...(i.length ? [`Not available yet on ${jt(i)}: ${de}.`] : []),
|
|
6164
7203
|
'The Acceptable Use Policy applies.',
|
|
6165
7204
|
].join(' ');
|
|
6166
7205
|
}
|
|
6167
|
-
function
|
|
6168
|
-
if (
|
|
7206
|
+
function wi(e) {
|
|
7207
|
+
if (bi.has(e.name)) return e;
|
|
6169
7208
|
let t = e.inputSchema.properties;
|
|
6170
7209
|
return !t || t.callback_url
|
|
6171
7210
|
? e
|
|
6172
|
-
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url:
|
|
7211
|
+
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: yi } } };
|
|
6173
7212
|
}
|
|
6174
|
-
function
|
|
7213
|
+
function xi(e) {
|
|
6175
7214
|
let t = e.inputSchema.properties;
|
|
6176
7215
|
if (!t) return e;
|
|
6177
|
-
let
|
|
6178
|
-
|
|
6179
|
-
for (let [
|
|
6180
|
-
|
|
6181
|
-
? ((
|
|
6182
|
-
:
|
|
6183
|
-
? ((
|
|
6184
|
-
: (
|
|
6185
|
-
return
|
|
7216
|
+
let r = !1,
|
|
7217
|
+
i = {};
|
|
7218
|
+
for (let [s, n] of Object.entries(t))
|
|
7219
|
+
Gt.has(s) && n.type === 'string' && !n.format
|
|
7220
|
+
? ((i[s] = { ...n, format: 'uri' }), (r = !0))
|
|
7221
|
+
: Gt.has(s) && n.type === 'array' && n.items?.type === 'string' && !n.items.format
|
|
7222
|
+
? ((i[s] = { ...n, items: { ...n.items, format: 'uri' } }), (r = !0))
|
|
7223
|
+
: (i[s] = n);
|
|
7224
|
+
return r ? { ...e, inputSchema: { ...e.inputSchema, properties: i } } : e;
|
|
6186
7225
|
}
|
|
6187
|
-
function
|
|
7226
|
+
function Ii(e) {
|
|
6188
7227
|
switch (e.type) {
|
|
6189
7228
|
case 'string':
|
|
6190
7229
|
return {
|
|
@@ -6239,32 +7278,32 @@ function wr(e) {
|
|
|
6239
7278
|
return { type: 'string', description: e.description };
|
|
6240
7279
|
}
|
|
6241
7280
|
}
|
|
6242
|
-
function
|
|
6243
|
-
let
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
for (let o of e.parameters) ((
|
|
6247
|
-
let
|
|
7281
|
+
function Pi(e, t) {
|
|
7282
|
+
let r = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
|
|
7283
|
+
i = {},
|
|
7284
|
+
s = [];
|
|
7285
|
+
for (let o of e.parameters) ((i[o.name] = Ii(o)), o.required && s.push(o.name));
|
|
7286
|
+
let n = {
|
|
6248
7287
|
type: 'object',
|
|
6249
|
-
properties:
|
|
6250
|
-
...(
|
|
7288
|
+
properties: i,
|
|
7289
|
+
...(s.length > 0 ? { required: s } : {}),
|
|
6251
7290
|
additionalProperties: !0,
|
|
6252
7291
|
};
|
|
6253
7292
|
return {
|
|
6254
|
-
name:
|
|
7293
|
+
name: r,
|
|
6255
7294
|
description: `[Tein AI - ${e.name} (${e.category})] ${e.description} (Pricing: ${e.priceFormatted})`,
|
|
6256
|
-
inputSchema:
|
|
7295
|
+
inputSchema: n,
|
|
6257
7296
|
};
|
|
6258
7297
|
}
|
|
6259
|
-
function
|
|
6260
|
-
let e =
|
|
6261
|
-
t =
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
7298
|
+
function Ti() {
|
|
7299
|
+
let e = R().filter((d) => d.category === 'Image'),
|
|
7300
|
+
t = R().filter((d) => d.category === 'Video'),
|
|
7301
|
+
r = R().filter((d) => d.category === 'Text'),
|
|
7302
|
+
i = R().filter((d) => d.category === 'Audio'),
|
|
7303
|
+
s = {
|
|
6265
7304
|
name: 'generate_image',
|
|
6266
7305
|
description:
|
|
6267
|
-
'Generate or edit images with Tein AI image models (GPT Image 2 and 2.5, Nano Banana 2 and Pro, Seedream 5.0 Pro, Qwen Image 3.0). Billed per image at the published price.',
|
|
7306
|
+
'Generate or edit images with Tein AI image models (GPT Image 2 and 2.5, Nano Banana 2 and Pro, Seedream 5.5 and 5.0 Pro, Qwen Image 3.0). Billed per image at the published price.',
|
|
6268
7307
|
inputSchema: {
|
|
6269
7308
|
type: 'object',
|
|
6270
7309
|
properties: {
|
|
@@ -6352,13 +7391,13 @@ function xr() {
|
|
|
6352
7391
|
maximum: 2147483647,
|
|
6353
7392
|
description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
|
|
6354
7393
|
},
|
|
6355
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
7394
|
+
creative_mode: { type: 'boolean', default: !1, description: Ft('image') },
|
|
6356
7395
|
},
|
|
6357
7396
|
required: ['prompt'],
|
|
6358
7397
|
additionalProperties: !0,
|
|
6359
7398
|
},
|
|
6360
7399
|
},
|
|
6361
|
-
|
|
7400
|
+
n = {
|
|
6362
7401
|
name: 'generate_video',
|
|
6363
7402
|
description:
|
|
6364
7403
|
'Generate video with Tein AI video models (Seedance 2.5, Seedance 2.0 with quality standard, fast or mini, Wan 3.0, HappyHorse, Hailuo 3). Seedance and Wan take creative_mode; Seedance takes priority.',
|
|
@@ -6389,7 +7428,7 @@ function xr() {
|
|
|
6389
7428
|
default: '480p',
|
|
6390
7429
|
description: 'Video resolution (the lowest price is the default; see each model tool).',
|
|
6391
7430
|
},
|
|
6392
|
-
creative_mode: { type: 'boolean', default: !1, description:
|
|
7431
|
+
creative_mode: { type: 'boolean', default: !1, description: Ft('video') },
|
|
6393
7432
|
priority: {
|
|
6394
7433
|
type: 'boolean',
|
|
6395
7434
|
default: !1,
|
|
@@ -6457,7 +7496,7 @@ function xr() {
|
|
|
6457
7496
|
prompt: { type: 'string', description: 'The reasoning task or query to execute.' },
|
|
6458
7497
|
model: {
|
|
6459
7498
|
type: 'string',
|
|
6460
|
-
enum:
|
|
7499
|
+
enum: r.map((d) => d.slug),
|
|
6461
7500
|
default: 'gpt-6-astra',
|
|
6462
7501
|
description: 'The reasoning model to use (default: gpt-6-astra).',
|
|
6463
7502
|
},
|
|
@@ -6480,16 +7519,32 @@ function xr() {
|
|
|
6480
7519
|
},
|
|
6481
7520
|
l = {
|
|
6482
7521
|
name: 'generate_mesh',
|
|
6483
|
-
description:
|
|
7522
|
+
description:
|
|
7523
|
+
'Split an image into layers (layer decomposition): Seedream 5.0 Pro by default, or model seedream-5-5 for up to 100 transparent layers billed per layer made, with optional typeset-text recognition.',
|
|
6484
7524
|
inputSchema: {
|
|
6485
7525
|
type: 'object',
|
|
6486
7526
|
properties: {
|
|
7527
|
+
model: {
|
|
7528
|
+
type: 'string',
|
|
7529
|
+
enum: ['seedream-5-pro', 'seedream-5-5'],
|
|
7530
|
+
description: 'seedream-5-pro (default) or seedream-5-5.',
|
|
7531
|
+
},
|
|
6487
7532
|
prompt: { type: 'string', description: 'What to separate into layers.' },
|
|
6488
7533
|
images: {
|
|
6489
7534
|
type: 'array',
|
|
6490
7535
|
items: { type: 'string' },
|
|
6491
7536
|
description: 'The image to decompose (jpeg or png).',
|
|
6492
7537
|
},
|
|
7538
|
+
max_layers: {
|
|
7539
|
+
type: 'number',
|
|
7540
|
+
description:
|
|
7541
|
+
'seedream-5-5 only: most images to return, the base image included (2-100, default 30). You pay for the layers made.',
|
|
7542
|
+
},
|
|
7543
|
+
text_recognition: {
|
|
7544
|
+
type: 'boolean',
|
|
7545
|
+
description:
|
|
7546
|
+
'seedream-5-5 only: return the text and style of each typeset text layer (layer.text_recognition).',
|
|
7547
|
+
},
|
|
6493
7548
|
},
|
|
6494
7549
|
required: ['prompt'],
|
|
6495
7550
|
additionalProperties: !0,
|
|
@@ -6511,10 +7566,10 @@ function xr() {
|
|
|
6511
7566
|
additionalProperties: !0,
|
|
6512
7567
|
},
|
|
6513
7568
|
},
|
|
6514
|
-
p =
|
|
6515
|
-
return [
|
|
7569
|
+
p = vi();
|
|
7570
|
+
return [s, n, o, u, l, p, c, ki];
|
|
6516
7571
|
}
|
|
6517
|
-
function
|
|
7572
|
+
function vi() {
|
|
6518
7573
|
return {
|
|
6519
7574
|
name: 'upload_asset',
|
|
6520
7575
|
description:
|
|
@@ -6561,26 +7616,26 @@ function vr() {
|
|
|
6561
7616
|
},
|
|
6562
7617
|
};
|
|
6563
7618
|
}
|
|
6564
|
-
function
|
|
6565
|
-
let e =
|
|
6566
|
-
t =
|
|
6567
|
-
return [...e, ...t].map(
|
|
7619
|
+
function Ge() {
|
|
7620
|
+
let e = Ti(),
|
|
7621
|
+
t = R().map((r) => Pi(r));
|
|
7622
|
+
return [...e, ...t].map(wi).map(xi);
|
|
6568
7623
|
}
|
|
6569
|
-
var
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
7624
|
+
var yi,
|
|
7625
|
+
bi,
|
|
7626
|
+
ki,
|
|
7627
|
+
Gt,
|
|
7628
|
+
zt = y(() => {
|
|
6574
7629
|
'use strict';
|
|
6575
|
-
|
|
7630
|
+
B();
|
|
6576
7631
|
Ce();
|
|
6577
|
-
|
|
6578
|
-
((
|
|
7632
|
+
W();
|
|
7633
|
+
((yi = {
|
|
6579
7634
|
type: 'string',
|
|
6580
7635
|
description:
|
|
6581
7636
|
'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.',
|
|
6582
7637
|
}),
|
|
6583
|
-
(
|
|
7638
|
+
(bi = new Set([
|
|
6584
7639
|
'upload_asset',
|
|
6585
7640
|
'upload_media',
|
|
6586
7641
|
'upload_image',
|
|
@@ -6588,7 +7643,7 @@ var fr,
|
|
|
6588
7643
|
'check_status',
|
|
6589
7644
|
'get_pricing',
|
|
6590
7645
|
])),
|
|
6591
|
-
(
|
|
7646
|
+
(ki = {
|
|
6592
7647
|
name: 'get_pricing',
|
|
6593
7648
|
description:
|
|
6594
7649
|
'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.',
|
|
@@ -6603,7 +7658,7 @@ var fr,
|
|
|
6603
7658
|
additionalProperties: !1,
|
|
6604
7659
|
},
|
|
6605
7660
|
}));
|
|
6606
|
-
|
|
7661
|
+
Gt = new Set([
|
|
6607
7662
|
'image',
|
|
6608
7663
|
'images',
|
|
6609
7664
|
'image_url',
|
|
@@ -6620,31 +7675,31 @@ var fr,
|
|
|
6620
7675
|
'lipsyncing_audio',
|
|
6621
7676
|
]);
|
|
6622
7677
|
});
|
|
6623
|
-
var
|
|
6624
|
-
|
|
6625
|
-
forgetToolSchemas: () =>
|
|
6626
|
-
jsonRpcAnswer: () =>
|
|
6627
|
-
preprocessLocalFiles: () =>
|
|
6628
|
-
startStdioServer: () =>
|
|
7678
|
+
var rr = {};
|
|
7679
|
+
dr(rr, {
|
|
7680
|
+
forgetToolSchemas: () => qi,
|
|
7681
|
+
jsonRpcAnswer: () => Yt,
|
|
7682
|
+
preprocessLocalFiles: () => er,
|
|
7683
|
+
startStdioServer: () => tr,
|
|
6629
7684
|
});
|
|
6630
|
-
function
|
|
6631
|
-
let t = (
|
|
6632
|
-
!!
|
|
7685
|
+
function _i(e) {
|
|
7686
|
+
let t = (r) =>
|
|
7687
|
+
!!r && typeof r == 'object' && r.jsonrpc === '2.0' && ('result' in r || 'error' in r);
|
|
6633
7688
|
return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
|
|
6634
7689
|
}
|
|
6635
|
-
function
|
|
6636
|
-
let
|
|
6637
|
-
|
|
6638
|
-
|
|
7690
|
+
function Yt(e, t, r) {
|
|
7691
|
+
let i = e?.id,
|
|
7692
|
+
s = i == null,
|
|
7693
|
+
n = null;
|
|
6639
7694
|
try {
|
|
6640
|
-
|
|
7695
|
+
n = r ? JSON.parse(r) : null;
|
|
6641
7696
|
} catch {
|
|
6642
|
-
|
|
7697
|
+
n = null;
|
|
6643
7698
|
}
|
|
6644
|
-
if (
|
|
6645
|
-
if (
|
|
6646
|
-
if (!
|
|
6647
|
-
let o =
|
|
7699
|
+
if (n !== null && _i(n)) return s ? null : n;
|
|
7700
|
+
if (s) return null;
|
|
7701
|
+
if (!r && t >= 200 && t < 300) return;
|
|
7702
|
+
let o = n?.error,
|
|
6648
7703
|
u =
|
|
6649
7704
|
typeof o == 'string'
|
|
6650
7705
|
? o
|
|
@@ -6654,7 +7709,7 @@ function Ht(e, t, i) {
|
|
|
6654
7709
|
l = o && typeof o == 'object' && typeof o.code == 'string' ? o.code : null;
|
|
6655
7710
|
return {
|
|
6656
7711
|
jsonrpc: '2.0',
|
|
6657
|
-
id:
|
|
7712
|
+
id: i,
|
|
6658
7713
|
error: {
|
|
6659
7714
|
code: t === 401 ? -32001 : -32603,
|
|
6660
7715
|
message: u,
|
|
@@ -6662,23 +7717,23 @@ function Ht(e, t, i) {
|
|
|
6662
7717
|
},
|
|
6663
7718
|
};
|
|
6664
7719
|
}
|
|
6665
|
-
function
|
|
7720
|
+
function Mi() {
|
|
6666
7721
|
let e = process.argv.slice(2),
|
|
6667
7722
|
t = e.indexOf('--api-key');
|
|
6668
|
-
return
|
|
7723
|
+
return q(t >= 0 ? e[t + 1] : void 0);
|
|
6669
7724
|
}
|
|
6670
|
-
async function
|
|
6671
|
-
let
|
|
6672
|
-
if (!
|
|
7725
|
+
async function Qt(e, t, r) {
|
|
7726
|
+
let i = F.default.resolve(e);
|
|
7727
|
+
if (!D.default.existsSync(i) || !D.default.statSync(i).isFile())
|
|
6673
7728
|
throw new Error(`File not found: ${e}`);
|
|
6674
|
-
let
|
|
6675
|
-
|
|
6676
|
-
o =
|
|
6677
|
-
u = `${
|
|
7729
|
+
let s = D.default.readFileSync(i),
|
|
7730
|
+
n = s.toString('base64'),
|
|
7731
|
+
o = s.length,
|
|
7732
|
+
u = `${r.replace(/\/$/, '')}/v1/upload`,
|
|
6678
7733
|
l = await fetch(u, {
|
|
6679
7734
|
method: 'POST',
|
|
6680
7735
|
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${t}` },
|
|
6681
|
-
body: JSON.stringify({ data:
|
|
7736
|
+
body: JSON.stringify({ data: n }),
|
|
6682
7737
|
});
|
|
6683
7738
|
if (!l.ok) {
|
|
6684
7739
|
let p = `Upload failed (HTTP ${l.status})`;
|
|
@@ -6696,15 +7751,15 @@ async function Wt(e, t, i) {
|
|
|
6696
7751
|
mimeType: c.mime_type || c.mimeType || 'image/png',
|
|
6697
7752
|
};
|
|
6698
7753
|
}
|
|
6699
|
-
function
|
|
6700
|
-
return
|
|
7754
|
+
function Xt(e) {
|
|
7755
|
+
return Ki.has(F.default.extname(e).toLowerCase());
|
|
6701
7756
|
}
|
|
6702
|
-
function
|
|
7757
|
+
function Zt(e) {
|
|
6703
7758
|
return new Error(
|
|
6704
|
-
`Tein uploads image, video and audio files only, and ${
|
|
7759
|
+
`Tein uploads image, video and audio files only, and ${F.default.basename(e)} is not one.`,
|
|
6705
7760
|
);
|
|
6706
7761
|
}
|
|
6707
|
-
function
|
|
7762
|
+
function Si(e) {
|
|
6708
7763
|
let t = e.trim();
|
|
6709
7764
|
if (
|
|
6710
7765
|
!t ||
|
|
@@ -6714,27 +7769,27 @@ function Tr(e) {
|
|
|
6714
7769
|
`)
|
|
6715
7770
|
)
|
|
6716
7771
|
return null;
|
|
6717
|
-
let
|
|
6718
|
-
return
|
|
7772
|
+
let r = F.default.resolve(t);
|
|
7773
|
+
return D.default.existsSync(r) && D.default.statSync(r).isFile() ? r : null;
|
|
6719
7774
|
}
|
|
6720
7775
|
function Je(e) {
|
|
6721
7776
|
if (Array.isArray(e))
|
|
6722
7777
|
for (let t of e) {
|
|
6723
|
-
let
|
|
6724
|
-
typeof
|
|
6725
|
-
|
|
6726
|
-
typeof
|
|
6727
|
-
|
|
7778
|
+
let r = t;
|
|
7779
|
+
typeof r.name == 'string' &&
|
|
7780
|
+
r.inputSchema &&
|
|
7781
|
+
typeof r.inputSchema == 'object' &&
|
|
7782
|
+
X.set(r.name, r.inputSchema);
|
|
6728
7783
|
}
|
|
6729
7784
|
}
|
|
6730
|
-
function
|
|
6731
|
-
(
|
|
7785
|
+
function qi() {
|
|
7786
|
+
(X.clear(), (ze = 0));
|
|
6732
7787
|
}
|
|
6733
|
-
async function
|
|
6734
|
-
if (!(Date.now() -
|
|
6735
|
-
|
|
7788
|
+
async function $i(e, t) {
|
|
7789
|
+
if (!(Date.now() - ze < 6e4)) {
|
|
7790
|
+
ze = Date.now();
|
|
6736
7791
|
try {
|
|
6737
|
-
let
|
|
7792
|
+
let i = await (
|
|
6738
7793
|
await fetch(e, {
|
|
6739
7794
|
method: 'POST',
|
|
6740
7795
|
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${t}` },
|
|
@@ -6742,39 +7797,39 @@ async function Kr(e, t) {
|
|
|
6742
7797
|
signal: AbortSignal.timeout(1e4),
|
|
6743
7798
|
})
|
|
6744
7799
|
).json();
|
|
6745
|
-
Je(
|
|
7800
|
+
Je(i.result?.tools);
|
|
6746
7801
|
} catch {}
|
|
6747
7802
|
}
|
|
6748
7803
|
}
|
|
6749
|
-
function
|
|
7804
|
+
function Ci(e) {
|
|
6750
7805
|
return e
|
|
6751
7806
|
? e.type === 'string'
|
|
6752
7807
|
? e.format === 'uri'
|
|
6753
7808
|
: e.type === 'array' && e.items?.format === 'uri'
|
|
6754
7809
|
: !1;
|
|
6755
7810
|
}
|
|
6756
|
-
async function
|
|
7811
|
+
async function Jt(e, t, r) {
|
|
6757
7812
|
if (typeof e != 'string') return e;
|
|
6758
|
-
let
|
|
6759
|
-
if (!
|
|
6760
|
-
if (!
|
|
6761
|
-
return (await
|
|
7813
|
+
let i = Si(e);
|
|
7814
|
+
if (!i) return e;
|
|
7815
|
+
if (!Xt(i)) throw Zt(i);
|
|
7816
|
+
return (await Qt(i, t, r)).url;
|
|
6762
7817
|
}
|
|
6763
|
-
async function
|
|
6764
|
-
(
|
|
6765
|
-
let
|
|
6766
|
-
if (!
|
|
7818
|
+
async function er(e, t, r, i, s) {
|
|
7819
|
+
(X.size === 0 && Je(Ge()), X.has(e) || (await $i(s, r)));
|
|
7820
|
+
let n = X.get(e)?.properties;
|
|
7821
|
+
if (!n) return t;
|
|
6767
7822
|
let o = { ...t };
|
|
6768
7823
|
for (let [u, l] of Object.entries(t))
|
|
6769
|
-
if (
|
|
7824
|
+
if (Ci(n[u]))
|
|
6770
7825
|
if (Array.isArray(l)) {
|
|
6771
7826
|
let c = [];
|
|
6772
|
-
for (let p of l) c.push(await
|
|
7827
|
+
for (let p of l) c.push(await Jt(p, r, i));
|
|
6773
7828
|
o[u] = c;
|
|
6774
|
-
} else o[u] = await
|
|
7829
|
+
} else o[u] = await Jt(l, r, i);
|
|
6775
7830
|
return o;
|
|
6776
7831
|
}
|
|
6777
|
-
function
|
|
7832
|
+
function Ei(e) {
|
|
6778
7833
|
let t = e.id ?? null;
|
|
6779
7834
|
switch (e.method) {
|
|
6780
7835
|
case 'initialize':
|
|
@@ -6792,7 +7847,7 @@ function $r(e) {
|
|
|
6792
7847
|
case 'ping':
|
|
6793
7848
|
return { jsonrpc: '2.0', id: t, result: {} };
|
|
6794
7849
|
case 'tools/list':
|
|
6795
|
-
return { jsonrpc: '2.0', id: t, result: { tools:
|
|
7850
|
+
return { jsonrpc: '2.0', id: t, result: { tools: Ge() } };
|
|
6796
7851
|
case 'tools/call':
|
|
6797
7852
|
return {
|
|
6798
7853
|
jsonrpc: '2.0',
|
|
@@ -6815,19 +7870,19 @@ function $r(e) {
|
|
|
6815
7870
|
};
|
|
6816
7871
|
}
|
|
6817
7872
|
}
|
|
6818
|
-
async function
|
|
6819
|
-
if (
|
|
6820
|
-
|
|
6821
|
-
let e =
|
|
6822
|
-
t =
|
|
6823
|
-
|
|
6824
|
-
(
|
|
7873
|
+
async function tr() {
|
|
7874
|
+
if (Ht) return;
|
|
7875
|
+
Ht = !0;
|
|
7876
|
+
let e = Mi(),
|
|
7877
|
+
t = P(),
|
|
7878
|
+
r = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
|
|
7879
|
+
(Wt.default
|
|
6825
7880
|
.createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
|
|
6826
|
-
.on('line', async (
|
|
6827
|
-
let
|
|
6828
|
-
if (
|
|
7881
|
+
.on('line', async (s) => {
|
|
7882
|
+
let n = s.trim();
|
|
7883
|
+
if (n)
|
|
6829
7884
|
try {
|
|
6830
|
-
let o = JSON.parse(
|
|
7885
|
+
let o = JSON.parse(n);
|
|
6831
7886
|
if (o && o.method === 'tools/call' && o.params) {
|
|
6832
7887
|
let l = o.params.name,
|
|
6833
7888
|
c = o.params.arguments || {};
|
|
@@ -6880,10 +7935,10 @@ async function Zt() {
|
|
|
6880
7935
|
!p.startsWith('data:')
|
|
6881
7936
|
)
|
|
6882
7937
|
try {
|
|
6883
|
-
let d =
|
|
6884
|
-
if (
|
|
6885
|
-
if (!
|
|
6886
|
-
let m = await
|
|
7938
|
+
let d = F.default.resolve(p.trim());
|
|
7939
|
+
if (D.default.existsSync(d) && D.default.statSync(d).isFile() && e) {
|
|
7940
|
+
if (!Xt(d)) throw Zt(d);
|
|
7941
|
+
let m = await Qt(d, e, t),
|
|
6887
7942
|
h = (m.sizeBytes / 1024).toFixed(1),
|
|
6888
7943
|
fe =
|
|
6889
7944
|
m.mimeType.startsWith('image/') ||
|
|
@@ -6939,7 +7994,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6939
7994
|
}
|
|
6940
7995
|
if (e)
|
|
6941
7996
|
try {
|
|
6942
|
-
o.params.arguments = await
|
|
7997
|
+
o.params.arguments = await er(String(l), c, e, t, r);
|
|
6943
7998
|
} catch (p) {
|
|
6944
7999
|
let d = p instanceof Error ? p.message : String(p);
|
|
6945
8000
|
process.stdout.write(
|
|
@@ -6964,13 +8019,13 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6964
8019
|
}
|
|
6965
8020
|
if (e)
|
|
6966
8021
|
try {
|
|
6967
|
-
let l = await fetch(
|
|
8022
|
+
let l = await fetch(r, {
|
|
6968
8023
|
method: 'POST',
|
|
6969
8024
|
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${e}` },
|
|
6970
8025
|
body: JSON.stringify(o),
|
|
6971
8026
|
}),
|
|
6972
8027
|
c = await l.text(),
|
|
6973
|
-
p =
|
|
8028
|
+
p = Yt(o, l.status, c);
|
|
6974
8029
|
if (p === null) return;
|
|
6975
8030
|
if (p) {
|
|
6976
8031
|
(o?.method === 'tools/list' && Je(p.result?.tools),
|
|
@@ -6982,7 +8037,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6982
8037
|
return;
|
|
6983
8038
|
}
|
|
6984
8039
|
} catch {}
|
|
6985
|
-
let u =
|
|
8040
|
+
let u = Ei(o);
|
|
6986
8041
|
u !== null &&
|
|
6987
8042
|
process.stdout.write(
|
|
6988
8043
|
JSON.stringify(u) +
|
|
@@ -7005,22 +8060,22 @@ Pass this URL to any Tein generation tool.`,
|
|
|
7005
8060
|
process.stderr.write(`Tein AI MCP Server running on stdio transport.
|
|
7006
8061
|
`));
|
|
7007
8062
|
}
|
|
7008
|
-
var
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
8063
|
+
var D,
|
|
8064
|
+
F,
|
|
8065
|
+
Wt,
|
|
8066
|
+
Ki,
|
|
8067
|
+
X,
|
|
8068
|
+
ze,
|
|
8069
|
+
Ht,
|
|
8070
|
+
ir = y(() => {
|
|
7016
8071
|
'use strict';
|
|
7017
|
-
((
|
|
7018
|
-
(
|
|
7019
|
-
(
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
8072
|
+
((D = T(require('node:fs'))),
|
|
8073
|
+
(F = T(require('node:path'))),
|
|
8074
|
+
(Wt = T(require('node:readline'))));
|
|
8075
|
+
Ve();
|
|
8076
|
+
zt();
|
|
8077
|
+
A();
|
|
8078
|
+
Ki = new Set([
|
|
7024
8079
|
'.png',
|
|
7025
8080
|
'.jpg',
|
|
7026
8081
|
'.jpeg',
|
|
@@ -7046,42 +8101,42 @@ var R,
|
|
|
7046
8101
|
'.flac',
|
|
7047
8102
|
'.opus',
|
|
7048
8103
|
]);
|
|
7049
|
-
((
|
|
7050
|
-
|
|
8104
|
+
((X = new Map()), (ze = 0));
|
|
8105
|
+
Ht = !1;
|
|
7051
8106
|
require.main === module &&
|
|
7052
|
-
|
|
8107
|
+
tr().catch((e) => {
|
|
7053
8108
|
(process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
|
|
7054
8109
|
`),
|
|
7055
8110
|
process.exit(1));
|
|
7056
8111
|
});
|
|
7057
8112
|
});
|
|
7058
|
-
var
|
|
8113
|
+
var ur =
|
|
7059
8114
|
!process.env.NO_COLOR &&
|
|
7060
8115
|
(process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
|
|
7061
|
-
function
|
|
7062
|
-
return (
|
|
8116
|
+
function k(e, t) {
|
|
8117
|
+
return (r) => (ur ? `\x1B[${e}m${r}\x1B[${t}m` : String(r));
|
|
7063
8118
|
}
|
|
7064
8119
|
var a = {
|
|
7065
|
-
bold:
|
|
7066
|
-
dim:
|
|
7067
|
-
italic:
|
|
7068
|
-
underline:
|
|
7069
|
-
inverse:
|
|
7070
|
-
black:
|
|
7071
|
-
red:
|
|
7072
|
-
green:
|
|
7073
|
-
yellow:
|
|
7074
|
-
blue:
|
|
7075
|
-
magenta:
|
|
7076
|
-
cyan:
|
|
7077
|
-
white:
|
|
7078
|
-
gray:
|
|
7079
|
-
bgBlue:
|
|
7080
|
-
bgMagenta:
|
|
7081
|
-
bgCyan:
|
|
7082
|
-
bgGreen:
|
|
8120
|
+
bold: k(1, 22),
|
|
8121
|
+
dim: k(2, 22),
|
|
8122
|
+
italic: k(3, 23),
|
|
8123
|
+
underline: k(4, 24),
|
|
8124
|
+
inverse: k(7, 27),
|
|
8125
|
+
black: k(30, 39),
|
|
8126
|
+
red: k(31, 39),
|
|
8127
|
+
green: k(32, 39),
|
|
8128
|
+
yellow: k(33, 39),
|
|
8129
|
+
blue: k(34, 39),
|
|
8130
|
+
magenta: k(35, 39),
|
|
8131
|
+
cyan: k(36, 39),
|
|
8132
|
+
white: k(37, 39),
|
|
8133
|
+
gray: k(90, 39),
|
|
8134
|
+
bgBlue: k(44, 49),
|
|
8135
|
+
bgMagenta: k(45, 49),
|
|
8136
|
+
bgCyan: k(46, 49),
|
|
8137
|
+
bgGreen: k(42, 49),
|
|
7083
8138
|
},
|
|
7084
|
-
|
|
8139
|
+
_ = class {
|
|
7085
8140
|
constructor(t = '') {
|
|
7086
8141
|
this.frames = [
|
|
7087
8142
|
'\u280B',
|
|
@@ -7105,8 +8160,8 @@ var a = {
|
|
|
7105
8160
|
process.stdout.isTTY
|
|
7106
8161
|
? (this.stop(),
|
|
7107
8162
|
(this.timer = setInterval(() => {
|
|
7108
|
-
let
|
|
7109
|
-
(process.stdout.write(`\r${
|
|
8163
|
+
let r = a.cyan(this.frames[this.current]);
|
|
8164
|
+
(process.stdout.write(`\r${r} ${this.text} `),
|
|
7110
8165
|
(this.current = (this.current + 1) % this.frames.length));
|
|
7111
8166
|
}, 80)),
|
|
7112
8167
|
this)
|
|
@@ -7120,20 +8175,20 @@ var a = {
|
|
|
7120
8175
|
}
|
|
7121
8176
|
succeed(t) {
|
|
7122
8177
|
this.stop();
|
|
7123
|
-
let
|
|
8178
|
+
let r = t || this.text;
|
|
7124
8179
|
process.stdout.isTTY
|
|
7125
|
-
? process.stdout.write(`\r${a.green('\u2713')} ${
|
|
8180
|
+
? process.stdout.write(`\r${a.green('\u2713')} ${r}
|
|
7126
8181
|
`)
|
|
7127
|
-
: process.stdout.write(`[\u2713] ${
|
|
8182
|
+
: process.stdout.write(`[\u2713] ${r}
|
|
7128
8183
|
`);
|
|
7129
8184
|
}
|
|
7130
8185
|
fail(t) {
|
|
7131
8186
|
this.stop();
|
|
7132
|
-
let
|
|
8187
|
+
let r = t || this.text;
|
|
7133
8188
|
process.stdout.isTTY
|
|
7134
|
-
? process.stdout.write(`\r${a.red('\u2717')} ${
|
|
8189
|
+
? process.stdout.write(`\r${a.red('\u2717')} ${r}
|
|
7135
8190
|
`)
|
|
7136
|
-
: process.stdout.write(`[\u2717] ${
|
|
8191
|
+
: process.stdout.write(`[\u2717] ${r}
|
|
7137
8192
|
`);
|
|
7138
8193
|
}
|
|
7139
8194
|
stop() {
|
|
@@ -7143,78 +8198,78 @@ var a = {
|
|
|
7143
8198
|
process.stdout.isTTY && process.stdout.write('\r\x1B[K'));
|
|
7144
8199
|
}
|
|
7145
8200
|
};
|
|
7146
|
-
var
|
|
7147
|
-
|
|
7148
|
-
var ee =
|
|
7149
|
-
|
|
7150
|
-
|
|
8201
|
+
var V = T(require('node:fs')),
|
|
8202
|
+
$ = T(require('node:path'));
|
|
8203
|
+
var ee = T(require('node:fs')),
|
|
8204
|
+
Qe = T(require('node:path')),
|
|
8205
|
+
Xe = require('node:stream/promises');
|
|
7151
8206
|
var Z = '1.1.7';
|
|
7152
|
-
var
|
|
8207
|
+
var mr = new Set([
|
|
7153
8208
|
'account_suspended',
|
|
7154
8209
|
'account_terminated',
|
|
7155
8210
|
'creative_mode_restricted',
|
|
7156
8211
|
'unfiltered_restricted',
|
|
7157
8212
|
'workspace_paused',
|
|
7158
8213
|
]),
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
constructor(t,
|
|
7163
|
-
(super(
|
|
8214
|
+
v = 1,
|
|
8215
|
+
fr = 3,
|
|
8216
|
+
w = class extends Error {
|
|
8217
|
+
constructor(t, r, i, s = {}) {
|
|
8218
|
+
(super(r),
|
|
7164
8219
|
(this.name = 'TeinApiError'),
|
|
7165
8220
|
(this.status = t),
|
|
7166
|
-
|
|
7167
|
-
(this.fields =
|
|
8221
|
+
i && (this.code = i),
|
|
8222
|
+
(this.fields = s));
|
|
7168
8223
|
}
|
|
7169
8224
|
get exitCode() {
|
|
7170
|
-
return this.code &&
|
|
8225
|
+
return this.code && mr.has(this.code) ? fr : v;
|
|
7171
8226
|
}
|
|
7172
8227
|
};
|
|
7173
|
-
function
|
|
7174
|
-
let
|
|
7175
|
-
if (!
|
|
7176
|
-
let
|
|
7177
|
-
if (
|
|
7178
|
-
let p =
|
|
8228
|
+
function gr(e, t, r) {
|
|
8229
|
+
let i = `HTTP ${e}${t ? ` ${t}` : ''}`;
|
|
8230
|
+
if (!r || typeof r != 'object') return new w(e, i);
|
|
8231
|
+
let s = r;
|
|
8232
|
+
if (s.error && typeof s.error == 'object' && !Array.isArray(s.error)) {
|
|
8233
|
+
let p = s.error,
|
|
7179
8234
|
{ code: d, message: m, ...h } = p;
|
|
7180
|
-
return new
|
|
8235
|
+
return new w(e, typeof m == 'string' && m ? m : i, typeof d == 'string' ? d : void 0, h);
|
|
7181
8236
|
}
|
|
7182
|
-
let { error:
|
|
7183
|
-
c = (typeof
|
|
7184
|
-
return new
|
|
8237
|
+
let { error: n, code: o, message: u, ...l } = s,
|
|
8238
|
+
c = (typeof n == 'string' && n) || (typeof u == 'string' && u) || i;
|
|
8239
|
+
return new w(e, c, typeof o == 'string' ? o : void 0, l);
|
|
7185
8240
|
}
|
|
7186
|
-
function
|
|
8241
|
+
function We(e) {
|
|
7187
8242
|
return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
|
|
7188
8243
|
}
|
|
7189
|
-
function
|
|
8244
|
+
function S(e) {
|
|
7190
8245
|
let t = [e.message],
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
(
|
|
7194
|
-
t.push([
|
|
7195
|
-
let
|
|
7196
|
-
typeof
|
|
7197
|
-
let
|
|
7198
|
-
return (typeof
|
|
8246
|
+
r = We(e.fields.required),
|
|
8247
|
+
i = We(e.fields.balance);
|
|
8248
|
+
(r || i) &&
|
|
8249
|
+
t.push([r ? `Required: ${r}` : '', i ? `Balance: ${i}` : ''].filter(Boolean).join(' '));
|
|
8250
|
+
let s = e.fields.org_name ?? e.fields.orgName;
|
|
8251
|
+
typeof s == 'string' && s && t.push(`Workspace: ${s}`);
|
|
8252
|
+
let n = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
|
|
8253
|
+
return (typeof n == 'string' && n && t.push(n), e.code && t.push(`(${e.code})`), t);
|
|
7199
8254
|
}
|
|
7200
|
-
function
|
|
8255
|
+
function hr(e) {
|
|
7201
8256
|
return /\.(mp4|webm|mov)(\?|$)/i.test(e)
|
|
7202
8257
|
? 'video'
|
|
7203
8258
|
: /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
|
|
7204
8259
|
? 'audio'
|
|
7205
8260
|
: 'image';
|
|
7206
8261
|
}
|
|
7207
|
-
function
|
|
8262
|
+
function Ye(e) {
|
|
7208
8263
|
let t = [];
|
|
7209
|
-
for (let
|
|
7210
|
-
typeof
|
|
7211
|
-
? t.push({ type: 'text', text:
|
|
7212
|
-
:
|
|
8264
|
+
for (let r of e.data ?? [])
|
|
8265
|
+
typeof r.message?.content == 'string'
|
|
8266
|
+
? t.push({ type: 'text', text: r.message.content })
|
|
8267
|
+
: r.url && t.push({ type: hr(r.url), url: r.url, ...(r.layer ? { layer: r.layer } : {}) });
|
|
7213
8268
|
return t;
|
|
7214
8269
|
}
|
|
7215
|
-
var
|
|
7216
|
-
constructor(t,
|
|
7217
|
-
((this.apiKey = t), (this.baseUrl =
|
|
8270
|
+
var K = class {
|
|
8271
|
+
constructor(t, r) {
|
|
8272
|
+
((this.apiKey = t), (this.baseUrl = r.replace(/\/+$/, '')));
|
|
7218
8273
|
}
|
|
7219
8274
|
getHeaders() {
|
|
7220
8275
|
return {
|
|
@@ -7224,126 +8279,126 @@ var M = class {
|
|
|
7224
8279
|
'X-Tein-Client': 'cli',
|
|
7225
8280
|
};
|
|
7226
8281
|
}
|
|
7227
|
-
async send(t,
|
|
7228
|
-
let
|
|
8282
|
+
async send(t, r, i) {
|
|
8283
|
+
let s = await fetch(`${this.baseUrl}${r}`, {
|
|
7229
8284
|
method: t,
|
|
7230
8285
|
headers: this.getHeaders(),
|
|
7231
|
-
...(
|
|
8286
|
+
...(i === void 0 ? {} : { body: JSON.stringify(i) }),
|
|
7232
8287
|
});
|
|
7233
|
-
if (!
|
|
7234
|
-
let
|
|
8288
|
+
if (!s.ok) {
|
|
8289
|
+
let n = null;
|
|
7235
8290
|
try {
|
|
7236
|
-
|
|
8291
|
+
n = await s.json();
|
|
7237
8292
|
} catch {}
|
|
7238
|
-
throw
|
|
8293
|
+
throw gr(s.status, s.statusText, n);
|
|
7239
8294
|
}
|
|
7240
|
-
return await
|
|
8295
|
+
return await s.json();
|
|
7241
8296
|
}
|
|
7242
8297
|
async checkKey() {
|
|
7243
8298
|
await this.send('GET', '/v1/jobs?limit=1');
|
|
7244
8299
|
}
|
|
7245
|
-
queueJob(t,
|
|
7246
|
-
return this.send('POST', '/v1/generate', { model: t, ...
|
|
7247
|
-
let
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
?
|
|
8300
|
+
queueJob(t, r) {
|
|
8301
|
+
return this.send('POST', '/v1/generate', { model: t, ...r }).then((i) => {
|
|
8302
|
+
let s = i.status,
|
|
8303
|
+
n =
|
|
8304
|
+
s === 'succeeded' || s === 'failed' || s === 'expired' || s === 'cancelled'
|
|
8305
|
+
? s
|
|
7251
8306
|
: 'processing',
|
|
7252
|
-
o =
|
|
8307
|
+
o = Ye(i);
|
|
7253
8308
|
return {
|
|
7254
|
-
request_id:
|
|
7255
|
-
model:
|
|
7256
|
-
status:
|
|
8309
|
+
request_id: i.request_id || i.id || '',
|
|
8310
|
+
model: i.model,
|
|
8311
|
+
status: n,
|
|
7257
8312
|
...(o.length ? { output: o } : {}),
|
|
7258
|
-
error:
|
|
7259
|
-
...(
|
|
8313
|
+
error: i.error && typeof i.error.message == 'string' ? i.error.message : null,
|
|
8314
|
+
...(i.usage ? { usage: i.usage } : {}),
|
|
7260
8315
|
};
|
|
7261
8316
|
});
|
|
7262
8317
|
}
|
|
7263
8318
|
getStatus(t) {
|
|
7264
|
-
return this.send('GET', `/v1/jobs/${encodeURIComponent(t)}`).then((
|
|
7265
|
-
let
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
?
|
|
8319
|
+
return this.send('GET', `/v1/jobs/${encodeURIComponent(t)}`).then((r) => {
|
|
8320
|
+
let i = r.status,
|
|
8321
|
+
s =
|
|
8322
|
+
i === 'succeeded' || i === 'failed' || i === 'expired' || i === 'cancelled'
|
|
8323
|
+
? i
|
|
7269
8324
|
: 'processing',
|
|
7270
|
-
|
|
7271
|
-
o =
|
|
8325
|
+
n = Ye(r),
|
|
8326
|
+
o = r.error && typeof r.error.message == 'string' ? r.error.message : null;
|
|
7272
8327
|
return {
|
|
7273
|
-
request_id:
|
|
7274
|
-
model:
|
|
7275
|
-
status:
|
|
7276
|
-
...(
|
|
8328
|
+
request_id: r.id || t,
|
|
8329
|
+
model: r.model,
|
|
8330
|
+
status: s,
|
|
8331
|
+
...(n.length ? { output: n } : {}),
|
|
7277
8332
|
error: o,
|
|
7278
|
-
...(
|
|
8333
|
+
...(r.usage ? { usage: r.usage } : {}),
|
|
7279
8334
|
};
|
|
7280
8335
|
});
|
|
7281
8336
|
}
|
|
7282
8337
|
uploadAsset(t) {
|
|
7283
8338
|
return this.send('POST', '/v1/upload', { data: t });
|
|
7284
8339
|
}
|
|
7285
|
-
async downloadOutput(t,
|
|
7286
|
-
let
|
|
7287
|
-
if (!
|
|
7288
|
-
let
|
|
7289
|
-
ee.default.existsSync(
|
|
7290
|
-
let
|
|
7291
|
-
return (await (0,
|
|
8340
|
+
async downloadOutput(t, r) {
|
|
8341
|
+
let i = await fetch(t);
|
|
8342
|
+
if (!i.ok) throw new Error(`The file could not be downloaded (HTTP ${i.status})`);
|
|
8343
|
+
let s = Qe.default.dirname(r);
|
|
8344
|
+
ee.default.existsSync(s) || ee.default.mkdirSync(s, { recursive: !0 });
|
|
8345
|
+
let n = ee.default.createWriteStream(r);
|
|
8346
|
+
return (await (0, Xe.pipeline)(i.body, n), r);
|
|
7292
8347
|
}
|
|
7293
8348
|
};
|
|
7294
|
-
|
|
8349
|
+
A();
|
|
7295
8350
|
function we(e) {
|
|
7296
8351
|
if (typeof e != 'number' || !Number.isFinite(e)) return '';
|
|
7297
8352
|
if (Math.abs(e) >= 1 || Math.abs(Number(e.toFixed(4)) - e) < 1e-12) return `$${e.toFixed(4)}`;
|
|
7298
8353
|
let t = Math.max(0, 3 - Number(e.toExponential(3).split('e')[1])),
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
return
|
|
8354
|
+
r = 10 ** t,
|
|
8355
|
+
i = Math.round(Number((e * r).toFixed(6))) / r;
|
|
8356
|
+
return i >= 1 ? `$${i.toFixed(4)}` : `$${i.toFixed(t).replace(/0+$/, '')}`;
|
|
7302
8357
|
}
|
|
7303
|
-
|
|
7304
|
-
var
|
|
7305
|
-
function
|
|
7306
|
-
for (let t of
|
|
8358
|
+
W();
|
|
8359
|
+
var Et = ['images', 'input_images', 'videos', 'audios'];
|
|
8360
|
+
function Qr(e) {
|
|
8361
|
+
for (let t of Et) typeof e[t] == 'string' && (e[t] = [e[t]]);
|
|
7307
8362
|
}
|
|
7308
|
-
function
|
|
8363
|
+
function Xr(e) {
|
|
7309
8364
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
7310
|
-
let t =
|
|
7311
|
-
return
|
|
8365
|
+
let t = $.default.resolve(e);
|
|
8366
|
+
return V.default.existsSync(t) && V.default.statSync(t).isFile() ? t : null;
|
|
7312
8367
|
}
|
|
7313
|
-
async function
|
|
7314
|
-
for (let
|
|
7315
|
-
if (!Array.isArray(e[
|
|
7316
|
-
let
|
|
7317
|
-
for (let
|
|
7318
|
-
if (typeof
|
|
7319
|
-
let
|
|
7320
|
-
|
|
8368
|
+
async function Zr(e, t) {
|
|
8369
|
+
for (let r of Et) {
|
|
8370
|
+
if (!Array.isArray(e[r])) continue;
|
|
8371
|
+
let i = [];
|
|
8372
|
+
for (let s of e[r]) {
|
|
8373
|
+
if (typeof s != 'string') continue;
|
|
8374
|
+
let n = Xr(s);
|
|
8375
|
+
i.push(n ? await t(n) : s);
|
|
7321
8376
|
}
|
|
7322
|
-
e[
|
|
8377
|
+
e[r] = i;
|
|
7323
8378
|
}
|
|
7324
8379
|
}
|
|
7325
|
-
var
|
|
7326
|
-
function
|
|
8380
|
+
var Y = { starter: 10, plus: 25, scale: 40, enterprise: 300 };
|
|
8381
|
+
function ei(e) {
|
|
7327
8382
|
if (e.count === void 0 || e.count === !0) return 1;
|
|
7328
8383
|
let t = typeof e.count == 'number' ? e.count : Number(e.count),
|
|
7329
|
-
|
|
8384
|
+
r = Y.enterprise;
|
|
7330
8385
|
return (
|
|
7331
|
-
(!Number.isInteger(t) || t < 1 || t >
|
|
8386
|
+
(!Number.isInteger(t) || t < 1 || t > r) &&
|
|
7332
8387
|
(process.stderr
|
|
7333
|
-
.write(`${a.red('Error:')} --count must be a whole number from 1 to ${
|
|
8388
|
+
.write(`${a.red('Error:')} --count must be a whole number from 1 to ${r}. The API allows Starter ${Y.starter}, Plus ${Y.plus}, Scale ${Y.scale}, Enterprise ${Y.enterprise} at once, including polling.
|
|
7334
8389
|
`),
|
|
7335
8390
|
process.exit(1)),
|
|
7336
8391
|
t
|
|
7337
8392
|
);
|
|
7338
8393
|
}
|
|
7339
|
-
async function
|
|
7340
|
-
|
|
7341
|
-
process.stderr.write(`Starting ${
|
|
8394
|
+
async function ti(e, t, r, i, s) {
|
|
8395
|
+
s.isJson ||
|
|
8396
|
+
process.stderr.write(`Starting ${i} ${t} jobs together...
|
|
7342
8397
|
`);
|
|
7343
|
-
let
|
|
7344
|
-
Array.from({ length:
|
|
8398
|
+
let n = await Promise.all(
|
|
8399
|
+
Array.from({ length: i }, async () => {
|
|
7345
8400
|
try {
|
|
7346
|
-
return { job: await e.queueJob(t,
|
|
8401
|
+
return { job: await e.queueJob(t, r) };
|
|
7347
8402
|
} catch (l) {
|
|
7348
8403
|
return { err: l };
|
|
7349
8404
|
}
|
|
@@ -7351,22 +8406,22 @@ async function Zi(e, t, i, r, n) {
|
|
|
7351
8406
|
),
|
|
7352
8407
|
o = [],
|
|
7353
8408
|
u = [];
|
|
7354
|
-
for (let l of
|
|
8409
|
+
for (let l of n)
|
|
7355
8410
|
'job' in l && l.job
|
|
7356
8411
|
? o.push(l.job)
|
|
7357
8412
|
: 'err' in l &&
|
|
7358
8413
|
u.push(
|
|
7359
|
-
l.err instanceof
|
|
8414
|
+
l.err instanceof w
|
|
7360
8415
|
? l.err
|
|
7361
|
-
: new
|
|
8416
|
+
: new w(0, l.err instanceof Error ? l.err.message : String(l.err)),
|
|
7362
8417
|
);
|
|
7363
|
-
if (!
|
|
8418
|
+
if (!s.isAsync) {
|
|
7364
8419
|
let l = Date.now(),
|
|
7365
8420
|
c = o.filter((p) => p.status === 'processing' && p.request_id);
|
|
7366
8421
|
for (; c.length;) {
|
|
7367
|
-
if ((await new Promise((d) => setTimeout(d, 2e3)), !
|
|
8422
|
+
if ((await new Promise((d) => setTimeout(d, 2e3)), !s.isJson)) {
|
|
7368
8423
|
let d = Math.round((Date.now() - l) / 1e3);
|
|
7369
|
-
process.stderr.write(`Waiting on ${c.length} of ${
|
|
8424
|
+
process.stderr.write(`Waiting on ${c.length} of ${i} (${d}s)...
|
|
7370
8425
|
`);
|
|
7371
8426
|
}
|
|
7372
8427
|
let p = await Promise.all(
|
|
@@ -7385,7 +8440,7 @@ async function Zi(e, t, i, r, n) {
|
|
|
7385
8440
|
c = o.filter((d) => d.status === 'processing' && d.request_id);
|
|
7386
8441
|
}
|
|
7387
8442
|
}
|
|
7388
|
-
if (
|
|
8443
|
+
if (s.isJson)
|
|
7389
8444
|
process.stdout.write(
|
|
7390
8445
|
JSON.stringify(
|
|
7391
8446
|
{ jobs: o, errors: u.map((l) => ({ code: l.code ?? null, message: l.message })) },
|
|
@@ -7403,27 +8458,32 @@ async function Zi(e, t, i, r, n) {
|
|
|
7403
8458
|
process.stdout.write(`
|
|
7404
8459
|
`));
|
|
7405
8460
|
for (let l of u)
|
|
7406
|
-
process.stderr.write(`${
|
|
8461
|
+
process.stderr.write(`${S(l).join(`
|
|
7407
8462
|
`)}
|
|
7408
8463
|
`);
|
|
7409
8464
|
}
|
|
7410
8465
|
(u.length ||
|
|
7411
8466
|
o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
|
|
7412
|
-
process.exit(
|
|
8467
|
+
process.exit(v);
|
|
8468
|
+
}
|
|
8469
|
+
function ri(e, t, r) {
|
|
8470
|
+
if (r <= 1) return e;
|
|
8471
|
+
let i = $.default.extname(e);
|
|
8472
|
+
return `${e.slice(0, e.length - i.length)}-${t + 1}${i}`;
|
|
7413
8473
|
}
|
|
7414
|
-
function
|
|
8474
|
+
function At(e) {
|
|
7415
8475
|
let t = {},
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
for (let
|
|
7419
|
-
let
|
|
7420
|
-
if (
|
|
7421
|
-
let o =
|
|
8476
|
+
r = new Set(),
|
|
8477
|
+
i = [];
|
|
8478
|
+
for (let s = 0; s < e.length; s++) {
|
|
8479
|
+
let n = e[s];
|
|
8480
|
+
if (n.startsWith('--')) {
|
|
8481
|
+
let o = n.slice(2);
|
|
7422
8482
|
if (o.includes('=')) {
|
|
7423
8483
|
let [u, l] = o.split('=', 2);
|
|
7424
8484
|
t[u.replace(/-/g, '_')] = l;
|
|
7425
|
-
} else if (
|
|
7426
|
-
let u = e[
|
|
8485
|
+
} else if (s + 1 < e.length && !e[s + 1].startsWith('-')) {
|
|
8486
|
+
let u = e[s + 1];
|
|
7427
8487
|
(u === 'true'
|
|
7428
8488
|
? (t[o.replace(/-/g, '_')] = !0)
|
|
7429
8489
|
: u === 'false'
|
|
@@ -7431,10 +8491,10 @@ function Et(e) {
|
|
|
7431
8491
|
: /^-?\d+(\.\d+)?$/.test(u)
|
|
7432
8492
|
? (t[o.replace(/-/g, '_')] = Number(u))
|
|
7433
8493
|
: (t[o.replace(/-/g, '_')] = u),
|
|
7434
|
-
|
|
7435
|
-
} else ((t[o.replace(/-/g, '_')] = !0),
|
|
7436
|
-
} else if (
|
|
7437
|
-
let o =
|
|
8494
|
+
s++);
|
|
8495
|
+
} else ((t[o.replace(/-/g, '_')] = !0), r.add(o));
|
|
8496
|
+
} else if (n.startsWith('-') && n.length === 2) {
|
|
8497
|
+
let o = n[1],
|
|
7438
8498
|
l =
|
|
7439
8499
|
{
|
|
7440
8500
|
p: 'prompt',
|
|
@@ -7448,18 +8508,18 @@ function Et(e) {
|
|
|
7448
8508
|
v: 'version',
|
|
7449
8509
|
}[o] || o;
|
|
7450
8510
|
o === 'j' || o === 'h' || o === 'v'
|
|
7451
|
-
? ((t[l] = !0),
|
|
7452
|
-
:
|
|
7453
|
-
? ((t[l] = e[
|
|
8511
|
+
? ((t[l] = !0), r.add(l))
|
|
8512
|
+
: s + 1 < e.length && !e[s + 1].startsWith('-')
|
|
8513
|
+
? ((t[l] = e[s + 1]), s++)
|
|
7454
8514
|
: (t[l] = !0);
|
|
7455
|
-
} else
|
|
8515
|
+
} else i.push(n);
|
|
7456
8516
|
}
|
|
7457
|
-
return { command:
|
|
8517
|
+
return { command: i[0] || '', subcommand: i[1], modelSlug: i[1] || i[0], options: t, flags: r };
|
|
7458
8518
|
}
|
|
7459
|
-
async function
|
|
7460
|
-
let
|
|
7461
|
-
|
|
7462
|
-
(
|
|
8519
|
+
async function Le(e, t) {
|
|
8520
|
+
let r = q(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
8521
|
+
i = P(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
8522
|
+
(r ||
|
|
7463
8523
|
(process.stderr.write(`${a.red('Error:')} Authentication required.
|
|
7464
8524
|
`),
|
|
7465
8525
|
process.stderr
|
|
@@ -7474,11 +8534,11 @@ async function De(e, t) {
|
|
|
7474
8534
|
process.stderr.write(`Run ${a.cyan('tein models')} to list all available models.
|
|
7475
8535
|
`),
|
|
7476
8536
|
process.exit(1)));
|
|
7477
|
-
let
|
|
7478
|
-
|
|
8537
|
+
let s = j(e),
|
|
8538
|
+
n = !!t.json,
|
|
7479
8539
|
o = !!(t.async || t.no_wait),
|
|
7480
8540
|
u = typeof t.output == 'string' ? t.output : void 0,
|
|
7481
|
-
l =
|
|
8541
|
+
l = ei(t),
|
|
7482
8542
|
c = { ...t };
|
|
7483
8543
|
(delete c.json,
|
|
7484
8544
|
delete c.async,
|
|
@@ -7487,76 +8547,76 @@ async function De(e, t) {
|
|
|
7487
8547
|
delete c.api_key,
|
|
7488
8548
|
delete c.api_url,
|
|
7489
8549
|
delete c.count);
|
|
7490
|
-
let p =
|
|
7491
|
-
(
|
|
8550
|
+
let p = Ct(s, c);
|
|
8551
|
+
(Qr(p),
|
|
7492
8552
|
typeof p.image == 'string' && !p.images && ((p.images = [p.image]), delete p.image),
|
|
7493
8553
|
p.image_url &&
|
|
7494
8554
|
!p.first_frame_image &&
|
|
7495
8555
|
(e.startsWith('seedance') || e.startsWith('happy-horse')) &&
|
|
7496
8556
|
(p.first_frame_image = p.image_url));
|
|
7497
|
-
let d = new
|
|
8557
|
+
let d = new K(r, i),
|
|
7498
8558
|
m = ['image', 'first_frame_image', 'last_frame_image', 'lipsyncing_audio', 'audio', 'video'];
|
|
7499
|
-
for (let
|
|
7500
|
-
let
|
|
7501
|
-
if (typeof
|
|
7502
|
-
let
|
|
7503
|
-
if (
|
|
7504
|
-
let
|
|
7505
|
-
|
|
8559
|
+
for (let b of m) {
|
|
8560
|
+
let g = p[b];
|
|
8561
|
+
if (typeof g == 'string' && !g.startsWith('http://') && !g.startsWith('https://')) {
|
|
8562
|
+
let x = $.default.resolve(g);
|
|
8563
|
+
if (V.default.existsSync(x) && V.default.statSync(x).isFile()) {
|
|
8564
|
+
let I = new _(`Uploading local file ${$.default.basename(x)} to CDN...`);
|
|
8565
|
+
n || I.start();
|
|
7506
8566
|
try {
|
|
7507
|
-
let
|
|
7508
|
-
|
|
7509
|
-
((p[
|
|
7510
|
-
} catch (
|
|
7511
|
-
let
|
|
7512
|
-
(
|
|
8567
|
+
let L = V.default.readFileSync(x),
|
|
8568
|
+
C = await d.uploadAsset(L.toString('base64'));
|
|
8569
|
+
((p[b] = C.url), n || I.succeed(`Uploaded ${$.default.basename(x)} to CDN`));
|
|
8570
|
+
} catch (L) {
|
|
8571
|
+
let C = L instanceof Error ? L.message : String(L);
|
|
8572
|
+
(n
|
|
7513
8573
|
? process.stdout.write(
|
|
7514
|
-
JSON.stringify({ error:
|
|
8574
|
+
JSON.stringify({ error: C }) +
|
|
7515
8575
|
`
|
|
7516
8576
|
`,
|
|
7517
8577
|
)
|
|
7518
|
-
:
|
|
8578
|
+
: I.fail(`Upload failed: ${C}`),
|
|
7519
8579
|
process.exit(1));
|
|
7520
8580
|
}
|
|
7521
8581
|
}
|
|
7522
8582
|
}
|
|
7523
8583
|
}
|
|
7524
|
-
await
|
|
7525
|
-
let
|
|
7526
|
-
|
|
8584
|
+
await Zr(p, async (b) => {
|
|
8585
|
+
let g = new _(`Uploading local file ${$.default.basename(b)} to CDN...`);
|
|
8586
|
+
n || g.start();
|
|
7527
8587
|
try {
|
|
7528
|
-
let
|
|
7529
|
-
|
|
7530
|
-
return (
|
|
7531
|
-
} catch (
|
|
7532
|
-
let
|
|
7533
|
-
(
|
|
8588
|
+
let x = V.default.readFileSync(b),
|
|
8589
|
+
I = await d.uploadAsset(x.toString('base64'));
|
|
8590
|
+
return (n || g.succeed(`Uploaded ${$.default.basename(b)} to CDN`), I.url);
|
|
8591
|
+
} catch (x) {
|
|
8592
|
+
let I = x instanceof Error ? x.message : String(x);
|
|
8593
|
+
(n
|
|
7534
8594
|
? process.stdout.write(
|
|
7535
|
-
JSON.stringify({ error:
|
|
8595
|
+
JSON.stringify({ error: I }) +
|
|
7536
8596
|
`
|
|
7537
8597
|
`,
|
|
7538
8598
|
)
|
|
7539
|
-
:
|
|
8599
|
+
: g.fail(`Upload failed: ${I}`),
|
|
7540
8600
|
process.exit(1));
|
|
7541
8601
|
}
|
|
7542
8602
|
});
|
|
7543
|
-
let h = new
|
|
7544
|
-
|
|
7545
|
-
let
|
|
8603
|
+
let h = new _(`Submitting task for ${a.bold(e)}...`);
|
|
8604
|
+
n || h.start();
|
|
8605
|
+
let f;
|
|
7546
8606
|
try {
|
|
7547
8607
|
if (l > 1) {
|
|
7548
|
-
await
|
|
8608
|
+
await ti(d, e, p, l, { isJson: n, isAsync: o });
|
|
7549
8609
|
return;
|
|
7550
8610
|
}
|
|
7551
|
-
|
|
7552
|
-
} catch (
|
|
7553
|
-
let
|
|
7554
|
-
(
|
|
8611
|
+
f = await d.queueJob(e, p);
|
|
8612
|
+
} catch (b) {
|
|
8613
|
+
let g = b instanceof w ? b : null;
|
|
8614
|
+
(n
|
|
7555
8615
|
? process.stdout.write(
|
|
7556
8616
|
JSON.stringify(
|
|
7557
|
-
|
|
7558
|
-
? { error: { code:
|
|
7559
|
-
: { error: { code: null, message:
|
|
8617
|
+
g
|
|
8618
|
+
? { error: { code: g.code ?? null, message: g.message, ...g.fields } }
|
|
8619
|
+
: { error: { code: null, message: b instanceof Error ? b.message : String(b) } },
|
|
7560
8620
|
null,
|
|
7561
8621
|
2,
|
|
7562
8622
|
) +
|
|
@@ -7564,59 +8624,59 @@ async function De(e, t) {
|
|
|
7564
8624
|
`,
|
|
7565
8625
|
)
|
|
7566
8626
|
: h.fail(
|
|
7567
|
-
|
|
7568
|
-
?
|
|
8627
|
+
g
|
|
8628
|
+
? S(g).join(`
|
|
7569
8629
|
`)
|
|
7570
|
-
: `Failed to start generation: ${
|
|
8630
|
+
: `Failed to start generation: ${b instanceof Error ? b.message : b}`,
|
|
7571
8631
|
),
|
|
7572
|
-
process.exit(
|
|
8632
|
+
process.exit(g ? g.exitCode : v));
|
|
7573
8633
|
}
|
|
7574
8634
|
if (o) {
|
|
7575
|
-
|
|
8635
|
+
n
|
|
7576
8636
|
? process.stdout.write(
|
|
7577
|
-
JSON.stringify(
|
|
8637
|
+
JSON.stringify(f, null, 2) +
|
|
7578
8638
|
`
|
|
7579
8639
|
`,
|
|
7580
8640
|
)
|
|
7581
|
-
: (h.succeed(`Queued successfully! Request ID: ${a.bold(
|
|
7582
|
-
process.stdout.write(`Check status anytime with: ${a.cyan(`tein status ${
|
|
8641
|
+
: (h.succeed(`Queued successfully! Request ID: ${a.bold(f.request_id)}`),
|
|
8642
|
+
process.stdout.write(`Check status anytime with: ${a.cyan(`tein status ${f.request_id}`)}
|
|
7583
8643
|
`));
|
|
7584
8644
|
return;
|
|
7585
8645
|
}
|
|
7586
8646
|
let fe = Date.now(),
|
|
7587
8647
|
ge = 1500;
|
|
7588
|
-
for (;
|
|
7589
|
-
let
|
|
7590
|
-
(
|
|
7591
|
-
await new Promise((
|
|
8648
|
+
for (; f.status === 'processing';) {
|
|
8649
|
+
let b = Math.round((Date.now() - fe) / 1e3);
|
|
8650
|
+
(n || h.update(`Rendering ${a.bold(e)} (${b}s elapsed)... [ID: ${f.request_id}]`),
|
|
8651
|
+
await new Promise((g) => setTimeout(g, ge)));
|
|
7592
8652
|
try {
|
|
7593
|
-
|
|
7594
|
-
} catch (
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
(
|
|
8653
|
+
f = await d.getStatus(f.request_id);
|
|
8654
|
+
} catch (g) {
|
|
8655
|
+
g instanceof w &&
|
|
8656
|
+
g.exitCode !== v &&
|
|
8657
|
+
(n ||
|
|
7598
8658
|
h.fail(
|
|
7599
|
-
|
|
8659
|
+
S(g).join(`
|
|
7600
8660
|
`),
|
|
7601
8661
|
),
|
|
7602
|
-
process.exit(
|
|
8662
|
+
process.exit(g.exitCode));
|
|
7603
8663
|
}
|
|
7604
8664
|
}
|
|
7605
8665
|
if (
|
|
7606
|
-
((
|
|
7607
|
-
(
|
|
8666
|
+
((f.status === 'failed' || f.status === 'expired' || f.status === 'cancelled') &&
|
|
8667
|
+
(n
|
|
7608
8668
|
? process.stdout.write(
|
|
7609
|
-
JSON.stringify(
|
|
8669
|
+
JSON.stringify(f, null, 2) +
|
|
7610
8670
|
`
|
|
7611
8671
|
`,
|
|
7612
8672
|
)
|
|
7613
|
-
: h.fail(`Generation ${
|
|
7614
|
-
process.exit(
|
|
7615
|
-
|
|
7616
|
-
|
|
8673
|
+
: h.fail(`Generation ${f.status}: ${f.error || 'Something failed on our side.'}`),
|
|
8674
|
+
process.exit(v)),
|
|
8675
|
+
n || h.succeed(`Generation completed for ${a.bold(s?.name || e)}!`),
|
|
8676
|
+
n)
|
|
7617
8677
|
) {
|
|
7618
8678
|
process.stdout.write(
|
|
7619
|
-
JSON.stringify(
|
|
8679
|
+
JSON.stringify(f, null, 2) +
|
|
7620
8680
|
`
|
|
7621
8681
|
`,
|
|
7622
8682
|
);
|
|
@@ -7627,97 +8687,101 @@ async function De(e, t) {
|
|
|
7627
8687
|
`),
|
|
7628
8688
|
process.stdout.write(` ${a.bold('Status:')} ${a.green('Succeeded')}
|
|
7629
8689
|
`),
|
|
7630
|
-
process.stdout.write(` ${a.bold('Request ID:')} ${
|
|
8690
|
+
process.stdout.write(` ${a.bold('Request ID:')} ${f.request_id}
|
|
7631
8691
|
`),
|
|
7632
|
-
|
|
7633
|
-
process.stdout.write(` ${a.bold('Cost:')} ${we(
|
|
8692
|
+
f.usage?.cost !== void 0 &&
|
|
8693
|
+
process.stdout.write(` ${a.bold('Cost:')} ${we(f.usage.cost)}
|
|
7634
8694
|
`),
|
|
7635
|
-
|
|
8695
|
+
f.output && f.output.length > 0)
|
|
7636
8696
|
) {
|
|
7637
8697
|
process.stdout.write(`
|
|
7638
8698
|
${a.bold('Outputs:')}
|
|
7639
8699
|
`);
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
|
|
8700
|
+
let b = f.output.filter((x) => x.url).length,
|
|
8701
|
+
g = 0;
|
|
8702
|
+
for (let x = 0; x < f.output.length; x++) {
|
|
8703
|
+
let I = f.output[x];
|
|
8704
|
+
if (I.url) {
|
|
8705
|
+
let L = I.layer?.name ? ` ${a.bold(I.layer.name)}` : '';
|
|
7643
8706
|
if (
|
|
7644
|
-
(process.stdout.write(` [${
|
|
8707
|
+
(process.stdout.write(` [${I.type.toUpperCase()}]${L} ${a.cyan(a.underline(I.url))}
|
|
7645
8708
|
`),
|
|
7646
8709
|
u)
|
|
7647
8710
|
) {
|
|
7648
|
-
let
|
|
8711
|
+
let C = ri(u, g++, b),
|
|
8712
|
+
He = new _(`Downloading output to ${C}...`).start();
|
|
7649
8713
|
try {
|
|
7650
|
-
(await d.downloadOutput(
|
|
7651
|
-
|
|
7652
|
-
} catch (
|
|
7653
|
-
|
|
8714
|
+
(await d.downloadOutput(I.url, $.default.resolve(process.cwd(), C)),
|
|
8715
|
+
He.succeed(`Saved to ${a.bold(C)}`));
|
|
8716
|
+
} catch (he) {
|
|
8717
|
+
He.fail(`Failed to download: ${he instanceof Error ? he.message : he}`);
|
|
7654
8718
|
}
|
|
7655
8719
|
}
|
|
7656
8720
|
} else
|
|
7657
|
-
|
|
8721
|
+
I.text &&
|
|
7658
8722
|
process.stdout.write(`
|
|
7659
|
-
${
|
|
8723
|
+
${I.text}
|
|
7660
8724
|
`);
|
|
7661
8725
|
}
|
|
7662
8726
|
}
|
|
7663
8727
|
process.stdout.write(`
|
|
7664
8728
|
`);
|
|
7665
8729
|
}
|
|
7666
|
-
var
|
|
7667
|
-
|
|
7668
|
-
async function
|
|
8730
|
+
var Ot = T(require('node:readline'));
|
|
8731
|
+
A();
|
|
8732
|
+
async function ii(e) {
|
|
7669
8733
|
try {
|
|
7670
|
-
return (await new
|
|
8734
|
+
return (await new K(e, P()).checkKey(), 'ok');
|
|
7671
8735
|
} catch (t) {
|
|
7672
|
-
if (t instanceof
|
|
8736
|
+
if (t instanceof w) {
|
|
7673
8737
|
if (t.status === 401) return 'invalid';
|
|
7674
8738
|
if (t.status === 403) return 'blocked';
|
|
7675
8739
|
}
|
|
7676
8740
|
return 'unchecked';
|
|
7677
8741
|
}
|
|
7678
8742
|
}
|
|
7679
|
-
function
|
|
7680
|
-
let t =
|
|
7681
|
-
return new Promise((
|
|
7682
|
-
t.question(e, (
|
|
7683
|
-
(t.close(), i
|
|
8743
|
+
function ai(e) {
|
|
8744
|
+
let t = Ot.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
8745
|
+
return new Promise((r) => {
|
|
8746
|
+
t.question(e, (i) => {
|
|
8747
|
+
(t.close(), r(i.trim()));
|
|
7684
8748
|
});
|
|
7685
8749
|
});
|
|
7686
8750
|
}
|
|
7687
|
-
async function
|
|
8751
|
+
async function Q(e, t) {
|
|
7688
8752
|
switch (e) {
|
|
7689
8753
|
case 'login':
|
|
7690
8754
|
case 'set-key': {
|
|
7691
|
-
let
|
|
7692
|
-
(
|
|
8755
|
+
let r = t?.trim() || '';
|
|
8756
|
+
(r ||
|
|
7693
8757
|
(process.stdout.write(`
|
|
7694
8758
|
${a.bold('Tein AI Authentication')}
|
|
7695
8759
|
`),
|
|
7696
8760
|
process.stdout.write(`Get your API key at: ${a.cyan('https://tein.ai/dashboard/keys')}
|
|
7697
8761
|
|
|
7698
8762
|
`),
|
|
7699
|
-
(
|
|
7700
|
-
!
|
|
7701
|
-
!
|
|
8763
|
+
(r = await ai('Enter your Tein API Key (sk_live_...): '))),
|
|
8764
|
+
!r.startsWith('sk_live_') &&
|
|
8765
|
+
!r.startsWith('sk_test_') &&
|
|
7702
8766
|
(process.stderr
|
|
7703
8767
|
.write(`${a.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
|
|
7704
8768
|
`),
|
|
7705
8769
|
process.exit(1)));
|
|
7706
|
-
let
|
|
7707
|
-
(
|
|
8770
|
+
let i = await ii(r);
|
|
8771
|
+
(i === 'invalid' &&
|
|
7708
8772
|
(process.stderr
|
|
7709
8773
|
.write(`${a.red('Error:')} Tein did not accept this key. Copy it again from ${a.cyan('https://tein.ai/dashboard/keys')}. Nothing was saved.
|
|
7710
8774
|
`),
|
|
7711
8775
|
process.exit(1)),
|
|
7712
|
-
|
|
8776
|
+
ke({ apiKey: r }),
|
|
7713
8777
|
process.stdout.write(`
|
|
7714
|
-
${a.green('\u2713')} API key saved to ${a.dim(
|
|
8778
|
+
${a.green('\u2713')} API key saved to ${a.dim(re())}
|
|
7715
8779
|
`),
|
|
7716
|
-
|
|
8780
|
+
i === 'blocked'
|
|
7717
8781
|
? process.stdout
|
|
7718
8782
|
.write(`${a.yellow('\u2139')} The key is valid, but this account cannot run requests right now. Check your dashboard.
|
|
7719
8783
|
`)
|
|
7720
|
-
:
|
|
8784
|
+
: i === 'unchecked' &&
|
|
7721
8785
|
process.stdout
|
|
7722
8786
|
.write(`${a.yellow('\u2139')} Could not reach Tein to check the key. It is saved; run ${a.cyan('tein auth set-key')} again once you are online to check it.
|
|
7723
8787
|
`),
|
|
@@ -7728,31 +8792,31 @@ ${a.green('\u2713')} API key saved to ${a.dim(ie())}
|
|
|
7728
8792
|
break;
|
|
7729
8793
|
}
|
|
7730
8794
|
case 'logout': {
|
|
7731
|
-
if (!
|
|
8795
|
+
if (!U().apiKey) {
|
|
7732
8796
|
process.stdout
|
|
7733
8797
|
.write(`${a.yellow('\u2139')} No active API key found. You are already logged out.
|
|
7734
8798
|
`);
|
|
7735
8799
|
break;
|
|
7736
8800
|
}
|
|
7737
|
-
(
|
|
8801
|
+
(ke({ apiKey: '' }),
|
|
7738
8802
|
process.stdout
|
|
7739
|
-
.write(`${a.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${a.dim(
|
|
8803
|
+
.write(`${a.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${a.dim(re())}
|
|
7740
8804
|
`));
|
|
7741
8805
|
break;
|
|
7742
8806
|
}
|
|
7743
8807
|
default: {
|
|
7744
|
-
let
|
|
7745
|
-
|
|
7746
|
-
|
|
8808
|
+
let r = q(),
|
|
8809
|
+
i = P(),
|
|
8810
|
+
s = U();
|
|
7747
8811
|
if (
|
|
7748
8812
|
(process.stdout.write(`
|
|
7749
8813
|
${a.bold('Tein AI CLI Configuration')}
|
|
7750
8814
|
`),
|
|
7751
|
-
process.stdout.write(` Config file: ${a.dim(
|
|
8815
|
+
process.stdout.write(` Config file: ${a.dim(re())}
|
|
7752
8816
|
`),
|
|
7753
|
-
process.stdout.write(` API URL: ${a.cyan(
|
|
8817
|
+
process.stdout.write(` API URL: ${a.cyan(i)}
|
|
7754
8818
|
`),
|
|
7755
|
-
!
|
|
8819
|
+
!r)
|
|
7756
8820
|
)
|
|
7757
8821
|
(process.stdout.write(` API Key: ${a.red('Not configured')}
|
|
7758
8822
|
|
|
@@ -7762,9 +8826,9 @@ ${a.bold('Tein AI CLI Configuration')}
|
|
|
7762
8826
|
|
|
7763
8827
|
`));
|
|
7764
8828
|
else {
|
|
7765
|
-
let
|
|
8829
|
+
let n = `${r.slice(0, 10)}...${r.slice(-4)}`;
|
|
7766
8830
|
process.stdout
|
|
7767
|
-
.write(` API Key: ${a.green(
|
|
8831
|
+
.write(` API Key: ${a.green(n)} (${r.startsWith('sk_live_') ? 'Live Key' : 'Test Key'})
|
|
7768
8832
|
|
|
7769
8833
|
`);
|
|
7770
8834
|
}
|
|
@@ -7772,52 +8836,52 @@ ${a.bold('Tein AI CLI Configuration')}
|
|
|
7772
8836
|
}
|
|
7773
8837
|
}
|
|
7774
8838
|
}
|
|
7775
|
-
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
var
|
|
7779
|
-
async function
|
|
8839
|
+
A();
|
|
8840
|
+
xe();
|
|
8841
|
+
W();
|
|
8842
|
+
var si = 3e3;
|
|
8843
|
+
async function Rt(e) {
|
|
7780
8844
|
try {
|
|
7781
|
-
let t = await fetch(`${
|
|
8845
|
+
let t = await fetch(`${P(e)}/v1/pricing`, { signal: AbortSignal.timeout(si) });
|
|
7782
8846
|
if (!t.ok) return;
|
|
7783
|
-
let
|
|
7784
|
-
|
|
7785
|
-
for (let
|
|
7786
|
-
let
|
|
7787
|
-
|
|
8847
|
+
let r = await t.json(),
|
|
8848
|
+
i = {};
|
|
8849
|
+
for (let s of r.configs ?? []) {
|
|
8850
|
+
let n = String(s.modelSlug ?? '');
|
|
8851
|
+
G.has(n) && (i[n] ??= []).push(Number(s.starterPrice));
|
|
7788
8852
|
}
|
|
7789
|
-
|
|
8853
|
+
vt(i);
|
|
7790
8854
|
} catch {}
|
|
7791
8855
|
}
|
|
7792
|
-
var
|
|
7793
|
-
|
|
7794
|
-
async function
|
|
7795
|
-
await
|
|
7796
|
-
let
|
|
8856
|
+
var ni = new Set(['video', 'image', 'text', 'audio', '3d']),
|
|
8857
|
+
oi = { llm: 'text', chat: 'text', reasoning: 'text' };
|
|
8858
|
+
async function Dt(e, t) {
|
|
8859
|
+
await Rt(t);
|
|
8860
|
+
let r = R();
|
|
7797
8861
|
if (e) {
|
|
7798
|
-
let
|
|
7799
|
-
o =
|
|
7800
|
-
|
|
7801
|
-
?
|
|
7802
|
-
:
|
|
8862
|
+
let n = e.toLowerCase(),
|
|
8863
|
+
o = oi[n] ?? n;
|
|
8864
|
+
r = ni.has(o)
|
|
8865
|
+
? r.filter((u) => u.category.toLowerCase() === o)
|
|
8866
|
+
: r.filter((u) => u.kind.toLowerCase().includes(n) || u.slug.toLowerCase().includes(n));
|
|
7803
8867
|
}
|
|
7804
8868
|
(process.stdout.write(`
|
|
7805
|
-
${a.bold('Tein AI Models Catalog')} (${
|
|
8869
|
+
${a.bold('Tein AI Models Catalog')} (${r.length} available)
|
|
7806
8870
|
`),
|
|
7807
8871
|
process.stdout
|
|
7808
8872
|
.write(`${a.dim('Run `tein info <model-slug>` to see detailed parameters and options.')}
|
|
7809
8873
|
|
|
7810
8874
|
`));
|
|
7811
|
-
let
|
|
7812
|
-
for (let
|
|
7813
|
-
let o =
|
|
7814
|
-
(
|
|
8875
|
+
let i = {};
|
|
8876
|
+
for (let n of r) {
|
|
8877
|
+
let o = n.category;
|
|
8878
|
+
(i[o] || (i[o] = []), i[o].push(n));
|
|
7815
8879
|
}
|
|
7816
|
-
let
|
|
7817
|
-
for (let
|
|
7818
|
-
let o =
|
|
8880
|
+
let s = ['Video', 'Image', 'Text', 'Audio', '3D'];
|
|
8881
|
+
for (let n of s) {
|
|
8882
|
+
let o = i[n];
|
|
7819
8883
|
if (!(!o || o.length === 0)) {
|
|
7820
|
-
process.stdout.write(`${a.bold(a.cyan(`\u2500\u2500 ${
|
|
8884
|
+
process.stdout.write(`${a.bold(a.cyan(`\u2500\u2500 ${n} Models \u2500\u2500`))}
|
|
7821
8885
|
`);
|
|
7822
8886
|
for (let u of o) {
|
|
7823
8887
|
let l = u.slug.padEnd(24),
|
|
@@ -7835,55 +8899,55 @@ ${a.bold('Tein AI Models Catalog')} (${i.length} available)
|
|
|
7835
8899
|
|
|
7836
8900
|
`);
|
|
7837
8901
|
}
|
|
7838
|
-
async function
|
|
7839
|
-
|
|
7840
|
-
let
|
|
7841
|
-
(
|
|
8902
|
+
async function Lt(e, t) {
|
|
8903
|
+
G.has(e) && (await Rt(t));
|
|
8904
|
+
let r = j(e);
|
|
8905
|
+
(r ||
|
|
7842
8906
|
(process.stderr.write(`${a.red('Error:')} Model "${e}" not found in Tein AI registry.
|
|
7843
8907
|
`),
|
|
7844
8908
|
process.stderr.write(`Run ${a.cyan('tein models')} to see all available model slugs.
|
|
7845
8909
|
`),
|
|
7846
8910
|
process.exit(1)),
|
|
7847
8911
|
process.stdout.write(`
|
|
7848
|
-
${a.bold(a.cyan(
|
|
8912
|
+
${a.bold(a.cyan(r.name))} (${a.bold(r.slug)})
|
|
7849
8913
|
`),
|
|
7850
|
-
process.stdout.write(` ${a.gray(
|
|
8914
|
+
process.stdout.write(` ${a.gray(r.description)}
|
|
7851
8915
|
|
|
7852
8916
|
`),
|
|
7853
8917
|
process.stdout.write(`${a.bold('Metadata:')}
|
|
7854
8918
|
`),
|
|
7855
|
-
process.stdout.write(` Category: ${a.yellow(
|
|
8919
|
+
process.stdout.write(` Category: ${a.yellow(r.category)}
|
|
7856
8920
|
`),
|
|
7857
|
-
process.stdout.write(` Kind: ${
|
|
8921
|
+
process.stdout.write(` Kind: ${r.kind}
|
|
7858
8922
|
`),
|
|
7859
|
-
process.stdout.write(` Vendor: ${
|
|
8923
|
+
process.stdout.write(` Vendor: ${r.vendor}
|
|
7860
8924
|
`),
|
|
7861
|
-
process.stdout.write(` Pricing: ${a.green(
|
|
8925
|
+
process.stdout.write(` Pricing: ${a.green(r.priceFormatted)}
|
|
7862
8926
|
|
|
7863
8927
|
`),
|
|
7864
8928
|
process.stdout.write(`${a.bold('Parameters:')}
|
|
7865
8929
|
`));
|
|
7866
|
-
for (let
|
|
7867
|
-
let
|
|
7868
|
-
|
|
8930
|
+
for (let i of r.parameters) {
|
|
8931
|
+
let s = i.required ? a.red('(required)') : a.dim('(optional)'),
|
|
8932
|
+
n = i.default !== void 0 ? a.dim(` [default: ${i.default}]`) : '';
|
|
7869
8933
|
(process.stdout
|
|
7870
|
-
.write(` ${a.bold(`--${
|
|
8934
|
+
.write(` ${a.bold(`--${i.name.replace(/_/g, '-')}`)} ${a.yellow(`<${i.type}>`)} ${s}${n}
|
|
7871
8935
|
`),
|
|
7872
|
-
|
|
7873
|
-
process.stdout.write(` ${a.gray(
|
|
8936
|
+
i.description &&
|
|
8937
|
+
process.stdout.write(` ${a.gray(i.description)}
|
|
7874
8938
|
`),
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
process.stdout.write(` Allowed values: ${a.dim(
|
|
8939
|
+
i.options &&
|
|
8940
|
+
i.options.length > 0 &&
|
|
8941
|
+
process.stdout.write(` Allowed values: ${a.dim(i.options.join(', '))}
|
|
7878
8942
|
`),
|
|
7879
|
-
(
|
|
7880
|
-
process.stdout.write(` Range: ${
|
|
8943
|
+
(i.min !== void 0 || i.max !== void 0) &&
|
|
8944
|
+
process.stdout.write(` Range: ${i.min ?? ''} to ${i.max ?? ''}
|
|
7881
8945
|
`),
|
|
7882
8946
|
process.stdout.write(`
|
|
7883
8947
|
`));
|
|
7884
8948
|
}
|
|
7885
8949
|
if (
|
|
7886
|
-
(
|
|
8950
|
+
(r.parameters.some((i) => i.name === 'callback_url') ||
|
|
7887
8951
|
(process.stdout
|
|
7888
8952
|
.write(` ${a.bold('--callback-url')} ${a.yellow('<string>')} ${a.dim('(optional)')}
|
|
7889
8953
|
`),
|
|
@@ -7893,33 +8957,33 @@ ${a.bold(a.cyan(i.name))} (${a.bold(i.slug)})
|
|
|
7893
8957
|
`)),
|
|
7894
8958
|
process.stdout.write(`${a.bold('Sample CLI Usage:')}
|
|
7895
8959
|
`),
|
|
7896
|
-
|
|
8960
|
+
r.category === 'Video')
|
|
7897
8961
|
)
|
|
7898
8962
|
process.stdout
|
|
7899
|
-
.write(` ${a.cyan(`tein run ${
|
|
8963
|
+
.write(` ${a.cyan(`tein run ${r.slug} --prompt "Cinematic camera drone shot of a coastline" --aspect-ratio 16:9 --duration 5 -o output.mp4`)}
|
|
7900
8964
|
|
|
7901
8965
|
`);
|
|
7902
|
-
else if (
|
|
7903
|
-
let
|
|
8966
|
+
else if (r.category === 'Image') {
|
|
8967
|
+
let i = r.parameters.some((s) => s.name === 'aspect_ratio') ? ' --aspect-ratio 16:9' : '';
|
|
7904
8968
|
process.stdout
|
|
7905
|
-
.write(` ${a.cyan(`tein run ${
|
|
8969
|
+
.write(` ${a.cyan(`tein run ${r.slug} --prompt "Cyberpunk city in the rain, 8k render"${i} -o output.png`)}
|
|
7906
8970
|
|
|
7907
8971
|
`);
|
|
7908
8972
|
} else
|
|
7909
|
-
|
|
8973
|
+
r.category === 'Audio'
|
|
7910
8974
|
? process.stdout
|
|
7911
|
-
.write(` ${a.cyan(`tein run ${
|
|
8975
|
+
.write(` ${a.cyan(`tein run ${r.slug} --prompt "Hello world from Tein AI" --speaker en_female_warm -o speech.wav`)}
|
|
7912
8976
|
|
|
7913
8977
|
`)
|
|
7914
8978
|
: process.stdout
|
|
7915
|
-
.write(` ${a.cyan(`tein run ${
|
|
8979
|
+
.write(` ${a.cyan(`tein run ${r.slug} --prompt "Explain quantum computing in simple terms"`)}
|
|
7916
8980
|
|
|
7917
8981
|
`);
|
|
7918
8982
|
}
|
|
7919
|
-
|
|
7920
|
-
|
|
7921
|
-
var
|
|
7922
|
-
|
|
8983
|
+
A();
|
|
8984
|
+
Ve();
|
|
8985
|
+
var li = 1e4,
|
|
8986
|
+
Ue = {
|
|
7923
8987
|
price: '',
|
|
7924
8988
|
creativeMode: 'Creative mode',
|
|
7925
8989
|
priority: 'Priority',
|
|
@@ -7929,109 +8993,109 @@ var nr = 1e4,
|
|
|
7929
8993
|
priorityDraft: 'Priority + Draft',
|
|
7930
8994
|
creativeModePriorityDraft: 'Creative mode + Priority + Draft',
|
|
7931
8995
|
},
|
|
7932
|
-
|
|
7933
|
-
|
|
8996
|
+
pi = Object.keys(Ue),
|
|
8997
|
+
di = {
|
|
7934
8998
|
creativeMode: 'unfiltered',
|
|
7935
8999
|
creativeModePriority: 'unfilteredPriority',
|
|
7936
9000
|
creativeModeDraft: 'unfilteredDraft',
|
|
7937
9001
|
creativeModePriorityDraft: 'unfilteredPriorityDraft',
|
|
7938
9002
|
};
|
|
7939
|
-
function
|
|
7940
|
-
let
|
|
7941
|
-
return e[t] ?? (
|
|
9003
|
+
function ci(e, t) {
|
|
9004
|
+
let r = di[t];
|
|
9005
|
+
return e[t] ?? (r ? e[r] : void 0);
|
|
7942
9006
|
}
|
|
7943
|
-
async function
|
|
7944
|
-
let
|
|
7945
|
-
|
|
9007
|
+
async function ui(e, t) {
|
|
9008
|
+
let r = `${P(e)}${me(t)}`,
|
|
9009
|
+
i;
|
|
7946
9010
|
try {
|
|
7947
|
-
|
|
9011
|
+
i = await fetch(r, { signal: AbortSignal.timeout(li) });
|
|
7948
9012
|
} catch {
|
|
7949
|
-
throw new Error(`Could not reach ${
|
|
9013
|
+
throw new Error(`Could not reach ${r}`);
|
|
7950
9014
|
}
|
|
7951
|
-
let
|
|
7952
|
-
if (!
|
|
7953
|
-
let
|
|
7954
|
-
|
|
7955
|
-
?
|
|
7956
|
-
:
|
|
7957
|
-
?
|
|
7958
|
-
: `Pricing request failed (${
|
|
7959
|
-
throw new Error(
|
|
9015
|
+
let s = await i.json().catch(() => null);
|
|
9016
|
+
if (!i.ok || !s || s.object !== 'list' || !s.board) {
|
|
9017
|
+
let n =
|
|
9018
|
+
s && typeof s.error == 'string'
|
|
9019
|
+
? s.error
|
|
9020
|
+
: s && typeof s.error == 'object' && s.error?.message
|
|
9021
|
+
? s.error.message
|
|
9022
|
+
: `Pricing request failed (${i.status})`;
|
|
9023
|
+
throw new Error(n);
|
|
7960
9024
|
}
|
|
7961
|
-
return
|
|
9025
|
+
return s;
|
|
7962
9026
|
}
|
|
7963
|
-
function
|
|
9027
|
+
function Ne(e) {
|
|
7964
9028
|
let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
|
|
7965
|
-
[
|
|
7966
|
-
return `$${
|
|
9029
|
+
[r, i = ''] = t.split('.');
|
|
9030
|
+
return `$${r}.${i.padEnd(2, '0')}`;
|
|
7967
9031
|
}
|
|
7968
|
-
function
|
|
9032
|
+
function Be(e) {
|
|
7969
9033
|
if (!e || typeof e.starter != 'number') return null;
|
|
7970
9034
|
let t = typeof e.plus == 'number' ? e.plus : e.starter,
|
|
7971
|
-
|
|
7972
|
-
return `Starter ${
|
|
9035
|
+
r = typeof e.scale == 'number' ? e.scale : t;
|
|
9036
|
+
return `Starter ${Ne(e.starter)} Plus ${Ne(t)} Scale ${Ne(r)}`;
|
|
7973
9037
|
}
|
|
7974
|
-
function
|
|
9038
|
+
function mi(e) {
|
|
7975
9039
|
if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
|
|
7976
9040
|
let t = [];
|
|
7977
|
-
for (let
|
|
7978
|
-
let
|
|
7979
|
-
|
|
9041
|
+
for (let r of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
|
|
9042
|
+
let i = e[r];
|
|
9043
|
+
i != null && i !== '' && t.push(String(i));
|
|
7980
9044
|
}
|
|
7981
9045
|
return (
|
|
7982
9046
|
e.withVideo === !0 && t.push('with video'),
|
|
7983
9047
|
t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
|
|
7984
9048
|
);
|
|
7985
9049
|
}
|
|
7986
|
-
function
|
|
7987
|
-
let
|
|
7988
|
-
for (let
|
|
7989
|
-
let
|
|
7990
|
-
if (!
|
|
7991
|
-
let
|
|
7992
|
-
t.push(` ${
|
|
9050
|
+
function fi(e, t) {
|
|
9051
|
+
let r = mi(e);
|
|
9052
|
+
for (let i of pi) {
|
|
9053
|
+
let s = Be(ci(e, i));
|
|
9054
|
+
if (!s) continue;
|
|
9055
|
+
let n = Ue[i] ? ` (${Ue[i]})` : '';
|
|
9056
|
+
t.push(` ${r}${n} ${s}`);
|
|
7993
9057
|
}
|
|
7994
9058
|
}
|
|
7995
|
-
function
|
|
7996
|
-
let
|
|
9059
|
+
function gi(e, t) {
|
|
9060
|
+
let r = e.quality ? ` quality=${e.quality}` : '';
|
|
7997
9061
|
t.push(
|
|
7998
|
-
` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${
|
|
9062
|
+
` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${r}`)}`,
|
|
7999
9063
|
);
|
|
8000
|
-
for (let
|
|
8001
|
-
let
|
|
8002
|
-
if (Array.isArray(
|
|
8003
|
-
for (let
|
|
8004
|
-
if (!
|
|
8005
|
-
let
|
|
8006
|
-
o = typeof
|
|
8007
|
-
u =
|
|
9064
|
+
for (let s of e.variants ?? []) fi(s, t);
|
|
9065
|
+
let i = e.addons;
|
|
9066
|
+
if (Array.isArray(i))
|
|
9067
|
+
for (let s of i) {
|
|
9068
|
+
if (!s || typeof s != 'object') continue;
|
|
9069
|
+
let n = s,
|
|
9070
|
+
o = typeof n.label == 'string' ? n.label : String(n.id ?? 'add-on'),
|
|
9071
|
+
u = Be(n.price);
|
|
8008
9072
|
u && t.push(` ${o} (add-on) ${u}`);
|
|
8009
9073
|
}
|
|
8010
9074
|
t.push('');
|
|
8011
9075
|
}
|
|
8012
|
-
function
|
|
9076
|
+
function hi(e) {
|
|
8013
9077
|
let t = [],
|
|
8014
|
-
|
|
8015
|
-
(t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${
|
|
9078
|
+
r = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
9079
|
+
(t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${r}`),
|
|
8016
9080
|
t.push(
|
|
8017
9081
|
`${a.dim('Starter, Plus and Scale. Creative mode, Priority and draft show only where published.')}`,
|
|
8018
9082
|
),
|
|
8019
9083
|
t.push(''));
|
|
8020
|
-
let
|
|
9084
|
+
let i = new Map();
|
|
8021
9085
|
for (let l of e.board.models) {
|
|
8022
9086
|
let c = l.kind || 'other',
|
|
8023
|
-
p =
|
|
8024
|
-
(p.push(l),
|
|
9087
|
+
p = i.get(c) ?? [];
|
|
9088
|
+
(p.push(l), i.set(c, p));
|
|
8025
9089
|
}
|
|
8026
|
-
let
|
|
8027
|
-
|
|
8028
|
-
let p =
|
|
8029
|
-
d =
|
|
9090
|
+
let s = ['video', 'image', 'audio', 'llm', 'text', '3d'],
|
|
9091
|
+
n = [...i.keys()].sort((l, c) => {
|
|
9092
|
+
let p = s.indexOf(l),
|
|
9093
|
+
d = s.indexOf(c);
|
|
8030
9094
|
return (p === -1 ? 99 : p) - (d === -1 ? 99 : d);
|
|
8031
9095
|
});
|
|
8032
|
-
for (let l of
|
|
9096
|
+
for (let l of n) {
|
|
8033
9097
|
t.push(`${a.bold(a.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
|
|
8034
|
-
for (let c of
|
|
9098
|
+
for (let c of i.get(l) ?? []) gi(c, t);
|
|
8035
9099
|
}
|
|
8036
9100
|
let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
|
|
8037
9101
|
u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
|
|
@@ -8048,8 +9112,8 @@ function mr(e) {
|
|
|
8048
9112
|
t.push(` ${a.bold(c.padEnd(26))} ${a.gray(d)}`);
|
|
8049
9113
|
for (let m of p) {
|
|
8050
9114
|
let h = String(m.displayLabel ?? m.billingUnit ?? 'price'),
|
|
8051
|
-
|
|
8052
|
-
|
|
9115
|
+
f = Be(m.prices);
|
|
9116
|
+
f && t.push(` ${h} ${f}`);
|
|
8053
9117
|
}
|
|
8054
9118
|
t.push('');
|
|
8055
9119
|
}
|
|
@@ -8061,13 +9125,13 @@ function mr(e) {
|
|
|
8061
9125
|
`
|
|
8062
9126
|
);
|
|
8063
9127
|
}
|
|
8064
|
-
async function
|
|
9128
|
+
async function Vt(e) {
|
|
8065
9129
|
let t;
|
|
8066
9130
|
try {
|
|
8067
|
-
t = await
|
|
8068
|
-
} catch (
|
|
8069
|
-
let
|
|
8070
|
-
(process.stderr.write(`${a.red('Error:')} ${
|
|
9131
|
+
t = await ui(e.apiUrl, e.model);
|
|
9132
|
+
} catch (r) {
|
|
9133
|
+
let i = r instanceof Error ? r.message : String(r);
|
|
9134
|
+
(process.stderr.write(`${a.red('Error:')} ${i}
|
|
8071
9135
|
`),
|
|
8072
9136
|
process.exit(1));
|
|
8073
9137
|
}
|
|
@@ -8075,15 +9139,15 @@ async function Dt(e) {
|
|
|
8075
9139
|
e.json
|
|
8076
9140
|
? `${JSON.stringify(t, null, 2)}
|
|
8077
9141
|
`
|
|
8078
|
-
:
|
|
9142
|
+
: hi(t),
|
|
8079
9143
|
);
|
|
8080
9144
|
}
|
|
8081
|
-
var
|
|
8082
|
-
|
|
8083
|
-
async function
|
|
8084
|
-
let
|
|
8085
|
-
|
|
8086
|
-
(
|
|
9145
|
+
var Nt = T(require('node:path'));
|
|
9146
|
+
A();
|
|
9147
|
+
async function Ut(e, t) {
|
|
9148
|
+
let r = q(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
9149
|
+
i = P(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
9150
|
+
(r ||
|
|
8087
9151
|
(process.stderr.write(`${a.red('Error:')} Authentication required.
|
|
8088
9152
|
`),
|
|
8089
9153
|
process.stderr
|
|
@@ -8096,18 +9160,18 @@ async function Vt(e, t) {
|
|
|
8096
9160
|
process.stderr.write(`Usage: ${a.cyan('tein status <request-id> [--wait] [-o output.mp4]')}
|
|
8097
9161
|
`),
|
|
8098
9162
|
process.exit(1)));
|
|
8099
|
-
let
|
|
8100
|
-
|
|
9163
|
+
let s = !!t.json,
|
|
9164
|
+
n = !!t.wait,
|
|
8101
9165
|
o = typeof t.output == 'string' ? t.output : void 0,
|
|
8102
|
-
u = new
|
|
8103
|
-
l = new
|
|
8104
|
-
|
|
9166
|
+
u = new K(r, i),
|
|
9167
|
+
l = new _(`Checking status of ${a.bold(e)}...`);
|
|
9168
|
+
s || l.start();
|
|
8105
9169
|
let c;
|
|
8106
9170
|
try {
|
|
8107
9171
|
c = await u.getStatus(e);
|
|
8108
9172
|
} catch (p) {
|
|
8109
|
-
(p instanceof
|
|
8110
|
-
(
|
|
9173
|
+
(p instanceof w &&
|
|
9174
|
+
(s
|
|
8111
9175
|
? process.stdout.write(
|
|
8112
9176
|
JSON.stringify(
|
|
8113
9177
|
{ error: { code: p.code ?? null, message: p.message, ...p.fields } },
|
|
@@ -8118,18 +9182,18 @@ async function Vt(e, t) {
|
|
|
8118
9182
|
`,
|
|
8119
9183
|
)
|
|
8120
9184
|
: l.fail(
|
|
8121
|
-
|
|
9185
|
+
S(p).join(`
|
|
8122
9186
|
`),
|
|
8123
9187
|
),
|
|
8124
9188
|
process.exit(p.exitCode)),
|
|
8125
|
-
|
|
8126
|
-
process.exit(
|
|
9189
|
+
s || l.fail(p instanceof Error ? p.message : String(p)),
|
|
9190
|
+
process.exit(v));
|
|
8127
9191
|
}
|
|
8128
|
-
if (
|
|
9192
|
+
if (n && c.status === 'processing') {
|
|
8129
9193
|
let p = Date.now();
|
|
8130
9194
|
for (; c.status === 'processing';) {
|
|
8131
9195
|
let d = Math.round((Date.now() - p) / 1e3);
|
|
8132
|
-
(
|
|
9196
|
+
(s || l.update(`Waiting for ${a.bold(c.model)} (${d}s elapsed)...`),
|
|
8133
9197
|
await new Promise((m) => setTimeout(m, 1500)));
|
|
8134
9198
|
try {
|
|
8135
9199
|
c = await u.getStatus(e);
|
|
@@ -8137,13 +9201,13 @@ async function Vt(e, t) {
|
|
|
8137
9201
|
}
|
|
8138
9202
|
}
|
|
8139
9203
|
if (
|
|
8140
|
-
(
|
|
9204
|
+
(s ||
|
|
8141
9205
|
(c.status === 'succeeded'
|
|
8142
9206
|
? l.succeed('Task completed!')
|
|
8143
9207
|
: c.status === 'failed' || c.status === 'expired' || c.status === 'cancelled'
|
|
8144
9208
|
? l.fail(`Task ${c.status}: ${c.error || 'Something failed on our side.'}`)
|
|
8145
9209
|
: l.stop()),
|
|
8146
|
-
|
|
9210
|
+
s)
|
|
8147
9211
|
) {
|
|
8148
9212
|
process.stdout.write(
|
|
8149
9213
|
JSON.stringify(c, null, 2) +
|
|
@@ -8173,9 +9237,9 @@ ${a.bold('Outputs:')}
|
|
|
8173
9237
|
`),
|
|
8174
9238
|
o)
|
|
8175
9239
|
) {
|
|
8176
|
-
let d = new
|
|
9240
|
+
let d = new _(`Downloading output to ${o}...`).start();
|
|
8177
9241
|
try {
|
|
8178
|
-
(await u.downloadOutput(p.url,
|
|
9242
|
+
(await u.downloadOutput(p.url, Nt.default.resolve(process.cwd(), o)),
|
|
8179
9243
|
d.succeed(`Saved to ${a.bold(o)}`));
|
|
8180
9244
|
} catch (m) {
|
|
8181
9245
|
d.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
|
|
@@ -8190,14 +9254,14 @@ ${p.text}
|
|
|
8190
9254
|
process.stdout.write(`
|
|
8191
9255
|
`);
|
|
8192
9256
|
}
|
|
8193
|
-
var
|
|
8194
|
-
|
|
8195
|
-
|
|
8196
|
-
async function
|
|
8197
|
-
let
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
(
|
|
9257
|
+
var je = T(require('node:fs')),
|
|
9258
|
+
Fe = T(require('node:path'));
|
|
9259
|
+
A();
|
|
9260
|
+
async function Bt(e, t = {}) {
|
|
9261
|
+
let r = q(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
9262
|
+
i = P(typeof t.api_url == 'string' ? t.api_url : void 0),
|
|
9263
|
+
s = !!t.json;
|
|
9264
|
+
(r ||
|
|
8201
9265
|
(process.stderr.write(`${a.red('Error:')} Authentication required.
|
|
8202
9266
|
`),
|
|
8203
9267
|
process.stderr
|
|
@@ -8210,19 +9274,19 @@ async function Nt(e, t = {}) {
|
|
|
8210
9274
|
process.stderr.write(`Usage: ${a.cyan('tein upload <image.png|video.mp4>')}
|
|
8211
9275
|
`),
|
|
8212
9276
|
process.exit(1)));
|
|
8213
|
-
let
|
|
8214
|
-
|
|
8215
|
-
(process.stderr.write(`${a.red('Error:')} File not found: ${
|
|
9277
|
+
let n = Fe.default.resolve(e);
|
|
9278
|
+
je.default.existsSync(n) ||
|
|
9279
|
+
(process.stderr.write(`${a.red('Error:')} File not found: ${n}
|
|
8216
9280
|
`),
|
|
8217
9281
|
process.exit(1));
|
|
8218
|
-
let o =
|
|
8219
|
-
l =
|
|
8220
|
-
c = new
|
|
8221
|
-
p = new
|
|
8222
|
-
|
|
9282
|
+
let o = Fe.default.basename(n),
|
|
9283
|
+
l = je.default.readFileSync(n).toString('base64'),
|
|
9284
|
+
c = new K(r, i),
|
|
9285
|
+
p = new _(`Uploading ${a.bold(o)} to Tein AI CDN...`);
|
|
9286
|
+
s || p.start();
|
|
8223
9287
|
try {
|
|
8224
9288
|
let d = await c.uploadAsset(l);
|
|
8225
|
-
|
|
9289
|
+
s
|
|
8226
9290
|
? process.stdout.write(
|
|
8227
9291
|
JSON.stringify(d, null, 2) +
|
|
8228
9292
|
`
|
|
@@ -8240,26 +9304,26 @@ ${a.bold('CDN URL:')} ${a.green(d.url)}
|
|
|
8240
9304
|
|
|
8241
9305
|
`));
|
|
8242
9306
|
} catch (d) {
|
|
8243
|
-
let m = d instanceof
|
|
9307
|
+
let m = d instanceof w ? d : null,
|
|
8244
9308
|
h = m
|
|
8245
|
-
?
|
|
9309
|
+
? S(m).join(`
|
|
8246
9310
|
`)
|
|
8247
9311
|
: d instanceof Error
|
|
8248
9312
|
? d.message
|
|
8249
9313
|
: String(d);
|
|
8250
|
-
(
|
|
9314
|
+
(s
|
|
8251
9315
|
? process.stdout.write(
|
|
8252
9316
|
JSON.stringify({ error: { code: m?.code ?? null, message: m?.message ?? h } }, null, 2) +
|
|
8253
9317
|
`
|
|
8254
9318
|
`,
|
|
8255
9319
|
)
|
|
8256
9320
|
: p.fail(`Upload failed: ${h}`),
|
|
8257
|
-
process.exit(m ? m.exitCode :
|
|
9321
|
+
process.exit(m ? m.exitCode : v));
|
|
8258
9322
|
}
|
|
8259
9323
|
}
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
function
|
|
9324
|
+
W();
|
|
9325
|
+
qe();
|
|
9326
|
+
function ar() {
|
|
8263
9327
|
process.stdout.write(`
|
|
8264
9328
|
${a.bold(a.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
|
|
8265
9329
|
|
|
@@ -8319,11 +9383,11 @@ ${a.bold('EXAMPLES:')}
|
|
|
8319
9383
|
|
|
8320
9384
|
`);
|
|
8321
9385
|
}
|
|
8322
|
-
async function
|
|
9386
|
+
async function Ai() {
|
|
8323
9387
|
let e = process.argv.slice(2),
|
|
8324
|
-
t =
|
|
9388
|
+
t = At(e);
|
|
8325
9389
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
8326
|
-
|
|
9390
|
+
ar();
|
|
8327
9391
|
return;
|
|
8328
9392
|
}
|
|
8329
9393
|
if (t.flags.has('version') || t.options.version || t.command === 'version') {
|
|
@@ -8333,32 +9397,32 @@ async function Cr() {
|
|
|
8333
9397
|
}
|
|
8334
9398
|
switch (t.command) {
|
|
8335
9399
|
case 'auth': {
|
|
8336
|
-
await
|
|
9400
|
+
await Q(t.subcommand, t.options.key);
|
|
8337
9401
|
break;
|
|
8338
9402
|
}
|
|
8339
9403
|
case 'login': {
|
|
8340
|
-
await
|
|
9404
|
+
await Q('login', t.options.key);
|
|
8341
9405
|
break;
|
|
8342
9406
|
}
|
|
8343
9407
|
case 'logout': {
|
|
8344
|
-
await
|
|
9408
|
+
await Q('logout');
|
|
8345
9409
|
break;
|
|
8346
9410
|
}
|
|
8347
9411
|
case 'whoami': {
|
|
8348
|
-
await
|
|
9412
|
+
await Q('status');
|
|
8349
9413
|
break;
|
|
8350
9414
|
}
|
|
8351
9415
|
case 'models':
|
|
8352
9416
|
case 'list': {
|
|
8353
|
-
await
|
|
9417
|
+
await Dt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
|
|
8354
9418
|
break;
|
|
8355
9419
|
}
|
|
8356
9420
|
case 'pricing':
|
|
8357
9421
|
case 'prices': {
|
|
8358
|
-
let
|
|
8359
|
-
|
|
8360
|
-
await
|
|
8361
|
-
model:
|
|
9422
|
+
let r = t.options.model,
|
|
9423
|
+
i = t.subcommand || (typeof r == 'string' ? r : void 0);
|
|
9424
|
+
await Vt({
|
|
9425
|
+
model: i,
|
|
8362
9426
|
json: !!t.options.json,
|
|
8363
9427
|
apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
|
|
8364
9428
|
});
|
|
@@ -8372,56 +9436,56 @@ async function Cr() {
|
|
|
8372
9436
|
process.stderr.write(`Usage: ${a.cyan('tein info <model-slug>')}
|
|
8373
9437
|
`),
|
|
8374
9438
|
process.exit(1)),
|
|
8375
|
-
await
|
|
9439
|
+
await Lt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
|
|
8376
9440
|
break;
|
|
8377
9441
|
}
|
|
8378
9442
|
case 'upload': {
|
|
8379
|
-
let
|
|
8380
|
-
await
|
|
9443
|
+
let r = t.subcommand || '';
|
|
9444
|
+
await Bt(r, t.options);
|
|
8381
9445
|
break;
|
|
8382
9446
|
}
|
|
8383
9447
|
case 'run':
|
|
8384
9448
|
case 'generate': {
|
|
8385
|
-
let
|
|
8386
|
-
await
|
|
9449
|
+
let r = t.subcommand || '';
|
|
9450
|
+
await Le(r, t.options);
|
|
8387
9451
|
break;
|
|
8388
9452
|
}
|
|
8389
9453
|
case 'status': {
|
|
8390
|
-
let
|
|
8391
|
-
await
|
|
9454
|
+
let r = t.subcommand || '';
|
|
9455
|
+
await Ut(r, t.options);
|
|
8392
9456
|
break;
|
|
8393
9457
|
}
|
|
8394
9458
|
case 'mcp': {
|
|
8395
|
-
let { startStdioServer:
|
|
8396
|
-
await
|
|
9459
|
+
let { startStdioServer: r } = await Promise.resolve().then(() => (ir(), rr));
|
|
9460
|
+
await r();
|
|
8397
9461
|
break;
|
|
8398
9462
|
}
|
|
8399
9463
|
default: {
|
|
8400
9464
|
if (t.command && !t.command.startsWith('-')) {
|
|
8401
|
-
(!
|
|
9465
|
+
(!j(t.command) &&
|
|
8402
9466
|
!pe[t.command] &&
|
|
8403
9467
|
(process.stderr.write(`
|
|
8404
9468
|
${a.red('Error:')} Unknown command or model "${t.command}".
|
|
8405
9469
|
Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for the model slugs.
|
|
8406
9470
|
`),
|
|
8407
|
-
process.exit(
|
|
8408
|
-
await
|
|
9471
|
+
process.exit(v)),
|
|
9472
|
+
await Le(t.command, t.options));
|
|
8409
9473
|
return;
|
|
8410
9474
|
}
|
|
8411
|
-
|
|
9475
|
+
ar();
|
|
8412
9476
|
break;
|
|
8413
9477
|
}
|
|
8414
9478
|
}
|
|
8415
9479
|
}
|
|
8416
|
-
|
|
8417
|
-
(e instanceof
|
|
9480
|
+
Ai().catch((e) => {
|
|
9481
|
+
(e instanceof w &&
|
|
8418
9482
|
(process.stderr.write(`
|
|
8419
|
-
${a.red('Error:')} ${
|
|
9483
|
+
${a.red('Error:')} ${S(e).join(`
|
|
8420
9484
|
`)}
|
|
8421
9485
|
`),
|
|
8422
9486
|
process.exit(e.exitCode)),
|
|
8423
9487
|
process.stderr.write(`
|
|
8424
9488
|
${a.red('Fatal error:')} ${e instanceof Error ? e.message : e}
|
|
8425
9489
|
`),
|
|
8426
|
-
process.exit(
|
|
9490
|
+
process.exit(v));
|
|
8427
9491
|
});
|