@teinai/cli 1.1.18 → 1.1.19
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 +1929 -994
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
var
|
|
3
|
+
var ir = Object.create;
|
|
4
4
|
var he = Object.defineProperty;
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var b = (e, t,
|
|
10
|
-
if (
|
|
5
|
+
var ar = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var sr = Object.getOwnPropertyNames;
|
|
7
|
+
var nr = Object.getPrototypeOf,
|
|
8
|
+
or = Object.prototype.hasOwnProperty;
|
|
9
|
+
var b = (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 lr = (e, t) => {
|
|
18
|
+
for (var r in t) he(e, r, { get: t[r], enumerable: !0 });
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
pr = (e, t, r, i) => {
|
|
21
21
|
if ((t && typeof t == 'object') || typeof t == 'function')
|
|
22
|
-
for (let
|
|
23
|
-
!
|
|
24
|
-
|
|
25
|
-
he(e,
|
|
22
|
+
for (let s of sr(t))
|
|
23
|
+
!or.call(e, s) &&
|
|
24
|
+
s !== r &&
|
|
25
|
+
he(e, s, { get: () => t[s], enumerable: !(i = ar(t, s)) || i.enumerable });
|
|
26
26
|
return e;
|
|
27
27
|
};
|
|
28
|
-
var
|
|
29
|
-
(
|
|
30
|
-
|
|
28
|
+
var P = (e, t, r) => (
|
|
29
|
+
(r = e != null ? ir(nr(e)) : {}),
|
|
30
|
+
pr(t || !e || !e.__esModule ? he(r, 'default', { value: e, enumerable: !0 }) : r, e)
|
|
31
31
|
);
|
|
32
32
|
function V() {
|
|
33
33
|
try {
|
|
34
|
-
if (
|
|
35
|
-
let e =
|
|
34
|
+
if ($.default.existsSync(L)) {
|
|
35
|
+
let e = $.default.readFileSync(L, 'utf-8');
|
|
36
36
|
return JSON.parse(e);
|
|
37
37
|
}
|
|
38
38
|
} catch {}
|
|
@@ -40,11 +40,11 @@ function V() {
|
|
|
40
40
|
}
|
|
41
41
|
function be(e) {
|
|
42
42
|
try {
|
|
43
|
-
|
|
44
|
-
let
|
|
45
|
-
(
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
$.default.existsSync(te) || $.default.mkdirSync(te, { recursive: !0, mode: 448 });
|
|
44
|
+
let r = { ...V(), ...e };
|
|
45
|
+
($.default.writeFileSync(L, JSON.stringify(r, null, 2), { encoding: 'utf-8', mode: 384 }),
|
|
46
|
+
$.default.chmodSync(te, 448),
|
|
47
|
+
$.default.chmodSync(L, 384));
|
|
48
48
|
} catch (t) {
|
|
49
49
|
throw new Error(`Failed to save config to ${L}: ${t}`);
|
|
50
50
|
}
|
|
@@ -53,55 +53,55 @@ function S(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 = V();
|
|
57
|
+
return r.apiKey && r.apiKey.trim() ? r.apiKey.trim() : '';
|
|
58
58
|
}
|
|
59
59
|
function x(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 = V();
|
|
64
|
+
return r.apiUrl && r.apiUrl.trim() ? r.apiUrl.trim().replace(/\/+$/, '') : 'https://api.tein.ai';
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function re() {
|
|
67
67
|
return L;
|
|
68
68
|
}
|
|
69
|
-
var
|
|
69
|
+
var $,
|
|
70
70
|
Qe,
|
|
71
71
|
ye,
|
|
72
72
|
te,
|
|
73
73
|
L,
|
|
74
|
-
|
|
74
|
+
C = b(() => {
|
|
75
75
|
'use strict';
|
|
76
|
-
((
|
|
77
|
-
(Qe =
|
|
78
|
-
(ye =
|
|
76
|
+
(($ = P(require('node:fs'))),
|
|
77
|
+
(Qe = P(require('node:os'))),
|
|
78
|
+
(ye = P(require('node:path'))),
|
|
79
79
|
(te = ye.default.join(Qe.default.homedir(), '.tein')),
|
|
80
80
|
(L = ye.default.join(te, 'config.json')));
|
|
81
81
|
});
|
|
82
|
-
var
|
|
82
|
+
var gr,
|
|
83
83
|
Xe,
|
|
84
84
|
Ze,
|
|
85
85
|
et = b(() => {
|
|
86
86
|
'use strict';
|
|
87
|
-
((
|
|
88
|
-
(Xe = [...
|
|
87
|
+
((gr = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4']),
|
|
88
|
+
(Xe = [...gr, 'auto']),
|
|
89
89
|
(Ze =
|
|
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 j,
|
|
93
|
+
we = b(() => {
|
|
94
94
|
'use strict';
|
|
95
|
-
|
|
95
|
+
j = 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
100
|
var tt = b(() => {
|
|
101
101
|
'use strict';
|
|
102
102
|
});
|
|
103
103
|
var ae,
|
|
104
|
-
|
|
104
|
+
rt = b(() => {
|
|
105
105
|
'use strict';
|
|
106
106
|
ae = {
|
|
107
107
|
source: 'TEIN Price Board',
|
|
@@ -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
|
{
|
|
@@ -3127,242 +3133,1132 @@ var ae,
|
|
|
3127
3133
|
},
|
|
3128
3134
|
{
|
|
3129
3135
|
id: 'dynamic-4k-medium',
|
|
3130
|
-
price: { starter: 0.0451, plus: 0.0428, scale: 0.0384 },
|
|
3136
|
+
price: { starter: 0.0451, plus: 0.0428, scale: 0.0384 },
|
|
3137
|
+
label: '4K \xB7 medium',
|
|
3138
|
+
endpoint: 'dynamic',
|
|
3139
|
+
resolution: '4K',
|
|
3140
|
+
quality: 'medium',
|
|
3141
|
+
mode: 'edit',
|
|
3142
|
+
acceptsImages: !0,
|
|
3143
|
+
perInputImage: 0,
|
|
3144
|
+
capTiers: { starter: 0.067, plus: 0.0636, scale: 0.057 },
|
|
3145
|
+
},
|
|
3146
|
+
{
|
|
3147
|
+
id: 'dynamic-1k-high',
|
|
3148
|
+
price: { starter: 0.0274, plus: 0.026, scale: 0.0233 },
|
|
3149
|
+
label: '1K \xB7 high',
|
|
3150
|
+
endpoint: 'dynamic',
|
|
3151
|
+
resolution: '1K',
|
|
3152
|
+
quality: 'high',
|
|
3153
|
+
mode: 'edit',
|
|
3154
|
+
acceptsImages: !0,
|
|
3155
|
+
perInputImage: 0,
|
|
3156
|
+
capTiers: { starter: 0.0274, plus: 0.026, scale: 0.0233 },
|
|
3157
|
+
},
|
|
3158
|
+
{
|
|
3159
|
+
id: 'dynamic-2k-high',
|
|
3160
|
+
price: { starter: 0.0457, plus: 0.0434, scale: 0.0389 },
|
|
3161
|
+
label: '2K \xB7 high',
|
|
3162
|
+
endpoint: 'dynamic',
|
|
3163
|
+
resolution: '2K',
|
|
3164
|
+
quality: 'high',
|
|
3165
|
+
mode: 'edit',
|
|
3166
|
+
acceptsImages: !0,
|
|
3167
|
+
perInputImage: 0,
|
|
3168
|
+
capTiers: { starter: 0.0457, plus: 0.0434, scale: 0.0389 },
|
|
3169
|
+
},
|
|
3170
|
+
{
|
|
3171
|
+
id: 'dynamic-4k-high',
|
|
3172
|
+
price: { starter: 0.0731, plus: 0.0694, scale: 0.0622 },
|
|
3173
|
+
label: '4K \xB7 high',
|
|
3174
|
+
endpoint: 'dynamic',
|
|
3175
|
+
resolution: '4K',
|
|
3176
|
+
quality: 'high',
|
|
3177
|
+
mode: 'edit',
|
|
3178
|
+
acceptsImages: !0,
|
|
3179
|
+
perInputImage: 0,
|
|
3180
|
+
capTiers: { starter: 0.067, plus: 0.0636, scale: 0.057 },
|
|
3181
|
+
},
|
|
3182
|
+
{
|
|
3183
|
+
id: 'dynamic-1k-xhigh',
|
|
3184
|
+
price: { starter: 0.0274, plus: 0.026, scale: 0.0233 },
|
|
3185
|
+
label: '1K \xB7 xhigh',
|
|
3186
|
+
endpoint: 'dynamic',
|
|
3187
|
+
resolution: '1K',
|
|
3188
|
+
quality: 'xhigh',
|
|
3189
|
+
mode: 'edit',
|
|
3190
|
+
acceptsImages: !0,
|
|
3191
|
+
perInputImage: 0,
|
|
3192
|
+
capTiers: { starter: 0.0274, plus: 0.026, scale: 0.0233 },
|
|
3193
|
+
},
|
|
3194
|
+
{
|
|
3195
|
+
id: 'dynamic-2k-xhigh',
|
|
3196
|
+
price: { starter: 0.0457, plus: 0.0434, scale: 0.0389 },
|
|
3197
|
+
label: '2K \xB7 xhigh',
|
|
3198
|
+
endpoint: 'dynamic',
|
|
3199
|
+
resolution: '2K',
|
|
3200
|
+
quality: 'xhigh',
|
|
3201
|
+
mode: 'edit',
|
|
3202
|
+
acceptsImages: !0,
|
|
3203
|
+
perInputImage: 0,
|
|
3204
|
+
capTiers: { starter: 0.0457, plus: 0.0434, scale: 0.0389 },
|
|
3205
|
+
},
|
|
3206
|
+
{
|
|
3207
|
+
id: 'dynamic-4k-xhigh',
|
|
3208
|
+
price: { starter: 0.0731, plus: 0.0694, scale: 0.0622 },
|
|
3209
|
+
label: '4K \xB7 xhigh',
|
|
3210
|
+
endpoint: 'dynamic',
|
|
3211
|
+
resolution: '4K',
|
|
3212
|
+
quality: 'xhigh',
|
|
3213
|
+
mode: 'edit',
|
|
3214
|
+
acceptsImages: !0,
|
|
3215
|
+
perInputImage: 0,
|
|
3216
|
+
capTiers: { starter: 0.067, plus: 0.0636, scale: 0.057 },
|
|
3217
|
+
},
|
|
3218
|
+
{
|
|
3219
|
+
id: 'dynamic-1k-max',
|
|
3220
|
+
price: { starter: 0.0274, plus: 0.026, scale: 0.0233 },
|
|
3221
|
+
label: '1K \xB7 max',
|
|
3222
|
+
endpoint: 'dynamic',
|
|
3223
|
+
resolution: '1K',
|
|
3224
|
+
quality: 'max',
|
|
3225
|
+
mode: 'edit',
|
|
3226
|
+
acceptsImages: !0,
|
|
3227
|
+
perInputImage: 0,
|
|
3228
|
+
capTiers: { starter: 0.0274, plus: 0.026, scale: 0.0233 },
|
|
3229
|
+
},
|
|
3230
|
+
{
|
|
3231
|
+
id: 'dynamic-2k-max',
|
|
3232
|
+
price: { starter: 0.0457, plus: 0.0434, scale: 0.0389 },
|
|
3233
|
+
label: '2K \xB7 max',
|
|
3234
|
+
endpoint: 'dynamic',
|
|
3235
|
+
resolution: '2K',
|
|
3236
|
+
quality: 'max',
|
|
3237
|
+
mode: 'edit',
|
|
3238
|
+
acceptsImages: !0,
|
|
3239
|
+
perInputImage: 0,
|
|
3240
|
+
capTiers: { starter: 0.0457, plus: 0.0434, scale: 0.0389 },
|
|
3241
|
+
},
|
|
3242
|
+
{
|
|
3243
|
+
id: 'dynamic-4k-max',
|
|
3244
|
+
price: { starter: 0.0731, plus: 0.0694, scale: 0.0622 },
|
|
3245
|
+
label: '4K \xB7 max',
|
|
3246
|
+
endpoint: 'dynamic',
|
|
3247
|
+
resolution: '4K',
|
|
3248
|
+
quality: 'max',
|
|
3249
|
+
mode: 'edit',
|
|
3250
|
+
acceptsImages: !0,
|
|
3251
|
+
perInputImage: 0,
|
|
3252
|
+
capTiers: { starter: 0.067, plus: 0.0636, scale: 0.057 },
|
|
3253
|
+
},
|
|
3254
|
+
{
|
|
3255
|
+
id: 'token-1k-low',
|
|
3256
|
+
price: { starter: 0.0065, plus: 0.0062, scale: 0.0056 },
|
|
3257
|
+
label: '1K \xB7 low',
|
|
3258
|
+
endpoint: 'token',
|
|
3259
|
+
resolution: '1K',
|
|
3260
|
+
quality: 'low',
|
|
3261
|
+
mode: 'edit',
|
|
3262
|
+
acceptsImages: !0,
|
|
3263
|
+
note: '150-token prompt, no input images',
|
|
3264
|
+
token: {
|
|
3265
|
+
listTextInPerM: 5,
|
|
3266
|
+
listImageOutPerM: 30,
|
|
3267
|
+
listImageInPerM: 8,
|
|
3268
|
+
textInPerM: 4.95,
|
|
3269
|
+
imageOutPerM: 29.7,
|
|
3270
|
+
imageInPerM: 7.92,
|
|
3271
|
+
inputImageTokens: 256,
|
|
3272
|
+
promptTokens: 150,
|
|
3273
|
+
outputTokens: 196,
|
|
3274
|
+
maxPromptTokens: 2568,
|
|
3275
|
+
maxRefs: 5,
|
|
3276
|
+
},
|
|
3277
|
+
},
|
|
3278
|
+
{
|
|
3279
|
+
id: 'token-2k-low',
|
|
3280
|
+
price: { starter: 0.0125, plus: 0.0119, scale: 0.0107 },
|
|
3281
|
+
label: '2K \xB7 low',
|
|
3282
|
+
endpoint: 'token',
|
|
3283
|
+
resolution: '2K',
|
|
3284
|
+
quality: 'low',
|
|
3285
|
+
mode: 'edit',
|
|
3286
|
+
acceptsImages: !0,
|
|
3287
|
+
note: '150-token prompt, no input images',
|
|
3288
|
+
token: {
|
|
3289
|
+
listTextInPerM: 5,
|
|
3290
|
+
listImageOutPerM: 30,
|
|
3291
|
+
listImageInPerM: 8,
|
|
3292
|
+
textInPerM: 4.95,
|
|
3293
|
+
imageOutPerM: 29.7,
|
|
3294
|
+
imageInPerM: 7.92,
|
|
3295
|
+
inputImageTokens: 256,
|
|
3296
|
+
promptTokens: 150,
|
|
3297
|
+
outputTokens: 397,
|
|
3298
|
+
maxPromptTokens: 1362,
|
|
3299
|
+
maxRefs: 2,
|
|
3300
|
+
},
|
|
3301
|
+
},
|
|
3302
|
+
{
|
|
3303
|
+
id: 'token-1k-medium',
|
|
3304
|
+
price: { starter: 0.0137, plus: 0.013, scale: 0.0117 },
|
|
3305
|
+
label: '1K \xB7 medium',
|
|
3306
|
+
endpoint: 'token',
|
|
3307
|
+
resolution: '1K',
|
|
3308
|
+
quality: 'medium',
|
|
3309
|
+
mode: 'edit',
|
|
3310
|
+
acceptsImages: !0,
|
|
3311
|
+
note: '150-token prompt, no input images',
|
|
3312
|
+
token: {
|
|
3313
|
+
listTextInPerM: 5,
|
|
3314
|
+
listImageOutPerM: 30,
|
|
3315
|
+
listImageInPerM: 8,
|
|
3316
|
+
textInPerM: 4.95,
|
|
3317
|
+
imageOutPerM: 29.7,
|
|
3318
|
+
imageInPerM: 7.92,
|
|
3319
|
+
inputImageTokens: 256,
|
|
3320
|
+
promptTokens: 150,
|
|
3321
|
+
outputTokens: 439,
|
|
3322
|
+
maxPromptTokens: 1109,
|
|
3323
|
+
maxRefs: 2,
|
|
3324
|
+
},
|
|
3325
|
+
},
|
|
3326
|
+
{
|
|
3327
|
+
id: 'flat-1k-any',
|
|
3328
|
+
price: { starter: 0.0274, plus: 0.026, scale: 0.0233 },
|
|
3329
|
+
label: '1K \xB7 any quality',
|
|
3330
|
+
endpoint: 'flat',
|
|
3331
|
+
resolution: '1K',
|
|
3332
|
+
quality: 'any',
|
|
3333
|
+
mode: 'edit',
|
|
3334
|
+
acceptsImages: !0,
|
|
3335
|
+
perInputImage: 0,
|
|
3336
|
+
},
|
|
3337
|
+
{
|
|
3338
|
+
id: 'flat-2k-any',
|
|
3339
|
+
price: { starter: 0.0457, plus: 0.0434, scale: 0.0389 },
|
|
3340
|
+
label: '2K \xB7 any quality',
|
|
3341
|
+
endpoint: 'flat',
|
|
3342
|
+
resolution: '2K',
|
|
3343
|
+
quality: 'any',
|
|
3344
|
+
mode: 'edit',
|
|
3345
|
+
acceptsImages: !0,
|
|
3346
|
+
perInputImage: 0,
|
|
3347
|
+
},
|
|
3348
|
+
{
|
|
3349
|
+
id: 'flat-4k-any',
|
|
3350
|
+
price: { starter: 0.0731, plus: 0.0694, scale: 0.0622 },
|
|
3351
|
+
label: '4K \xB7 any quality',
|
|
3352
|
+
endpoint: 'flat',
|
|
3353
|
+
resolution: '4K',
|
|
3354
|
+
quality: 'any',
|
|
3355
|
+
mode: 'edit',
|
|
3356
|
+
acceptsImages: !0,
|
|
3357
|
+
perInputImage: 0,
|
|
3358
|
+
},
|
|
3359
|
+
],
|
|
3360
|
+
endpoints: [
|
|
3361
|
+
{ id: 'token', label: 'Token', recommended: !0 },
|
|
3362
|
+
{ id: 'dynamic', label: 'Dynamic' },
|
|
3363
|
+
{ id: 'flat', label: 'Flat', verified: !0 },
|
|
3364
|
+
],
|
|
3365
|
+
defaultEndpoint: 'token',
|
|
3366
|
+
axes: {
|
|
3367
|
+
quality: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
3368
|
+
resolution: ['1K', '2K', '4K'],
|
|
3369
|
+
mode: ['text-to-image', 'edit'],
|
|
3370
|
+
},
|
|
3371
|
+
from: { variant: 'token-1k-low' },
|
|
3372
|
+
},
|
|
3373
|
+
{
|
|
3374
|
+
slug: 'gpt-image-2.6-flare',
|
|
3375
|
+
name: 'GPT Image 2.6 Flare',
|
|
3376
|
+
family: 'gpt-image',
|
|
3377
|
+
vendor: 'OpenAI',
|
|
3378
|
+
desc: "GPT Image 2.6 Flare \u2014 OpenAI's GPT Image 2.6, served by OpenAI. One price per quality and size.",
|
|
3379
|
+
kind: 'image',
|
|
3380
|
+
unit: '/img',
|
|
3381
|
+
api: { model: 'gpt-image-2.6-flare' },
|
|
3382
|
+
variants: [
|
|
3383
|
+
{
|
|
3384
|
+
id: 'dynamic-1k-low',
|
|
3385
|
+
price: { starter: 0.0323, plus: 0.0298, scale: 0.0285 },
|
|
3386
|
+
label: '1K \xB7 low',
|
|
3387
|
+
endpoint: 'dynamic',
|
|
3388
|
+
resolution: '1K',
|
|
3389
|
+
quality: 'low',
|
|
3390
|
+
mode: 'text-to-image',
|
|
3391
|
+
acceptsImages: !1,
|
|
3392
|
+
promptIncludedTokens: 144,
|
|
3393
|
+
extraPromptPerM: 6.5,
|
|
3394
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3395
|
+
},
|
|
3396
|
+
{
|
|
3397
|
+
id: 'dynamic-2k-low',
|
|
3398
|
+
price: { starter: 0.0652, plus: 0.0602, scale: 0.0577 },
|
|
3399
|
+
label: '2K \xB7 low',
|
|
3400
|
+
endpoint: 'dynamic',
|
|
3401
|
+
resolution: '2K',
|
|
3402
|
+
quality: 'low',
|
|
3403
|
+
mode: 'text-to-image',
|
|
3404
|
+
acceptsImages: !1,
|
|
3405
|
+
promptIncludedTokens: 144,
|
|
3406
|
+
extraPromptPerM: 6.5,
|
|
3407
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3408
|
+
},
|
|
3409
|
+
{
|
|
3410
|
+
id: 'dynamic-4k-low',
|
|
3411
|
+
price: { starter: 0.1081, plus: 0.0998, scale: 0.0956 },
|
|
3412
|
+
label: '4K \xB7 low',
|
|
3413
|
+
endpoint: 'dynamic',
|
|
3414
|
+
resolution: '4K',
|
|
3415
|
+
quality: 'low',
|
|
3416
|
+
mode: 'text-to-image',
|
|
3417
|
+
acceptsImages: !1,
|
|
3418
|
+
promptIncludedTokens: 144,
|
|
3419
|
+
extraPromptPerM: 6.5,
|
|
3420
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3421
|
+
},
|
|
3422
|
+
{
|
|
3423
|
+
id: 'dynamic-1k-medium',
|
|
3424
|
+
price: { starter: 0.0566, plus: 0.0523, scale: 0.0501 },
|
|
3425
|
+
label: '1K \xB7 medium',
|
|
3426
|
+
endpoint: 'dynamic',
|
|
3427
|
+
resolution: '1K',
|
|
3428
|
+
quality: 'medium',
|
|
3429
|
+
mode: 'text-to-image',
|
|
3430
|
+
acceptsImages: !1,
|
|
3431
|
+
promptIncludedTokens: 144,
|
|
3432
|
+
extraPromptPerM: 6.5,
|
|
3433
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3434
|
+
},
|
|
3435
|
+
{
|
|
3436
|
+
id: 'dynamic-2k-medium',
|
|
3437
|
+
price: { starter: 0.1149, plus: 0.1061, scale: 0.1017 },
|
|
3438
|
+
label: '2K \xB7 medium',
|
|
3439
|
+
endpoint: 'dynamic',
|
|
3440
|
+
resolution: '2K',
|
|
3441
|
+
quality: 'medium',
|
|
3442
|
+
mode: 'text-to-image',
|
|
3443
|
+
acceptsImages: !1,
|
|
3444
|
+
promptIncludedTokens: 144,
|
|
3445
|
+
extraPromptPerM: 6.5,
|
|
3446
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3447
|
+
},
|
|
3448
|
+
{
|
|
3449
|
+
id: 'dynamic-4k-medium',
|
|
3450
|
+
price: { starter: 0.191, plus: 0.1763, scale: 0.169 },
|
|
3451
|
+
label: '4K \xB7 medium',
|
|
3452
|
+
endpoint: 'dynamic',
|
|
3453
|
+
resolution: '4K',
|
|
3454
|
+
quality: 'medium',
|
|
3455
|
+
mode: 'text-to-image',
|
|
3456
|
+
acceptsImages: !1,
|
|
3457
|
+
promptIncludedTokens: 144,
|
|
3458
|
+
extraPromptPerM: 6.5,
|
|
3459
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3460
|
+
},
|
|
3461
|
+
{
|
|
3462
|
+
id: 'dynamic-1k-high',
|
|
3463
|
+
price: { starter: 0.0687, plus: 0.0634, scale: 0.0607 },
|
|
3464
|
+
label: '1K \xB7 high',
|
|
3465
|
+
endpoint: 'dynamic',
|
|
3466
|
+
resolution: '1K',
|
|
3467
|
+
quality: 'high',
|
|
3468
|
+
mode: 'text-to-image',
|
|
3469
|
+
acceptsImages: !1,
|
|
3470
|
+
promptIncludedTokens: 144,
|
|
3471
|
+
extraPromptPerM: 6.5,
|
|
3472
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3473
|
+
},
|
|
3474
|
+
{
|
|
3475
|
+
id: 'dynamic-2k-high',
|
|
3476
|
+
price: { starter: 0.1393, plus: 0.1286, scale: 0.1232 },
|
|
3477
|
+
label: '2K \xB7 high',
|
|
3478
|
+
endpoint: 'dynamic',
|
|
3479
|
+
resolution: '2K',
|
|
3480
|
+
quality: 'high',
|
|
3481
|
+
mode: 'text-to-image',
|
|
3482
|
+
acceptsImages: !1,
|
|
3483
|
+
promptIncludedTokens: 144,
|
|
3484
|
+
extraPromptPerM: 6.5,
|
|
3485
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3486
|
+
},
|
|
3487
|
+
{
|
|
3488
|
+
id: 'dynamic-4k-high',
|
|
3489
|
+
price: { starter: 0.2314, plus: 0.2136, scale: 0.2047 },
|
|
3490
|
+
label: '4K \xB7 high',
|
|
3491
|
+
endpoint: 'dynamic',
|
|
3492
|
+
resolution: '4K',
|
|
3493
|
+
quality: 'high',
|
|
3494
|
+
mode: 'text-to-image',
|
|
3495
|
+
acceptsImages: !1,
|
|
3496
|
+
promptIncludedTokens: 144,
|
|
3497
|
+
extraPromptPerM: 6.5,
|
|
3498
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3499
|
+
},
|
|
3500
|
+
{
|
|
3501
|
+
id: 'dynamic-1k-xhigh',
|
|
3502
|
+
price: { starter: 0.1219, plus: 0.1125, scale: 0.1078 },
|
|
3503
|
+
label: '1K \xB7 xhigh',
|
|
3504
|
+
endpoint: 'dynamic',
|
|
3505
|
+
resolution: '1K',
|
|
3506
|
+
quality: 'xhigh',
|
|
3507
|
+
mode: 'text-to-image',
|
|
3508
|
+
acceptsImages: !1,
|
|
3509
|
+
promptIncludedTokens: 144,
|
|
3510
|
+
extraPromptPerM: 6.5,
|
|
3511
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3512
|
+
},
|
|
3513
|
+
{
|
|
3514
|
+
id: 'dynamic-2k-xhigh',
|
|
3515
|
+
price: { starter: 0.2475, plus: 0.2285, scale: 0.2189 },
|
|
3516
|
+
label: '2K \xB7 xhigh',
|
|
3517
|
+
endpoint: 'dynamic',
|
|
3518
|
+
resolution: '2K',
|
|
3519
|
+
quality: 'xhigh',
|
|
3520
|
+
mode: 'text-to-image',
|
|
3521
|
+
acceptsImages: !1,
|
|
3522
|
+
promptIncludedTokens: 144,
|
|
3523
|
+
extraPromptPerM: 6.5,
|
|
3524
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3525
|
+
},
|
|
3526
|
+
{
|
|
3527
|
+
id: 'dynamic-4k-xhigh',
|
|
3528
|
+
price: { starter: 0.4113, plus: 0.3796, scale: 0.3638 },
|
|
3529
|
+
label: '4K \xB7 xhigh',
|
|
3530
|
+
endpoint: 'dynamic',
|
|
3531
|
+
resolution: '4K',
|
|
3532
|
+
quality: 'xhigh',
|
|
3533
|
+
mode: 'text-to-image',
|
|
3534
|
+
acceptsImages: !1,
|
|
3535
|
+
promptIncludedTokens: 144,
|
|
3536
|
+
extraPromptPerM: 6.5,
|
|
3537
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3538
|
+
},
|
|
3539
|
+
{
|
|
3540
|
+
id: 'dynamic-1k-max',
|
|
3541
|
+
price: { starter: 0.2741, plus: 0.253, scale: 0.2424 },
|
|
3542
|
+
label: '1K \xB7 max',
|
|
3543
|
+
endpoint: 'dynamic',
|
|
3544
|
+
resolution: '1K',
|
|
3545
|
+
quality: 'max',
|
|
3546
|
+
mode: 'text-to-image',
|
|
3547
|
+
acceptsImages: !1,
|
|
3548
|
+
promptIncludedTokens: 144,
|
|
3549
|
+
extraPromptPerM: 6.5,
|
|
3550
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3551
|
+
},
|
|
3552
|
+
{
|
|
3553
|
+
id: 'dynamic-2k-max',
|
|
3554
|
+
price: { starter: 0.5567, plus: 0.5139, scale: 0.4925 },
|
|
3555
|
+
label: '2K \xB7 max',
|
|
3556
|
+
endpoint: 'dynamic',
|
|
3557
|
+
resolution: '2K',
|
|
3558
|
+
quality: 'max',
|
|
3559
|
+
mode: 'text-to-image',
|
|
3560
|
+
acceptsImages: !1,
|
|
3561
|
+
promptIncludedTokens: 144,
|
|
3562
|
+
extraPromptPerM: 6.5,
|
|
3563
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3564
|
+
},
|
|
3565
|
+
{
|
|
3566
|
+
id: 'dynamic-4k-max',
|
|
3567
|
+
price: { starter: 0.9252, plus: 0.854, scale: 0.8184 },
|
|
3568
|
+
label: '4K \xB7 max',
|
|
3569
|
+
endpoint: 'dynamic',
|
|
3570
|
+
resolution: '4K',
|
|
3571
|
+
quality: 'max',
|
|
3572
|
+
mode: 'text-to-image',
|
|
3573
|
+
acceptsImages: !1,
|
|
3574
|
+
promptIncludedTokens: 144,
|
|
3575
|
+
extraPromptPerM: 6.5,
|
|
3576
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3577
|
+
},
|
|
3578
|
+
],
|
|
3579
|
+
unfiltered: null,
|
|
3580
|
+
priority: null,
|
|
3581
|
+
draft: null,
|
|
3582
|
+
editVariants: [
|
|
3583
|
+
{
|
|
3584
|
+
id: 'dynamic-1k-low',
|
|
3585
|
+
price: { starter: 0.0323, plus: 0.0298, scale: 0.0285 },
|
|
3586
|
+
label: '1K \xB7 low',
|
|
3587
|
+
endpoint: 'dynamic',
|
|
3588
|
+
resolution: '1K',
|
|
3589
|
+
quality: 'low',
|
|
3590
|
+
mode: 'edit',
|
|
3591
|
+
acceptsImages: !0,
|
|
3592
|
+
perInputImage: 0.0027,
|
|
3593
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3594
|
+
promptIncludedTokens: 144,
|
|
3595
|
+
extraPromptPerM: 6.5,
|
|
3596
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3597
|
+
},
|
|
3598
|
+
{
|
|
3599
|
+
id: 'dynamic-2k-low',
|
|
3600
|
+
price: { starter: 0.0652, plus: 0.0602, scale: 0.0577 },
|
|
3601
|
+
label: '2K \xB7 low',
|
|
3602
|
+
endpoint: 'dynamic',
|
|
3603
|
+
resolution: '2K',
|
|
3604
|
+
quality: 'low',
|
|
3605
|
+
mode: 'edit',
|
|
3606
|
+
acceptsImages: !0,
|
|
3607
|
+
perInputImage: 0.0027,
|
|
3608
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3609
|
+
promptIncludedTokens: 144,
|
|
3610
|
+
extraPromptPerM: 6.5,
|
|
3611
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3612
|
+
},
|
|
3613
|
+
{
|
|
3614
|
+
id: 'dynamic-4k-low',
|
|
3615
|
+
price: { starter: 0.1081, plus: 0.0998, scale: 0.0956 },
|
|
3616
|
+
label: '4K \xB7 low',
|
|
3617
|
+
endpoint: 'dynamic',
|
|
3618
|
+
resolution: '4K',
|
|
3619
|
+
quality: 'low',
|
|
3620
|
+
mode: 'edit',
|
|
3621
|
+
acceptsImages: !0,
|
|
3622
|
+
perInputImage: 0.0027,
|
|
3623
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3624
|
+
promptIncludedTokens: 144,
|
|
3625
|
+
extraPromptPerM: 6.5,
|
|
3626
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3627
|
+
},
|
|
3628
|
+
{
|
|
3629
|
+
id: 'dynamic-1k-medium',
|
|
3630
|
+
price: { starter: 0.0566, plus: 0.0523, scale: 0.0501 },
|
|
3631
|
+
label: '1K \xB7 medium',
|
|
3632
|
+
endpoint: 'dynamic',
|
|
3633
|
+
resolution: '1K',
|
|
3634
|
+
quality: 'medium',
|
|
3635
|
+
mode: 'edit',
|
|
3636
|
+
acceptsImages: !0,
|
|
3637
|
+
perInputImage: 0.0027,
|
|
3638
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3639
|
+
promptIncludedTokens: 144,
|
|
3640
|
+
extraPromptPerM: 6.5,
|
|
3641
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3642
|
+
},
|
|
3643
|
+
{
|
|
3644
|
+
id: 'dynamic-2k-medium',
|
|
3645
|
+
price: { starter: 0.1149, plus: 0.1061, scale: 0.1017 },
|
|
3646
|
+
label: '2K \xB7 medium',
|
|
3647
|
+
endpoint: 'dynamic',
|
|
3648
|
+
resolution: '2K',
|
|
3649
|
+
quality: 'medium',
|
|
3650
|
+
mode: 'edit',
|
|
3651
|
+
acceptsImages: !0,
|
|
3652
|
+
perInputImage: 0.0027,
|
|
3653
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3654
|
+
promptIncludedTokens: 144,
|
|
3655
|
+
extraPromptPerM: 6.5,
|
|
3656
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3657
|
+
},
|
|
3658
|
+
{
|
|
3659
|
+
id: 'dynamic-4k-medium',
|
|
3660
|
+
price: { starter: 0.191, plus: 0.1763, scale: 0.169 },
|
|
3661
|
+
label: '4K \xB7 medium',
|
|
3662
|
+
endpoint: 'dynamic',
|
|
3663
|
+
resolution: '4K',
|
|
3664
|
+
quality: 'medium',
|
|
3665
|
+
mode: 'edit',
|
|
3666
|
+
acceptsImages: !0,
|
|
3667
|
+
perInputImage: 0.0027,
|
|
3668
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3669
|
+
promptIncludedTokens: 144,
|
|
3670
|
+
extraPromptPerM: 6.5,
|
|
3671
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3672
|
+
},
|
|
3673
|
+
{
|
|
3674
|
+
id: 'dynamic-1k-high',
|
|
3675
|
+
price: { starter: 0.0687, plus: 0.0634, scale: 0.0607 },
|
|
3676
|
+
label: '1K \xB7 high',
|
|
3677
|
+
endpoint: 'dynamic',
|
|
3678
|
+
resolution: '1K',
|
|
3679
|
+
quality: 'high',
|
|
3680
|
+
mode: 'edit',
|
|
3681
|
+
acceptsImages: !0,
|
|
3682
|
+
perInputImage: 0.0027,
|
|
3683
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3684
|
+
promptIncludedTokens: 144,
|
|
3685
|
+
extraPromptPerM: 6.5,
|
|
3686
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3687
|
+
},
|
|
3688
|
+
{
|
|
3689
|
+
id: 'dynamic-2k-high',
|
|
3690
|
+
price: { starter: 0.1393, plus: 0.1286, scale: 0.1232 },
|
|
3691
|
+
label: '2K \xB7 high',
|
|
3692
|
+
endpoint: 'dynamic',
|
|
3693
|
+
resolution: '2K',
|
|
3694
|
+
quality: 'high',
|
|
3695
|
+
mode: 'edit',
|
|
3696
|
+
acceptsImages: !0,
|
|
3697
|
+
perInputImage: 0.0027,
|
|
3698
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3699
|
+
promptIncludedTokens: 144,
|
|
3700
|
+
extraPromptPerM: 6.5,
|
|
3701
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3702
|
+
},
|
|
3703
|
+
{
|
|
3704
|
+
id: 'dynamic-4k-high',
|
|
3705
|
+
price: { starter: 0.2314, plus: 0.2136, scale: 0.2047 },
|
|
3706
|
+
label: '4K \xB7 high',
|
|
3707
|
+
endpoint: 'dynamic',
|
|
3708
|
+
resolution: '4K',
|
|
3709
|
+
quality: 'high',
|
|
3710
|
+
mode: 'edit',
|
|
3711
|
+
acceptsImages: !0,
|
|
3712
|
+
perInputImage: 0.0027,
|
|
3713
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3714
|
+
promptIncludedTokens: 144,
|
|
3715
|
+
extraPromptPerM: 6.5,
|
|
3716
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3717
|
+
},
|
|
3718
|
+
{
|
|
3719
|
+
id: 'dynamic-1k-xhigh',
|
|
3720
|
+
price: { starter: 0.1219, plus: 0.1125, scale: 0.1078 },
|
|
3721
|
+
label: '1K \xB7 xhigh',
|
|
3722
|
+
endpoint: 'dynamic',
|
|
3723
|
+
resolution: '1K',
|
|
3724
|
+
quality: 'xhigh',
|
|
3725
|
+
mode: 'edit',
|
|
3726
|
+
acceptsImages: !0,
|
|
3727
|
+
perInputImage: 0.0027,
|
|
3728
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3729
|
+
promptIncludedTokens: 144,
|
|
3730
|
+
extraPromptPerM: 6.5,
|
|
3731
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3732
|
+
},
|
|
3733
|
+
{
|
|
3734
|
+
id: 'dynamic-2k-xhigh',
|
|
3735
|
+
price: { starter: 0.2475, plus: 0.2285, scale: 0.2189 },
|
|
3736
|
+
label: '2K \xB7 xhigh',
|
|
3737
|
+
endpoint: 'dynamic',
|
|
3738
|
+
resolution: '2K',
|
|
3739
|
+
quality: 'xhigh',
|
|
3740
|
+
mode: 'edit',
|
|
3741
|
+
acceptsImages: !0,
|
|
3742
|
+
perInputImage: 0.0027,
|
|
3743
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3744
|
+
promptIncludedTokens: 144,
|
|
3745
|
+
extraPromptPerM: 6.5,
|
|
3746
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3747
|
+
},
|
|
3748
|
+
{
|
|
3749
|
+
id: 'dynamic-4k-xhigh',
|
|
3750
|
+
price: { starter: 0.4113, plus: 0.3796, scale: 0.3638 },
|
|
3751
|
+
label: '4K \xB7 xhigh',
|
|
3752
|
+
endpoint: 'dynamic',
|
|
3753
|
+
resolution: '4K',
|
|
3754
|
+
quality: 'xhigh',
|
|
3755
|
+
mode: 'edit',
|
|
3756
|
+
acceptsImages: !0,
|
|
3757
|
+
perInputImage: 0.0027,
|
|
3758
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3759
|
+
promptIncludedTokens: 144,
|
|
3760
|
+
extraPromptPerM: 6.5,
|
|
3761
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3762
|
+
},
|
|
3763
|
+
{
|
|
3764
|
+
id: 'dynamic-1k-max',
|
|
3765
|
+
price: { starter: 0.2741, plus: 0.253, scale: 0.2424 },
|
|
3766
|
+
label: '1K \xB7 max',
|
|
3767
|
+
endpoint: 'dynamic',
|
|
3768
|
+
resolution: '1K',
|
|
3769
|
+
quality: 'max',
|
|
3770
|
+
mode: 'edit',
|
|
3771
|
+
acceptsImages: !0,
|
|
3772
|
+
perInputImage: 0.0027,
|
|
3773
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3774
|
+
promptIncludedTokens: 144,
|
|
3775
|
+
extraPromptPerM: 6.5,
|
|
3776
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3777
|
+
},
|
|
3778
|
+
{
|
|
3779
|
+
id: 'dynamic-2k-max',
|
|
3780
|
+
price: { starter: 0.5567, plus: 0.5139, scale: 0.4925 },
|
|
3781
|
+
label: '2K \xB7 max',
|
|
3782
|
+
endpoint: 'dynamic',
|
|
3783
|
+
resolution: '2K',
|
|
3784
|
+
quality: 'max',
|
|
3785
|
+
mode: 'edit',
|
|
3786
|
+
acceptsImages: !0,
|
|
3787
|
+
perInputImage: 0.0027,
|
|
3788
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3789
|
+
promptIncludedTokens: 144,
|
|
3790
|
+
extraPromptPerM: 6.5,
|
|
3791
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3792
|
+
},
|
|
3793
|
+
{
|
|
3794
|
+
id: 'dynamic-4k-max',
|
|
3795
|
+
price: { starter: 0.9252, plus: 0.854, scale: 0.8184 },
|
|
3796
|
+
label: '4K \xB7 max',
|
|
3797
|
+
endpoint: 'dynamic',
|
|
3798
|
+
resolution: '4K',
|
|
3799
|
+
quality: 'max',
|
|
3800
|
+
mode: 'edit',
|
|
3801
|
+
acceptsImages: !0,
|
|
3802
|
+
perInputImage: 0.0027,
|
|
3803
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
3804
|
+
promptIncludedTokens: 144,
|
|
3805
|
+
extraPromptPerM: 6.5,
|
|
3806
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3807
|
+
},
|
|
3808
|
+
],
|
|
3809
|
+
endpoints: [{ id: 'dynamic', label: 'Dynamic', recommended: !0 }],
|
|
3810
|
+
defaultEndpoint: 'dynamic',
|
|
3811
|
+
axes: {
|
|
3812
|
+
quality: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
3813
|
+
resolution: ['1K', '2K', '4K'],
|
|
3814
|
+
mode: ['text-to-image', 'edit'],
|
|
3815
|
+
},
|
|
3816
|
+
from: { variant: 'dynamic-1k-low' },
|
|
3817
|
+
},
|
|
3818
|
+
{
|
|
3819
|
+
slug: 'gpt-image-2.6-sunburst',
|
|
3820
|
+
name: 'GPT Image 2.6 Sunburst',
|
|
3821
|
+
family: 'gpt-image',
|
|
3822
|
+
vendor: 'OpenAI',
|
|
3823
|
+
desc: "GPT Image 2.6 Sunburst \u2014 OpenAI's GPT Image 2.6, served by OpenAI. One price per quality and size.",
|
|
3824
|
+
kind: 'image',
|
|
3825
|
+
unit: '/img',
|
|
3826
|
+
api: { model: 'gpt-image-2.6-sunburst' },
|
|
3827
|
+
variants: [
|
|
3828
|
+
{
|
|
3829
|
+
id: 'dynamic-1k-low',
|
|
3830
|
+
price: { starter: 0.0323, plus: 0.0298, scale: 0.0285 },
|
|
3831
|
+
label: '1K \xB7 low',
|
|
3832
|
+
endpoint: 'dynamic',
|
|
3833
|
+
resolution: '1K',
|
|
3834
|
+
quality: 'low',
|
|
3835
|
+
mode: 'text-to-image',
|
|
3836
|
+
acceptsImages: !1,
|
|
3837
|
+
promptIncludedTokens: 144,
|
|
3838
|
+
extraPromptPerM: 6.5,
|
|
3839
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3840
|
+
},
|
|
3841
|
+
{
|
|
3842
|
+
id: 'dynamic-2k-low',
|
|
3843
|
+
price: { starter: 0.0652, plus: 0.0602, scale: 0.0577 },
|
|
3844
|
+
label: '2K \xB7 low',
|
|
3845
|
+
endpoint: 'dynamic',
|
|
3846
|
+
resolution: '2K',
|
|
3847
|
+
quality: 'low',
|
|
3848
|
+
mode: 'text-to-image',
|
|
3849
|
+
acceptsImages: !1,
|
|
3850
|
+
promptIncludedTokens: 144,
|
|
3851
|
+
extraPromptPerM: 6.5,
|
|
3852
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3853
|
+
},
|
|
3854
|
+
{
|
|
3855
|
+
id: 'dynamic-4k-low',
|
|
3856
|
+
price: { starter: 0.1081, plus: 0.0998, scale: 0.0956 },
|
|
3857
|
+
label: '4K \xB7 low',
|
|
3858
|
+
endpoint: 'dynamic',
|
|
3859
|
+
resolution: '4K',
|
|
3860
|
+
quality: 'low',
|
|
3861
|
+
mode: 'text-to-image',
|
|
3862
|
+
acceptsImages: !1,
|
|
3863
|
+
promptIncludedTokens: 144,
|
|
3864
|
+
extraPromptPerM: 6.5,
|
|
3865
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3866
|
+
},
|
|
3867
|
+
{
|
|
3868
|
+
id: 'dynamic-1k-medium',
|
|
3869
|
+
price: { starter: 0.0566, plus: 0.0523, scale: 0.0501 },
|
|
3870
|
+
label: '1K \xB7 medium',
|
|
3871
|
+
endpoint: 'dynamic',
|
|
3872
|
+
resolution: '1K',
|
|
3873
|
+
quality: 'medium',
|
|
3874
|
+
mode: 'text-to-image',
|
|
3875
|
+
acceptsImages: !1,
|
|
3876
|
+
promptIncludedTokens: 144,
|
|
3877
|
+
extraPromptPerM: 6.5,
|
|
3878
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3879
|
+
},
|
|
3880
|
+
{
|
|
3881
|
+
id: 'dynamic-2k-medium',
|
|
3882
|
+
price: { starter: 0.1149, plus: 0.1061, scale: 0.1017 },
|
|
3883
|
+
label: '2K \xB7 medium',
|
|
3884
|
+
endpoint: 'dynamic',
|
|
3885
|
+
resolution: '2K',
|
|
3886
|
+
quality: 'medium',
|
|
3887
|
+
mode: 'text-to-image',
|
|
3888
|
+
acceptsImages: !1,
|
|
3889
|
+
promptIncludedTokens: 144,
|
|
3890
|
+
extraPromptPerM: 6.5,
|
|
3891
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3892
|
+
},
|
|
3893
|
+
{
|
|
3894
|
+
id: 'dynamic-4k-medium',
|
|
3895
|
+
price: { starter: 0.191, plus: 0.1763, scale: 0.169 },
|
|
3896
|
+
label: '4K \xB7 medium',
|
|
3897
|
+
endpoint: 'dynamic',
|
|
3898
|
+
resolution: '4K',
|
|
3899
|
+
quality: 'medium',
|
|
3900
|
+
mode: 'text-to-image',
|
|
3901
|
+
acceptsImages: !1,
|
|
3902
|
+
promptIncludedTokens: 144,
|
|
3903
|
+
extraPromptPerM: 6.5,
|
|
3904
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3905
|
+
},
|
|
3906
|
+
{
|
|
3907
|
+
id: 'dynamic-1k-high',
|
|
3908
|
+
price: { starter: 0.0687, plus: 0.0634, scale: 0.0607 },
|
|
3909
|
+
label: '1K \xB7 high',
|
|
3910
|
+
endpoint: 'dynamic',
|
|
3911
|
+
resolution: '1K',
|
|
3912
|
+
quality: 'high',
|
|
3913
|
+
mode: 'text-to-image',
|
|
3914
|
+
acceptsImages: !1,
|
|
3915
|
+
promptIncludedTokens: 144,
|
|
3916
|
+
extraPromptPerM: 6.5,
|
|
3917
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3918
|
+
},
|
|
3919
|
+
{
|
|
3920
|
+
id: 'dynamic-2k-high',
|
|
3921
|
+
price: { starter: 0.1393, plus: 0.1286, scale: 0.1232 },
|
|
3922
|
+
label: '2K \xB7 high',
|
|
3923
|
+
endpoint: 'dynamic',
|
|
3924
|
+
resolution: '2K',
|
|
3925
|
+
quality: 'high',
|
|
3926
|
+
mode: 'text-to-image',
|
|
3927
|
+
acceptsImages: !1,
|
|
3928
|
+
promptIncludedTokens: 144,
|
|
3929
|
+
extraPromptPerM: 6.5,
|
|
3930
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3931
|
+
},
|
|
3932
|
+
{
|
|
3933
|
+
id: 'dynamic-4k-high',
|
|
3934
|
+
price: { starter: 0.2314, plus: 0.2136, scale: 0.2047 },
|
|
3935
|
+
label: '4K \xB7 high',
|
|
3936
|
+
endpoint: 'dynamic',
|
|
3937
|
+
resolution: '4K',
|
|
3938
|
+
quality: 'high',
|
|
3939
|
+
mode: 'text-to-image',
|
|
3940
|
+
acceptsImages: !1,
|
|
3941
|
+
promptIncludedTokens: 144,
|
|
3942
|
+
extraPromptPerM: 6.5,
|
|
3943
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3944
|
+
},
|
|
3945
|
+
{
|
|
3946
|
+
id: 'dynamic-1k-xhigh',
|
|
3947
|
+
price: { starter: 0.1219, plus: 0.1125, scale: 0.1078 },
|
|
3948
|
+
label: '1K \xB7 xhigh',
|
|
3949
|
+
endpoint: 'dynamic',
|
|
3950
|
+
resolution: '1K',
|
|
3951
|
+
quality: 'xhigh',
|
|
3952
|
+
mode: 'text-to-image',
|
|
3953
|
+
acceptsImages: !1,
|
|
3954
|
+
promptIncludedTokens: 144,
|
|
3955
|
+
extraPromptPerM: 6.5,
|
|
3956
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3957
|
+
},
|
|
3958
|
+
{
|
|
3959
|
+
id: 'dynamic-2k-xhigh',
|
|
3960
|
+
price: { starter: 0.2475, plus: 0.2285, scale: 0.2189 },
|
|
3961
|
+
label: '2K \xB7 xhigh',
|
|
3962
|
+
endpoint: 'dynamic',
|
|
3963
|
+
resolution: '2K',
|
|
3964
|
+
quality: 'xhigh',
|
|
3965
|
+
mode: 'text-to-image',
|
|
3966
|
+
acceptsImages: !1,
|
|
3967
|
+
promptIncludedTokens: 144,
|
|
3968
|
+
extraPromptPerM: 6.5,
|
|
3969
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3970
|
+
},
|
|
3971
|
+
{
|
|
3972
|
+
id: 'dynamic-4k-xhigh',
|
|
3973
|
+
price: { starter: 0.4113, plus: 0.3796, scale: 0.3638 },
|
|
3974
|
+
label: '4K \xB7 xhigh',
|
|
3975
|
+
endpoint: 'dynamic',
|
|
3976
|
+
resolution: '4K',
|
|
3977
|
+
quality: 'xhigh',
|
|
3978
|
+
mode: 'text-to-image',
|
|
3979
|
+
acceptsImages: !1,
|
|
3980
|
+
promptIncludedTokens: 144,
|
|
3981
|
+
extraPromptPerM: 6.5,
|
|
3982
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3983
|
+
},
|
|
3984
|
+
{
|
|
3985
|
+
id: 'dynamic-1k-max',
|
|
3986
|
+
price: { starter: 0.2741, plus: 0.253, scale: 0.2424 },
|
|
3987
|
+
label: '1K \xB7 max',
|
|
3988
|
+
endpoint: 'dynamic',
|
|
3989
|
+
resolution: '1K',
|
|
3990
|
+
quality: 'max',
|
|
3991
|
+
mode: 'text-to-image',
|
|
3992
|
+
acceptsImages: !1,
|
|
3993
|
+
promptIncludedTokens: 144,
|
|
3994
|
+
extraPromptPerM: 6.5,
|
|
3995
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3996
|
+
},
|
|
3997
|
+
{
|
|
3998
|
+
id: 'dynamic-2k-max',
|
|
3999
|
+
price: { starter: 0.5567, plus: 0.5139, scale: 0.4925 },
|
|
4000
|
+
label: '2K \xB7 max',
|
|
4001
|
+
endpoint: 'dynamic',
|
|
4002
|
+
resolution: '2K',
|
|
4003
|
+
quality: 'max',
|
|
4004
|
+
mode: 'text-to-image',
|
|
4005
|
+
acceptsImages: !1,
|
|
4006
|
+
promptIncludedTokens: 144,
|
|
4007
|
+
extraPromptPerM: 6.5,
|
|
4008
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4009
|
+
},
|
|
4010
|
+
{
|
|
4011
|
+
id: 'dynamic-4k-max',
|
|
4012
|
+
price: { starter: 0.9252, plus: 0.854, scale: 0.8184 },
|
|
4013
|
+
label: '4K \xB7 max',
|
|
4014
|
+
endpoint: 'dynamic',
|
|
4015
|
+
resolution: '4K',
|
|
4016
|
+
quality: 'max',
|
|
4017
|
+
mode: 'text-to-image',
|
|
4018
|
+
acceptsImages: !1,
|
|
4019
|
+
promptIncludedTokens: 144,
|
|
4020
|
+
extraPromptPerM: 6.5,
|
|
4021
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4022
|
+
},
|
|
4023
|
+
],
|
|
4024
|
+
unfiltered: null,
|
|
4025
|
+
priority: null,
|
|
4026
|
+
draft: null,
|
|
4027
|
+
editVariants: [
|
|
4028
|
+
{
|
|
4029
|
+
id: 'dynamic-1k-low',
|
|
4030
|
+
price: { starter: 0.0323, plus: 0.0298, scale: 0.0285 },
|
|
4031
|
+
label: '1K \xB7 low',
|
|
4032
|
+
endpoint: 'dynamic',
|
|
4033
|
+
resolution: '1K',
|
|
4034
|
+
quality: 'low',
|
|
4035
|
+
mode: 'edit',
|
|
4036
|
+
acceptsImages: !0,
|
|
4037
|
+
perInputImage: 0.0027,
|
|
4038
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4039
|
+
promptIncludedTokens: 144,
|
|
4040
|
+
extraPromptPerM: 6.5,
|
|
4041
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4042
|
+
},
|
|
4043
|
+
{
|
|
4044
|
+
id: 'dynamic-2k-low',
|
|
4045
|
+
price: { starter: 0.0652, plus: 0.0602, scale: 0.0577 },
|
|
4046
|
+
label: '2K \xB7 low',
|
|
4047
|
+
endpoint: 'dynamic',
|
|
4048
|
+
resolution: '2K',
|
|
4049
|
+
quality: 'low',
|
|
4050
|
+
mode: 'edit',
|
|
4051
|
+
acceptsImages: !0,
|
|
4052
|
+
perInputImage: 0.0027,
|
|
4053
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4054
|
+
promptIncludedTokens: 144,
|
|
4055
|
+
extraPromptPerM: 6.5,
|
|
4056
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4057
|
+
},
|
|
4058
|
+
{
|
|
4059
|
+
id: 'dynamic-4k-low',
|
|
4060
|
+
price: { starter: 0.1081, plus: 0.0998, scale: 0.0956 },
|
|
4061
|
+
label: '4K \xB7 low',
|
|
4062
|
+
endpoint: 'dynamic',
|
|
4063
|
+
resolution: '4K',
|
|
4064
|
+
quality: 'low',
|
|
4065
|
+
mode: 'edit',
|
|
4066
|
+
acceptsImages: !0,
|
|
4067
|
+
perInputImage: 0.0027,
|
|
4068
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4069
|
+
promptIncludedTokens: 144,
|
|
4070
|
+
extraPromptPerM: 6.5,
|
|
4071
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4072
|
+
},
|
|
4073
|
+
{
|
|
4074
|
+
id: 'dynamic-1k-medium',
|
|
4075
|
+
price: { starter: 0.0566, plus: 0.0523, scale: 0.0501 },
|
|
4076
|
+
label: '1K \xB7 medium',
|
|
4077
|
+
endpoint: 'dynamic',
|
|
4078
|
+
resolution: '1K',
|
|
4079
|
+
quality: 'medium',
|
|
4080
|
+
mode: 'edit',
|
|
4081
|
+
acceptsImages: !0,
|
|
4082
|
+
perInputImage: 0.0027,
|
|
4083
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4084
|
+
promptIncludedTokens: 144,
|
|
4085
|
+
extraPromptPerM: 6.5,
|
|
4086
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4087
|
+
},
|
|
4088
|
+
{
|
|
4089
|
+
id: 'dynamic-2k-medium',
|
|
4090
|
+
price: { starter: 0.1149, plus: 0.1061, scale: 0.1017 },
|
|
4091
|
+
label: '2K \xB7 medium',
|
|
4092
|
+
endpoint: 'dynamic',
|
|
4093
|
+
resolution: '2K',
|
|
4094
|
+
quality: 'medium',
|
|
4095
|
+
mode: 'edit',
|
|
4096
|
+
acceptsImages: !0,
|
|
4097
|
+
perInputImage: 0.0027,
|
|
4098
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4099
|
+
promptIncludedTokens: 144,
|
|
4100
|
+
extraPromptPerM: 6.5,
|
|
4101
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
4102
|
+
},
|
|
4103
|
+
{
|
|
4104
|
+
id: 'dynamic-4k-medium',
|
|
4105
|
+
price: { starter: 0.191, plus: 0.1763, scale: 0.169 },
|
|
3131
4106
|
label: '4K \xB7 medium',
|
|
3132
4107
|
endpoint: 'dynamic',
|
|
3133
4108
|
resolution: '4K',
|
|
3134
4109
|
quality: 'medium',
|
|
3135
4110
|
mode: 'edit',
|
|
3136
4111
|
acceptsImages: !0,
|
|
3137
|
-
perInputImage: 0,
|
|
3138
|
-
|
|
4112
|
+
perInputImage: 0.0027,
|
|
4113
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4114
|
+
promptIncludedTokens: 144,
|
|
4115
|
+
extraPromptPerM: 6.5,
|
|
4116
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3139
4117
|
},
|
|
3140
4118
|
{
|
|
3141
4119
|
id: 'dynamic-1k-high',
|
|
3142
|
-
price: { starter: 0.
|
|
4120
|
+
price: { starter: 0.0687, plus: 0.0634, scale: 0.0607 },
|
|
3143
4121
|
label: '1K \xB7 high',
|
|
3144
4122
|
endpoint: 'dynamic',
|
|
3145
4123
|
resolution: '1K',
|
|
3146
4124
|
quality: 'high',
|
|
3147
4125
|
mode: 'edit',
|
|
3148
4126
|
acceptsImages: !0,
|
|
3149
|
-
perInputImage: 0,
|
|
3150
|
-
|
|
4127
|
+
perInputImage: 0.0027,
|
|
4128
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4129
|
+
promptIncludedTokens: 144,
|
|
4130
|
+
extraPromptPerM: 6.5,
|
|
4131
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3151
4132
|
},
|
|
3152
4133
|
{
|
|
3153
4134
|
id: 'dynamic-2k-high',
|
|
3154
|
-
price: { starter: 0.
|
|
4135
|
+
price: { starter: 0.1393, plus: 0.1286, scale: 0.1232 },
|
|
3155
4136
|
label: '2K \xB7 high',
|
|
3156
4137
|
endpoint: 'dynamic',
|
|
3157
4138
|
resolution: '2K',
|
|
3158
4139
|
quality: 'high',
|
|
3159
4140
|
mode: 'edit',
|
|
3160
4141
|
acceptsImages: !0,
|
|
3161
|
-
perInputImage: 0,
|
|
3162
|
-
|
|
4142
|
+
perInputImage: 0.0027,
|
|
4143
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4144
|
+
promptIncludedTokens: 144,
|
|
4145
|
+
extraPromptPerM: 6.5,
|
|
4146
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3163
4147
|
},
|
|
3164
4148
|
{
|
|
3165
4149
|
id: 'dynamic-4k-high',
|
|
3166
|
-
price: { starter: 0.
|
|
4150
|
+
price: { starter: 0.2314, plus: 0.2136, scale: 0.2047 },
|
|
3167
4151
|
label: '4K \xB7 high',
|
|
3168
4152
|
endpoint: 'dynamic',
|
|
3169
4153
|
resolution: '4K',
|
|
3170
4154
|
quality: 'high',
|
|
3171
4155
|
mode: 'edit',
|
|
3172
4156
|
acceptsImages: !0,
|
|
3173
|
-
perInputImage: 0,
|
|
3174
|
-
|
|
4157
|
+
perInputImage: 0.0027,
|
|
4158
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4159
|
+
promptIncludedTokens: 144,
|
|
4160
|
+
extraPromptPerM: 6.5,
|
|
4161
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3175
4162
|
},
|
|
3176
4163
|
{
|
|
3177
4164
|
id: 'dynamic-1k-xhigh',
|
|
3178
|
-
price: { starter: 0.
|
|
4165
|
+
price: { starter: 0.1219, plus: 0.1125, scale: 0.1078 },
|
|
3179
4166
|
label: '1K \xB7 xhigh',
|
|
3180
4167
|
endpoint: 'dynamic',
|
|
3181
4168
|
resolution: '1K',
|
|
3182
4169
|
quality: 'xhigh',
|
|
3183
4170
|
mode: 'edit',
|
|
3184
4171
|
acceptsImages: !0,
|
|
3185
|
-
perInputImage: 0,
|
|
3186
|
-
|
|
4172
|
+
perInputImage: 0.0027,
|
|
4173
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4174
|
+
promptIncludedTokens: 144,
|
|
4175
|
+
extraPromptPerM: 6.5,
|
|
4176
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3187
4177
|
},
|
|
3188
4178
|
{
|
|
3189
4179
|
id: 'dynamic-2k-xhigh',
|
|
3190
|
-
price: { starter: 0.
|
|
4180
|
+
price: { starter: 0.2475, plus: 0.2285, scale: 0.2189 },
|
|
3191
4181
|
label: '2K \xB7 xhigh',
|
|
3192
4182
|
endpoint: 'dynamic',
|
|
3193
4183
|
resolution: '2K',
|
|
3194
4184
|
quality: 'xhigh',
|
|
3195
4185
|
mode: 'edit',
|
|
3196
4186
|
acceptsImages: !0,
|
|
3197
|
-
perInputImage: 0,
|
|
3198
|
-
|
|
4187
|
+
perInputImage: 0.0027,
|
|
4188
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4189
|
+
promptIncludedTokens: 144,
|
|
4190
|
+
extraPromptPerM: 6.5,
|
|
4191
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3199
4192
|
},
|
|
3200
4193
|
{
|
|
3201
4194
|
id: 'dynamic-4k-xhigh',
|
|
3202
|
-
price: { starter: 0.
|
|
4195
|
+
price: { starter: 0.4113, plus: 0.3796, scale: 0.3638 },
|
|
3203
4196
|
label: '4K \xB7 xhigh',
|
|
3204
4197
|
endpoint: 'dynamic',
|
|
3205
4198
|
resolution: '4K',
|
|
3206
4199
|
quality: 'xhigh',
|
|
3207
4200
|
mode: 'edit',
|
|
3208
4201
|
acceptsImages: !0,
|
|
3209
|
-
perInputImage: 0,
|
|
3210
|
-
|
|
4202
|
+
perInputImage: 0.0027,
|
|
4203
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4204
|
+
promptIncludedTokens: 144,
|
|
4205
|
+
extraPromptPerM: 6.5,
|
|
4206
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3211
4207
|
},
|
|
3212
4208
|
{
|
|
3213
4209
|
id: 'dynamic-1k-max',
|
|
3214
|
-
price: { starter: 0.
|
|
4210
|
+
price: { starter: 0.2741, plus: 0.253, scale: 0.2424 },
|
|
3215
4211
|
label: '1K \xB7 max',
|
|
3216
4212
|
endpoint: 'dynamic',
|
|
3217
4213
|
resolution: '1K',
|
|
3218
4214
|
quality: 'max',
|
|
3219
4215
|
mode: 'edit',
|
|
3220
4216
|
acceptsImages: !0,
|
|
3221
|
-
perInputImage: 0,
|
|
3222
|
-
|
|
4217
|
+
perInputImage: 0.0027,
|
|
4218
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4219
|
+
promptIncludedTokens: 144,
|
|
4220
|
+
extraPromptPerM: 6.5,
|
|
4221
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3223
4222
|
},
|
|
3224
4223
|
{
|
|
3225
4224
|
id: 'dynamic-2k-max',
|
|
3226
|
-
price: { starter: 0.
|
|
4225
|
+
price: { starter: 0.5567, plus: 0.5139, scale: 0.4925 },
|
|
3227
4226
|
label: '2K \xB7 max',
|
|
3228
4227
|
endpoint: 'dynamic',
|
|
3229
4228
|
resolution: '2K',
|
|
3230
4229
|
quality: 'max',
|
|
3231
4230
|
mode: 'edit',
|
|
3232
4231
|
acceptsImages: !0,
|
|
3233
|
-
perInputImage: 0,
|
|
3234
|
-
|
|
4232
|
+
perInputImage: 0.0027,
|
|
4233
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4234
|
+
promptIncludedTokens: 144,
|
|
4235
|
+
extraPromptPerM: 6.5,
|
|
4236
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3235
4237
|
},
|
|
3236
4238
|
{
|
|
3237
4239
|
id: 'dynamic-4k-max',
|
|
3238
|
-
price: { starter: 0.
|
|
4240
|
+
price: { starter: 0.9252, plus: 0.854, scale: 0.8184 },
|
|
3239
4241
|
label: '4K \xB7 max',
|
|
3240
4242
|
endpoint: 'dynamic',
|
|
3241
4243
|
resolution: '4K',
|
|
3242
4244
|
quality: 'max',
|
|
3243
4245
|
mode: 'edit',
|
|
3244
4246
|
acceptsImages: !0,
|
|
3245
|
-
perInputImage: 0,
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
price: { starter: 0.0065, plus: 0.0062, scale: 0.0056 },
|
|
3251
|
-
label: '1K \xB7 low',
|
|
3252
|
-
endpoint: 'token',
|
|
3253
|
-
resolution: '1K',
|
|
3254
|
-
quality: 'low',
|
|
3255
|
-
mode: 'edit',
|
|
3256
|
-
acceptsImages: !0,
|
|
3257
|
-
note: '150-token prompt, no input images',
|
|
3258
|
-
token: {
|
|
3259
|
-
listTextInPerM: 5,
|
|
3260
|
-
listImageOutPerM: 30,
|
|
3261
|
-
listImageInPerM: 8,
|
|
3262
|
-
textInPerM: 4.95,
|
|
3263
|
-
imageOutPerM: 29.7,
|
|
3264
|
-
imageInPerM: 7.92,
|
|
3265
|
-
inputImageTokens: 256,
|
|
3266
|
-
promptTokens: 150,
|
|
3267
|
-
outputTokens: 196,
|
|
3268
|
-
maxPromptTokens: 2568,
|
|
3269
|
-
maxRefs: 5,
|
|
3270
|
-
},
|
|
3271
|
-
},
|
|
3272
|
-
{
|
|
3273
|
-
id: 'token-2k-low',
|
|
3274
|
-
price: { starter: 0.0125, plus: 0.0119, scale: 0.0107 },
|
|
3275
|
-
label: '2K \xB7 low',
|
|
3276
|
-
endpoint: 'token',
|
|
3277
|
-
resolution: '2K',
|
|
3278
|
-
quality: 'low',
|
|
3279
|
-
mode: 'edit',
|
|
3280
|
-
acceptsImages: !0,
|
|
3281
|
-
note: '150-token prompt, no input images',
|
|
3282
|
-
token: {
|
|
3283
|
-
listTextInPerM: 5,
|
|
3284
|
-
listImageOutPerM: 30,
|
|
3285
|
-
listImageInPerM: 8,
|
|
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
|
-
},
|
|
3295
|
-
},
|
|
3296
|
-
{
|
|
3297
|
-
id: 'token-1k-medium',
|
|
3298
|
-
price: { starter: 0.0137, plus: 0.013, scale: 0.0117 },
|
|
3299
|
-
label: '1K \xB7 medium',
|
|
3300
|
-
endpoint: 'token',
|
|
3301
|
-
resolution: '1K',
|
|
3302
|
-
quality: 'medium',
|
|
3303
|
-
mode: 'edit',
|
|
3304
|
-
acceptsImages: !0,
|
|
3305
|
-
note: '150-token prompt, no input images',
|
|
3306
|
-
token: {
|
|
3307
|
-
listTextInPerM: 5,
|
|
3308
|
-
listImageOutPerM: 30,
|
|
3309
|
-
listImageInPerM: 8,
|
|
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
|
-
},
|
|
3319
|
-
},
|
|
3320
|
-
{
|
|
3321
|
-
id: 'flat-1k-any',
|
|
3322
|
-
price: { starter: 0.0274, plus: 0.026, scale: 0.0233 },
|
|
3323
|
-
label: '1K \xB7 any quality',
|
|
3324
|
-
endpoint: 'flat',
|
|
3325
|
-
resolution: '1K',
|
|
3326
|
-
quality: 'any',
|
|
3327
|
-
mode: 'edit',
|
|
3328
|
-
acceptsImages: !0,
|
|
3329
|
-
perInputImage: 0,
|
|
3330
|
-
},
|
|
3331
|
-
{
|
|
3332
|
-
id: 'flat-2k-any',
|
|
3333
|
-
price: { starter: 0.0457, plus: 0.0434, scale: 0.0389 },
|
|
3334
|
-
label: '2K \xB7 any quality',
|
|
3335
|
-
endpoint: 'flat',
|
|
3336
|
-
resolution: '2K',
|
|
3337
|
-
quality: 'any',
|
|
3338
|
-
mode: 'edit',
|
|
3339
|
-
acceptsImages: !0,
|
|
3340
|
-
perInputImage: 0,
|
|
3341
|
-
},
|
|
3342
|
-
{
|
|
3343
|
-
id: 'flat-4k-any',
|
|
3344
|
-
price: { starter: 0.0731, plus: 0.0694, scale: 0.0622 },
|
|
3345
|
-
label: '4K \xB7 any quality',
|
|
3346
|
-
endpoint: 'flat',
|
|
3347
|
-
resolution: '4K',
|
|
3348
|
-
quality: 'any',
|
|
3349
|
-
mode: 'edit',
|
|
3350
|
-
acceptsImages: !0,
|
|
3351
|
-
perInputImage: 0,
|
|
4247
|
+
perInputImage: 0.0027,
|
|
4248
|
+
perInputImageTiers: { starter: 0.0027, plus: 0.0025, scale: 0.0024 },
|
|
4249
|
+
promptIncludedTokens: 144,
|
|
4250
|
+
extraPromptPerM: 6.5,
|
|
4251
|
+
extraPromptPerMTiers: { starter: 6.5, plus: 6, scale: 5.75 },
|
|
3352
4252
|
},
|
|
3353
4253
|
],
|
|
3354
|
-
endpoints: [
|
|
3355
|
-
|
|
3356
|
-
{ id: 'dynamic', label: 'Dynamic' },
|
|
3357
|
-
{ id: 'flat', label: 'Flat', verified: !0 },
|
|
3358
|
-
],
|
|
3359
|
-
defaultEndpoint: 'token',
|
|
4254
|
+
endpoints: [{ id: 'dynamic', label: 'Dynamic', recommended: !0 }],
|
|
4255
|
+
defaultEndpoint: 'dynamic',
|
|
3360
4256
|
axes: {
|
|
3361
4257
|
quality: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
3362
4258
|
resolution: ['1K', '2K', '4K'],
|
|
3363
4259
|
mode: ['text-to-image', 'edit'],
|
|
3364
4260
|
},
|
|
3365
|
-
from: { variant: '
|
|
4261
|
+
from: { variant: 'dynamic-1k-low' },
|
|
3366
4262
|
},
|
|
3367
4263
|
{
|
|
3368
4264
|
slug: 'gpt-6-astra',
|
|
@@ -4659,102 +5555,139 @@ var ae,
|
|
|
4659
5555
|
],
|
|
4660
5556
|
};
|
|
4661
5557
|
});
|
|
4662
|
-
var
|
|
4663
|
-
|
|
5558
|
+
var it,
|
|
5559
|
+
se,
|
|
4664
5560
|
xe = b(() => {
|
|
4665
5561
|
'use strict';
|
|
4666
|
-
((
|
|
5562
|
+
((it = { slug: 'tein', name: 'Tein', models: ['tein-video-upscaler'] }),
|
|
5563
|
+
(se = [
|
|
5564
|
+
{
|
|
5565
|
+
slug: 'tein-video-upscaler',
|
|
5566
|
+
name: 'Tein Video Upscaler',
|
|
5567
|
+
family: 'tein',
|
|
5568
|
+
vendor: 'Tein',
|
|
5569
|
+
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.',
|
|
5570
|
+
kind: 'video',
|
|
5571
|
+
unit: '/sec',
|
|
5572
|
+
api: { model: 'tein-video-upscaler' },
|
|
5573
|
+
variants: [
|
|
5574
|
+
{
|
|
5575
|
+
id: '1080p',
|
|
5576
|
+
label: '1080p',
|
|
5577
|
+
resolution: '1080p',
|
|
5578
|
+
price: { starter: 0.2281, plus: 0.2281, scale: 0.2281 },
|
|
5579
|
+
},
|
|
5580
|
+
{
|
|
5581
|
+
id: '2k',
|
|
5582
|
+
label: '2K',
|
|
5583
|
+
resolution: '2k',
|
|
5584
|
+
price: { starter: 0.4055, plus: 0.4055, scale: 0.4055 },
|
|
5585
|
+
},
|
|
5586
|
+
{
|
|
5587
|
+
id: '4k',
|
|
5588
|
+
label: '4K',
|
|
5589
|
+
resolution: '4k',
|
|
5590
|
+
price: { starter: 0.9124, plus: 0.9124, scale: 0.9124 },
|
|
5591
|
+
},
|
|
5592
|
+
],
|
|
5593
|
+
unfiltered: null,
|
|
5594
|
+
priority: null,
|
|
5595
|
+
draft: null,
|
|
5596
|
+
axes: { resolution: ['1080p', '2k', '4k'] },
|
|
5597
|
+
from: { variant: '1080p' },
|
|
5598
|
+
},
|
|
5599
|
+
]));
|
|
4667
5600
|
});
|
|
4668
|
-
function
|
|
5601
|
+
function _e(e, t) {
|
|
4669
5602
|
return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
|
|
4670
5603
|
}
|
|
4671
|
-
function
|
|
5604
|
+
function br(e, t) {
|
|
4672
5605
|
if (e === 'seedance-2-mini') return 'mini';
|
|
4673
5606
|
if (e !== 'seedance-2') return;
|
|
4674
|
-
let
|
|
4675
|
-
return
|
|
4676
|
-
?
|
|
5607
|
+
let r = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
|
|
5608
|
+
return r === 'fast' || r === 'mini' || r === 'standard'
|
|
5609
|
+
? r
|
|
4677
5610
|
: t?.fast_mode === !0
|
|
4678
5611
|
? 'fast'
|
|
4679
5612
|
: 'standard';
|
|
4680
5613
|
}
|
|
4681
|
-
function
|
|
4682
|
-
let
|
|
5614
|
+
function kr(e, t) {
|
|
5615
|
+
let r = e
|
|
4683
5616
|
.trim()
|
|
4684
5617
|
.toLowerCase()
|
|
4685
5618
|
.replace(/-(?:unfiltered|uncensored)$/, '');
|
|
4686
|
-
if (
|
|
4687
|
-
let
|
|
4688
|
-
|
|
4689
|
-
return
|
|
5619
|
+
if (r === 'seedance-2' || r === 'seedance-2-mini') {
|
|
5620
|
+
let s = br(r, t),
|
|
5621
|
+
n = Te.get(_e('seedance-2', s));
|
|
5622
|
+
return n ? n.slug : null;
|
|
4690
5623
|
}
|
|
4691
|
-
let
|
|
4692
|
-
return
|
|
5624
|
+
let i = ne.get(r) ?? Te.get(_e(r));
|
|
5625
|
+
return i ? i.slug : null;
|
|
4693
5626
|
}
|
|
4694
|
-
function
|
|
4695
|
-
return
|
|
5627
|
+
function xr(e, t) {
|
|
5628
|
+
return ne.has(e) && !(wr.has(e) && t) ? e : kr(e, t);
|
|
4696
5629
|
}
|
|
4697
5630
|
function G(e, t) {
|
|
4698
|
-
let
|
|
4699
|
-
return
|
|
5631
|
+
let r = xr(e, t);
|
|
5632
|
+
return r ? (ne.get(r) ?? null) : null;
|
|
4700
5633
|
}
|
|
4701
5634
|
function oe() {
|
|
4702
|
-
return
|
|
5635
|
+
return st;
|
|
4703
5636
|
}
|
|
4704
|
-
var
|
|
4705
|
-
_e,
|
|
4706
|
-
nt,
|
|
4707
|
-
hi,
|
|
4708
|
-
se,
|
|
4709
|
-
Ie,
|
|
4710
|
-
at,
|
|
4711
|
-
yi,
|
|
5637
|
+
var Ie,
|
|
4712
5638
|
Pe,
|
|
4713
|
-
|
|
5639
|
+
st,
|
|
5640
|
+
hr,
|
|
5641
|
+
ne,
|
|
5642
|
+
Te,
|
|
5643
|
+
at,
|
|
5644
|
+
yr,
|
|
5645
|
+
ve,
|
|
5646
|
+
wr,
|
|
4714
5647
|
N = b(() => {
|
|
4715
5648
|
'use strict';
|
|
4716
5649
|
tt();
|
|
4717
|
-
|
|
5650
|
+
rt();
|
|
4718
5651
|
xe();
|
|
4719
|
-
((
|
|
5652
|
+
((Ie = {
|
|
4720
5653
|
...ae,
|
|
4721
|
-
families: ae.families.map((e) => ({ ...e, models: e.models.filter((t) => !
|
|
4722
|
-
models: ae.models.filter((e) => !
|
|
5654
|
+
families: ae.families.map((e) => ({ ...e, models: e.models.filter((t) => !ie(t)) })),
|
|
5655
|
+
models: ae.models.filter((e) => !ie(e.slug)),
|
|
4723
5656
|
}),
|
|
4724
|
-
(
|
|
4725
|
-
(
|
|
4726
|
-
(
|
|
4727
|
-
(
|
|
4728
|
-
(
|
|
5657
|
+
(Pe = se.filter((e) => !ie(e.slug))),
|
|
5658
|
+
(st = [...Ie.models, ...Pe]),
|
|
5659
|
+
(hr = Pe.length ? [...Ie.families, { ...it, models: Pe.map((e) => e.slug) }] : Ie.families),
|
|
5660
|
+
(ne = new Map()),
|
|
5661
|
+
(Te = new Map()),
|
|
4729
5662
|
(at = new Map()),
|
|
4730
|
-
(
|
|
4731
|
-
(
|
|
4732
|
-
for (let e of
|
|
4733
|
-
(
|
|
5663
|
+
(yr = new Map()),
|
|
5664
|
+
(ve = new Map()));
|
|
5665
|
+
for (let e of st) {
|
|
5666
|
+
(ne.set(e.slug, e), Te.set(_e(e.api.model, e.api.quality), e));
|
|
4734
5667
|
for (let t of e.variants) at.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
|
|
4735
5668
|
for (let t of e.editVariants ?? [])
|
|
4736
5669
|
at.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
|
|
4737
|
-
for (let t of e.addons ?? [])
|
|
4738
|
-
|
|
5670
|
+
for (let t of e.addons ?? []) yr.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
|
|
5671
|
+
ve.set(e.slug, e.family);
|
|
4739
5672
|
}
|
|
4740
|
-
for (let e of
|
|
4741
|
-
|
|
5673
|
+
for (let e of hr) for (let t of e.models) ve.has(t) || ve.set(t, e.slug);
|
|
5674
|
+
wr = new Set(['seedance-2']);
|
|
4742
5675
|
});
|
|
4743
5676
|
function le(e) {
|
|
4744
5677
|
let t = e.from?.variant;
|
|
4745
|
-
return (t && e.variants.find((
|
|
5678
|
+
return (t && e.variants.find((r) => r.id === t)) || e.variants[0];
|
|
4746
5679
|
}
|
|
4747
5680
|
function Me(e) {
|
|
4748
5681
|
if (e.endpoints?.length)
|
|
4749
|
-
return e.editVariants?.length && e.endpoints.some((t) => t.id ===
|
|
4750
|
-
?
|
|
5682
|
+
return e.editVariants?.length && e.endpoints.some((t) => t.id === nt)
|
|
5683
|
+
? nt
|
|
4751
5684
|
: (e.defaultEndpoint ?? e.endpoints[0].id);
|
|
4752
5685
|
}
|
|
4753
|
-
var
|
|
5686
|
+
var nt,
|
|
4754
5687
|
Ke = b(() => {
|
|
4755
5688
|
'use strict';
|
|
4756
5689
|
N();
|
|
4757
|
-
|
|
5690
|
+
nt = 'dynamic';
|
|
4758
5691
|
});
|
|
4759
5692
|
var pe,
|
|
4760
5693
|
Se = b(() => {
|
|
@@ -4765,31 +5698,33 @@ var pe,
|
|
|
4765
5698
|
'gemini-3-1-pro-preview': 'gemini-3.1-pro-preview',
|
|
4766
5699
|
'gpt-image-2-5-flare': 'gpt-image-2.5-flare',
|
|
4767
5700
|
'gpt-image-2-5-sunburst': 'gpt-image-2.5-sunburst',
|
|
5701
|
+
'gpt-image-2-6-flare': 'gpt-image-2.6-flare',
|
|
5702
|
+
'gpt-image-2-6-sunburst': 'gpt-image-2.6-sunburst',
|
|
4768
5703
|
};
|
|
4769
5704
|
});
|
|
4770
5705
|
var ot = b(() => {
|
|
4771
5706
|
'use strict';
|
|
4772
5707
|
});
|
|
4773
5708
|
function lt(e, t) {
|
|
4774
|
-
return typeof t == 'string' && (
|
|
5709
|
+
return typeof t == 'string' && (Ir[e]?.includes(t) ?? !1);
|
|
4775
5710
|
}
|
|
4776
|
-
var
|
|
5711
|
+
var Ir,
|
|
4777
5712
|
pt = b(() => {
|
|
4778
5713
|
'use strict';
|
|
4779
5714
|
N();
|
|
4780
5715
|
Ke();
|
|
4781
5716
|
ot();
|
|
4782
|
-
|
|
5717
|
+
Ir = {};
|
|
4783
5718
|
});
|
|
4784
5719
|
function dt(e) {
|
|
4785
|
-
return e === 'nano-banana-pro' ?
|
|
5720
|
+
return e === 'nano-banana-pro' ? Pr : Tr;
|
|
4786
5721
|
}
|
|
4787
|
-
var
|
|
4788
|
-
|
|
5722
|
+
var Pr,
|
|
5723
|
+
Tr,
|
|
4789
5724
|
ct = b(() => {
|
|
4790
5725
|
'use strict';
|
|
4791
|
-
((
|
|
4792
|
-
(
|
|
5726
|
+
((Pr = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
|
|
5727
|
+
(Tr = [
|
|
4793
5728
|
'auto',
|
|
4794
5729
|
'1:1',
|
|
4795
5730
|
'1:4',
|
|
@@ -4899,10 +5834,10 @@ var ft,
|
|
|
4899
5834
|
function ht(e) {
|
|
4900
5835
|
return `$${e}`;
|
|
4901
5836
|
}
|
|
4902
|
-
function
|
|
4903
|
-
return G(e)?.variants.find((
|
|
5837
|
+
function qe(e, t, r) {
|
|
5838
|
+
return G(e)?.variants.find((s) => s.endpoint === t && s.component === r)?.price.starter ?? null;
|
|
4904
5839
|
}
|
|
4905
|
-
function
|
|
5840
|
+
function vr(e) {
|
|
4906
5841
|
return [
|
|
4907
5842
|
{
|
|
4908
5843
|
name: 'prompt',
|
|
@@ -4971,23 +5906,23 @@ function Pi(e) {
|
|
|
4971
5906
|
function yt() {
|
|
4972
5907
|
return Object.fromEntries(
|
|
4973
5908
|
ft.map((e) => {
|
|
4974
|
-
let t =
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
5909
|
+
let t = qe(e.slug, 'cheap', 'input'),
|
|
5910
|
+
r = qe(e.slug, 'cheap', 'output'),
|
|
5911
|
+
i = qe(e.slug, 'stable', 'input') != null,
|
|
5912
|
+
s = t != null && r != null ? `${ht(t)}/M in \xB7 ${ht(r)}/M out` : '',
|
|
5913
|
+
n = {
|
|
4979
5914
|
slug: e.slug,
|
|
4980
5915
|
name: e.name,
|
|
4981
5916
|
category: 'Text',
|
|
4982
5917
|
kind: 'Reasoning (LLM)',
|
|
4983
5918
|
vendor: 'Anthropic',
|
|
4984
5919
|
description: e.description,
|
|
4985
|
-
priceFormatted:
|
|
5920
|
+
priceFormatted: s,
|
|
4986
5921
|
unit: '/M tokens',
|
|
4987
5922
|
primaryToolName: 'run_task',
|
|
4988
|
-
parameters:
|
|
5923
|
+
parameters: vr(i),
|
|
4989
5924
|
};
|
|
4990
|
-
return [e.slug,
|
|
5925
|
+
return [e.slug, n];
|
|
4991
5926
|
}),
|
|
4992
5927
|
);
|
|
4993
5928
|
}
|
|
@@ -4996,11 +5931,11 @@ var bt = b(() => {
|
|
|
4996
5931
|
gt();
|
|
4997
5932
|
N();
|
|
4998
5933
|
});
|
|
4999
|
-
var
|
|
5934
|
+
var z,
|
|
5000
5935
|
de,
|
|
5001
|
-
|
|
5936
|
+
$e = b(() => {
|
|
5002
5937
|
'use strict';
|
|
5003
|
-
((
|
|
5938
|
+
((z = [
|
|
5004
5939
|
'seedance-2-5',
|
|
5005
5940
|
'seedance-2',
|
|
5006
5941
|
'seedance-2-mini',
|
|
@@ -5011,91 +5946,91 @@ var J,
|
|
|
5011
5946
|
(de =
|
|
5012
5947
|
'a request with creative_mode: true answers 503 checkpoint_unavailable and nothing is charged'));
|
|
5013
5948
|
});
|
|
5014
|
-
function
|
|
5949
|
+
function J(e) {
|
|
5015
5950
|
return `$${Number(e.toFixed(5))}`;
|
|
5016
5951
|
}
|
|
5017
|
-
function
|
|
5952
|
+
function Sr(e) {
|
|
5018
5953
|
if (e.kind === 'llm') {
|
|
5019
5954
|
let t = e.defaultEndpoint,
|
|
5020
|
-
|
|
5955
|
+
r = (n) =>
|
|
5021
5956
|
e.variants.find(
|
|
5022
5957
|
(o) =>
|
|
5023
|
-
o.component ===
|
|
5958
|
+
o.component === n &&
|
|
5024
5959
|
(!t || !o.endpoint || o.endpoint === t) &&
|
|
5025
5960
|
(!o.context || o.context === '0\u201332K'),
|
|
5026
5961
|
),
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
return
|
|
5030
|
-
? `${
|
|
5031
|
-
: `from ${
|
|
5962
|
+
i = r('input'),
|
|
5963
|
+
s = r('output');
|
|
5964
|
+
return i && s
|
|
5965
|
+
? `${J(i.price.starter)}/M in \xB7 ${J(s.price.starter)}/M out`
|
|
5966
|
+
: `from ${J(le(e).price.starter)}/M tokens`;
|
|
5032
5967
|
}
|
|
5033
|
-
return `from ${
|
|
5968
|
+
return `from ${J(le(e).price.starter)}${e.unit}`;
|
|
5034
5969
|
}
|
|
5035
|
-
function
|
|
5036
|
-
let
|
|
5037
|
-
return
|
|
5970
|
+
function qr(e, t) {
|
|
5971
|
+
let r = t.filter((i) => Number.isFinite(i) && i > 0);
|
|
5972
|
+
return r.length ? `from ${J(Math.min(...r))}${e}` : null;
|
|
5038
5973
|
}
|
|
5039
|
-
function
|
|
5040
|
-
for (let t of
|
|
5041
|
-
let
|
|
5042
|
-
|
|
5043
|
-
|
|
5974
|
+
function Pt(e) {
|
|
5975
|
+
for (let t of j) {
|
|
5976
|
+
let r = ue[t],
|
|
5977
|
+
i = r ? qr(r.unit, e[t] ?? []) : null;
|
|
5978
|
+
r && i && (r.priceFormatted = i);
|
|
5044
5979
|
}
|
|
5045
5980
|
}
|
|
5046
|
-
function
|
|
5047
|
-
let
|
|
5048
|
-
...new Set(e.variants.map((
|
|
5981
|
+
function R(e, t) {
|
|
5982
|
+
let r = e.axes?.resolution ?? [
|
|
5983
|
+
...new Set(e.variants.map((i) => i.resolution).filter((i) => !!i)),
|
|
5049
5984
|
];
|
|
5050
5985
|
return {
|
|
5051
5986
|
name: 'resolution',
|
|
5052
5987
|
type: 'select',
|
|
5053
|
-
default: le(e).resolution ??
|
|
5054
|
-
options:
|
|
5988
|
+
default: le(e).resolution ?? r[0],
|
|
5989
|
+
options: r,
|
|
5055
5990
|
...(t ? { description: t } : {}),
|
|
5056
5991
|
};
|
|
5057
5992
|
}
|
|
5058
|
-
function
|
|
5993
|
+
function Tt(e) {
|
|
5059
5994
|
if (!e.endpoints?.length) return null;
|
|
5060
|
-
let t = e.endpoints.filter((
|
|
5995
|
+
let t = e.endpoints.filter((r) => lt(e.slug, r.id));
|
|
5061
5996
|
return {
|
|
5062
5997
|
name: 'endpoint',
|
|
5063
5998
|
type: 'select',
|
|
5064
5999
|
default: Me(e),
|
|
5065
|
-
options: e.endpoints.filter((
|
|
6000
|
+
options: e.endpoints.filter((r) => !t.includes(r)).map((r) => r.id),
|
|
5066
6001
|
description:
|
|
5067
6002
|
(e.slug === 'gemini-3.1-pro-preview'
|
|
5068
6003
|
? 'Where the request is served; a missing endpoint is the default, the lowest price, and an unknown one is refused.'
|
|
5069
6004
|
: 'Where the request is served; a missing or unknown endpoint is the default, the lowest price.') +
|
|
5070
|
-
(t.length ? ` ${t.map((
|
|
6005
|
+
(t.length ? ` ${t.map((r) => r.label).join(' and ')}: coming soon.` : ''),
|
|
5071
6006
|
};
|
|
5072
6007
|
}
|
|
5073
|
-
function
|
|
5074
|
-
if (e.unfiltered == null || t.some((
|
|
5075
|
-
let
|
|
5076
|
-
return [...t.filter((
|
|
6008
|
+
function Er(e, t) {
|
|
6009
|
+
if (e.unfiltered == null || t.some((i) => i.name === 'creative_mode')) return t;
|
|
6010
|
+
let r = z.includes(e.api.model);
|
|
6011
|
+
return [...t.filter((i) => !Oe.has(i.name)), r ? vt : $r];
|
|
5077
6012
|
}
|
|
5078
|
-
function
|
|
5079
|
-
let
|
|
5080
|
-
|
|
5081
|
-
return (
|
|
6013
|
+
function Ce(e, t) {
|
|
6014
|
+
let r = e.filter((s) => !Oe.has(s.name)),
|
|
6015
|
+
i = [vt, Cr];
|
|
6016
|
+
return (i.push(_t, Mt), [...r, ...i]);
|
|
5082
6017
|
}
|
|
5083
|
-
function
|
|
6018
|
+
function kt(e, t = {}) {
|
|
5084
6019
|
return [
|
|
5085
6020
|
...e
|
|
5086
|
-
.filter((
|
|
5087
|
-
.map((
|
|
5088
|
-
|
|
5089
|
-
? { ...
|
|
5090
|
-
:
|
|
6021
|
+
.filter((r) => !Ar.has(r.name) && !Oe.has(r.name))
|
|
6022
|
+
.map((r) =>
|
|
6023
|
+
r.name === 'prompt'
|
|
6024
|
+
? { ...r, required: !0 }
|
|
6025
|
+
: r.name === 'resolution'
|
|
5091
6026
|
? {
|
|
5092
|
-
...
|
|
5093
|
-
...(t.no4k &&
|
|
5094
|
-
? { options:
|
|
6027
|
+
...r,
|
|
6028
|
+
...(t.no4k && r.options
|
|
6029
|
+
? { options: r.options.filter((i) => String(i).toLowerCase() !== '4k') }
|
|
5095
6030
|
: {}),
|
|
5096
6031
|
description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${ce}`,
|
|
5097
6032
|
}
|
|
5098
|
-
:
|
|
6033
|
+
: r,
|
|
5099
6034
|
),
|
|
5100
6035
|
{
|
|
5101
6036
|
name: 'bitrate_mode',
|
|
@@ -5104,13 +6039,13 @@ function wt(e, t = {}) {
|
|
|
5104
6039
|
options: ['standard'],
|
|
5105
6040
|
description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
|
|
5106
6041
|
},
|
|
5107
|
-
|
|
6042
|
+
_t,
|
|
5108
6043
|
Mt,
|
|
5109
6044
|
];
|
|
5110
6045
|
}
|
|
5111
|
-
function
|
|
6046
|
+
function Ee(e, t) {
|
|
5112
6047
|
return [
|
|
5113
|
-
|
|
6048
|
+
q('Text prompt describing the video.'),
|
|
5114
6049
|
{ name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
|
|
5115
6050
|
{
|
|
5116
6051
|
name: 'duration',
|
|
@@ -5120,27 +6055,27 @@ function qe(e, t) {
|
|
|
5120
6055
|
max: t.maxSec,
|
|
5121
6056
|
description: `Video length in seconds (${t.minSec} to ${t.maxSec}).`,
|
|
5122
6057
|
},
|
|
5123
|
-
|
|
6058
|
+
R(e),
|
|
5124
6059
|
{ name: 'aspect_ratio', type: 'select', default: t.aspects[0], options: t.aspects },
|
|
5125
|
-
...t.references.map((
|
|
5126
|
-
|
|
6060
|
+
...t.references.map((r) =>
|
|
6061
|
+
r.endsWith('s')
|
|
5127
6062
|
? {
|
|
5128
|
-
name:
|
|
6063
|
+
name: r,
|
|
5129
6064
|
type: 'string[]',
|
|
5130
|
-
description: `${
|
|
6065
|
+
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
6066
|
}
|
|
5132
6067
|
: {
|
|
5133
|
-
name:
|
|
6068
|
+
name: r,
|
|
5134
6069
|
type: 'string',
|
|
5135
|
-
description: `${
|
|
6070
|
+
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
6071
|
},
|
|
5137
6072
|
),
|
|
5138
6073
|
];
|
|
5139
6074
|
}
|
|
5140
|
-
function
|
|
5141
|
-
let t =
|
|
6075
|
+
function Or(e) {
|
|
6076
|
+
let t = Tt(e);
|
|
5142
6077
|
return [
|
|
5143
|
-
|
|
6078
|
+
q('Image prompt text. Supports complex composition and text instructions.'),
|
|
5144
6079
|
...(t ? [t] : []),
|
|
5145
6080
|
{
|
|
5146
6081
|
name: 'quality',
|
|
@@ -5148,7 +6083,7 @@ function Ri(e) {
|
|
|
5148
6083
|
default: 'low',
|
|
5149
6084
|
options: e.axes?.quality ?? ['low', 'medium', 'high'],
|
|
5150
6085
|
},
|
|
5151
|
-
|
|
6086
|
+
R(
|
|
5152
6087
|
e,
|
|
5153
6088
|
e.slug === 'gpt-image-2'
|
|
5154
6089
|
? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${Ze}`
|
|
@@ -5205,16 +6140,16 @@ function Ri(e) {
|
|
|
5205
6140
|
},
|
|
5206
6141
|
];
|
|
5207
6142
|
}
|
|
5208
|
-
function
|
|
6143
|
+
function Rr(e) {
|
|
5209
6144
|
return [
|
|
5210
|
-
|
|
6145
|
+
q('Image prompt text.'),
|
|
5211
6146
|
{
|
|
5212
6147
|
name: 'input_images',
|
|
5213
6148
|
type: 'string[]',
|
|
5214
6149
|
description: 'Images to edit or use as reference (up to 14).',
|
|
5215
6150
|
},
|
|
5216
6151
|
{ name: 'aspect_ratio', type: 'select', default: '1:1', options: [...dt(e.slug)] },
|
|
5217
|
-
|
|
6152
|
+
R(e),
|
|
5218
6153
|
{
|
|
5219
6154
|
name: 'n',
|
|
5220
6155
|
type: 'slider',
|
|
@@ -5239,22 +6174,22 @@ function Oi(e) {
|
|
|
5239
6174
|
},
|
|
5240
6175
|
];
|
|
5241
6176
|
}
|
|
5242
|
-
function
|
|
6177
|
+
function Nr() {
|
|
5243
6178
|
let e = ut,
|
|
5244
6179
|
t = [];
|
|
5245
|
-
for (let
|
|
5246
|
-
e.includes(
|
|
6180
|
+
for (let r of Re(!0))
|
|
6181
|
+
e.includes(r.name) &&
|
|
5247
6182
|
(t.push({
|
|
5248
|
-
...
|
|
5249
|
-
...(
|
|
5250
|
-
...(
|
|
6183
|
+
...r,
|
|
6184
|
+
...(r.name === 'max_tokens' ? { min: 64 } : {}),
|
|
6185
|
+
...(r.name === 'messages'
|
|
5251
6186
|
? {
|
|
5252
6187
|
description:
|
|
5253
6188
|
'Chat history: system, developer, user (text and image_url parts) and assistant turns; no tool turns.',
|
|
5254
6189
|
}
|
|
5255
6190
|
: {}),
|
|
5256
6191
|
}),
|
|
5257
|
-
|
|
6192
|
+
r.name === 'top_p' &&
|
|
5258
6193
|
t.push({
|
|
5259
6194
|
name: 'top_k',
|
|
5260
6195
|
type: 'number',
|
|
@@ -5264,14 +6199,14 @@ function Ni() {
|
|
|
5264
6199
|
}));
|
|
5265
6200
|
return t;
|
|
5266
6201
|
}
|
|
5267
|
-
function
|
|
5268
|
-
return
|
|
6202
|
+
function Ur() {
|
|
6203
|
+
return Re(!0).map((e) =>
|
|
5269
6204
|
e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
|
|
5270
6205
|
);
|
|
5271
6206
|
}
|
|
5272
|
-
function
|
|
6207
|
+
function Re(e) {
|
|
5273
6208
|
return [
|
|
5274
|
-
|
|
6209
|
+
q('The user message or task.'),
|
|
5275
6210
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
5276
6211
|
{
|
|
5277
6212
|
name: 'messages',
|
|
@@ -5364,21 +6299,21 @@ function Oe(e) {
|
|
|
5364
6299
|
},
|
|
5365
6300
|
];
|
|
5366
6301
|
}
|
|
5367
|
-
function
|
|
5368
|
-
if (e.slug === 'seed-2-1-turbo') return
|
|
5369
|
-
let t =
|
|
6302
|
+
function Br(e) {
|
|
6303
|
+
if (e.slug === 'seed-2-1-turbo') return Lr;
|
|
6304
|
+
let t = Tt(e);
|
|
5370
6305
|
return [
|
|
5371
6306
|
...(e.slug === 'gemini-3.1-pro-preview'
|
|
5372
|
-
?
|
|
6307
|
+
? Nr()
|
|
5373
6308
|
: e.slug === 'gemini-3.7-flash'
|
|
5374
|
-
?
|
|
5375
|
-
: e.slug === 'gpt-6-astra' ||
|
|
5376
|
-
?
|
|
5377
|
-
:
|
|
6309
|
+
? Ur()
|
|
6310
|
+
: e.slug === 'gpt-6-astra' || Vr.includes(e.slug)
|
|
6311
|
+
? Re(e.slug !== 'gpt-6-astra')
|
|
6312
|
+
: Dr),
|
|
5378
6313
|
...(t ? [t] : []),
|
|
5379
6314
|
];
|
|
5380
6315
|
}
|
|
5381
|
-
function
|
|
6316
|
+
function Fr(e) {
|
|
5382
6317
|
return [
|
|
5383
6318
|
{
|
|
5384
6319
|
name: 'video_url',
|
|
@@ -5387,7 +6322,7 @@ function ji(e) {
|
|
|
5387
6322
|
description:
|
|
5388
6323
|
'The video to upscale (up to 30 seconds): a Tein upload link, or any public https link.',
|
|
5389
6324
|
},
|
|
5390
|
-
|
|
6325
|
+
R(
|
|
5391
6326
|
e,
|
|
5392
6327
|
'Size of the result: 1080p, 2k or 4k. A video already near a size cannot be upscaled to it.',
|
|
5393
6328
|
),
|
|
@@ -5400,31 +6335,31 @@ function ji(e) {
|
|
|
5400
6335
|
},
|
|
5401
6336
|
];
|
|
5402
6337
|
}
|
|
5403
|
-
function
|
|
6338
|
+
function jr(e) {
|
|
5404
6339
|
let t = e.slug;
|
|
5405
|
-
if (
|
|
5406
|
-
if (e.kind === 'llm') return
|
|
5407
|
-
if (e.editVariants?.length) return
|
|
6340
|
+
if (se.some((r) => r.slug === t)) return Fr(e);
|
|
6341
|
+
if (e.kind === 'llm') return Br(e);
|
|
6342
|
+
if (e.editVariants?.length) return Or(e);
|
|
5408
6343
|
switch (t) {
|
|
5409
6344
|
case 'seedance-2-5':
|
|
5410
|
-
return
|
|
6345
|
+
return Ce(wt, t);
|
|
5411
6346
|
case 'seedance-2-5-lite':
|
|
5412
|
-
return wt
|
|
6347
|
+
return kt(wt, { no4k: !0 });
|
|
5413
6348
|
case 'seedance-2':
|
|
5414
|
-
return
|
|
6349
|
+
return Ce(xt, t);
|
|
5415
6350
|
case 'seedance-2-lite':
|
|
5416
|
-
return
|
|
6351
|
+
return kt(xt);
|
|
5417
6352
|
case 'seedance-2-mini':
|
|
5418
|
-
return
|
|
6353
|
+
return Ce(Gr, t);
|
|
5419
6354
|
case 'nano-banana-2':
|
|
5420
6355
|
case 'nano-banana-2.1':
|
|
5421
6356
|
case 'nano-banana-pro':
|
|
5422
|
-
return
|
|
6357
|
+
return Rr(e);
|
|
5423
6358
|
case 'seedream-5-pro':
|
|
5424
6359
|
return [
|
|
5425
|
-
|
|
6360
|
+
q('Detailed description of the image to generate.'),
|
|
5426
6361
|
{ name: 'images', type: 'string[]', description: 'Reference images (the first is free).' },
|
|
5427
|
-
|
|
6362
|
+
R(e),
|
|
5428
6363
|
{
|
|
5429
6364
|
name: 'aspect_ratio',
|
|
5430
6365
|
type: 'select',
|
|
@@ -5436,13 +6371,13 @@ function Fi(e) {
|
|
|
5436
6371
|
case 'qwen-3':
|
|
5437
6372
|
case 'qwen-3-pro':
|
|
5438
6373
|
return [
|
|
5439
|
-
|
|
6374
|
+
q('Image prompt text; dense layouts and multilingual text work well.'),
|
|
5440
6375
|
{
|
|
5441
6376
|
name: 'images',
|
|
5442
6377
|
type: 'string[]',
|
|
5443
6378
|
description: 'Up to 3 reference images, each billed at the published add-on price.',
|
|
5444
6379
|
},
|
|
5445
|
-
|
|
6380
|
+
R(e),
|
|
5446
6381
|
{
|
|
5447
6382
|
name: 'aspect_ratio',
|
|
5448
6383
|
type: 'select',
|
|
@@ -5460,8 +6395,8 @@ function Fi(e) {
|
|
|
5460
6395
|
];
|
|
5461
6396
|
case 'z-image-pro':
|
|
5462
6397
|
return [
|
|
5463
|
-
|
|
5464
|
-
|
|
6398
|
+
q('Image prompt text: subject, scene, style, composition and lighting.'),
|
|
6399
|
+
R(e, 'Long edge: 1K is 1024 px, 2K is 2048 px. Same price.'),
|
|
5465
6400
|
{
|
|
5466
6401
|
name: 'aspect_ratio',
|
|
5467
6402
|
type: 'select',
|
|
@@ -5514,7 +6449,7 @@ function Fi(e) {
|
|
|
5514
6449
|
];
|
|
5515
6450
|
case 'wan-3-0':
|
|
5516
6451
|
case 'wan-3-0-prime':
|
|
5517
|
-
return
|
|
6452
|
+
return Ee(e, {
|
|
5518
6453
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
5519
6454
|
aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
|
|
5520
6455
|
minSec: 2,
|
|
@@ -5524,7 +6459,7 @@ function Fi(e) {
|
|
|
5524
6459
|
});
|
|
5525
6460
|
case 'happy-horse-1-1':
|
|
5526
6461
|
case 'happy-horse-1-0':
|
|
5527
|
-
return
|
|
6462
|
+
return Ee(e, {
|
|
5528
6463
|
modes:
|
|
5529
6464
|
t === 'happy-horse-1-0'
|
|
5530
6465
|
? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
|
|
@@ -5535,7 +6470,7 @@ function Fi(e) {
|
|
|
5535
6470
|
references: t === 'happy-horse-1-0' ? ['images', 'videos'] : ['images'],
|
|
5536
6471
|
});
|
|
5537
6472
|
case 'minimax-h3':
|
|
5538
|
-
return
|
|
6473
|
+
return Ee(e, {
|
|
5539
6474
|
modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
|
|
5540
6475
|
aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
|
|
5541
6476
|
minSec: 4,
|
|
@@ -5543,24 +6478,24 @@ function Fi(e) {
|
|
|
5543
6478
|
references: ['images', 'videos', 'audios', 'first_frame_image', 'last_frame_image'],
|
|
5544
6479
|
});
|
|
5545
6480
|
default:
|
|
5546
|
-
return [
|
|
6481
|
+
return [q('Prompt text.')];
|
|
5547
6482
|
}
|
|
5548
6483
|
}
|
|
5549
6484
|
function Ae(e, t = e.api.model) {
|
|
5550
6485
|
return {
|
|
5551
6486
|
slug: t,
|
|
5552
6487
|
name: e.name,
|
|
5553
|
-
category:
|
|
5554
|
-
kind:
|
|
6488
|
+
category: _r[e.kind],
|
|
6489
|
+
kind: Kr[e.kind],
|
|
5555
6490
|
vendor: e.vendor ?? '',
|
|
5556
6491
|
description: e.desc ?? e.name,
|
|
5557
|
-
priceFormatted:
|
|
6492
|
+
priceFormatted: Sr(e),
|
|
5558
6493
|
unit: e.unit,
|
|
5559
|
-
primaryToolName:
|
|
5560
|
-
parameters:
|
|
6494
|
+
primaryToolName: Mr[e.kind],
|
|
6495
|
+
parameters: Er(e, jr(e)),
|
|
5561
6496
|
};
|
|
5562
6497
|
}
|
|
5563
|
-
function
|
|
6498
|
+
function zr() {
|
|
5564
6499
|
let e = {};
|
|
5565
6500
|
for (let t of oe())
|
|
5566
6501
|
if (t.slug !== 'seedance-2-fast') {
|
|
@@ -5569,77 +6504,77 @@ function Ji() {
|
|
|
5569
6504
|
continue;
|
|
5570
6505
|
}
|
|
5571
6506
|
if (t.slug === 'seedance-2') {
|
|
5572
|
-
let
|
|
5573
|
-
((
|
|
5574
|
-
(e['seedance-2'] =
|
|
6507
|
+
let r = Ae(t);
|
|
6508
|
+
((r.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
|
|
6509
|
+
(e['seedance-2'] = r));
|
|
5575
6510
|
continue;
|
|
5576
6511
|
}
|
|
5577
6512
|
t.slug.startsWith('claude-') || (e[t.api.model] = Ae(t));
|
|
5578
6513
|
}
|
|
5579
6514
|
Object.assign(e, yt());
|
|
5580
|
-
for (let [t,
|
|
5581
|
-
e[
|
|
6515
|
+
for (let [t, r] of Object.entries(pe))
|
|
6516
|
+
e[r] && Object.defineProperty(e, t, { value: e[r], enumerable: !1 });
|
|
5582
6517
|
return e;
|
|
5583
6518
|
}
|
|
5584
6519
|
function U(e) {
|
|
5585
6520
|
return ue[e] ?? null;
|
|
5586
6521
|
}
|
|
5587
|
-
function
|
|
6522
|
+
function Jr(e, t, r) {
|
|
5588
6523
|
if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite') && t === 'duration') {
|
|
5589
|
-
let
|
|
5590
|
-
if (r
|
|
6524
|
+
let i = (s) => (typeof s == 'string' ? s.trim().toLowerCase() : '');
|
|
6525
|
+
if (i(r.mode) === 'edit' || i(r.omni_reference_task_type) === 'edit') return !1;
|
|
5591
6526
|
}
|
|
5592
6527
|
return !(
|
|
5593
|
-
(t === 'max_tokens' &&
|
|
5594
|
-
(t === 'max_completion_tokens' &&
|
|
6528
|
+
(t === 'max_tokens' && It(r.max_completion_tokens)) ||
|
|
6529
|
+
(t === 'max_completion_tokens' && It(r.max_tokens))
|
|
5595
6530
|
);
|
|
5596
6531
|
}
|
|
5597
|
-
function
|
|
6532
|
+
function It(e) {
|
|
5598
6533
|
return e != null && e !== '';
|
|
5599
6534
|
}
|
|
5600
|
-
function
|
|
5601
|
-
let
|
|
6535
|
+
function qt(e, t) {
|
|
6536
|
+
let r = { ...t };
|
|
5602
6537
|
if (e?.slug === 'seedance-2-5') {
|
|
5603
|
-
let
|
|
5604
|
-
for (let
|
|
5605
|
-
if (!r
|
|
6538
|
+
let i = (s) => typeof s != 'string' || !s.trim();
|
|
6539
|
+
for (let s of Hr) (i(r.finalize) && !i(r[s]) && (r.finalize = r[s]), delete r[s]);
|
|
6540
|
+
if (!i(r.finalize)) return r;
|
|
5606
6541
|
}
|
|
5607
|
-
for (let
|
|
5608
|
-
|
|
5609
|
-
i
|
|
5610
|
-
|
|
5611
|
-
(i
|
|
5612
|
-
return
|
|
6542
|
+
for (let i of e?.parameters ?? [])
|
|
6543
|
+
i.default !== void 0 &&
|
|
6544
|
+
r[i.name] === void 0 &&
|
|
6545
|
+
Jr(e.slug, i.name, t) &&
|
|
6546
|
+
(r[i.name] = i.default);
|
|
6547
|
+
return r;
|
|
5613
6548
|
}
|
|
5614
|
-
function
|
|
6549
|
+
function E() {
|
|
5615
6550
|
return Object.values(ue);
|
|
5616
6551
|
}
|
|
5617
|
-
var
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
6552
|
+
var _r,
|
|
6553
|
+
Mr,
|
|
6554
|
+
Kr,
|
|
6555
|
+
q,
|
|
6556
|
+
vt,
|
|
6557
|
+
$r,
|
|
6558
|
+
Cr,
|
|
6559
|
+
_t,
|
|
5625
6560
|
Mt,
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
6561
|
+
Oe,
|
|
6562
|
+
Ar,
|
|
6563
|
+
Dr,
|
|
6564
|
+
Lr,
|
|
6565
|
+
Vr,
|
|
5631
6566
|
ce,
|
|
5632
|
-
|
|
6567
|
+
wt,
|
|
5633
6568
|
Kt,
|
|
5634
6569
|
St,
|
|
5635
6570
|
xt,
|
|
5636
|
-
|
|
6571
|
+
Gr,
|
|
5637
6572
|
ue,
|
|
5638
|
-
|
|
6573
|
+
Hr,
|
|
5639
6574
|
H = b(() => {
|
|
5640
6575
|
'use strict';
|
|
5641
6576
|
et();
|
|
5642
|
-
|
|
6577
|
+
we();
|
|
5643
6578
|
N();
|
|
5644
6579
|
Ke();
|
|
5645
6580
|
xe();
|
|
@@ -5648,41 +6583,41 @@ var Ti,
|
|
|
5648
6583
|
ct();
|
|
5649
6584
|
mt();
|
|
5650
6585
|
bt();
|
|
5651
|
-
|
|
5652
|
-
((
|
|
5653
|
-
(
|
|
6586
|
+
$e();
|
|
6587
|
+
((_r = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
|
|
6588
|
+
(Mr = {
|
|
5654
6589
|
video: 'generate_video',
|
|
5655
6590
|
image: 'generate_image',
|
|
5656
6591
|
audio: 'generate_audio',
|
|
5657
6592
|
llm: 'run_task',
|
|
5658
6593
|
}),
|
|
5659
|
-
(
|
|
6594
|
+
(Kr = {
|
|
5660
6595
|
video: 'Text-to-Video',
|
|
5661
6596
|
image: 'Text-to-Image',
|
|
5662
6597
|
audio: 'Text-to-Audio',
|
|
5663
6598
|
llm: 'Reasoning (LLM)',
|
|
5664
6599
|
}));
|
|
5665
|
-
|
|
5666
|
-
((
|
|
6600
|
+
q = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
|
|
6601
|
+
((vt = {
|
|
5667
6602
|
name: 'creative_mode',
|
|
5668
6603
|
type: 'boolean',
|
|
5669
6604
|
default: !1,
|
|
5670
6605
|
description:
|
|
5671
6606
|
'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
|
|
5672
6607
|
}),
|
|
5673
|
-
(
|
|
6608
|
+
($r = {
|
|
5674
6609
|
name: 'creative_mode',
|
|
5675
6610
|
type: 'boolean',
|
|
5676
6611
|
default: !1,
|
|
5677
6612
|
description: `Not available yet on this model: ${de}.`,
|
|
5678
6613
|
}),
|
|
5679
|
-
(
|
|
6614
|
+
(Cr = {
|
|
5680
6615
|
name: 'priority',
|
|
5681
6616
|
type: 'boolean',
|
|
5682
6617
|
default: !1,
|
|
5683
6618
|
description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
|
|
5684
6619
|
}),
|
|
5685
|
-
(
|
|
6620
|
+
(_t = {
|
|
5686
6621
|
name: 'reference_roles',
|
|
5687
6622
|
type: 'json',
|
|
5688
6623
|
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).`,
|
|
@@ -5694,8 +6629,8 @@ var Ti,
|
|
|
5694
6629
|
description:
|
|
5695
6630
|
'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
6631
|
}),
|
|
5697
|
-
(
|
|
5698
|
-
|
|
6632
|
+
(Oe = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
|
|
6633
|
+
Ar = new Set([
|
|
5699
6634
|
'quality',
|
|
5700
6635
|
'bitrate_mode',
|
|
5701
6636
|
'draft',
|
|
@@ -5704,8 +6639,8 @@ var Ti,
|
|
|
5704
6639
|
'draft_generation_id',
|
|
5705
6640
|
'pass_faces',
|
|
5706
6641
|
]);
|
|
5707
|
-
((
|
|
5708
|
-
|
|
6642
|
+
((Dr = [
|
|
6643
|
+
q('The user message or task.'),
|
|
5709
6644
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
5710
6645
|
{
|
|
5711
6646
|
name: 'messages',
|
|
@@ -5722,8 +6657,8 @@ var Ti,
|
|
|
5722
6657
|
{ name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
|
|
5723
6658
|
{ name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
|
|
5724
6659
|
]),
|
|
5725
|
-
(
|
|
5726
|
-
|
|
6660
|
+
(Lr = [
|
|
6661
|
+
q('The user message or task.'),
|
|
5727
6662
|
{ name: 'system', type: 'string', description: 'Optional system instructions.' },
|
|
5728
6663
|
{
|
|
5729
6664
|
name: 'messages',
|
|
@@ -5804,9 +6739,9 @@ var Ti,
|
|
|
5804
6739
|
description: 'Video frames read a second.',
|
|
5805
6740
|
},
|
|
5806
6741
|
]),
|
|
5807
|
-
(
|
|
6742
|
+
(Vr = ['gemini-3.8-flash', 'gemini-3.7-flash']));
|
|
5808
6743
|
((ce = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
|
|
5809
|
-
(
|
|
6744
|
+
(wt = [
|
|
5810
6745
|
{
|
|
5811
6746
|
name: 'prompt',
|
|
5812
6747
|
type: 'string',
|
|
@@ -6067,7 +7002,7 @@ var Ti,
|
|
|
6067
7002
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
6068
7003
|
},
|
|
6069
7004
|
]),
|
|
6070
|
-
(
|
|
7005
|
+
(Gr = [
|
|
6071
7006
|
{
|
|
6072
7007
|
name: 'prompt',
|
|
6073
7008
|
type: 'string',
|
|
@@ -6138,13 +7073,13 @@ var Ti,
|
|
|
6138
7073
|
'Keeps real faces in reference images. On by default. Send false to turn it off.',
|
|
6139
7074
|
},
|
|
6140
7075
|
]));
|
|
6141
|
-
ue =
|
|
6142
|
-
|
|
7076
|
+
ue = zr();
|
|
7077
|
+
Hr = ['draft_task_id', 'draft_generation_id'];
|
|
6143
7078
|
});
|
|
6144
7079
|
function me(e) {
|
|
6145
7080
|
let t = '/v1/pricing/models',
|
|
6146
|
-
|
|
6147
|
-
return
|
|
7081
|
+
r = e?.trim();
|
|
7082
|
+
return r ? `${t}?model=${encodeURIComponent(r)}` : t;
|
|
6148
7083
|
}
|
|
6149
7084
|
var Le = b(() => {
|
|
6150
7085
|
'use strict';
|
|
@@ -6153,38 +7088,38 @@ function Ut(e) {
|
|
|
6153
7088
|
return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
|
|
6154
7089
|
}
|
|
6155
7090
|
function Bt(e) {
|
|
6156
|
-
let t = oe().filter((
|
|
6157
|
-
|
|
6158
|
-
|
|
7091
|
+
let t = oe().filter((n) => n.kind === e && n.unfiltered != null),
|
|
7092
|
+
r = t.filter((n) => z.includes(n.api.model)).map((n) => n.name),
|
|
7093
|
+
i = t.filter((n) => !z.includes(n.api.model)).map((n) => n.name);
|
|
6159
7094
|
return [
|
|
6160
|
-
...(
|
|
6161
|
-
? [`${Ut(
|
|
7095
|
+
...(r.length
|
|
7096
|
+
? [`${Ut(r)}: runs the Creative mode checkpoint at its published price (+5%).`]
|
|
6162
7097
|
: []),
|
|
6163
|
-
...(
|
|
7098
|
+
...(i.length ? [`Not available yet on ${Ut(i)}: ${de}.`] : []),
|
|
6164
7099
|
'The Acceptable Use Policy applies.',
|
|
6165
7100
|
].join(' ');
|
|
6166
7101
|
}
|
|
6167
|
-
function
|
|
6168
|
-
if (
|
|
7102
|
+
function yi(e) {
|
|
7103
|
+
if (gi.has(e.name)) return e;
|
|
6169
7104
|
let t = e.inputSchema.properties;
|
|
6170
7105
|
return !t || t.callback_url
|
|
6171
7106
|
? e
|
|
6172
|
-
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url:
|
|
7107
|
+
: { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: fi } } };
|
|
6173
7108
|
}
|
|
6174
|
-
function
|
|
7109
|
+
function bi(e) {
|
|
6175
7110
|
let t = e.inputSchema.properties;
|
|
6176
7111
|
if (!t) return e;
|
|
6177
|
-
let
|
|
6178
|
-
|
|
6179
|
-
for (let [
|
|
6180
|
-
|
|
6181
|
-
? ((
|
|
6182
|
-
:
|
|
6183
|
-
? ((
|
|
6184
|
-
: (
|
|
6185
|
-
return
|
|
7112
|
+
let r = !1,
|
|
7113
|
+
i = {};
|
|
7114
|
+
for (let [s, n] of Object.entries(t))
|
|
7115
|
+
Ft.has(s) && n.type === 'string' && !n.format
|
|
7116
|
+
? ((i[s] = { ...n, format: 'uri' }), (r = !0))
|
|
7117
|
+
: Ft.has(s) && n.type === 'array' && n.items?.type === 'string' && !n.items.format
|
|
7118
|
+
? ((i[s] = { ...n, items: { ...n.items, format: 'uri' } }), (r = !0))
|
|
7119
|
+
: (i[s] = n);
|
|
7120
|
+
return r ? { ...e, inputSchema: { ...e.inputSchema, properties: i } } : e;
|
|
6186
7121
|
}
|
|
6187
|
-
function
|
|
7122
|
+
function ki(e) {
|
|
6188
7123
|
switch (e.type) {
|
|
6189
7124
|
case 'string':
|
|
6190
7125
|
return {
|
|
@@ -6239,29 +7174,29 @@ function wr(e) {
|
|
|
6239
7174
|
return { type: 'string', description: e.description };
|
|
6240
7175
|
}
|
|
6241
7176
|
}
|
|
6242
|
-
function
|
|
6243
|
-
let
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
for (let o of e.parameters) ((
|
|
6247
|
-
let
|
|
7177
|
+
function wi(e, t) {
|
|
7178
|
+
let r = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
|
|
7179
|
+
i = {},
|
|
7180
|
+
s = [];
|
|
7181
|
+
for (let o of e.parameters) ((i[o.name] = ki(o)), o.required && s.push(o.name));
|
|
7182
|
+
let n = {
|
|
6248
7183
|
type: 'object',
|
|
6249
|
-
properties:
|
|
6250
|
-
...(
|
|
7184
|
+
properties: i,
|
|
7185
|
+
...(s.length > 0 ? { required: s } : {}),
|
|
6251
7186
|
additionalProperties: !0,
|
|
6252
7187
|
};
|
|
6253
7188
|
return {
|
|
6254
|
-
name:
|
|
7189
|
+
name: r,
|
|
6255
7190
|
description: `[Tein AI - ${e.name} (${e.category})] ${e.description} (Pricing: ${e.priceFormatted})`,
|
|
6256
|
-
inputSchema:
|
|
7191
|
+
inputSchema: n,
|
|
6257
7192
|
};
|
|
6258
7193
|
}
|
|
6259
|
-
function
|
|
6260
|
-
let e =
|
|
6261
|
-
t =
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
7194
|
+
function xi() {
|
|
7195
|
+
let e = E().filter((d) => d.category === 'Image'),
|
|
7196
|
+
t = E().filter((d) => d.category === 'Video'),
|
|
7197
|
+
r = E().filter((d) => d.category === 'Text'),
|
|
7198
|
+
i = E().filter((d) => d.category === 'Audio'),
|
|
7199
|
+
s = {
|
|
6265
7200
|
name: 'generate_image',
|
|
6266
7201
|
description:
|
|
6267
7202
|
'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.',
|
|
@@ -6358,7 +7293,7 @@ function xr() {
|
|
|
6358
7293
|
additionalProperties: !0,
|
|
6359
7294
|
},
|
|
6360
7295
|
},
|
|
6361
|
-
|
|
7296
|
+
n = {
|
|
6362
7297
|
name: 'generate_video',
|
|
6363
7298
|
description:
|
|
6364
7299
|
'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.',
|
|
@@ -6457,7 +7392,7 @@ function xr() {
|
|
|
6457
7392
|
prompt: { type: 'string', description: 'The reasoning task or query to execute.' },
|
|
6458
7393
|
model: {
|
|
6459
7394
|
type: 'string',
|
|
6460
|
-
enum:
|
|
7395
|
+
enum: r.map((d) => d.slug),
|
|
6461
7396
|
default: 'gpt-6-astra',
|
|
6462
7397
|
description: 'The reasoning model to use (default: gpt-6-astra).',
|
|
6463
7398
|
},
|
|
@@ -6511,10 +7446,10 @@ function xr() {
|
|
|
6511
7446
|
additionalProperties: !0,
|
|
6512
7447
|
},
|
|
6513
7448
|
},
|
|
6514
|
-
p =
|
|
6515
|
-
return [
|
|
7449
|
+
p = Ii();
|
|
7450
|
+
return [s, n, o, u, l, p, c, hi];
|
|
6516
7451
|
}
|
|
6517
|
-
function
|
|
7452
|
+
function Ii() {
|
|
6518
7453
|
return {
|
|
6519
7454
|
name: 'upload_asset',
|
|
6520
7455
|
description:
|
|
@@ -6561,26 +7496,26 @@ function vr() {
|
|
|
6561
7496
|
},
|
|
6562
7497
|
};
|
|
6563
7498
|
}
|
|
6564
|
-
function
|
|
6565
|
-
let e =
|
|
6566
|
-
t =
|
|
6567
|
-
return [...e, ...t].map(
|
|
7499
|
+
function je() {
|
|
7500
|
+
let e = xi(),
|
|
7501
|
+
t = E().map((r) => wi(r));
|
|
7502
|
+
return [...e, ...t].map(yi).map(bi);
|
|
6568
7503
|
}
|
|
6569
|
-
var
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
7504
|
+
var fi,
|
|
7505
|
+
gi,
|
|
7506
|
+
hi,
|
|
7507
|
+
Ft,
|
|
7508
|
+
jt = b(() => {
|
|
6574
7509
|
'use strict';
|
|
6575
7510
|
N();
|
|
6576
|
-
|
|
7511
|
+
$e();
|
|
6577
7512
|
H();
|
|
6578
|
-
((
|
|
7513
|
+
((fi = {
|
|
6579
7514
|
type: 'string',
|
|
6580
7515
|
description:
|
|
6581
7516
|
'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
7517
|
}),
|
|
6583
|
-
(
|
|
7518
|
+
(gi = new Set([
|
|
6584
7519
|
'upload_asset',
|
|
6585
7520
|
'upload_media',
|
|
6586
7521
|
'upload_image',
|
|
@@ -6588,7 +7523,7 @@ var fr,
|
|
|
6588
7523
|
'check_status',
|
|
6589
7524
|
'get_pricing',
|
|
6590
7525
|
])),
|
|
6591
|
-
(
|
|
7526
|
+
(hi = {
|
|
6592
7527
|
name: 'get_pricing',
|
|
6593
7528
|
description:
|
|
6594
7529
|
'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 +7538,7 @@ var fr,
|
|
|
6603
7538
|
additionalProperties: !1,
|
|
6604
7539
|
},
|
|
6605
7540
|
}));
|
|
6606
|
-
|
|
7541
|
+
Ft = new Set([
|
|
6607
7542
|
'image',
|
|
6608
7543
|
'images',
|
|
6609
7544
|
'image_url',
|
|
@@ -6620,31 +7555,31 @@ var fr,
|
|
|
6620
7555
|
'lipsyncing_audio',
|
|
6621
7556
|
]);
|
|
6622
7557
|
});
|
|
6623
|
-
var
|
|
6624
|
-
|
|
6625
|
-
forgetToolSchemas: () =>
|
|
7558
|
+
var er = {};
|
|
7559
|
+
lr(er, {
|
|
7560
|
+
forgetToolSchemas: () => Mi,
|
|
6626
7561
|
jsonRpcAnswer: () => Ht,
|
|
6627
7562
|
preprocessLocalFiles: () => Xt,
|
|
6628
7563
|
startStdioServer: () => Zt,
|
|
6629
7564
|
});
|
|
6630
|
-
function
|
|
6631
|
-
let t = (
|
|
6632
|
-
!!
|
|
7565
|
+
function Pi(e) {
|
|
7566
|
+
let t = (r) =>
|
|
7567
|
+
!!r && typeof r == 'object' && r.jsonrpc === '2.0' && ('result' in r || 'error' in r);
|
|
6633
7568
|
return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
|
|
6634
7569
|
}
|
|
6635
|
-
function Ht(e, t,
|
|
6636
|
-
let
|
|
6637
|
-
|
|
6638
|
-
|
|
7570
|
+
function Ht(e, t, r) {
|
|
7571
|
+
let i = e?.id,
|
|
7572
|
+
s = i == null,
|
|
7573
|
+
n = null;
|
|
6639
7574
|
try {
|
|
6640
|
-
|
|
7575
|
+
n = r ? JSON.parse(r) : null;
|
|
6641
7576
|
} catch {
|
|
6642
|
-
|
|
7577
|
+
n = null;
|
|
6643
7578
|
}
|
|
6644
|
-
if (
|
|
6645
|
-
if (
|
|
6646
|
-
if (!
|
|
6647
|
-
let o =
|
|
7579
|
+
if (n !== null && Pi(n)) return s ? null : n;
|
|
7580
|
+
if (s) return null;
|
|
7581
|
+
if (!r && t >= 200 && t < 300) return;
|
|
7582
|
+
let o = n?.error,
|
|
6648
7583
|
u =
|
|
6649
7584
|
typeof o == 'string'
|
|
6650
7585
|
? o
|
|
@@ -6654,7 +7589,7 @@ function Ht(e, t, i) {
|
|
|
6654
7589
|
l = o && typeof o == 'object' && typeof o.code == 'string' ? o.code : null;
|
|
6655
7590
|
return {
|
|
6656
7591
|
jsonrpc: '2.0',
|
|
6657
|
-
id:
|
|
7592
|
+
id: i,
|
|
6658
7593
|
error: {
|
|
6659
7594
|
code: t === 401 ? -32001 : -32603,
|
|
6660
7595
|
message: u,
|
|
@@ -6662,23 +7597,23 @@ function Ht(e, t, i) {
|
|
|
6662
7597
|
},
|
|
6663
7598
|
};
|
|
6664
7599
|
}
|
|
6665
|
-
function
|
|
7600
|
+
function Ti() {
|
|
6666
7601
|
let e = process.argv.slice(2),
|
|
6667
7602
|
t = e.indexOf('--api-key');
|
|
6668
7603
|
return S(t >= 0 ? e[t + 1] : void 0);
|
|
6669
7604
|
}
|
|
6670
|
-
async function Wt(e, t,
|
|
6671
|
-
let
|
|
6672
|
-
if (!
|
|
7605
|
+
async function Wt(e, t, r) {
|
|
7606
|
+
let i = B.default.resolve(e);
|
|
7607
|
+
if (!O.default.existsSync(i) || !O.default.statSync(i).isFile())
|
|
6673
7608
|
throw new Error(`File not found: ${e}`);
|
|
6674
|
-
let
|
|
6675
|
-
|
|
6676
|
-
o =
|
|
6677
|
-
u = `${
|
|
7609
|
+
let s = O.default.readFileSync(i),
|
|
7610
|
+
n = s.toString('base64'),
|
|
7611
|
+
o = s.length,
|
|
7612
|
+
u = `${r.replace(/\/$/, '')}/v1/upload`,
|
|
6678
7613
|
l = await fetch(u, {
|
|
6679
7614
|
method: 'POST',
|
|
6680
7615
|
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${t}` },
|
|
6681
|
-
body: JSON.stringify({ data:
|
|
7616
|
+
body: JSON.stringify({ data: n }),
|
|
6682
7617
|
});
|
|
6683
7618
|
if (!l.ok) {
|
|
6684
7619
|
let p = `Upload failed (HTTP ${l.status})`;
|
|
@@ -6697,14 +7632,14 @@ async function Wt(e, t, i) {
|
|
|
6697
7632
|
};
|
|
6698
7633
|
}
|
|
6699
7634
|
function Yt(e) {
|
|
6700
|
-
return
|
|
7635
|
+
return vi.has(B.default.extname(e).toLowerCase());
|
|
6701
7636
|
}
|
|
6702
7637
|
function Qt(e) {
|
|
6703
7638
|
return new Error(
|
|
6704
7639
|
`Tein uploads image, video and audio files only, and ${B.default.basename(e)} is not one.`,
|
|
6705
7640
|
);
|
|
6706
7641
|
}
|
|
6707
|
-
function
|
|
7642
|
+
function _i(e) {
|
|
6708
7643
|
let t = e.trim();
|
|
6709
7644
|
if (
|
|
6710
7645
|
!t ||
|
|
@@ -6714,27 +7649,27 @@ function Tr(e) {
|
|
|
6714
7649
|
`)
|
|
6715
7650
|
)
|
|
6716
7651
|
return null;
|
|
6717
|
-
let
|
|
6718
|
-
return
|
|
7652
|
+
let r = B.default.resolve(t);
|
|
7653
|
+
return O.default.existsSync(r) && O.default.statSync(r).isFile() ? r : null;
|
|
6719
7654
|
}
|
|
6720
|
-
function
|
|
7655
|
+
function ze(e) {
|
|
6721
7656
|
if (Array.isArray(e))
|
|
6722
7657
|
for (let t of e) {
|
|
6723
|
-
let
|
|
6724
|
-
typeof
|
|
6725
|
-
|
|
6726
|
-
typeof
|
|
6727
|
-
Q.set(
|
|
7658
|
+
let r = t;
|
|
7659
|
+
typeof r.name == 'string' &&
|
|
7660
|
+
r.inputSchema &&
|
|
7661
|
+
typeof r.inputSchema == 'object' &&
|
|
7662
|
+
Q.set(r.name, r.inputSchema);
|
|
6728
7663
|
}
|
|
6729
7664
|
}
|
|
6730
|
-
function
|
|
7665
|
+
function Mi() {
|
|
6731
7666
|
(Q.clear(), (Ge = 0));
|
|
6732
7667
|
}
|
|
6733
|
-
async function
|
|
7668
|
+
async function Ki(e, t) {
|
|
6734
7669
|
if (!(Date.now() - Ge < 6e4)) {
|
|
6735
7670
|
Ge = Date.now();
|
|
6736
7671
|
try {
|
|
6737
|
-
let
|
|
7672
|
+
let i = await (
|
|
6738
7673
|
await fetch(e, {
|
|
6739
7674
|
method: 'POST',
|
|
6740
7675
|
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${t}` },
|
|
@@ -6742,39 +7677,39 @@ async function Kr(e, t) {
|
|
|
6742
7677
|
signal: AbortSignal.timeout(1e4),
|
|
6743
7678
|
})
|
|
6744
7679
|
).json();
|
|
6745
|
-
|
|
7680
|
+
ze(i.result?.tools);
|
|
6746
7681
|
} catch {}
|
|
6747
7682
|
}
|
|
6748
7683
|
}
|
|
6749
|
-
function
|
|
7684
|
+
function Si(e) {
|
|
6750
7685
|
return e
|
|
6751
7686
|
? e.type === 'string'
|
|
6752
7687
|
? e.format === 'uri'
|
|
6753
7688
|
: e.type === 'array' && e.items?.format === 'uri'
|
|
6754
7689
|
: !1;
|
|
6755
7690
|
}
|
|
6756
|
-
async function Gt(e, t,
|
|
7691
|
+
async function Gt(e, t, r) {
|
|
6757
7692
|
if (typeof e != 'string') return e;
|
|
6758
|
-
let
|
|
6759
|
-
if (!
|
|
6760
|
-
if (!Yt(
|
|
6761
|
-
return (await Wt(
|
|
7693
|
+
let i = _i(e);
|
|
7694
|
+
if (!i) return e;
|
|
7695
|
+
if (!Yt(i)) throw Qt(i);
|
|
7696
|
+
return (await Wt(i, t, r)).url;
|
|
6762
7697
|
}
|
|
6763
|
-
async function Xt(e, t,
|
|
6764
|
-
(Q.size === 0 &&
|
|
6765
|
-
let
|
|
6766
|
-
if (!
|
|
7698
|
+
async function Xt(e, t, r, i, s) {
|
|
7699
|
+
(Q.size === 0 && ze(je()), Q.has(e) || (await Ki(s, r)));
|
|
7700
|
+
let n = Q.get(e)?.properties;
|
|
7701
|
+
if (!n) return t;
|
|
6767
7702
|
let o = { ...t };
|
|
6768
7703
|
for (let [u, l] of Object.entries(t))
|
|
6769
|
-
if (
|
|
7704
|
+
if (Si(n[u]))
|
|
6770
7705
|
if (Array.isArray(l)) {
|
|
6771
7706
|
let c = [];
|
|
6772
|
-
for (let p of l) c.push(await Gt(p,
|
|
7707
|
+
for (let p of l) c.push(await Gt(p, r, i));
|
|
6773
7708
|
o[u] = c;
|
|
6774
|
-
} else o[u] = await Gt(l,
|
|
7709
|
+
} else o[u] = await Gt(l, r, i);
|
|
6775
7710
|
return o;
|
|
6776
7711
|
}
|
|
6777
|
-
function
|
|
7712
|
+
function qi(e) {
|
|
6778
7713
|
let t = e.id ?? null;
|
|
6779
7714
|
switch (e.method) {
|
|
6780
7715
|
case 'initialize':
|
|
@@ -6792,7 +7727,7 @@ function $r(e) {
|
|
|
6792
7727
|
case 'ping':
|
|
6793
7728
|
return { jsonrpc: '2.0', id: t, result: {} };
|
|
6794
7729
|
case 'tools/list':
|
|
6795
|
-
return { jsonrpc: '2.0', id: t, result: { tools:
|
|
7730
|
+
return { jsonrpc: '2.0', id: t, result: { tools: je() } };
|
|
6796
7731
|
case 'tools/call':
|
|
6797
7732
|
return {
|
|
6798
7733
|
jsonrpc: '2.0',
|
|
@@ -6816,18 +7751,18 @@ function $r(e) {
|
|
|
6816
7751
|
}
|
|
6817
7752
|
}
|
|
6818
7753
|
async function Zt() {
|
|
6819
|
-
if (
|
|
6820
|
-
|
|
6821
|
-
let e =
|
|
7754
|
+
if (zt) return;
|
|
7755
|
+
zt = !0;
|
|
7756
|
+
let e = Ti(),
|
|
6822
7757
|
t = x(),
|
|
6823
|
-
|
|
6824
|
-
(
|
|
7758
|
+
r = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
|
|
7759
|
+
(Jt.default
|
|
6825
7760
|
.createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
|
|
6826
|
-
.on('line', async (
|
|
6827
|
-
let
|
|
6828
|
-
if (
|
|
7761
|
+
.on('line', async (s) => {
|
|
7762
|
+
let n = s.trim();
|
|
7763
|
+
if (n)
|
|
6829
7764
|
try {
|
|
6830
|
-
let o = JSON.parse(
|
|
7765
|
+
let o = JSON.parse(n);
|
|
6831
7766
|
if (o && o.method === 'tools/call' && o.params) {
|
|
6832
7767
|
let l = o.params.name,
|
|
6833
7768
|
c = o.params.arguments || {};
|
|
@@ -6881,7 +7816,7 @@ async function Zt() {
|
|
|
6881
7816
|
)
|
|
6882
7817
|
try {
|
|
6883
7818
|
let d = B.default.resolve(p.trim());
|
|
6884
|
-
if (
|
|
7819
|
+
if (O.default.existsSync(d) && O.default.statSync(d).isFile() && e) {
|
|
6885
7820
|
if (!Yt(d)) throw Qt(d);
|
|
6886
7821
|
let m = await Wt(d, e, t),
|
|
6887
7822
|
h = (m.sizeBytes / 1024).toFixed(1),
|
|
@@ -6939,7 +7874,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6939
7874
|
}
|
|
6940
7875
|
if (e)
|
|
6941
7876
|
try {
|
|
6942
|
-
o.params.arguments = await Xt(String(l), c, e, t,
|
|
7877
|
+
o.params.arguments = await Xt(String(l), c, e, t, r);
|
|
6943
7878
|
} catch (p) {
|
|
6944
7879
|
let d = p instanceof Error ? p.message : String(p);
|
|
6945
7880
|
process.stdout.write(
|
|
@@ -6964,7 +7899,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6964
7899
|
}
|
|
6965
7900
|
if (e)
|
|
6966
7901
|
try {
|
|
6967
|
-
let l = await fetch(
|
|
7902
|
+
let l = await fetch(r, {
|
|
6968
7903
|
method: 'POST',
|
|
6969
7904
|
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${e}` },
|
|
6970
7905
|
body: JSON.stringify(o),
|
|
@@ -6973,7 +7908,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6973
7908
|
p = Ht(o, l.status, c);
|
|
6974
7909
|
if (p === null) return;
|
|
6975
7910
|
if (p) {
|
|
6976
|
-
(o?.method === 'tools/list' &&
|
|
7911
|
+
(o?.method === 'tools/list' && ze(p.result?.tools),
|
|
6977
7912
|
process.stdout.write(
|
|
6978
7913
|
JSON.stringify(p) +
|
|
6979
7914
|
`
|
|
@@ -6982,7 +7917,7 @@ Pass this URL to any Tein generation tool.`,
|
|
|
6982
7917
|
return;
|
|
6983
7918
|
}
|
|
6984
7919
|
} catch {}
|
|
6985
|
-
let u =
|
|
7920
|
+
let u = qi(o);
|
|
6986
7921
|
u !== null &&
|
|
6987
7922
|
process.stdout.write(
|
|
6988
7923
|
JSON.stringify(u) +
|
|
@@ -7005,22 +7940,22 @@ Pass this URL to any Tein generation tool.`,
|
|
|
7005
7940
|
process.stderr.write(`Tein AI MCP Server running on stdio transport.
|
|
7006
7941
|
`));
|
|
7007
7942
|
}
|
|
7008
|
-
var
|
|
7943
|
+
var O,
|
|
7009
7944
|
B,
|
|
7010
|
-
|
|
7011
|
-
|
|
7945
|
+
Jt,
|
|
7946
|
+
vi,
|
|
7012
7947
|
Q,
|
|
7013
7948
|
Ge,
|
|
7014
|
-
|
|
7015
|
-
|
|
7949
|
+
zt,
|
|
7950
|
+
tr = b(() => {
|
|
7016
7951
|
'use strict';
|
|
7017
|
-
((
|
|
7018
|
-
(B =
|
|
7019
|
-
(
|
|
7952
|
+
((O = P(require('node:fs'))),
|
|
7953
|
+
(B = P(require('node:path'))),
|
|
7954
|
+
(Jt = P(require('node:readline'))));
|
|
7020
7955
|
Le();
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7956
|
+
jt();
|
|
7957
|
+
C();
|
|
7958
|
+
vi = new Set([
|
|
7024
7959
|
'.png',
|
|
7025
7960
|
'.jpg',
|
|
7026
7961
|
'.jpeg',
|
|
@@ -7047,7 +7982,7 @@ var R,
|
|
|
7047
7982
|
'.opus',
|
|
7048
7983
|
]);
|
|
7049
7984
|
((Q = new Map()), (Ge = 0));
|
|
7050
|
-
|
|
7985
|
+
zt = !1;
|
|
7051
7986
|
require.main === module &&
|
|
7052
7987
|
Zt().catch((e) => {
|
|
7053
7988
|
(process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
|
|
@@ -7055,33 +7990,33 @@ var R,
|
|
|
7055
7990
|
process.exit(1));
|
|
7056
7991
|
});
|
|
7057
7992
|
});
|
|
7058
|
-
var
|
|
7993
|
+
var dr =
|
|
7059
7994
|
!process.env.NO_COLOR &&
|
|
7060
7995
|
(process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
|
|
7061
|
-
function
|
|
7062
|
-
return (
|
|
7996
|
+
function k(e, t) {
|
|
7997
|
+
return (r) => (dr ? `\x1B[${e}m${r}\x1B[${t}m` : String(r));
|
|
7063
7998
|
}
|
|
7064
7999
|
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:
|
|
8000
|
+
bold: k(1, 22),
|
|
8001
|
+
dim: k(2, 22),
|
|
8002
|
+
italic: k(3, 23),
|
|
8003
|
+
underline: k(4, 24),
|
|
8004
|
+
inverse: k(7, 27),
|
|
8005
|
+
black: k(30, 39),
|
|
8006
|
+
red: k(31, 39),
|
|
8007
|
+
green: k(32, 39),
|
|
8008
|
+
yellow: k(33, 39),
|
|
8009
|
+
blue: k(34, 39),
|
|
8010
|
+
magenta: k(35, 39),
|
|
8011
|
+
cyan: k(36, 39),
|
|
8012
|
+
white: k(37, 39),
|
|
8013
|
+
gray: k(90, 39),
|
|
8014
|
+
bgBlue: k(44, 49),
|
|
8015
|
+
bgMagenta: k(45, 49),
|
|
8016
|
+
bgCyan: k(46, 49),
|
|
8017
|
+
bgGreen: k(42, 49),
|
|
7083
8018
|
},
|
|
7084
|
-
|
|
8019
|
+
_ = class {
|
|
7085
8020
|
constructor(t = '') {
|
|
7086
8021
|
this.frames = [
|
|
7087
8022
|
'\u280B',
|
|
@@ -7105,8 +8040,8 @@ var a = {
|
|
|
7105
8040
|
process.stdout.isTTY
|
|
7106
8041
|
? (this.stop(),
|
|
7107
8042
|
(this.timer = setInterval(() => {
|
|
7108
|
-
let
|
|
7109
|
-
(process.stdout.write(`\r${
|
|
8043
|
+
let r = a.cyan(this.frames[this.current]);
|
|
8044
|
+
(process.stdout.write(`\r${r} ${this.text} `),
|
|
7110
8045
|
(this.current = (this.current + 1) % this.frames.length));
|
|
7111
8046
|
}, 80)),
|
|
7112
8047
|
this)
|
|
@@ -7120,20 +8055,20 @@ var a = {
|
|
|
7120
8055
|
}
|
|
7121
8056
|
succeed(t) {
|
|
7122
8057
|
this.stop();
|
|
7123
|
-
let
|
|
8058
|
+
let r = t || this.text;
|
|
7124
8059
|
process.stdout.isTTY
|
|
7125
|
-
? process.stdout.write(`\r${a.green('\u2713')} ${
|
|
8060
|
+
? process.stdout.write(`\r${a.green('\u2713')} ${r}
|
|
7126
8061
|
`)
|
|
7127
|
-
: process.stdout.write(`[\u2713] ${
|
|
8062
|
+
: process.stdout.write(`[\u2713] ${r}
|
|
7128
8063
|
`);
|
|
7129
8064
|
}
|
|
7130
8065
|
fail(t) {
|
|
7131
8066
|
this.stop();
|
|
7132
|
-
let
|
|
8067
|
+
let r = t || this.text;
|
|
7133
8068
|
process.stdout.isTTY
|
|
7134
|
-
? process.stdout.write(`\r${a.red('\u2717')} ${
|
|
8069
|
+
? process.stdout.write(`\r${a.red('\u2717')} ${r}
|
|
7135
8070
|
`)
|
|
7136
|
-
: process.stdout.write(`[\u2717] ${
|
|
8071
|
+
: process.stdout.write(`[\u2717] ${r}
|
|
7137
8072
|
`);
|
|
7138
8073
|
}
|
|
7139
8074
|
stop() {
|
|
@@ -7143,61 +8078,61 @@ var a = {
|
|
|
7143
8078
|
process.stdout.isTTY && process.stdout.write('\r\x1B[K'));
|
|
7144
8079
|
}
|
|
7145
8080
|
};
|
|
7146
|
-
var D =
|
|
7147
|
-
A =
|
|
7148
|
-
var ee =
|
|
7149
|
-
We =
|
|
8081
|
+
var D = P(require('node:fs')),
|
|
8082
|
+
A = P(require('node:path'));
|
|
8083
|
+
var ee = P(require('node:fs')),
|
|
8084
|
+
We = P(require('node:path')),
|
|
7150
8085
|
Ye = require('node:stream/promises');
|
|
7151
8086
|
var Z = '1.1.7';
|
|
7152
|
-
var
|
|
8087
|
+
var cr = new Set([
|
|
7153
8088
|
'account_suspended',
|
|
7154
8089
|
'account_terminated',
|
|
7155
8090
|
'creative_mode_restricted',
|
|
7156
8091
|
'unfiltered_restricted',
|
|
7157
8092
|
'workspace_paused',
|
|
7158
8093
|
]),
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
constructor(t,
|
|
7163
|
-
(super(
|
|
8094
|
+
T = 1,
|
|
8095
|
+
ur = 3,
|
|
8096
|
+
w = class extends Error {
|
|
8097
|
+
constructor(t, r, i, s = {}) {
|
|
8098
|
+
(super(r),
|
|
7164
8099
|
(this.name = 'TeinApiError'),
|
|
7165
8100
|
(this.status = t),
|
|
7166
|
-
|
|
7167
|
-
(this.fields =
|
|
8101
|
+
i && (this.code = i),
|
|
8102
|
+
(this.fields = s));
|
|
7168
8103
|
}
|
|
7169
8104
|
get exitCode() {
|
|
7170
|
-
return this.code &&
|
|
8105
|
+
return this.code && cr.has(this.code) ? ur : T;
|
|
7171
8106
|
}
|
|
7172
8107
|
};
|
|
7173
|
-
function
|
|
7174
|
-
let
|
|
7175
|
-
if (!
|
|
7176
|
-
let
|
|
7177
|
-
if (
|
|
7178
|
-
let p =
|
|
8108
|
+
function mr(e, t, r) {
|
|
8109
|
+
let i = `HTTP ${e}${t ? ` ${t}` : ''}`;
|
|
8110
|
+
if (!r || typeof r != 'object') return new w(e, i);
|
|
8111
|
+
let s = r;
|
|
8112
|
+
if (s.error && typeof s.error == 'object' && !Array.isArray(s.error)) {
|
|
8113
|
+
let p = s.error,
|
|
7179
8114
|
{ code: d, message: m, ...h } = p;
|
|
7180
|
-
return new
|
|
8115
|
+
return new w(e, typeof m == 'string' && m ? m : i, typeof d == 'string' ? d : void 0, h);
|
|
7181
8116
|
}
|
|
7182
|
-
let { error:
|
|
7183
|
-
c = (typeof
|
|
7184
|
-
return new
|
|
8117
|
+
let { error: n, code: o, message: u, ...l } = s,
|
|
8118
|
+
c = (typeof n == 'string' && n) || (typeof u == 'string' && u) || i;
|
|
8119
|
+
return new w(e, c, typeof o == 'string' ? o : void 0, l);
|
|
7185
8120
|
}
|
|
7186
|
-
function
|
|
8121
|
+
function Je(e) {
|
|
7187
8122
|
return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
|
|
7188
8123
|
}
|
|
7189
8124
|
function K(e) {
|
|
7190
8125
|
let t = [e.message],
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
(
|
|
7194
|
-
t.push([
|
|
7195
|
-
let
|
|
7196
|
-
typeof
|
|
7197
|
-
let
|
|
7198
|
-
return (typeof
|
|
8126
|
+
r = Je(e.fields.required),
|
|
8127
|
+
i = Je(e.fields.balance);
|
|
8128
|
+
(r || i) &&
|
|
8129
|
+
t.push([r ? `Required: ${r}` : '', i ? `Balance: ${i}` : ''].filter(Boolean).join(' '));
|
|
8130
|
+
let s = e.fields.org_name ?? e.fields.orgName;
|
|
8131
|
+
typeof s == 'string' && s && t.push(`Workspace: ${s}`);
|
|
8132
|
+
let n = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
|
|
8133
|
+
return (typeof n == 'string' && n && t.push(n), e.code && t.push(`(${e.code})`), t);
|
|
7199
8134
|
}
|
|
7200
|
-
function
|
|
8135
|
+
function fr(e) {
|
|
7201
8136
|
return /\.(mp4|webm|mov)(\?|$)/i.test(e)
|
|
7202
8137
|
? 'video'
|
|
7203
8138
|
: /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
|
|
@@ -7206,15 +8141,15 @@ function fi(e) {
|
|
|
7206
8141
|
}
|
|
7207
8142
|
function He(e) {
|
|
7208
8143
|
let t = [];
|
|
7209
|
-
for (let
|
|
7210
|
-
typeof
|
|
7211
|
-
? t.push({ type: 'text', text:
|
|
7212
|
-
:
|
|
8144
|
+
for (let r of e.data ?? [])
|
|
8145
|
+
typeof r.message?.content == 'string'
|
|
8146
|
+
? t.push({ type: 'text', text: r.message.content })
|
|
8147
|
+
: r.url && t.push({ type: fr(r.url), url: r.url });
|
|
7213
8148
|
return t;
|
|
7214
8149
|
}
|
|
7215
8150
|
var M = class {
|
|
7216
|
-
constructor(t,
|
|
7217
|
-
((this.apiKey = t), (this.baseUrl =
|
|
8151
|
+
constructor(t, r) {
|
|
8152
|
+
((this.apiKey = t), (this.baseUrl = r.replace(/\/+$/, '')));
|
|
7218
8153
|
}
|
|
7219
8154
|
getHeaders() {
|
|
7220
8155
|
return {
|
|
@@ -7224,126 +8159,126 @@ var M = class {
|
|
|
7224
8159
|
'X-Tein-Client': 'cli',
|
|
7225
8160
|
};
|
|
7226
8161
|
}
|
|
7227
|
-
async send(t,
|
|
7228
|
-
let
|
|
8162
|
+
async send(t, r, i) {
|
|
8163
|
+
let s = await fetch(`${this.baseUrl}${r}`, {
|
|
7229
8164
|
method: t,
|
|
7230
8165
|
headers: this.getHeaders(),
|
|
7231
|
-
...(
|
|
8166
|
+
...(i === void 0 ? {} : { body: JSON.stringify(i) }),
|
|
7232
8167
|
});
|
|
7233
|
-
if (!
|
|
7234
|
-
let
|
|
8168
|
+
if (!s.ok) {
|
|
8169
|
+
let n = null;
|
|
7235
8170
|
try {
|
|
7236
|
-
|
|
8171
|
+
n = await s.json();
|
|
7237
8172
|
} catch {}
|
|
7238
|
-
throw
|
|
8173
|
+
throw mr(s.status, s.statusText, n);
|
|
7239
8174
|
}
|
|
7240
|
-
return await
|
|
8175
|
+
return await s.json();
|
|
7241
8176
|
}
|
|
7242
8177
|
async checkKey() {
|
|
7243
8178
|
await this.send('GET', '/v1/jobs?limit=1');
|
|
7244
8179
|
}
|
|
7245
|
-
queueJob(t,
|
|
7246
|
-
return this.send('POST', '/v1/generate', { model: t, ...
|
|
7247
|
-
let
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
?
|
|
8180
|
+
queueJob(t, r) {
|
|
8181
|
+
return this.send('POST', '/v1/generate', { model: t, ...r }).then((i) => {
|
|
8182
|
+
let s = i.status,
|
|
8183
|
+
n =
|
|
8184
|
+
s === 'succeeded' || s === 'failed' || s === 'expired' || s === 'cancelled'
|
|
8185
|
+
? s
|
|
7251
8186
|
: 'processing',
|
|
7252
|
-
o = He(
|
|
8187
|
+
o = He(i);
|
|
7253
8188
|
return {
|
|
7254
|
-
request_id:
|
|
7255
|
-
model:
|
|
7256
|
-
status:
|
|
8189
|
+
request_id: i.request_id || i.id || '',
|
|
8190
|
+
model: i.model,
|
|
8191
|
+
status: n,
|
|
7257
8192
|
...(o.length ? { output: o } : {}),
|
|
7258
|
-
error:
|
|
7259
|
-
...(
|
|
8193
|
+
error: i.error && typeof i.error.message == 'string' ? i.error.message : null,
|
|
8194
|
+
...(i.usage ? { usage: i.usage } : {}),
|
|
7260
8195
|
};
|
|
7261
8196
|
});
|
|
7262
8197
|
}
|
|
7263
8198
|
getStatus(t) {
|
|
7264
|
-
return this.send('GET', `/v1/jobs/${encodeURIComponent(t)}`).then((
|
|
7265
|
-
let
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
?
|
|
8199
|
+
return this.send('GET', `/v1/jobs/${encodeURIComponent(t)}`).then((r) => {
|
|
8200
|
+
let i = r.status,
|
|
8201
|
+
s =
|
|
8202
|
+
i === 'succeeded' || i === 'failed' || i === 'expired' || i === 'cancelled'
|
|
8203
|
+
? i
|
|
7269
8204
|
: 'processing',
|
|
7270
|
-
|
|
7271
|
-
o =
|
|
8205
|
+
n = He(r),
|
|
8206
|
+
o = r.error && typeof r.error.message == 'string' ? r.error.message : null;
|
|
7272
8207
|
return {
|
|
7273
|
-
request_id:
|
|
7274
|
-
model:
|
|
7275
|
-
status:
|
|
7276
|
-
...(
|
|
8208
|
+
request_id: r.id || t,
|
|
8209
|
+
model: r.model,
|
|
8210
|
+
status: s,
|
|
8211
|
+
...(n.length ? { output: n } : {}),
|
|
7277
8212
|
error: o,
|
|
7278
|
-
...(
|
|
8213
|
+
...(r.usage ? { usage: r.usage } : {}),
|
|
7279
8214
|
};
|
|
7280
8215
|
});
|
|
7281
8216
|
}
|
|
7282
8217
|
uploadAsset(t) {
|
|
7283
8218
|
return this.send('POST', '/v1/upload', { data: t });
|
|
7284
8219
|
}
|
|
7285
|
-
async downloadOutput(t,
|
|
7286
|
-
let
|
|
7287
|
-
if (!
|
|
7288
|
-
let
|
|
7289
|
-
ee.default.existsSync(
|
|
7290
|
-
let
|
|
7291
|
-
return (await (0, Ye.pipeline)(
|
|
8220
|
+
async downloadOutput(t, r) {
|
|
8221
|
+
let i = await fetch(t);
|
|
8222
|
+
if (!i.ok) throw new Error(`The file could not be downloaded (HTTP ${i.status})`);
|
|
8223
|
+
let s = We.default.dirname(r);
|
|
8224
|
+
ee.default.existsSync(s) || ee.default.mkdirSync(s, { recursive: !0 });
|
|
8225
|
+
let n = ee.default.createWriteStream(r);
|
|
8226
|
+
return (await (0, Ye.pipeline)(i.body, n), r);
|
|
7292
8227
|
}
|
|
7293
8228
|
};
|
|
7294
|
-
|
|
7295
|
-
function
|
|
8229
|
+
C();
|
|
8230
|
+
function ke(e) {
|
|
7296
8231
|
if (typeof e != 'number' || !Number.isFinite(e)) return '';
|
|
7297
8232
|
if (Math.abs(e) >= 1 || Math.abs(Number(e.toFixed(4)) - e) < 1e-12) return `$${e.toFixed(4)}`;
|
|
7298
8233
|
let t = Math.max(0, 3 - Number(e.toExponential(3).split('e')[1])),
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
return
|
|
8234
|
+
r = 10 ** t,
|
|
8235
|
+
i = Math.round(Number((e * r).toFixed(6))) / r;
|
|
8236
|
+
return i >= 1 ? `$${i.toFixed(4)}` : `$${i.toFixed(t).replace(/0+$/, '')}`;
|
|
7302
8237
|
}
|
|
7303
8238
|
H();
|
|
7304
|
-
var
|
|
7305
|
-
function
|
|
7306
|
-
for (let t of
|
|
8239
|
+
var $t = ['images', 'input_images', 'videos', 'audios'];
|
|
8240
|
+
function Wr(e) {
|
|
8241
|
+
for (let t of $t) typeof e[t] == 'string' && (e[t] = [e[t]]);
|
|
7307
8242
|
}
|
|
7308
|
-
function
|
|
8243
|
+
function Yr(e) {
|
|
7309
8244
|
if (e.startsWith('http://') || e.startsWith('https://')) return null;
|
|
7310
8245
|
let t = A.default.resolve(e);
|
|
7311
8246
|
return D.default.existsSync(t) && D.default.statSync(t).isFile() ? t : null;
|
|
7312
8247
|
}
|
|
7313
|
-
async function
|
|
7314
|
-
for (let
|
|
7315
|
-
if (!Array.isArray(e[
|
|
7316
|
-
let
|
|
7317
|
-
for (let
|
|
7318
|
-
if (typeof
|
|
7319
|
-
let
|
|
7320
|
-
|
|
8248
|
+
async function Qr(e, t) {
|
|
8249
|
+
for (let r of $t) {
|
|
8250
|
+
if (!Array.isArray(e[r])) continue;
|
|
8251
|
+
let i = [];
|
|
8252
|
+
for (let s of e[r]) {
|
|
8253
|
+
if (typeof s != 'string') continue;
|
|
8254
|
+
let n = Yr(s);
|
|
8255
|
+
i.push(n ? await t(n) : s);
|
|
7321
8256
|
}
|
|
7322
|
-
e[
|
|
8257
|
+
e[r] = i;
|
|
7323
8258
|
}
|
|
7324
8259
|
}
|
|
7325
8260
|
var W = { starter: 10, plus: 25, scale: 40, enterprise: 300 };
|
|
7326
|
-
function
|
|
8261
|
+
function Xr(e) {
|
|
7327
8262
|
if (e.count === void 0 || e.count === !0) return 1;
|
|
7328
8263
|
let t = typeof e.count == 'number' ? e.count : Number(e.count),
|
|
7329
|
-
|
|
8264
|
+
r = W.enterprise;
|
|
7330
8265
|
return (
|
|
7331
|
-
(!Number.isInteger(t) || t < 1 || t >
|
|
8266
|
+
(!Number.isInteger(t) || t < 1 || t > r) &&
|
|
7332
8267
|
(process.stderr
|
|
7333
|
-
.write(`${a.red('Error:')} --count must be a whole number from 1 to ${
|
|
8268
|
+
.write(`${a.red('Error:')} --count must be a whole number from 1 to ${r}. The API allows Starter ${W.starter}, Plus ${W.plus}, Scale ${W.scale}, Enterprise ${W.enterprise} at once, including polling.
|
|
7334
8269
|
`),
|
|
7335
8270
|
process.exit(1)),
|
|
7336
8271
|
t
|
|
7337
8272
|
);
|
|
7338
8273
|
}
|
|
7339
|
-
async function
|
|
7340
|
-
|
|
7341
|
-
process.stderr.write(`Starting ${
|
|
8274
|
+
async function Zr(e, t, r, i, s) {
|
|
8275
|
+
s.isJson ||
|
|
8276
|
+
process.stderr.write(`Starting ${i} ${t} jobs together...
|
|
7342
8277
|
`);
|
|
7343
|
-
let
|
|
7344
|
-
Array.from({ length:
|
|
8278
|
+
let n = await Promise.all(
|
|
8279
|
+
Array.from({ length: i }, async () => {
|
|
7345
8280
|
try {
|
|
7346
|
-
return { job: await e.queueJob(t,
|
|
8281
|
+
return { job: await e.queueJob(t, r) };
|
|
7347
8282
|
} catch (l) {
|
|
7348
8283
|
return { err: l };
|
|
7349
8284
|
}
|
|
@@ -7351,22 +8286,22 @@ async function Zi(e, t, i, r, n) {
|
|
|
7351
8286
|
),
|
|
7352
8287
|
o = [],
|
|
7353
8288
|
u = [];
|
|
7354
|
-
for (let l of
|
|
8289
|
+
for (let l of n)
|
|
7355
8290
|
'job' in l && l.job
|
|
7356
8291
|
? o.push(l.job)
|
|
7357
8292
|
: 'err' in l &&
|
|
7358
8293
|
u.push(
|
|
7359
|
-
l.err instanceof
|
|
8294
|
+
l.err instanceof w
|
|
7360
8295
|
? l.err
|
|
7361
|
-
: new
|
|
8296
|
+
: new w(0, l.err instanceof Error ? l.err.message : String(l.err)),
|
|
7362
8297
|
);
|
|
7363
|
-
if (!
|
|
8298
|
+
if (!s.isAsync) {
|
|
7364
8299
|
let l = Date.now(),
|
|
7365
8300
|
c = o.filter((p) => p.status === 'processing' && p.request_id);
|
|
7366
8301
|
for (; c.length;) {
|
|
7367
|
-
if ((await new Promise((d) => setTimeout(d, 2e3)), !
|
|
8302
|
+
if ((await new Promise((d) => setTimeout(d, 2e3)), !s.isJson)) {
|
|
7368
8303
|
let d = Math.round((Date.now() - l) / 1e3);
|
|
7369
|
-
process.stderr.write(`Waiting on ${c.length} of ${
|
|
8304
|
+
process.stderr.write(`Waiting on ${c.length} of ${i} (${d}s)...
|
|
7370
8305
|
`);
|
|
7371
8306
|
}
|
|
7372
8307
|
let p = await Promise.all(
|
|
@@ -7385,7 +8320,7 @@ async function Zi(e, t, i, r, n) {
|
|
|
7385
8320
|
c = o.filter((d) => d.status === 'processing' && d.request_id);
|
|
7386
8321
|
}
|
|
7387
8322
|
}
|
|
7388
|
-
if (
|
|
8323
|
+
if (s.isJson)
|
|
7389
8324
|
process.stdout.write(
|
|
7390
8325
|
JSON.stringify(
|
|
7391
8326
|
{ jobs: o, errors: u.map((l) => ({ code: l.code ?? null, message: l.message })) },
|
|
@@ -7398,7 +8333,7 @@ async function Zi(e, t, i, r, n) {
|
|
|
7398
8333
|
else {
|
|
7399
8334
|
for (let l of o)
|
|
7400
8335
|
(process.stdout.write(`${l.request_id} ${l.status}`),
|
|
7401
|
-
l.usage?.cost !== void 0 && process.stdout.write(` ${
|
|
8336
|
+
l.usage?.cost !== void 0 && process.stdout.write(` ${ke(l.usage.cost)}`),
|
|
7402
8337
|
l.error && process.stdout.write(` ${l.error}`),
|
|
7403
8338
|
process.stdout.write(`
|
|
7404
8339
|
`));
|
|
@@ -7409,21 +8344,21 @@ async function Zi(e, t, i, r, n) {
|
|
|
7409
8344
|
}
|
|
7410
8345
|
(u.length ||
|
|
7411
8346
|
o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
|
|
7412
|
-
process.exit(
|
|
8347
|
+
process.exit(T);
|
|
7413
8348
|
}
|
|
7414
|
-
function
|
|
8349
|
+
function Ct(e) {
|
|
7415
8350
|
let t = {},
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
for (let
|
|
7419
|
-
let
|
|
7420
|
-
if (
|
|
7421
|
-
let o =
|
|
8351
|
+
r = new Set(),
|
|
8352
|
+
i = [];
|
|
8353
|
+
for (let s = 0; s < e.length; s++) {
|
|
8354
|
+
let n = e[s];
|
|
8355
|
+
if (n.startsWith('--')) {
|
|
8356
|
+
let o = n.slice(2);
|
|
7422
8357
|
if (o.includes('=')) {
|
|
7423
8358
|
let [u, l] = o.split('=', 2);
|
|
7424
8359
|
t[u.replace(/-/g, '_')] = l;
|
|
7425
|
-
} else if (
|
|
7426
|
-
let u = e[
|
|
8360
|
+
} else if (s + 1 < e.length && !e[s + 1].startsWith('-')) {
|
|
8361
|
+
let u = e[s + 1];
|
|
7427
8362
|
(u === 'true'
|
|
7428
8363
|
? (t[o.replace(/-/g, '_')] = !0)
|
|
7429
8364
|
: u === 'false'
|
|
@@ -7431,10 +8366,10 @@ function Et(e) {
|
|
|
7431
8366
|
: /^-?\d+(\.\d+)?$/.test(u)
|
|
7432
8367
|
? (t[o.replace(/-/g, '_')] = Number(u))
|
|
7433
8368
|
: (t[o.replace(/-/g, '_')] = u),
|
|
7434
|
-
|
|
7435
|
-
} else ((t[o.replace(/-/g, '_')] = !0),
|
|
7436
|
-
} else if (
|
|
7437
|
-
let o =
|
|
8369
|
+
s++);
|
|
8370
|
+
} else ((t[o.replace(/-/g, '_')] = !0), r.add(o));
|
|
8371
|
+
} else if (n.startsWith('-') && n.length === 2) {
|
|
8372
|
+
let o = n[1],
|
|
7438
8373
|
l =
|
|
7439
8374
|
{
|
|
7440
8375
|
p: 'prompt',
|
|
@@ -7448,18 +8383,18 @@ function Et(e) {
|
|
|
7448
8383
|
v: 'version',
|
|
7449
8384
|
}[o] || o;
|
|
7450
8385
|
o === 'j' || o === 'h' || o === 'v'
|
|
7451
|
-
? ((t[l] = !0),
|
|
7452
|
-
:
|
|
7453
|
-
? ((t[l] = e[
|
|
8386
|
+
? ((t[l] = !0), r.add(l))
|
|
8387
|
+
: s + 1 < e.length && !e[s + 1].startsWith('-')
|
|
8388
|
+
? ((t[l] = e[s + 1]), s++)
|
|
7454
8389
|
: (t[l] = !0);
|
|
7455
|
-
} else
|
|
8390
|
+
} else i.push(n);
|
|
7456
8391
|
}
|
|
7457
|
-
return { command:
|
|
8392
|
+
return { command: i[0] || '', subcommand: i[1], modelSlug: i[1] || i[0], options: t, flags: r };
|
|
7458
8393
|
}
|
|
7459
8394
|
async function De(e, t) {
|
|
7460
|
-
let
|
|
7461
|
-
|
|
7462
|
-
(
|
|
8395
|
+
let r = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
8396
|
+
i = x(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
8397
|
+
(r ||
|
|
7463
8398
|
(process.stderr.write(`${a.red('Error:')} Authentication required.
|
|
7464
8399
|
`),
|
|
7465
8400
|
process.stderr
|
|
@@ -7474,11 +8409,11 @@ async function De(e, t) {
|
|
|
7474
8409
|
process.stderr.write(`Run ${a.cyan('tein models')} to list all available models.
|
|
7475
8410
|
`),
|
|
7476
8411
|
process.exit(1)));
|
|
7477
|
-
let
|
|
7478
|
-
|
|
8412
|
+
let s = U(e),
|
|
8413
|
+
n = !!t.json,
|
|
7479
8414
|
o = !!(t.async || t.no_wait),
|
|
7480
8415
|
u = typeof t.output == 'string' ? t.output : void 0,
|
|
7481
|
-
l =
|
|
8416
|
+
l = Xr(t),
|
|
7482
8417
|
c = { ...t };
|
|
7483
8418
|
(delete c.json,
|
|
7484
8419
|
delete c.async,
|
|
@@ -7487,71 +8422,71 @@ async function De(e, t) {
|
|
|
7487
8422
|
delete c.api_key,
|
|
7488
8423
|
delete c.api_url,
|
|
7489
8424
|
delete c.count);
|
|
7490
|
-
let p =
|
|
7491
|
-
(
|
|
8425
|
+
let p = qt(s, c);
|
|
8426
|
+
(Wr(p),
|
|
7492
8427
|
typeof p.image == 'string' && !p.images && ((p.images = [p.image]), delete p.image),
|
|
7493
8428
|
p.image_url &&
|
|
7494
8429
|
!p.first_frame_image &&
|
|
7495
8430
|
(e.startsWith('seedance') || e.startsWith('happy-horse')) &&
|
|
7496
8431
|
(p.first_frame_image = p.image_url));
|
|
7497
|
-
let d = new M(
|
|
8432
|
+
let d = new M(r, i),
|
|
7498
8433
|
m = ['image', 'first_frame_image', 'last_frame_image', 'lipsyncing_audio', 'audio', 'video'];
|
|
7499
8434
|
for (let y of m) {
|
|
7500
8435
|
let f = p[y];
|
|
7501
8436
|
if (typeof f == 'string' && !f.startsWith('http://') && !f.startsWith('https://')) {
|
|
7502
|
-
let
|
|
7503
|
-
if (D.default.existsSync(
|
|
7504
|
-
let
|
|
7505
|
-
|
|
8437
|
+
let I = A.default.resolve(f);
|
|
8438
|
+
if (D.default.existsSync(I) && D.default.statSync(I).isFile()) {
|
|
8439
|
+
let v = new _(`Uploading local file ${A.default.basename(I)} to CDN...`);
|
|
8440
|
+
n || v.start();
|
|
7506
8441
|
try {
|
|
7507
|
-
let
|
|
7508
|
-
X = await d.uploadAsset(
|
|
7509
|
-
((p[y] = X.url),
|
|
7510
|
-
} catch (
|
|
7511
|
-
let X =
|
|
7512
|
-
(
|
|
8442
|
+
let F = D.default.readFileSync(I),
|
|
8443
|
+
X = await d.uploadAsset(F.toString('base64'));
|
|
8444
|
+
((p[y] = X.url), n || v.succeed(`Uploaded ${A.default.basename(I)} to CDN`));
|
|
8445
|
+
} catch (F) {
|
|
8446
|
+
let X = F instanceof Error ? F.message : String(F);
|
|
8447
|
+
(n
|
|
7513
8448
|
? process.stdout.write(
|
|
7514
8449
|
JSON.stringify({ error: X }) +
|
|
7515
8450
|
`
|
|
7516
8451
|
`,
|
|
7517
8452
|
)
|
|
7518
|
-
:
|
|
8453
|
+
: v.fail(`Upload failed: ${X}`),
|
|
7519
8454
|
process.exit(1));
|
|
7520
8455
|
}
|
|
7521
8456
|
}
|
|
7522
8457
|
}
|
|
7523
8458
|
}
|
|
7524
|
-
await
|
|
7525
|
-
let f = new
|
|
7526
|
-
|
|
8459
|
+
await Qr(p, async (y) => {
|
|
8460
|
+
let f = new _(`Uploading local file ${A.default.basename(y)} to CDN...`);
|
|
8461
|
+
n || f.start();
|
|
7527
8462
|
try {
|
|
7528
|
-
let
|
|
7529
|
-
|
|
7530
|
-
return (
|
|
7531
|
-
} catch (
|
|
7532
|
-
let
|
|
7533
|
-
(
|
|
8463
|
+
let I = D.default.readFileSync(y),
|
|
8464
|
+
v = await d.uploadAsset(I.toString('base64'));
|
|
8465
|
+
return (n || f.succeed(`Uploaded ${A.default.basename(y)} to CDN`), v.url);
|
|
8466
|
+
} catch (I) {
|
|
8467
|
+
let v = I instanceof Error ? I.message : String(I);
|
|
8468
|
+
(n
|
|
7534
8469
|
? process.stdout.write(
|
|
7535
|
-
JSON.stringify({ error:
|
|
8470
|
+
JSON.stringify({ error: v }) +
|
|
7536
8471
|
`
|
|
7537
8472
|
`,
|
|
7538
8473
|
)
|
|
7539
|
-
: f.fail(`Upload failed: ${
|
|
8474
|
+
: f.fail(`Upload failed: ${v}`),
|
|
7540
8475
|
process.exit(1));
|
|
7541
8476
|
}
|
|
7542
8477
|
});
|
|
7543
|
-
let h = new
|
|
7544
|
-
|
|
8478
|
+
let h = new _(`Submitting task for ${a.bold(e)}...`);
|
|
8479
|
+
n || h.start();
|
|
7545
8480
|
let g;
|
|
7546
8481
|
try {
|
|
7547
8482
|
if (l > 1) {
|
|
7548
|
-
await
|
|
8483
|
+
await Zr(d, e, p, l, { isJson: n, isAsync: o });
|
|
7549
8484
|
return;
|
|
7550
8485
|
}
|
|
7551
8486
|
g = await d.queueJob(e, p);
|
|
7552
8487
|
} catch (y) {
|
|
7553
|
-
let f = y instanceof
|
|
7554
|
-
(
|
|
8488
|
+
let f = y instanceof w ? y : null;
|
|
8489
|
+
(n
|
|
7555
8490
|
? process.stdout.write(
|
|
7556
8491
|
JSON.stringify(
|
|
7557
8492
|
f
|
|
@@ -7569,10 +8504,10 @@ async function De(e, t) {
|
|
|
7569
8504
|
`)
|
|
7570
8505
|
: `Failed to start generation: ${y instanceof Error ? y.message : y}`,
|
|
7571
8506
|
),
|
|
7572
|
-
process.exit(f ? f.exitCode :
|
|
8507
|
+
process.exit(f ? f.exitCode : T));
|
|
7573
8508
|
}
|
|
7574
8509
|
if (o) {
|
|
7575
|
-
|
|
8510
|
+
n
|
|
7576
8511
|
? process.stdout.write(
|
|
7577
8512
|
JSON.stringify(g, null, 2) +
|
|
7578
8513
|
`
|
|
@@ -7587,14 +8522,14 @@ async function De(e, t) {
|
|
|
7587
8522
|
ge = 1500;
|
|
7588
8523
|
for (; g.status === 'processing';) {
|
|
7589
8524
|
let y = Math.round((Date.now() - fe) / 1e3);
|
|
7590
|
-
(
|
|
8525
|
+
(n || h.update(`Rendering ${a.bold(e)} (${y}s elapsed)... [ID: ${g.request_id}]`),
|
|
7591
8526
|
await new Promise((f) => setTimeout(f, ge)));
|
|
7592
8527
|
try {
|
|
7593
8528
|
g = await d.getStatus(g.request_id);
|
|
7594
8529
|
} catch (f) {
|
|
7595
|
-
f instanceof
|
|
7596
|
-
f.exitCode !==
|
|
7597
|
-
(
|
|
8530
|
+
f instanceof w &&
|
|
8531
|
+
f.exitCode !== T &&
|
|
8532
|
+
(n ||
|
|
7598
8533
|
h.fail(
|
|
7599
8534
|
K(f).join(`
|
|
7600
8535
|
`),
|
|
@@ -7604,16 +8539,16 @@ async function De(e, t) {
|
|
|
7604
8539
|
}
|
|
7605
8540
|
if (
|
|
7606
8541
|
((g.status === 'failed' || g.status === 'expired' || g.status === 'cancelled') &&
|
|
7607
|
-
(
|
|
8542
|
+
(n
|
|
7608
8543
|
? process.stdout.write(
|
|
7609
8544
|
JSON.stringify(g, null, 2) +
|
|
7610
8545
|
`
|
|
7611
8546
|
`,
|
|
7612
8547
|
)
|
|
7613
8548
|
: h.fail(`Generation ${g.status}: ${g.error || 'Something failed on our side.'}`),
|
|
7614
|
-
process.exit(
|
|
7615
|
-
|
|
7616
|
-
|
|
8549
|
+
process.exit(T)),
|
|
8550
|
+
n || h.succeed(`Generation completed for ${a.bold(s?.name || e)}!`),
|
|
8551
|
+
n)
|
|
7617
8552
|
) {
|
|
7618
8553
|
process.stdout.write(
|
|
7619
8554
|
JSON.stringify(g, null, 2) +
|
|
@@ -7630,7 +8565,7 @@ async function De(e, t) {
|
|
|
7630
8565
|
process.stdout.write(` ${a.bold('Request ID:')} ${g.request_id}
|
|
7631
8566
|
`),
|
|
7632
8567
|
g.usage?.cost !== void 0 &&
|
|
7633
|
-
process.stdout.write(` ${a.bold('Cost:')} ${
|
|
8568
|
+
process.stdout.write(` ${a.bold('Cost:')} ${ke(g.usage.cost)}
|
|
7634
8569
|
`),
|
|
7635
8570
|
g.output && g.output.length > 0)
|
|
7636
8571
|
) {
|
|
@@ -7645,12 +8580,12 @@ ${a.bold('Outputs:')}
|
|
|
7645
8580
|
`),
|
|
7646
8581
|
u)
|
|
7647
8582
|
) {
|
|
7648
|
-
let
|
|
8583
|
+
let I = new _(`Downloading output to ${u}...`).start();
|
|
7649
8584
|
try {
|
|
7650
8585
|
(await d.downloadOutput(f.url, A.default.resolve(process.cwd(), u)),
|
|
7651
|
-
|
|
7652
|
-
} catch (
|
|
7653
|
-
|
|
8586
|
+
I.succeed(`Saved to ${a.bold(u)}`));
|
|
8587
|
+
} catch (v) {
|
|
8588
|
+
I.fail(`Failed to download: ${v instanceof Error ? v.message : v}`);
|
|
7654
8589
|
}
|
|
7655
8590
|
}
|
|
7656
8591
|
} else
|
|
@@ -7663,24 +8598,24 @@ ${f.text}
|
|
|
7663
8598
|
process.stdout.write(`
|
|
7664
8599
|
`);
|
|
7665
8600
|
}
|
|
7666
|
-
var
|
|
7667
|
-
|
|
7668
|
-
async function
|
|
8601
|
+
var Et = P(require('node:readline'));
|
|
8602
|
+
C();
|
|
8603
|
+
async function ei(e) {
|
|
7669
8604
|
try {
|
|
7670
8605
|
return (await new M(e, x()).checkKey(), 'ok');
|
|
7671
8606
|
} catch (t) {
|
|
7672
|
-
if (t instanceof
|
|
8607
|
+
if (t instanceof w) {
|
|
7673
8608
|
if (t.status === 401) return 'invalid';
|
|
7674
8609
|
if (t.status === 403) return 'blocked';
|
|
7675
8610
|
}
|
|
7676
8611
|
return 'unchecked';
|
|
7677
8612
|
}
|
|
7678
8613
|
}
|
|
7679
|
-
function
|
|
7680
|
-
let t =
|
|
7681
|
-
return new Promise((
|
|
7682
|
-
t.question(e, (
|
|
7683
|
-
(t.close(), i
|
|
8614
|
+
function ti(e) {
|
|
8615
|
+
let t = Et.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
8616
|
+
return new Promise((r) => {
|
|
8617
|
+
t.question(e, (i) => {
|
|
8618
|
+
(t.close(), r(i.trim()));
|
|
7684
8619
|
});
|
|
7685
8620
|
});
|
|
7686
8621
|
}
|
|
@@ -7688,36 +8623,36 @@ async function Y(e, t) {
|
|
|
7688
8623
|
switch (e) {
|
|
7689
8624
|
case 'login':
|
|
7690
8625
|
case 'set-key': {
|
|
7691
|
-
let
|
|
7692
|
-
(
|
|
8626
|
+
let r = t?.trim() || '';
|
|
8627
|
+
(r ||
|
|
7693
8628
|
(process.stdout.write(`
|
|
7694
8629
|
${a.bold('Tein AI Authentication')}
|
|
7695
8630
|
`),
|
|
7696
8631
|
process.stdout.write(`Get your API key at: ${a.cyan('https://tein.ai/dashboard/keys')}
|
|
7697
8632
|
|
|
7698
8633
|
`),
|
|
7699
|
-
(
|
|
7700
|
-
!
|
|
7701
|
-
!
|
|
8634
|
+
(r = await ti('Enter your Tein API Key (sk_live_...): '))),
|
|
8635
|
+
!r.startsWith('sk_live_') &&
|
|
8636
|
+
!r.startsWith('sk_test_') &&
|
|
7702
8637
|
(process.stderr
|
|
7703
8638
|
.write(`${a.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
|
|
7704
8639
|
`),
|
|
7705
8640
|
process.exit(1)));
|
|
7706
|
-
let
|
|
7707
|
-
(
|
|
8641
|
+
let i = await ei(r);
|
|
8642
|
+
(i === 'invalid' &&
|
|
7708
8643
|
(process.stderr
|
|
7709
8644
|
.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
8645
|
`),
|
|
7711
8646
|
process.exit(1)),
|
|
7712
|
-
be({ apiKey:
|
|
8647
|
+
be({ apiKey: r }),
|
|
7713
8648
|
process.stdout.write(`
|
|
7714
|
-
${a.green('\u2713')} API key saved to ${a.dim(
|
|
8649
|
+
${a.green('\u2713')} API key saved to ${a.dim(re())}
|
|
7715
8650
|
`),
|
|
7716
|
-
|
|
8651
|
+
i === 'blocked'
|
|
7717
8652
|
? process.stdout
|
|
7718
8653
|
.write(`${a.yellow('\u2139')} The key is valid, but this account cannot run requests right now. Check your dashboard.
|
|
7719
8654
|
`)
|
|
7720
|
-
:
|
|
8655
|
+
: i === 'unchecked' &&
|
|
7721
8656
|
process.stdout
|
|
7722
8657
|
.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
8658
|
`),
|
|
@@ -7736,23 +8671,23 @@ ${a.green('\u2713')} API key saved to ${a.dim(ie())}
|
|
|
7736
8671
|
}
|
|
7737
8672
|
(be({ apiKey: '' }),
|
|
7738
8673
|
process.stdout
|
|
7739
|
-
.write(`${a.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${a.dim(
|
|
8674
|
+
.write(`${a.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${a.dim(re())}
|
|
7740
8675
|
`));
|
|
7741
8676
|
break;
|
|
7742
8677
|
}
|
|
7743
8678
|
default: {
|
|
7744
|
-
let
|
|
7745
|
-
|
|
7746
|
-
|
|
8679
|
+
let r = S(),
|
|
8680
|
+
i = x(),
|
|
8681
|
+
s = V();
|
|
7747
8682
|
if (
|
|
7748
8683
|
(process.stdout.write(`
|
|
7749
8684
|
${a.bold('Tein AI CLI Configuration')}
|
|
7750
8685
|
`),
|
|
7751
|
-
process.stdout.write(` Config file: ${a.dim(
|
|
8686
|
+
process.stdout.write(` Config file: ${a.dim(re())}
|
|
7752
8687
|
`),
|
|
7753
|
-
process.stdout.write(` API URL: ${a.cyan(
|
|
8688
|
+
process.stdout.write(` API URL: ${a.cyan(i)}
|
|
7754
8689
|
`),
|
|
7755
|
-
!
|
|
8690
|
+
!r)
|
|
7756
8691
|
)
|
|
7757
8692
|
(process.stdout.write(` API Key: ${a.red('Not configured')}
|
|
7758
8693
|
|
|
@@ -7762,9 +8697,9 @@ ${a.bold('Tein AI CLI Configuration')}
|
|
|
7762
8697
|
|
|
7763
8698
|
`));
|
|
7764
8699
|
else {
|
|
7765
|
-
let
|
|
8700
|
+
let n = `${r.slice(0, 10)}...${r.slice(-4)}`;
|
|
7766
8701
|
process.stdout
|
|
7767
|
-
.write(` API Key: ${a.green(
|
|
8702
|
+
.write(` API Key: ${a.green(n)} (${r.startsWith('sk_live_') ? 'Live Key' : 'Test Key'})
|
|
7768
8703
|
|
|
7769
8704
|
`);
|
|
7770
8705
|
}
|
|
@@ -7772,52 +8707,52 @@ ${a.bold('Tein AI CLI Configuration')}
|
|
|
7772
8707
|
}
|
|
7773
8708
|
}
|
|
7774
8709
|
}
|
|
7775
|
-
|
|
7776
|
-
|
|
8710
|
+
C();
|
|
8711
|
+
we();
|
|
7777
8712
|
H();
|
|
7778
|
-
var
|
|
8713
|
+
var ri = 3e3;
|
|
7779
8714
|
async function At(e) {
|
|
7780
8715
|
try {
|
|
7781
|
-
let t = await fetch(`${x(e)}/v1/pricing`, { signal: AbortSignal.timeout(
|
|
8716
|
+
let t = await fetch(`${x(e)}/v1/pricing`, { signal: AbortSignal.timeout(ri) });
|
|
7782
8717
|
if (!t.ok) return;
|
|
7783
|
-
let
|
|
7784
|
-
|
|
7785
|
-
for (let
|
|
7786
|
-
let
|
|
7787
|
-
|
|
8718
|
+
let r = await t.json(),
|
|
8719
|
+
i = {};
|
|
8720
|
+
for (let s of r.configs ?? []) {
|
|
8721
|
+
let n = String(s.modelSlug ?? '');
|
|
8722
|
+
j.has(n) && (i[n] ??= []).push(Number(s.starterPrice));
|
|
7788
8723
|
}
|
|
7789
|
-
|
|
8724
|
+
Pt(i);
|
|
7790
8725
|
} catch {}
|
|
7791
8726
|
}
|
|
7792
|
-
var
|
|
7793
|
-
|
|
7794
|
-
async function
|
|
8727
|
+
var ii = new Set(['video', 'image', 'text', 'audio', '3d']),
|
|
8728
|
+
ai = { llm: 'text', chat: 'text', reasoning: 'text' };
|
|
8729
|
+
async function Ot(e, t) {
|
|
7795
8730
|
await At(t);
|
|
7796
|
-
let
|
|
8731
|
+
let r = E();
|
|
7797
8732
|
if (e) {
|
|
7798
|
-
let
|
|
7799
|
-
o =
|
|
7800
|
-
|
|
7801
|
-
?
|
|
7802
|
-
:
|
|
8733
|
+
let n = e.toLowerCase(),
|
|
8734
|
+
o = ai[n] ?? n;
|
|
8735
|
+
r = ii.has(o)
|
|
8736
|
+
? r.filter((u) => u.category.toLowerCase() === o)
|
|
8737
|
+
: r.filter((u) => u.kind.toLowerCase().includes(n) || u.slug.toLowerCase().includes(n));
|
|
7803
8738
|
}
|
|
7804
8739
|
(process.stdout.write(`
|
|
7805
|
-
${a.bold('Tein AI Models Catalog')} (${
|
|
8740
|
+
${a.bold('Tein AI Models Catalog')} (${r.length} available)
|
|
7806
8741
|
`),
|
|
7807
8742
|
process.stdout
|
|
7808
8743
|
.write(`${a.dim('Run `tein info <model-slug>` to see detailed parameters and options.')}
|
|
7809
8744
|
|
|
7810
8745
|
`));
|
|
7811
|
-
let
|
|
7812
|
-
for (let
|
|
7813
|
-
let o =
|
|
7814
|
-
(
|
|
8746
|
+
let i = {};
|
|
8747
|
+
for (let n of r) {
|
|
8748
|
+
let o = n.category;
|
|
8749
|
+
(i[o] || (i[o] = []), i[o].push(n));
|
|
7815
8750
|
}
|
|
7816
|
-
let
|
|
7817
|
-
for (let
|
|
7818
|
-
let o =
|
|
8751
|
+
let s = ['Video', 'Image', 'Text', 'Audio', '3D'];
|
|
8752
|
+
for (let n of s) {
|
|
8753
|
+
let o = i[n];
|
|
7819
8754
|
if (!(!o || o.length === 0)) {
|
|
7820
|
-
process.stdout.write(`${a.bold(a.cyan(`\u2500\u2500 ${
|
|
8755
|
+
process.stdout.write(`${a.bold(a.cyan(`\u2500\u2500 ${n} Models \u2500\u2500`))}
|
|
7821
8756
|
`);
|
|
7822
8757
|
for (let u of o) {
|
|
7823
8758
|
let l = u.slug.padEnd(24),
|
|
@@ -7835,55 +8770,55 @@ ${a.bold('Tein AI Models Catalog')} (${i.length} available)
|
|
|
7835
8770
|
|
|
7836
8771
|
`);
|
|
7837
8772
|
}
|
|
7838
|
-
async function
|
|
7839
|
-
|
|
7840
|
-
let
|
|
7841
|
-
(
|
|
8773
|
+
async function Rt(e, t) {
|
|
8774
|
+
j.has(e) && (await At(t));
|
|
8775
|
+
let r = U(e);
|
|
8776
|
+
(r ||
|
|
7842
8777
|
(process.stderr.write(`${a.red('Error:')} Model "${e}" not found in Tein AI registry.
|
|
7843
8778
|
`),
|
|
7844
8779
|
process.stderr.write(`Run ${a.cyan('tein models')} to see all available model slugs.
|
|
7845
8780
|
`),
|
|
7846
8781
|
process.exit(1)),
|
|
7847
8782
|
process.stdout.write(`
|
|
7848
|
-
${a.bold(a.cyan(
|
|
8783
|
+
${a.bold(a.cyan(r.name))} (${a.bold(r.slug)})
|
|
7849
8784
|
`),
|
|
7850
|
-
process.stdout.write(` ${a.gray(
|
|
8785
|
+
process.stdout.write(` ${a.gray(r.description)}
|
|
7851
8786
|
|
|
7852
8787
|
`),
|
|
7853
8788
|
process.stdout.write(`${a.bold('Metadata:')}
|
|
7854
8789
|
`),
|
|
7855
|
-
process.stdout.write(` Category: ${a.yellow(
|
|
8790
|
+
process.stdout.write(` Category: ${a.yellow(r.category)}
|
|
7856
8791
|
`),
|
|
7857
|
-
process.stdout.write(` Kind: ${
|
|
8792
|
+
process.stdout.write(` Kind: ${r.kind}
|
|
7858
8793
|
`),
|
|
7859
|
-
process.stdout.write(` Vendor: ${
|
|
8794
|
+
process.stdout.write(` Vendor: ${r.vendor}
|
|
7860
8795
|
`),
|
|
7861
|
-
process.stdout.write(` Pricing: ${a.green(
|
|
8796
|
+
process.stdout.write(` Pricing: ${a.green(r.priceFormatted)}
|
|
7862
8797
|
|
|
7863
8798
|
`),
|
|
7864
8799
|
process.stdout.write(`${a.bold('Parameters:')}
|
|
7865
8800
|
`));
|
|
7866
|
-
for (let
|
|
7867
|
-
let
|
|
7868
|
-
|
|
8801
|
+
for (let i of r.parameters) {
|
|
8802
|
+
let s = i.required ? a.red('(required)') : a.dim('(optional)'),
|
|
8803
|
+
n = i.default !== void 0 ? a.dim(` [default: ${i.default}]`) : '';
|
|
7869
8804
|
(process.stdout
|
|
7870
|
-
.write(` ${a.bold(`--${
|
|
8805
|
+
.write(` ${a.bold(`--${i.name.replace(/_/g, '-')}`)} ${a.yellow(`<${i.type}>`)} ${s}${n}
|
|
7871
8806
|
`),
|
|
7872
|
-
|
|
7873
|
-
process.stdout.write(` ${a.gray(
|
|
8807
|
+
i.description &&
|
|
8808
|
+
process.stdout.write(` ${a.gray(i.description)}
|
|
7874
8809
|
`),
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
process.stdout.write(` Allowed values: ${a.dim(
|
|
8810
|
+
i.options &&
|
|
8811
|
+
i.options.length > 0 &&
|
|
8812
|
+
process.stdout.write(` Allowed values: ${a.dim(i.options.join(', '))}
|
|
7878
8813
|
`),
|
|
7879
|
-
(
|
|
7880
|
-
process.stdout.write(` Range: ${
|
|
8814
|
+
(i.min !== void 0 || i.max !== void 0) &&
|
|
8815
|
+
process.stdout.write(` Range: ${i.min ?? ''} to ${i.max ?? ''}
|
|
7881
8816
|
`),
|
|
7882
8817
|
process.stdout.write(`
|
|
7883
8818
|
`));
|
|
7884
8819
|
}
|
|
7885
8820
|
if (
|
|
7886
|
-
(
|
|
8821
|
+
(r.parameters.some((i) => i.name === 'callback_url') ||
|
|
7887
8822
|
(process.stdout
|
|
7888
8823
|
.write(` ${a.bold('--callback-url')} ${a.yellow('<string>')} ${a.dim('(optional)')}
|
|
7889
8824
|
`),
|
|
@@ -7893,32 +8828,32 @@ ${a.bold(a.cyan(i.name))} (${a.bold(i.slug)})
|
|
|
7893
8828
|
`)),
|
|
7894
8829
|
process.stdout.write(`${a.bold('Sample CLI Usage:')}
|
|
7895
8830
|
`),
|
|
7896
|
-
|
|
8831
|
+
r.category === 'Video')
|
|
7897
8832
|
)
|
|
7898
8833
|
process.stdout
|
|
7899
|
-
.write(` ${a.cyan(`tein run ${
|
|
8834
|
+
.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
8835
|
|
|
7901
8836
|
`);
|
|
7902
|
-
else if (
|
|
7903
|
-
let
|
|
8837
|
+
else if (r.category === 'Image') {
|
|
8838
|
+
let i = r.parameters.some((s) => s.name === 'aspect_ratio') ? ' --aspect-ratio 16:9' : '';
|
|
7904
8839
|
process.stdout
|
|
7905
|
-
.write(` ${a.cyan(`tein run ${
|
|
8840
|
+
.write(` ${a.cyan(`tein run ${r.slug} --prompt "Cyberpunk city in the rain, 8k render"${i} -o output.png`)}
|
|
7906
8841
|
|
|
7907
8842
|
`);
|
|
7908
8843
|
} else
|
|
7909
|
-
|
|
8844
|
+
r.category === 'Audio'
|
|
7910
8845
|
? process.stdout
|
|
7911
|
-
.write(` ${a.cyan(`tein run ${
|
|
8846
|
+
.write(` ${a.cyan(`tein run ${r.slug} --prompt "Hello world from Tein AI" --speaker en_female_warm -o speech.wav`)}
|
|
7912
8847
|
|
|
7913
8848
|
`)
|
|
7914
8849
|
: process.stdout
|
|
7915
|
-
.write(` ${a.cyan(`tein run ${
|
|
8850
|
+
.write(` ${a.cyan(`tein run ${r.slug} --prompt "Explain quantum computing in simple terms"`)}
|
|
7916
8851
|
|
|
7917
8852
|
`);
|
|
7918
8853
|
}
|
|
7919
|
-
|
|
8854
|
+
C();
|
|
7920
8855
|
Le();
|
|
7921
|
-
var
|
|
8856
|
+
var si = 1e4,
|
|
7922
8857
|
Ne = {
|
|
7923
8858
|
price: '',
|
|
7924
8859
|
creativeMode: 'Creative mode',
|
|
@@ -7929,109 +8864,109 @@ var nr = 1e4,
|
|
|
7929
8864
|
priorityDraft: 'Priority + Draft',
|
|
7930
8865
|
creativeModePriorityDraft: 'Creative mode + Priority + Draft',
|
|
7931
8866
|
},
|
|
7932
|
-
|
|
7933
|
-
|
|
8867
|
+
ni = Object.keys(Ne),
|
|
8868
|
+
oi = {
|
|
7934
8869
|
creativeMode: 'unfiltered',
|
|
7935
8870
|
creativeModePriority: 'unfilteredPriority',
|
|
7936
8871
|
creativeModeDraft: 'unfilteredDraft',
|
|
7937
8872
|
creativeModePriorityDraft: 'unfilteredPriorityDraft',
|
|
7938
8873
|
};
|
|
7939
|
-
function
|
|
7940
|
-
let
|
|
7941
|
-
return e[t] ?? (
|
|
8874
|
+
function li(e, t) {
|
|
8875
|
+
let r = oi[t];
|
|
8876
|
+
return e[t] ?? (r ? e[r] : void 0);
|
|
7942
8877
|
}
|
|
7943
|
-
async function
|
|
7944
|
-
let
|
|
7945
|
-
|
|
8878
|
+
async function pi(e, t) {
|
|
8879
|
+
let r = `${x(e)}${me(t)}`,
|
|
8880
|
+
i;
|
|
7946
8881
|
try {
|
|
7947
|
-
|
|
8882
|
+
i = await fetch(r, { signal: AbortSignal.timeout(si) });
|
|
7948
8883
|
} catch {
|
|
7949
|
-
throw new Error(`Could not reach ${
|
|
8884
|
+
throw new Error(`Could not reach ${r}`);
|
|
7950
8885
|
}
|
|
7951
|
-
let
|
|
7952
|
-
if (!
|
|
7953
|
-
let
|
|
7954
|
-
|
|
7955
|
-
?
|
|
7956
|
-
:
|
|
7957
|
-
?
|
|
7958
|
-
: `Pricing request failed (${
|
|
7959
|
-
throw new Error(
|
|
8886
|
+
let s = await i.json().catch(() => null);
|
|
8887
|
+
if (!i.ok || !s || s.object !== 'list' || !s.board) {
|
|
8888
|
+
let n =
|
|
8889
|
+
s && typeof s.error == 'string'
|
|
8890
|
+
? s.error
|
|
8891
|
+
: s && typeof s.error == 'object' && s.error?.message
|
|
8892
|
+
? s.error.message
|
|
8893
|
+
: `Pricing request failed (${i.status})`;
|
|
8894
|
+
throw new Error(n);
|
|
7960
8895
|
}
|
|
7961
|
-
return
|
|
8896
|
+
return s;
|
|
7962
8897
|
}
|
|
7963
8898
|
function Ve(e) {
|
|
7964
8899
|
let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
|
|
7965
|
-
[
|
|
7966
|
-
return `$${
|
|
8900
|
+
[r, i = ''] = t.split('.');
|
|
8901
|
+
return `$${r}.${i.padEnd(2, '0')}`;
|
|
7967
8902
|
}
|
|
7968
8903
|
function Ue(e) {
|
|
7969
8904
|
if (!e || typeof e.starter != 'number') return null;
|
|
7970
8905
|
let t = typeof e.plus == 'number' ? e.plus : e.starter,
|
|
7971
|
-
|
|
7972
|
-
return `Starter ${Ve(e.starter)} Plus ${Ve(t)} Scale ${Ve(
|
|
8906
|
+
r = typeof e.scale == 'number' ? e.scale : t;
|
|
8907
|
+
return `Starter ${Ve(e.starter)} Plus ${Ve(t)} Scale ${Ve(r)}`;
|
|
7973
8908
|
}
|
|
7974
|
-
function
|
|
8909
|
+
function di(e) {
|
|
7975
8910
|
if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
|
|
7976
8911
|
let t = [];
|
|
7977
|
-
for (let
|
|
7978
|
-
let
|
|
7979
|
-
|
|
8912
|
+
for (let r of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
|
|
8913
|
+
let i = e[r];
|
|
8914
|
+
i != null && i !== '' && t.push(String(i));
|
|
7980
8915
|
}
|
|
7981
8916
|
return (
|
|
7982
8917
|
e.withVideo === !0 && t.push('with video'),
|
|
7983
8918
|
t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
|
|
7984
8919
|
);
|
|
7985
8920
|
}
|
|
7986
|
-
function
|
|
7987
|
-
let
|
|
7988
|
-
for (let
|
|
7989
|
-
let
|
|
7990
|
-
if (!
|
|
7991
|
-
let
|
|
7992
|
-
t.push(` ${
|
|
8921
|
+
function ci(e, t) {
|
|
8922
|
+
let r = di(e);
|
|
8923
|
+
for (let i of ni) {
|
|
8924
|
+
let s = Ue(li(e, i));
|
|
8925
|
+
if (!s) continue;
|
|
8926
|
+
let n = Ne[i] ? ` (${Ne[i]})` : '';
|
|
8927
|
+
t.push(` ${r}${n} ${s}`);
|
|
7993
8928
|
}
|
|
7994
8929
|
}
|
|
7995
|
-
function
|
|
7996
|
-
let
|
|
8930
|
+
function ui(e, t) {
|
|
8931
|
+
let r = e.quality ? ` quality=${e.quality}` : '';
|
|
7997
8932
|
t.push(
|
|
7998
|
-
` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${
|
|
8933
|
+
` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${r}`)}`,
|
|
7999
8934
|
);
|
|
8000
|
-
for (let
|
|
8001
|
-
let
|
|
8002
|
-
if (Array.isArray(
|
|
8003
|
-
for (let
|
|
8004
|
-
if (!
|
|
8005
|
-
let
|
|
8006
|
-
o = typeof
|
|
8007
|
-
u = Ue(
|
|
8935
|
+
for (let s of e.variants ?? []) ci(s, t);
|
|
8936
|
+
let i = e.addons;
|
|
8937
|
+
if (Array.isArray(i))
|
|
8938
|
+
for (let s of i) {
|
|
8939
|
+
if (!s || typeof s != 'object') continue;
|
|
8940
|
+
let n = s,
|
|
8941
|
+
o = typeof n.label == 'string' ? n.label : String(n.id ?? 'add-on'),
|
|
8942
|
+
u = Ue(n.price);
|
|
8008
8943
|
u && t.push(` ${o} (add-on) ${u}`);
|
|
8009
8944
|
}
|
|
8010
8945
|
t.push('');
|
|
8011
8946
|
}
|
|
8012
|
-
function
|
|
8947
|
+
function mi(e) {
|
|
8013
8948
|
let t = [],
|
|
8014
|
-
|
|
8015
|
-
(t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${
|
|
8949
|
+
r = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
|
|
8950
|
+
(t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${r}`),
|
|
8016
8951
|
t.push(
|
|
8017
8952
|
`${a.dim('Starter, Plus and Scale. Creative mode, Priority and draft show only where published.')}`,
|
|
8018
8953
|
),
|
|
8019
8954
|
t.push(''));
|
|
8020
|
-
let
|
|
8955
|
+
let i = new Map();
|
|
8021
8956
|
for (let l of e.board.models) {
|
|
8022
8957
|
let c = l.kind || 'other',
|
|
8023
|
-
p =
|
|
8024
|
-
(p.push(l),
|
|
8958
|
+
p = i.get(c) ?? [];
|
|
8959
|
+
(p.push(l), i.set(c, p));
|
|
8025
8960
|
}
|
|
8026
|
-
let
|
|
8027
|
-
|
|
8028
|
-
let p =
|
|
8029
|
-
d =
|
|
8961
|
+
let s = ['video', 'image', 'audio', 'llm', 'text', '3d'],
|
|
8962
|
+
n = [...i.keys()].sort((l, c) => {
|
|
8963
|
+
let p = s.indexOf(l),
|
|
8964
|
+
d = s.indexOf(c);
|
|
8030
8965
|
return (p === -1 ? 99 : p) - (d === -1 ? 99 : d);
|
|
8031
8966
|
});
|
|
8032
|
-
for (let l of
|
|
8967
|
+
for (let l of n) {
|
|
8033
8968
|
t.push(`${a.bold(a.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
|
|
8034
|
-
for (let c of
|
|
8969
|
+
for (let c of i.get(l) ?? []) ui(c, t);
|
|
8035
8970
|
}
|
|
8036
8971
|
let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
|
|
8037
8972
|
u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
|
|
@@ -8064,10 +8999,10 @@ function mr(e) {
|
|
|
8064
8999
|
async function Dt(e) {
|
|
8065
9000
|
let t;
|
|
8066
9001
|
try {
|
|
8067
|
-
t = await
|
|
8068
|
-
} catch (
|
|
8069
|
-
let
|
|
8070
|
-
(process.stderr.write(`${a.red('Error:')} ${
|
|
9002
|
+
t = await pi(e.apiUrl, e.model);
|
|
9003
|
+
} catch (r) {
|
|
9004
|
+
let i = r instanceof Error ? r.message : String(r);
|
|
9005
|
+
(process.stderr.write(`${a.red('Error:')} ${i}
|
|
8071
9006
|
`),
|
|
8072
9007
|
process.exit(1));
|
|
8073
9008
|
}
|
|
@@ -8075,15 +9010,15 @@ async function Dt(e) {
|
|
|
8075
9010
|
e.json
|
|
8076
9011
|
? `${JSON.stringify(t, null, 2)}
|
|
8077
9012
|
`
|
|
8078
|
-
:
|
|
9013
|
+
: mi(t),
|
|
8079
9014
|
);
|
|
8080
9015
|
}
|
|
8081
|
-
var Lt =
|
|
8082
|
-
|
|
9016
|
+
var Lt = P(require('node:path'));
|
|
9017
|
+
C();
|
|
8083
9018
|
async function Vt(e, t) {
|
|
8084
|
-
let
|
|
8085
|
-
|
|
8086
|
-
(
|
|
9019
|
+
let r = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
9020
|
+
i = x(typeof t.api_url == 'string' ? t.api_url : void 0);
|
|
9021
|
+
(r ||
|
|
8087
9022
|
(process.stderr.write(`${a.red('Error:')} Authentication required.
|
|
8088
9023
|
`),
|
|
8089
9024
|
process.stderr
|
|
@@ -8096,18 +9031,18 @@ async function Vt(e, t) {
|
|
|
8096
9031
|
process.stderr.write(`Usage: ${a.cyan('tein status <request-id> [--wait] [-o output.mp4]')}
|
|
8097
9032
|
`),
|
|
8098
9033
|
process.exit(1)));
|
|
8099
|
-
let
|
|
8100
|
-
|
|
9034
|
+
let s = !!t.json,
|
|
9035
|
+
n = !!t.wait,
|
|
8101
9036
|
o = typeof t.output == 'string' ? t.output : void 0,
|
|
8102
|
-
u = new M(
|
|
8103
|
-
l = new
|
|
8104
|
-
|
|
9037
|
+
u = new M(r, i),
|
|
9038
|
+
l = new _(`Checking status of ${a.bold(e)}...`);
|
|
9039
|
+
s || l.start();
|
|
8105
9040
|
let c;
|
|
8106
9041
|
try {
|
|
8107
9042
|
c = await u.getStatus(e);
|
|
8108
9043
|
} catch (p) {
|
|
8109
|
-
(p instanceof
|
|
8110
|
-
(
|
|
9044
|
+
(p instanceof w &&
|
|
9045
|
+
(s
|
|
8111
9046
|
? process.stdout.write(
|
|
8112
9047
|
JSON.stringify(
|
|
8113
9048
|
{ error: { code: p.code ?? null, message: p.message, ...p.fields } },
|
|
@@ -8122,14 +9057,14 @@ async function Vt(e, t) {
|
|
|
8122
9057
|
`),
|
|
8123
9058
|
),
|
|
8124
9059
|
process.exit(p.exitCode)),
|
|
8125
|
-
|
|
8126
|
-
process.exit(
|
|
9060
|
+
s || l.fail(p instanceof Error ? p.message : String(p)),
|
|
9061
|
+
process.exit(T));
|
|
8127
9062
|
}
|
|
8128
|
-
if (
|
|
9063
|
+
if (n && c.status === 'processing') {
|
|
8129
9064
|
let p = Date.now();
|
|
8130
9065
|
for (; c.status === 'processing';) {
|
|
8131
9066
|
let d = Math.round((Date.now() - p) / 1e3);
|
|
8132
|
-
(
|
|
9067
|
+
(s || l.update(`Waiting for ${a.bold(c.model)} (${d}s elapsed)...`),
|
|
8133
9068
|
await new Promise((m) => setTimeout(m, 1500)));
|
|
8134
9069
|
try {
|
|
8135
9070
|
c = await u.getStatus(e);
|
|
@@ -8137,13 +9072,13 @@ async function Vt(e, t) {
|
|
|
8137
9072
|
}
|
|
8138
9073
|
}
|
|
8139
9074
|
if (
|
|
8140
|
-
(
|
|
9075
|
+
(s ||
|
|
8141
9076
|
(c.status === 'succeeded'
|
|
8142
9077
|
? l.succeed('Task completed!')
|
|
8143
9078
|
: c.status === 'failed' || c.status === 'expired' || c.status === 'cancelled'
|
|
8144
9079
|
? l.fail(`Task ${c.status}: ${c.error || 'Something failed on our side.'}`)
|
|
8145
9080
|
: l.stop()),
|
|
8146
|
-
|
|
9081
|
+
s)
|
|
8147
9082
|
) {
|
|
8148
9083
|
process.stdout.write(
|
|
8149
9084
|
JSON.stringify(c, null, 2) +
|
|
@@ -8173,7 +9108,7 @@ ${a.bold('Outputs:')}
|
|
|
8173
9108
|
`),
|
|
8174
9109
|
o)
|
|
8175
9110
|
) {
|
|
8176
|
-
let d = new
|
|
9111
|
+
let d = new _(`Downloading output to ${o}...`).start();
|
|
8177
9112
|
try {
|
|
8178
9113
|
(await u.downloadOutput(p.url, Lt.default.resolve(process.cwd(), o)),
|
|
8179
9114
|
d.succeed(`Saved to ${a.bold(o)}`));
|
|
@@ -8190,14 +9125,14 @@ ${p.text}
|
|
|
8190
9125
|
process.stdout.write(`
|
|
8191
9126
|
`);
|
|
8192
9127
|
}
|
|
8193
|
-
var Be =
|
|
8194
|
-
|
|
8195
|
-
|
|
9128
|
+
var Be = P(require('node:fs')),
|
|
9129
|
+
Fe = P(require('node:path'));
|
|
9130
|
+
C();
|
|
8196
9131
|
async function Nt(e, t = {}) {
|
|
8197
|
-
let
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
(
|
|
9132
|
+
let r = S(typeof t.api_key == 'string' ? t.api_key : void 0),
|
|
9133
|
+
i = x(typeof t.api_url == 'string' ? t.api_url : void 0),
|
|
9134
|
+
s = !!t.json;
|
|
9135
|
+
(r ||
|
|
8201
9136
|
(process.stderr.write(`${a.red('Error:')} Authentication required.
|
|
8202
9137
|
`),
|
|
8203
9138
|
process.stderr
|
|
@@ -8210,19 +9145,19 @@ async function Nt(e, t = {}) {
|
|
|
8210
9145
|
process.stderr.write(`Usage: ${a.cyan('tein upload <image.png|video.mp4>')}
|
|
8211
9146
|
`),
|
|
8212
9147
|
process.exit(1)));
|
|
8213
|
-
let
|
|
8214
|
-
Be.default.existsSync(
|
|
8215
|
-
(process.stderr.write(`${a.red('Error:')} File not found: ${
|
|
9148
|
+
let n = Fe.default.resolve(e);
|
|
9149
|
+
Be.default.existsSync(n) ||
|
|
9150
|
+
(process.stderr.write(`${a.red('Error:')} File not found: ${n}
|
|
8216
9151
|
`),
|
|
8217
9152
|
process.exit(1));
|
|
8218
|
-
let o =
|
|
8219
|
-
l = Be.default.readFileSync(
|
|
8220
|
-
c = new M(
|
|
8221
|
-
p = new
|
|
8222
|
-
|
|
9153
|
+
let o = Fe.default.basename(n),
|
|
9154
|
+
l = Be.default.readFileSync(n).toString('base64'),
|
|
9155
|
+
c = new M(r, i),
|
|
9156
|
+
p = new _(`Uploading ${a.bold(o)} to Tein AI CDN...`);
|
|
9157
|
+
s || p.start();
|
|
8223
9158
|
try {
|
|
8224
9159
|
let d = await c.uploadAsset(l);
|
|
8225
|
-
|
|
9160
|
+
s
|
|
8226
9161
|
? process.stdout.write(
|
|
8227
9162
|
JSON.stringify(d, null, 2) +
|
|
8228
9163
|
`
|
|
@@ -8240,26 +9175,26 @@ ${a.bold('CDN URL:')} ${a.green(d.url)}
|
|
|
8240
9175
|
|
|
8241
9176
|
`));
|
|
8242
9177
|
} catch (d) {
|
|
8243
|
-
let m = d instanceof
|
|
9178
|
+
let m = d instanceof w ? d : null,
|
|
8244
9179
|
h = m
|
|
8245
9180
|
? K(m).join(`
|
|
8246
9181
|
`)
|
|
8247
9182
|
: d instanceof Error
|
|
8248
9183
|
? d.message
|
|
8249
9184
|
: String(d);
|
|
8250
|
-
(
|
|
9185
|
+
(s
|
|
8251
9186
|
? process.stdout.write(
|
|
8252
9187
|
JSON.stringify({ error: { code: m?.code ?? null, message: m?.message ?? h } }, null, 2) +
|
|
8253
9188
|
`
|
|
8254
9189
|
`,
|
|
8255
9190
|
)
|
|
8256
9191
|
: p.fail(`Upload failed: ${h}`),
|
|
8257
|
-
process.exit(m ? m.exitCode :
|
|
9192
|
+
process.exit(m ? m.exitCode : T));
|
|
8258
9193
|
}
|
|
8259
9194
|
}
|
|
8260
9195
|
H();
|
|
8261
9196
|
Se();
|
|
8262
|
-
function
|
|
9197
|
+
function rr() {
|
|
8263
9198
|
process.stdout.write(`
|
|
8264
9199
|
${a.bold(a.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
|
|
8265
9200
|
|
|
@@ -8319,11 +9254,11 @@ ${a.bold('EXAMPLES:')}
|
|
|
8319
9254
|
|
|
8320
9255
|
`);
|
|
8321
9256
|
}
|
|
8322
|
-
async function
|
|
9257
|
+
async function $i() {
|
|
8323
9258
|
let e = process.argv.slice(2),
|
|
8324
|
-
t =
|
|
9259
|
+
t = Ct(e);
|
|
8325
9260
|
if (t.flags.has('help') || t.options.help || t.command === 'help') {
|
|
8326
|
-
|
|
9261
|
+
rr();
|
|
8327
9262
|
return;
|
|
8328
9263
|
}
|
|
8329
9264
|
if (t.flags.has('version') || t.options.version || t.command === 'version') {
|
|
@@ -8350,15 +9285,15 @@ async function Cr() {
|
|
|
8350
9285
|
}
|
|
8351
9286
|
case 'models':
|
|
8352
9287
|
case 'list': {
|
|
8353
|
-
await
|
|
9288
|
+
await Ot(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
|
|
8354
9289
|
break;
|
|
8355
9290
|
}
|
|
8356
9291
|
case 'pricing':
|
|
8357
9292
|
case 'prices': {
|
|
8358
|
-
let
|
|
8359
|
-
|
|
9293
|
+
let r = t.options.model,
|
|
9294
|
+
i = t.subcommand || (typeof r == 'string' ? r : void 0);
|
|
8360
9295
|
await Dt({
|
|
8361
|
-
model:
|
|
9296
|
+
model: i,
|
|
8362
9297
|
json: !!t.options.json,
|
|
8363
9298
|
apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
|
|
8364
9299
|
});
|
|
@@ -8372,28 +9307,28 @@ async function Cr() {
|
|
|
8372
9307
|
process.stderr.write(`Usage: ${a.cyan('tein info <model-slug>')}
|
|
8373
9308
|
`),
|
|
8374
9309
|
process.exit(1)),
|
|
8375
|
-
await
|
|
9310
|
+
await Rt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
|
|
8376
9311
|
break;
|
|
8377
9312
|
}
|
|
8378
9313
|
case 'upload': {
|
|
8379
|
-
let
|
|
8380
|
-
await Nt(
|
|
9314
|
+
let r = t.subcommand || '';
|
|
9315
|
+
await Nt(r, t.options);
|
|
8381
9316
|
break;
|
|
8382
9317
|
}
|
|
8383
9318
|
case 'run':
|
|
8384
9319
|
case 'generate': {
|
|
8385
|
-
let
|
|
8386
|
-
await De(
|
|
9320
|
+
let r = t.subcommand || '';
|
|
9321
|
+
await De(r, t.options);
|
|
8387
9322
|
break;
|
|
8388
9323
|
}
|
|
8389
9324
|
case 'status': {
|
|
8390
|
-
let
|
|
8391
|
-
await Vt(
|
|
9325
|
+
let r = t.subcommand || '';
|
|
9326
|
+
await Vt(r, t.options);
|
|
8392
9327
|
break;
|
|
8393
9328
|
}
|
|
8394
9329
|
case 'mcp': {
|
|
8395
|
-
let { startStdioServer:
|
|
8396
|
-
await
|
|
9330
|
+
let { startStdioServer: r } = await Promise.resolve().then(() => (tr(), er));
|
|
9331
|
+
await r();
|
|
8397
9332
|
break;
|
|
8398
9333
|
}
|
|
8399
9334
|
default: {
|
|
@@ -8404,17 +9339,17 @@ async function Cr() {
|
|
|
8404
9339
|
${a.red('Error:')} Unknown command or model "${t.command}".
|
|
8405
9340
|
Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for the model slugs.
|
|
8406
9341
|
`),
|
|
8407
|
-
process.exit(
|
|
9342
|
+
process.exit(T)),
|
|
8408
9343
|
await De(t.command, t.options));
|
|
8409
9344
|
return;
|
|
8410
9345
|
}
|
|
8411
|
-
|
|
9346
|
+
rr();
|
|
8412
9347
|
break;
|
|
8413
9348
|
}
|
|
8414
9349
|
}
|
|
8415
9350
|
}
|
|
8416
|
-
|
|
8417
|
-
(e instanceof
|
|
9351
|
+
$i().catch((e) => {
|
|
9352
|
+
(e instanceof w &&
|
|
8418
9353
|
(process.stderr.write(`
|
|
8419
9354
|
${a.red('Error:')} ${K(e).join(`
|
|
8420
9355
|
`)}
|
|
@@ -8423,5 +9358,5 @@ ${a.red('Error:')} ${K(e).join(`
|
|
|
8423
9358
|
process.stderr.write(`
|
|
8424
9359
|
${a.red('Fatal error:')} ${e instanceof Error ? e.message : e}
|
|
8425
9360
|
`),
|
|
8426
|
-
process.exit(
|
|
9361
|
+
process.exit(T));
|
|
8427
9362
|
});
|