@teinai/cli 1.1.17 → 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.
Files changed (2) hide show
  1. package/index.js +2100 -1128
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,109 +1,109 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
- var Xt = Object.create;
4
- var fe = Object.defineProperty;
5
- var Zt = Object.getOwnPropertyDescriptor;
6
- var ei = Object.getOwnPropertyNames;
7
- var ti = Object.getPrototypeOf,
8
- ii = Object.prototype.hasOwnProperty;
9
- var b = (e, t, i) => () => {
10
- if (i) throw i[0];
3
+ var ir = Object.create;
4
+ var he = Object.defineProperty;
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 (r) {
14
- throw ((i = [r]), r);
13
+ } catch (i) {
14
+ throw ((r = [i]), i);
15
15
  }
16
16
  };
17
- var ri = (e, t) => {
18
- for (var i in t) fe(e, i, { get: t[i], enumerable: !0 });
17
+ var lr = (e, t) => {
18
+ for (var r in t) he(e, r, { get: t[r], enumerable: !0 });
19
19
  },
20
- ai = (e, t, i, r) => {
20
+ pr = (e, t, r, i) => {
21
21
  if ((t && typeof t == 'object') || typeof t == 'function')
22
- for (let n of ei(t))
23
- !ii.call(e, n) &&
24
- n !== i &&
25
- fe(e, n, { get: () => t[n], enumerable: !(r = Zt(t, n)) || r.enumerable });
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 I = (e, t, i) => (
29
- (i = e != null ? Xt(ti(e)) : {}),
30
- ai(t || !e || !e.__esModule ? fe(i, 'default', { value: e, enumerable: !0 }) : i, e)
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
- function L() {
32
+ function V() {
33
33
  try {
34
- if (C.default.existsSync(D)) {
35
- let e = C.default.readFileSync(D, 'utf-8');
34
+ if ($.default.existsSync(L)) {
35
+ let e = $.default.readFileSync(L, 'utf-8');
36
36
  return JSON.parse(e);
37
37
  }
38
38
  } catch {}
39
39
  return {};
40
40
  }
41
- function he(e) {
41
+ function be(e) {
42
42
  try {
43
- C.default.existsSync(te) || C.default.mkdirSync(te, { recursive: !0, mode: 448 });
44
- let i = { ...L(), ...e };
45
- (C.default.writeFileSync(D, JSON.stringify(i, null, 2), { encoding: 'utf-8', mode: 384 }),
46
- C.default.chmodSync(te, 448),
47
- C.default.chmodSync(D, 384));
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
- throw new Error(`Failed to save config to ${D}: ${t}`);
49
+ throw new Error(`Failed to save config to ${L}: ${t}`);
50
50
  }
51
51
  }
52
52
  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 i = L();
57
- return i.apiKey && i.apiKey.trim() ? i.apiKey.trim() : '';
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 i = L();
64
- return i.apiUrl && i.apiUrl.trim() ? i.apiUrl.trim().replace(/\/+$/, '') : 'https://api.tein.ai';
63
+ let r = V();
64
+ return r.apiUrl && r.apiUrl.trim() ? r.apiUrl.trim().replace(/\/+$/, '') : 'https://api.tein.ai';
65
65
  }
66
- function ie() {
67
- return D;
66
+ function re() {
67
+ return L;
68
68
  }
69
- var C,
70
- He,
71
- ge,
69
+ var $,
70
+ Qe,
71
+ ye,
72
72
  te,
73
- D,
74
- E = b(() => {
73
+ L,
74
+ C = b(() => {
75
75
  'use strict';
76
- ((C = I(require('node:fs'))),
77
- (He = I(require('node:os'))),
78
- (ge = I(require('node:path'))),
79
- (te = ge.default.join(He.default.homedir(), '.tein')),
80
- (D = ge.default.join(te, 'config.json')));
76
+ (($ = P(require('node:fs'))),
77
+ (Qe = P(require('node:os'))),
78
+ (ye = P(require('node:path'))),
79
+ (te = ye.default.join(Qe.default.homedir(), '.tein')),
80
+ (L = ye.default.join(te, 'config.json')));
81
81
  });
82
- var di,
83
- We,
84
- Ye,
85
- Qe = b(() => {
82
+ var gr,
83
+ Xe,
84
+ Ze,
85
+ et = b(() => {
86
86
  'use strict';
87
- ((di = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4']),
88
- (We = [...di, 'auto']),
89
- (Ye =
87
+ ((gr = ['1:1', '16:9', '9:16', '21:9', '3:2', '2:3', '4:3', '3:4']),
88
+ (Xe = [...gr, 'auto']),
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 F,
93
- be = b(() => {
92
+ var j,
93
+ we = b(() => {
94
94
  'use strict';
95
- F = new Set(['nano-banana-2.1', 'seedance-2-lite', 'seedance-2-5-lite']);
95
+ j = new Set(['nano-banana-2.1', 'seedance-2-lite', 'seedance-2-5-lite']);
96
96
  });
97
- function we(e) {
97
+ function ie(e) {
98
98
  return !1;
99
99
  }
100
- var Xe = b(() => {
100
+ var tt = b(() => {
101
101
  'use strict';
102
102
  });
103
- var re,
104
- Ze = b(() => {
103
+ var ae,
104
+ rt = b(() => {
105
105
  'use strict';
106
- re = {
106
+ ae = {
107
107
  source: 'TEIN Price Board',
108
108
  checked: '17 Sep 2026',
109
109
  generated: '2026-10-01',
@@ -149,7 +149,13 @@ var re,
149
149
  {
150
150
  slug: 'gpt-image',
151
151
  name: 'GPT Image',
152
- models: ['gpt-image-2', 'gpt-image-2.5-flare', 'gpt-image-2.5-sunburst'],
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 re,
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
- capTiers: { starter: 0.067, plus: 0.0636, scale: 0.057 },
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.0274, plus: 0.026, scale: 0.0233 },
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
- capTiers: { starter: 0.0274, plus: 0.026, scale: 0.0233 },
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.0457, plus: 0.0434, scale: 0.0389 },
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
- capTiers: { starter: 0.0457, plus: 0.0434, scale: 0.0389 },
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.0731, plus: 0.0694, scale: 0.0622 },
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
- capTiers: { starter: 0.067, plus: 0.0636, scale: 0.057 },
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.0274, plus: 0.026, scale: 0.0233 },
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
- capTiers: { starter: 0.0274, plus: 0.026, scale: 0.0233 },
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.0457, plus: 0.0434, scale: 0.0389 },
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
- capTiers: { starter: 0.0457, plus: 0.0434, scale: 0.0389 },
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.0731, plus: 0.0694, scale: 0.0622 },
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
- capTiers: { starter: 0.067, plus: 0.0636, scale: 0.057 },
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.0274, plus: 0.026, scale: 0.0233 },
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
- capTiers: { starter: 0.0274, plus: 0.026, scale: 0.0233 },
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.0457, plus: 0.0434, scale: 0.0389 },
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
- capTiers: { starter: 0.0457, plus: 0.0434, scale: 0.0389 },
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.0731, plus: 0.0694, scale: 0.0622 },
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
- capTiers: { starter: 0.067, plus: 0.0636, scale: 0.057 },
3247
- },
3248
- {
3249
- id: 'token-1k-low',
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
- { id: 'token', label: 'Token', recommended: !0 },
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: 'token-1k-low' },
4261
+ from: { variant: 'dynamic-1k-low' },
3366
4262
  },
3367
4263
  {
3368
4264
  slug: 'gpt-6-astra',
@@ -4659,124 +5555,176 @@ var re,
4659
5555
  ],
4660
5556
  };
4661
5557
  });
4662
- function ve(e, t) {
5558
+ var it,
5559
+ se,
5560
+ xe = b(() => {
5561
+ 'use strict';
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
+ ]));
5600
+ });
5601
+ function _e(e, t) {
4663
5602
  return `${e.trim().toLowerCase()}|${(t ?? '').trim().toLowerCase()}`;
4664
5603
  }
4665
- function ui(e, t) {
5604
+ function br(e, t) {
4666
5605
  if (e === 'seedance-2-mini') return 'mini';
4667
5606
  if (e !== 'seedance-2') return;
4668
- let i = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
4669
- return i === 'fast' || i === 'mini' || i === 'standard'
4670
- ? i
5607
+ let r = typeof t?.quality == 'string' ? t.quality.trim().toLowerCase() : '';
5608
+ return r === 'fast' || r === 'mini' || r === 'standard'
5609
+ ? r
4671
5610
  : t?.fast_mode === !0
4672
5611
  ? 'fast'
4673
5612
  : 'standard';
4674
5613
  }
4675
- function mi(e, t) {
4676
- let i = e
5614
+ function kr(e, t) {
5615
+ let r = e
4677
5616
  .trim()
4678
5617
  .toLowerCase()
4679
5618
  .replace(/-(?:unfiltered|uncensored)$/, '');
4680
- if (i === 'seedance-2' || i === 'seedance-2-mini') {
4681
- let n = ui(i, t),
4682
- s = ke.get(ve('seedance-2', n));
4683
- return s ? s.slug : null;
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;
4684
5623
  }
4685
- let r = ae.get(i) ?? ke.get(ve(i));
4686
- return r ? r.slug : null;
5624
+ let i = ne.get(r) ?? Te.get(_e(r));
5625
+ return i ? i.slug : null;
4687
5626
  }
4688
- function gi(e, t) {
4689
- return ae.has(e) && !(fi.has(e) && t) ? e : mi(e, t);
5627
+ function xr(e, t) {
5628
+ return ne.has(e) && !(wr.has(e) && t) ? e : kr(e, t);
4690
5629
  }
4691
5630
  function G(e, t) {
4692
- let i = gi(e, t);
4693
- return i ? (ae.get(i) ?? null) : null;
5631
+ let r = xr(e, t);
5632
+ return r ? (ne.get(r) ?? null) : null;
4694
5633
  }
4695
- function ne() {
4696
- return Ie.models;
5634
+ function oe() {
5635
+ return st;
4697
5636
  }
4698
5637
  var Ie,
4699
- ae,
4700
- ke,
4701
- et,
4702
- ci,
4703
- xe,
4704
- fi,
4705
- V = b(() => {
5638
+ Pe,
5639
+ st,
5640
+ hr,
5641
+ ne,
5642
+ Te,
5643
+ at,
5644
+ yr,
5645
+ ve,
5646
+ wr,
5647
+ N = b(() => {
4706
5648
  'use strict';
4707
- Xe();
4708
- Ze();
5649
+ tt();
5650
+ rt();
5651
+ xe();
4709
5652
  ((Ie = {
4710
- ...re,
4711
- families: re.families.map((e) => ({ ...e, models: e.models.filter((t) => !we(t)) })),
4712
- models: re.models.filter((e) => !we(e.slug)),
5653
+ ...ae,
5654
+ families: ae.families.map((e) => ({ ...e, models: e.models.filter((t) => !ie(t)) })),
5655
+ models: ae.models.filter((e) => !ie(e.slug)),
4713
5656
  }),
4714
- (ae = new Map()),
4715
- (ke = new Map()),
4716
- (et = new Map()),
4717
- (ci = new Map()),
4718
- (xe = new Map()));
4719
- for (let e of Ie.models) {
4720
- (ae.set(e.slug, e), ke.set(ve(e.api.model, e.api.quality), e));
4721
- for (let t of e.variants) et.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
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()),
5662
+ (at = new Map()),
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));
5667
+ for (let t of e.variants) at.set(`${e.slug}/${t.id}`, { model: e, variant: t, edit: !1 });
4722
5668
  for (let t of e.editVariants ?? [])
4723
- et.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
4724
- for (let t of e.addons ?? []) ci.set(`${e.slug}/addon/${t.id}`, { model: e, addon: t });
4725
- xe.set(e.slug, e.family);
5669
+ at.set(`${e.slug}/edit/${t.id}`, { model: e, variant: t, edit: !0 });
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);
4726
5672
  }
4727
- for (let e of Ie.families) for (let t of e.models) xe.has(t) || xe.set(t, e.slug);
4728
- fi = new Set(['seedance-2']);
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']);
4729
5675
  });
4730
- function se(e) {
5676
+ function le(e) {
4731
5677
  let t = e.from?.variant;
4732
- return (t && e.variants.find((i) => i.id === t)) || e.variants[0];
5678
+ return (t && e.variants.find((r) => r.id === t)) || e.variants[0];
4733
5679
  }
4734
- function _e(e) {
5680
+ function Me(e) {
4735
5681
  if (e.endpoints?.length)
4736
- return e.editVariants?.length && e.endpoints.some((t) => t.id === tt)
4737
- ? tt
5682
+ return e.editVariants?.length && e.endpoints.some((t) => t.id === nt)
5683
+ ? nt
4738
5684
  : (e.defaultEndpoint ?? e.endpoints[0].id);
4739
5685
  }
4740
- var tt,
4741
- Pe = b(() => {
5686
+ var nt,
5687
+ Ke = b(() => {
4742
5688
  'use strict';
4743
- V();
4744
- tt = 'dynamic';
5689
+ N();
5690
+ nt = 'dynamic';
4745
5691
  });
4746
- var oe,
4747
- Te = b(() => {
5692
+ var pe,
5693
+ Se = b(() => {
4748
5694
  'use strict';
4749
- oe = {
5695
+ pe = {
4750
5696
  'gemini-3-8-flash': 'gemini-3.8-flash',
4751
5697
  'gemini-3-7-flash': 'gemini-3.7-flash',
4752
5698
  'gemini-3-1-pro-preview': 'gemini-3.1-pro-preview',
4753
5699
  'gpt-image-2-5-flare': 'gpt-image-2.5-flare',
4754
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',
4755
5703
  };
4756
5704
  });
4757
- var it = b(() => {
5705
+ var ot = b(() => {
4758
5706
  'use strict';
4759
5707
  });
4760
- function rt(e, t) {
4761
- return typeof t == 'string' && (hi[e]?.includes(t) ?? !1);
5708
+ function lt(e, t) {
5709
+ return typeof t == 'string' && (Ir[e]?.includes(t) ?? !1);
4762
5710
  }
4763
- var hi,
4764
- at = b(() => {
5711
+ var Ir,
5712
+ pt = b(() => {
4765
5713
  'use strict';
4766
- V();
4767
- Pe();
4768
- it();
4769
- hi = {};
5714
+ N();
5715
+ Ke();
5716
+ ot();
5717
+ Ir = {};
4770
5718
  });
4771
- function nt(e) {
4772
- return e === 'nano-banana-pro' ? yi : bi;
5719
+ function dt(e) {
5720
+ return e === 'nano-banana-pro' ? Pr : Tr;
4773
5721
  }
4774
- var yi,
4775
- bi,
4776
- st = b(() => {
5722
+ var Pr,
5723
+ Tr,
5724
+ ct = b(() => {
4777
5725
  'use strict';
4778
- ((yi = ['auto', '1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9']),
4779
- (bi = [
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 = [
4780
5728
  'auto',
4781
5729
  '1:1',
4782
5730
  '1:4',
@@ -4794,10 +5742,10 @@ var yi,
4794
5742
  '21:9',
4795
5743
  ]));
4796
5744
  });
4797
- var ot,
4798
- lt = b(() => {
5745
+ var ut,
5746
+ mt = b(() => {
4799
5747
  'use strict';
4800
- ot = [
5748
+ ut = [
4801
5749
  'prompt',
4802
5750
  'system',
4803
5751
  'messages',
@@ -4811,10 +5759,10 @@ var ot,
4811
5759
  'endpoint',
4812
5760
  ];
4813
5761
  });
4814
- var pt,
4815
- dt = b(() => {
5762
+ var ft,
5763
+ gt = b(() => {
4816
5764
  'use strict';
4817
- pt = [
5765
+ ft = [
4818
5766
  {
4819
5767
  slug: 'claude-fable-5-1',
4820
5768
  family: 'fable-5-1',
@@ -4883,13 +5831,13 @@ var pt,
4883
5831
  },
4884
5832
  ];
4885
5833
  });
4886
- function ct(e) {
5834
+ function ht(e) {
4887
5835
  return `$${e}`;
4888
5836
  }
4889
- function Me(e, t, i) {
4890
- return G(e)?.variants.find((n) => n.endpoint === t && n.component === i)?.price.starter ?? null;
5837
+ function qe(e, t, r) {
5838
+ return G(e)?.variants.find((s) => s.endpoint === t && s.component === r)?.price.starter ?? null;
4891
5839
  }
4892
- function wi(e) {
5840
+ function vr(e) {
4893
5841
  return [
4894
5842
  {
4895
5843
  name: 'prompt',
@@ -4955,39 +5903,39 @@ function wi(e) {
4955
5903
  },
4956
5904
  ];
4957
5905
  }
4958
- function ut() {
5906
+ function yt() {
4959
5907
  return Object.fromEntries(
4960
- pt.map((e) => {
4961
- let t = Me(e.slug, 'cheap', 'input'),
4962
- i = Me(e.slug, 'cheap', 'output'),
4963
- r = Me(e.slug, 'stable', 'input') != null,
4964
- n = t != null && i != null ? `${ct(t)}/M in \xB7 ${ct(i)}/M out` : '',
4965
- s = {
5908
+ ft.map((e) => {
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 = {
4966
5914
  slug: e.slug,
4967
5915
  name: e.name,
4968
5916
  category: 'Text',
4969
5917
  kind: 'Reasoning (LLM)',
4970
5918
  vendor: 'Anthropic',
4971
5919
  description: e.description,
4972
- priceFormatted: n,
5920
+ priceFormatted: s,
4973
5921
  unit: '/M tokens',
4974
5922
  primaryToolName: 'run_task',
4975
- parameters: wi(r),
5923
+ parameters: vr(i),
4976
5924
  };
4977
- return [e.slug, s];
5925
+ return [e.slug, n];
4978
5926
  }),
4979
5927
  );
4980
5928
  }
4981
- var mt = b(() => {
5929
+ var bt = b(() => {
4982
5930
  'use strict';
4983
- dt();
4984
- V();
5931
+ gt();
5932
+ N();
4985
5933
  });
4986
- var J,
4987
- le,
4988
- Ke = b(() => {
5934
+ var z,
5935
+ de,
5936
+ $e = b(() => {
4989
5937
  'use strict';
4990
- ((J = [
5938
+ ((z = [
4991
5939
  'seedance-2-5',
4992
5940
  'seedance-2',
4993
5941
  'seedance-2-mini',
@@ -4995,94 +5943,94 @@ var J,
4995
5943
  'wan-3-0',
4996
5944
  'z-image-pro',
4997
5945
  ]),
4998
- (le =
5946
+ (de =
4999
5947
  'a request with creative_mode: true answers 503 checkpoint_unavailable and nothing is charged'));
5000
5948
  });
5001
- function z(e) {
5949
+ function J(e) {
5002
5950
  return `$${Number(e.toFixed(5))}`;
5003
5951
  }
5004
- function Ii(e) {
5952
+ function Sr(e) {
5005
5953
  if (e.kind === 'llm') {
5006
5954
  let t = e.defaultEndpoint,
5007
- i = (s) =>
5955
+ r = (n) =>
5008
5956
  e.variants.find(
5009
5957
  (o) =>
5010
- o.component === s &&
5958
+ o.component === n &&
5011
5959
  (!t || !o.endpoint || o.endpoint === t) &&
5012
5960
  (!o.context || o.context === '0\u201332K'),
5013
5961
  ),
5014
- r = i('input'),
5015
- n = i('output');
5016
- return r && n
5017
- ? `${z(r.price.starter)}/M in \xB7 ${z(n.price.starter)}/M out`
5018
- : `from ${z(se(e).price.starter)}/M tokens`;
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`;
5019
5967
  }
5020
- return `from ${z(se(e).price.starter)}${e.unit}`;
5968
+ return `from ${J(le(e).price.starter)}${e.unit}`;
5021
5969
  }
5022
- function _i(e, t) {
5023
- let i = t.filter((r) => Number.isFinite(r) && r > 0);
5024
- return i.length ? `from ${z(Math.min(...i))}${e}` : null;
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;
5025
5973
  }
5026
- function bt(e) {
5027
- for (let t of F) {
5028
- let i = de[t],
5029
- r = i ? _i(i.unit, e[t] ?? []) : null;
5030
- i && r && (i.priceFormatted = r);
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);
5031
5979
  }
5032
5980
  }
5033
- function N(e, t) {
5034
- let i = e.axes?.resolution ?? [
5035
- ...new Set(e.variants.map((r) => r.resolution).filter((r) => !!r)),
5981
+ function R(e, t) {
5982
+ let r = e.axes?.resolution ?? [
5983
+ ...new Set(e.variants.map((i) => i.resolution).filter((i) => !!i)),
5036
5984
  ];
5037
5985
  return {
5038
5986
  name: 'resolution',
5039
5987
  type: 'select',
5040
- default: se(e).resolution ?? i[0],
5041
- options: i,
5988
+ default: le(e).resolution ?? r[0],
5989
+ options: r,
5042
5990
  ...(t ? { description: t } : {}),
5043
5991
  };
5044
5992
  }
5045
- function wt(e) {
5993
+ function Tt(e) {
5046
5994
  if (!e.endpoints?.length) return null;
5047
- let t = e.endpoints.filter((i) => rt(e.slug, i.id));
5995
+ let t = e.endpoints.filter((r) => lt(e.slug, r.id));
5048
5996
  return {
5049
5997
  name: 'endpoint',
5050
5998
  type: 'select',
5051
- default: _e(e),
5052
- options: e.endpoints.filter((i) => !t.includes(i)).map((i) => i.id),
5999
+ default: Me(e),
6000
+ options: e.endpoints.filter((r) => !t.includes(r)).map((r) => r.id),
5053
6001
  description:
5054
6002
  (e.slug === 'gemini-3.1-pro-preview'
5055
6003
  ? 'Where the request is served; a missing endpoint is the default, the lowest price, and an unknown one is refused.'
5056
6004
  : 'Where the request is served; a missing or unknown endpoint is the default, the lowest price.') +
5057
- (t.length ? ` ${t.map((i) => i.label).join(' and ')}: coming soon.` : ''),
6005
+ (t.length ? ` ${t.map((r) => r.label).join(' and ')}: coming soon.` : ''),
5058
6006
  };
5059
6007
  }
5060
- function Mi(e, t) {
5061
- if (e.unfiltered == null || t.some((r) => r.name === 'creative_mode')) return t;
5062
- let i = J.includes(e.api.model);
5063
- return [...t.filter((r) => !Ee.has(r.name)), i ? kt : Pi];
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];
5064
6012
  }
5065
- function Se(e, t) {
5066
- let i = e.filter((n) => !Ee.has(n.name)),
5067
- r = [kt, Ti];
5068
- return (r.push(xt, vt), [...i, ...r]);
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]);
5069
6017
  }
5070
- function ft(e, t = {}) {
6018
+ function kt(e, t = {}) {
5071
6019
  return [
5072
6020
  ...e
5073
- .filter((i) => !Ki.has(i.name) && !Ee.has(i.name))
5074
- .map((i) =>
5075
- i.name === 'prompt'
5076
- ? { ...i, required: !0 }
5077
- : i.name === 'resolution'
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'
5078
6026
  ? {
5079
- ...i,
5080
- ...(t.no4k && i.options
5081
- ? { options: i.options.filter((r) => String(r).toLowerCase() !== '4k') }
6027
+ ...r,
6028
+ ...(t.no4k && r.options
6029
+ ? { options: r.options.filter((i) => String(i).toLowerCase() !== '4k') }
5082
6030
  : {}),
5083
- description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${pe}`,
6031
+ description: `Output resolution. TEIN LITE is the lower-priced endpoint for getting started. Stability and reliability are not guaranteed. ${ce}`,
5084
6032
  }
5085
- : i,
6033
+ : r,
5086
6034
  ),
5087
6035
  {
5088
6036
  name: 'bitrate_mode',
@@ -5091,13 +6039,13 @@ function ft(e, t = {}) {
5091
6039
  options: ['standard'],
5092
6040
  description: 'LITE uses standard bitrate. High bitrate is on the standard endpoint.',
5093
6041
  },
5094
- xt,
5095
- vt,
6042
+ _t,
6043
+ Mt,
5096
6044
  ];
5097
6045
  }
5098
- function $e(e, t) {
6046
+ function Ee(e, t) {
5099
6047
  return [
5100
- $('Text prompt describing the video.'),
6048
+ q('Text prompt describing the video.'),
5101
6049
  { name: 'mode', type: 'select', required: !0, default: t.modes[0], options: t.modes },
5102
6050
  {
5103
6051
  name: 'duration',
@@ -5107,27 +6055,27 @@ function $e(e, t) {
5107
6055
  max: t.maxSec,
5108
6056
  description: `Video length in seconds (${t.minSec} to ${t.maxSec}).`,
5109
6057
  },
5110
- N(e),
6058
+ R(e),
5111
6059
  { name: 'aspect_ratio', type: 'select', default: t.aspects[0], options: t.aspects },
5112
- ...t.references.map((i) =>
5113
- i.endsWith('s')
6060
+ ...t.references.map((r) =>
6061
+ r.endsWith('s')
5114
6062
  ? {
5115
- name: i,
6063
+ name: r,
5116
6064
  type: 'string[]',
5117
- description: `${i} 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.`,
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.`,
5118
6066
  }
5119
6067
  : {
5120
- name: i,
6068
+ name: r,
5121
6069
  type: 'string',
5122
- description: `${i} 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.`,
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.`,
5123
6071
  },
5124
6072
  ),
5125
6073
  ];
5126
6074
  }
5127
- function Si(e) {
5128
- let t = wt(e);
6075
+ function Or(e) {
6076
+ let t = Tt(e);
5129
6077
  return [
5130
- $('Image prompt text. Supports complex composition and text instructions.'),
6078
+ q('Image prompt text. Supports complex composition and text instructions.'),
5131
6079
  ...(t ? [t] : []),
5132
6080
  {
5133
6081
  name: 'quality',
@@ -5135,17 +6083,17 @@ function Si(e) {
5135
6083
  default: 'low',
5136
6084
  options: e.axes?.quality ?? ['low', 'medium', 'high'],
5137
6085
  },
5138
- N(
6086
+ R(
5139
6087
  e,
5140
6088
  e.slug === 'gpt-image-2'
5141
- ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${Ye}`
6089
+ ? `1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count. ${Ze}`
5142
6090
  : '1:1 is 1024, 2048 or 2880 px; other ratios keep about the same pixel count.',
5143
6091
  ),
5144
6092
  {
5145
6093
  name: 'aspect_ratio',
5146
6094
  type: 'select',
5147
6095
  default: 'auto',
5148
- options: [...We],
6096
+ options: [...Xe],
5149
6097
  description:
5150
6098
  "The frame. auto: an edit keeps its first input image's ratio (the nearest listed one), text to image is 1:1. The image is delivered at exactly the size for the ratio and resolution.",
5151
6099
  },
@@ -5192,16 +6140,16 @@ function Si(e) {
5192
6140
  },
5193
6141
  ];
5194
6142
  }
5195
- function $i(e) {
6143
+ function Rr(e) {
5196
6144
  return [
5197
- $('Image prompt text.'),
6145
+ q('Image prompt text.'),
5198
6146
  {
5199
6147
  name: 'input_images',
5200
6148
  type: 'string[]',
5201
6149
  description: 'Images to edit or use as reference (up to 14).',
5202
6150
  },
5203
- { name: 'aspect_ratio', type: 'select', default: '1:1', options: [...nt(e.slug)] },
5204
- N(e),
6151
+ { name: 'aspect_ratio', type: 'select', default: '1:1', options: [...dt(e.slug)] },
6152
+ R(e),
5205
6153
  {
5206
6154
  name: 'n',
5207
6155
  type: 'slider',
@@ -5226,22 +6174,22 @@ function $i(e) {
5226
6174
  },
5227
6175
  ];
5228
6176
  }
5229
- function Ai() {
5230
- let e = ot,
6177
+ function Nr() {
6178
+ let e = ut,
5231
6179
  t = [];
5232
- for (let i of qe(!0))
5233
- e.includes(i.name) &&
6180
+ for (let r of Re(!0))
6181
+ e.includes(r.name) &&
5234
6182
  (t.push({
5235
- ...i,
5236
- ...(i.name === 'max_tokens' ? { min: 64 } : {}),
5237
- ...(i.name === 'messages'
6183
+ ...r,
6184
+ ...(r.name === 'max_tokens' ? { min: 64 } : {}),
6185
+ ...(r.name === 'messages'
5238
6186
  ? {
5239
6187
  description:
5240
6188
  'Chat history: system, developer, user (text and image_url parts) and assistant turns; no tool turns.',
5241
6189
  }
5242
6190
  : {}),
5243
6191
  }),
5244
- i.name === 'top_p' &&
6192
+ r.name === 'top_p' &&
5245
6193
  t.push({
5246
6194
  name: 'top_k',
5247
6195
  type: 'number',
@@ -5251,14 +6199,14 @@ function Ai() {
5251
6199
  }));
5252
6200
  return t;
5253
6201
  }
5254
- function Ri() {
5255
- return qe(!0).map((e) =>
6202
+ function Ur() {
6203
+ return Re(!0).map((e) =>
5256
6204
  e.name === 'max_tokens' || e.name === 'max_completion_tokens' ? { ...e, min: 128 } : e,
5257
6205
  );
5258
6206
  }
5259
- function qe(e) {
6207
+ function Re(e) {
5260
6208
  return [
5261
- $('The user message or task.'),
6209
+ q('The user message or task.'),
5262
6210
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
5263
6211
  {
5264
6212
  name: 'messages',
@@ -5351,44 +6299,67 @@ function qe(e) {
5351
6299
  },
5352
6300
  ];
5353
6301
  }
5354
- function Oi(e) {
5355
- if (e.slug === 'seed-2-1-turbo') return Ei;
5356
- let t = wt(e);
6302
+ function Br(e) {
6303
+ if (e.slug === 'seed-2-1-turbo') return Lr;
6304
+ let t = Tt(e);
5357
6305
  return [
5358
6306
  ...(e.slug === 'gemini-3.1-pro-preview'
5359
- ? Ai()
6307
+ ? Nr()
5360
6308
  : e.slug === 'gemini-3.7-flash'
5361
- ? Ri()
5362
- : e.slug === 'gpt-6-astra' || qi.includes(e.slug)
5363
- ? qe(e.slug !== 'gpt-6-astra')
5364
- : Ci),
6309
+ ? Ur()
6310
+ : e.slug === 'gpt-6-astra' || Vr.includes(e.slug)
6311
+ ? Re(e.slug !== 'gpt-6-astra')
6312
+ : Dr),
5365
6313
  ...(t ? [t] : []),
5366
6314
  ];
5367
6315
  }
5368
- function Di(e) {
6316
+ function Fr(e) {
6317
+ return [
6318
+ {
6319
+ name: 'video_url',
6320
+ type: 'string',
6321
+ required: !0,
6322
+ description:
6323
+ 'The video to upscale (up to 30 seconds): a Tein upload link, or any public https link.',
6324
+ },
6325
+ R(
6326
+ e,
6327
+ 'Size of the result: 1080p, 2k or 4k. A video already near a size cannot be upscaled to it.',
6328
+ ),
6329
+ {
6330
+ name: 'grain',
6331
+ type: 'select',
6332
+ default: 'off',
6333
+ options: ['off', 'light', 'medium', 'heavy'],
6334
+ description: 'Film grain added to the result.',
6335
+ },
6336
+ ];
6337
+ }
6338
+ function jr(e) {
5369
6339
  let t = e.slug;
5370
- if (e.kind === 'llm') return Oi(e);
5371
- if (e.editVariants?.length) return Si(e);
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);
5372
6343
  switch (t) {
5373
6344
  case 'seedance-2-5':
5374
- return Se(gt, t);
6345
+ return Ce(wt, t);
5375
6346
  case 'seedance-2-5-lite':
5376
- return ft(gt, { no4k: !0 });
6347
+ return kt(wt, { no4k: !0 });
5377
6348
  case 'seedance-2':
5378
- return Se(ht, t);
6349
+ return Ce(xt, t);
5379
6350
  case 'seedance-2-lite':
5380
- return ft(ht);
6351
+ return kt(xt);
5381
6352
  case 'seedance-2-mini':
5382
- return Se(Li, t);
6353
+ return Ce(Gr, t);
5383
6354
  case 'nano-banana-2':
5384
6355
  case 'nano-banana-2.1':
5385
6356
  case 'nano-banana-pro':
5386
- return $i(e);
6357
+ return Rr(e);
5387
6358
  case 'seedream-5-pro':
5388
6359
  return [
5389
- $('Detailed description of the image to generate.'),
6360
+ q('Detailed description of the image to generate.'),
5390
6361
  { name: 'images', type: 'string[]', description: 'Reference images (the first is free).' },
5391
- N(e),
6362
+ R(e),
5392
6363
  {
5393
6364
  name: 'aspect_ratio',
5394
6365
  type: 'select',
@@ -5400,13 +6371,13 @@ function Di(e) {
5400
6371
  case 'qwen-3':
5401
6372
  case 'qwen-3-pro':
5402
6373
  return [
5403
- $('Image prompt text; dense layouts and multilingual text work well.'),
6374
+ q('Image prompt text; dense layouts and multilingual text work well.'),
5404
6375
  {
5405
6376
  name: 'images',
5406
6377
  type: 'string[]',
5407
6378
  description: 'Up to 3 reference images, each billed at the published add-on price.',
5408
6379
  },
5409
- N(e),
6380
+ R(e),
5410
6381
  {
5411
6382
  name: 'aspect_ratio',
5412
6383
  type: 'select',
@@ -5424,8 +6395,8 @@ function Di(e) {
5424
6395
  ];
5425
6396
  case 'z-image-pro':
5426
6397
  return [
5427
- $('Image prompt text: subject, scene, style, composition and lighting.'),
5428
- N(e, 'Long edge: 1K is 1024 px, 2K is 2048 px. Same price.'),
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.'),
5429
6400
  {
5430
6401
  name: 'aspect_ratio',
5431
6402
  type: 'select',
@@ -5478,7 +6449,7 @@ function Di(e) {
5478
6449
  ];
5479
6450
  case 'wan-3-0':
5480
6451
  case 'wan-3-0-prime':
5481
- return $e(e, {
6452
+ return Ee(e, {
5482
6453
  modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
5483
6454
  aspects: ['16:9', '9:16', '4:3', '3:4', '1:1', 'adaptive'],
5484
6455
  minSec: 2,
@@ -5488,7 +6459,7 @@ function Di(e) {
5488
6459
  });
5489
6460
  case 'happy-horse-1-1':
5490
6461
  case 'happy-horse-1-0':
5491
- return $e(e, {
6462
+ return Ee(e, {
5492
6463
  modes:
5493
6464
  t === 'happy-horse-1-0'
5494
6465
  ? ['text-to-video', 'single-image', 'multi-reference', 'video-editing']
@@ -5499,7 +6470,7 @@ function Di(e) {
5499
6470
  references: t === 'happy-horse-1-0' ? ['images', 'videos'] : ['images'],
5500
6471
  });
5501
6472
  case 'minimax-h3':
5502
- return $e(e, {
6473
+ return Ee(e, {
5503
6474
  modes: ['text_to_video', 'first_n_last_frames', 'multi_reference'],
5504
6475
  aspects: ['16:9', '21:9', '4:3', '1:1', '3:4', '9:16', 'adaptive'],
5505
6476
  minSec: 4,
@@ -5507,158 +6478,159 @@ function Di(e) {
5507
6478
  references: ['images', 'videos', 'audios', 'first_frame_image', 'last_frame_image'],
5508
6479
  });
5509
6480
  default:
5510
- return [$('Prompt text.')];
6481
+ return [q('Prompt text.')];
5511
6482
  }
5512
6483
  }
5513
- function Ce(e, t = e.api.model) {
6484
+ function Ae(e, t = e.api.model) {
5514
6485
  return {
5515
6486
  slug: t,
5516
6487
  name: e.name,
5517
- category: ki[e.kind],
5518
- kind: vi[e.kind],
6488
+ category: _r[e.kind],
6489
+ kind: Kr[e.kind],
5519
6490
  vendor: e.vendor ?? '',
5520
6491
  description: e.desc ?? e.name,
5521
- priceFormatted: Ii(e),
6492
+ priceFormatted: Sr(e),
5522
6493
  unit: e.unit,
5523
- primaryToolName: xi[e.kind],
5524
- parameters: Mi(e, Di(e)),
6494
+ primaryToolName: Mr[e.kind],
6495
+ parameters: Er(e, jr(e)),
5525
6496
  };
5526
6497
  }
5527
- function Vi() {
6498
+ function zr() {
5528
6499
  let e = {};
5529
- for (let t of ne())
6500
+ for (let t of oe())
5530
6501
  if (t.slug !== 'seedance-2-fast') {
5531
6502
  if (t.slug === 'seedance-2-mini') {
5532
- e['seedance-2-mini'] = Ce(t, 'seedance-2-mini');
6503
+ e['seedance-2-mini'] = Ae(t, 'seedance-2-mini');
5533
6504
  continue;
5534
6505
  }
5535
6506
  if (t.slug === 'seedance-2') {
5536
- let i = Ce(t);
5537
- ((i.description = `${t.desc ?? t.name} Send quality fast or mini for Seedance 2.0 Fast or Mini.`),
5538
- (e['seedance-2'] = i));
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));
5539
6510
  continue;
5540
6511
  }
5541
- t.slug.startsWith('claude-') || (e[t.api.model] = Ce(t));
6512
+ t.slug.startsWith('claude-') || (e[t.api.model] = Ae(t));
5542
6513
  }
5543
- Object.assign(e, ut());
5544
- for (let [t, i] of Object.entries(oe))
5545
- e[i] && Object.defineProperty(e, t, { value: e[i], enumerable: !1 });
6514
+ Object.assign(e, yt());
6515
+ for (let [t, r] of Object.entries(pe))
6516
+ e[r] && Object.defineProperty(e, t, { value: e[r], enumerable: !1 });
5546
6517
  return e;
5547
6518
  }
5548
6519
  function U(e) {
5549
- return de[e] ?? null;
6520
+ return ue[e] ?? null;
5550
6521
  }
5551
- function Ni(e, t, i) {
6522
+ function Jr(e, t, r) {
5552
6523
  if ((e === 'seedance-2-5' || e === 'seedance-2-5-lite') && t === 'duration') {
5553
- let r = (n) => (typeof n == 'string' ? n.trim().toLowerCase() : '');
5554
- if (r(i.mode) === 'edit' || r(i.omni_reference_task_type) === 'edit') return !1;
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;
5555
6526
  }
5556
6527
  return !(
5557
- (t === 'max_tokens' && yt(i.max_completion_tokens)) ||
5558
- (t === 'max_completion_tokens' && yt(i.max_tokens))
6528
+ (t === 'max_tokens' && It(r.max_completion_tokens)) ||
6529
+ (t === 'max_completion_tokens' && It(r.max_tokens))
5559
6530
  );
5560
6531
  }
5561
- function yt(e) {
6532
+ function It(e) {
5562
6533
  return e != null && e !== '';
5563
6534
  }
5564
- function Pt(e, t) {
5565
- let i = { ...t };
6535
+ function qt(e, t) {
6536
+ let r = { ...t };
5566
6537
  if (e?.slug === 'seedance-2-5') {
5567
- let r = (n) => typeof n != 'string' || !n.trim();
5568
- for (let n of Ui) (r(i.finalize) && !r(i[n]) && (i.finalize = i[n]), delete i[n]);
5569
- if (!r(i.finalize)) return i;
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;
5570
6541
  }
5571
- for (let r of e?.parameters ?? [])
5572
- r.default !== void 0 &&
5573
- i[r.name] === void 0 &&
5574
- Ni(e.slug, r.name, t) &&
5575
- (i[r.name] = r.default);
5576
- return i;
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;
5577
6548
  }
5578
- function q() {
5579
- return Object.values(de);
6549
+ function E() {
6550
+ return Object.values(ue);
5580
6551
  }
5581
- var ki,
5582
- xi,
5583
- vi,
5584
- $,
5585
- kt,
5586
- Pi,
5587
- Ti,
5588
- xt,
6552
+ var _r,
6553
+ Mr,
6554
+ Kr,
6555
+ q,
5589
6556
  vt,
5590
- Ee,
5591
- Ki,
5592
- Ci,
5593
- Ei,
5594
- qi,
5595
- pe,
5596
- gt,
5597
- It,
6557
+ $r,
6558
+ Cr,
5598
6559
  _t,
5599
- ht,
5600
- Li,
5601
- de,
5602
- Ui,
6560
+ Mt,
6561
+ Oe,
6562
+ Ar,
6563
+ Dr,
6564
+ Lr,
6565
+ Vr,
6566
+ ce,
6567
+ wt,
6568
+ Kt,
6569
+ St,
6570
+ xt,
6571
+ Gr,
6572
+ ue,
6573
+ Hr,
5603
6574
  H = b(() => {
5604
6575
  'use strict';
5605
- Qe();
5606
- be();
5607
- V();
5608
- Pe();
5609
- Te();
5610
- at();
5611
- st();
5612
- lt();
5613
- mt();
6576
+ et();
6577
+ we();
6578
+ N();
5614
6579
  Ke();
5615
- ((ki = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
5616
- (xi = {
6580
+ xe();
6581
+ Se();
6582
+ pt();
6583
+ ct();
6584
+ mt();
6585
+ bt();
6586
+ $e();
6587
+ ((_r = { video: 'Video', image: 'Image', audio: 'Audio', llm: 'Text' }),
6588
+ (Mr = {
5617
6589
  video: 'generate_video',
5618
6590
  image: 'generate_image',
5619
6591
  audio: 'generate_audio',
5620
6592
  llm: 'run_task',
5621
6593
  }),
5622
- (vi = {
6594
+ (Kr = {
5623
6595
  video: 'Text-to-Video',
5624
6596
  image: 'Text-to-Image',
5625
6597
  audio: 'Text-to-Audio',
5626
6598
  llm: 'Reasoning (LLM)',
5627
6599
  }));
5628
- $ = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
5629
- ((kt = {
6600
+ q = (e) => ({ name: 'prompt', type: 'string', required: !0, description: e });
6601
+ ((vt = {
5630
6602
  name: 'creative_mode',
5631
6603
  type: 'boolean',
5632
6604
  default: !1,
5633
6605
  description:
5634
6606
  'Runs the Creative mode checkpoint at its published price (+5%). The Acceptable Use Policy applies.',
5635
6607
  }),
5636
- (Pi = {
6608
+ ($r = {
5637
6609
  name: 'creative_mode',
5638
6610
  type: 'boolean',
5639
6611
  default: !1,
5640
- description: `Not available yet on this model: ${le}.`,
6612
+ description: `Not available yet on this model: ${de}.`,
5641
6613
  }),
5642
- (Ti = {
6614
+ (Cr = {
5643
6615
  name: 'priority',
5644
6616
  type: 'boolean',
5645
6617
  default: !1,
5646
6618
  description: 'Guaranteed speed and no queue, at the published Priority price (+6%).',
5647
6619
  }),
5648
- (xt = {
6620
+ (_t = {
5649
6621
  name: 'reference_roles',
5650
6622
  type: 'json',
5651
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).`,
5652
6624
  }),
5653
- (vt = {
6625
+ (Mt = {
5654
6626
  name: 'auto_fit_images',
5655
6627
  type: 'boolean',
5656
6628
  default: !1,
5657
6629
  description:
5658
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.',
5659
6631
  }),
5660
- (Ee = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
5661
- Ki = new Set([
6632
+ (Oe = new Set(['full_access', 'is_uncensored', 'unfiltered', 'verificationSignature'])));
6633
+ Ar = new Set([
5662
6634
  'quality',
5663
6635
  'bitrate_mode',
5664
6636
  'draft',
@@ -5667,8 +6639,8 @@ var ki,
5667
6639
  'draft_generation_id',
5668
6640
  'pass_faces',
5669
6641
  ]);
5670
- ((Ci = [
5671
- $('The user message or task.'),
6642
+ ((Dr = [
6643
+ q('The user message or task.'),
5672
6644
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
5673
6645
  {
5674
6646
  name: 'messages',
@@ -5685,8 +6657,8 @@ var ki,
5685
6657
  { name: 'temperature', type: 'slider', min: 0, max: 1, step: 0.1 },
5686
6658
  { name: 'top_p', type: 'slider', min: 0, max: 1, step: 0.05 },
5687
6659
  ]),
5688
- (Ei = [
5689
- $('The user message or task.'),
6660
+ (Lr = [
6661
+ q('The user message or task.'),
5690
6662
  { name: 'system', type: 'string', description: 'Optional system instructions.' },
5691
6663
  {
5692
6664
  name: 'messages',
@@ -5767,9 +6739,9 @@ var ki,
5767
6739
  description: 'Video frames read a second.',
5768
6740
  },
5769
6741
  ]),
5770
- (qi = ['gemini-3.8-flash', 'gemini-3.7-flash']));
5771
- ((pe = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
5772
- (gt = [
6742
+ (Vr = ['gemini-3.8-flash', 'gemini-3.7-flash']));
6743
+ ((ce = 'Left out: 480p, the same default as the API, the playground and workflow steps.'),
6744
+ (wt = [
5773
6745
  {
5774
6746
  name: 'prompt',
5775
6747
  type: 'string',
@@ -5807,7 +6779,7 @@ var ki,
5807
6779
  type: 'select',
5808
6780
  default: '480p',
5809
6781
  options: ['480p', '720p', '1080p', '4k'],
5810
- description: `Output resolution. 480p and 720p are 8-bit. 1080p and 4k are 10-bit H.265/HEVC. 4k is 3840x2160 at 16:9, works with Creative mode, and runs on one dedicated endpoint with no fallback, so it can be busy. ${pe}`,
6782
+ description: `Output resolution. 480p and 720p are 8-bit. 1080p and 4k are 10-bit H.265/HEVC. 4k is 3840x2160 at 16:9, works with Creative mode, and runs on one dedicated endpoint with no fallback, so it can be busy. ${ce}`,
5811
6783
  },
5812
6784
  {
5813
6785
  name: 'aspect_ratio',
@@ -5918,19 +6890,19 @@ var ki,
5918
6890
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
5919
6891
  },
5920
6892
  ]),
5921
- (It = {
6893
+ (Kt = {
5922
6894
  name: 'images',
5923
6895
  type: 'string[]',
5924
6896
  description:
5925
6897
  'Reference images as public http(s) URLs or data URIs (up to 9). The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.',
5926
6898
  }),
5927
- (_t = {
6899
+ (St = {
5928
6900
  name: 'audios',
5929
6901
  type: 'string[]',
5930
6902
  description:
5931
6903
  'Reference audio as public http(s) URLs or data URIs (up to 3; each 2 to 15s, combined 15s or less). Needs at least one photo in images. A first or last frame sent with it is used only as a reference image, with mode multi_reference. The Tein CLI and local MCP client read a file path on your machine and upload it before the request is sent.',
5932
6904
  }),
5933
- (ht = [
6905
+ (xt = [
5934
6906
  {
5935
6907
  name: 'prompt',
5936
6908
  type: 'string',
@@ -5974,7 +6946,7 @@ var ki,
5974
6946
  type: 'select',
5975
6947
  default: '480p',
5976
6948
  options: ['480p', '720p', '1080p', '4k'],
5977
- description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${pe}`,
6949
+ description: `Standard: 480p, 720p, 1080p (8-bit) and 4k (10-bit H.265). Fast and Mini: 480p and 720p only. ${ce}`,
5978
6950
  },
5979
6951
  {
5980
6952
  name: 'bitrate_mode',
@@ -6008,8 +6980,8 @@ var ki,
6008
6980
  description:
6009
6981
  'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
6010
6982
  },
6011
- It,
6012
- _t,
6983
+ Kt,
6984
+ St,
6013
6985
  {
6014
6986
  name: 'first_frame_image',
6015
6987
  type: 'string',
@@ -6030,7 +7002,7 @@ var ki,
6030
7002
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
6031
7003
  },
6032
7004
  ]),
6033
- (Li = [
7005
+ (Gr = [
6034
7006
  {
6035
7007
  name: 'prompt',
6036
7008
  type: 'string',
@@ -6051,7 +7023,7 @@ var ki,
6051
7023
  type: 'select',
6052
7024
  default: '480p',
6053
7025
  options: ['480p', '720p'],
6054
- description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${pe}`,
7026
+ description: `480p and 720p, both 8-bit. Mini does not serve 1080p or 4k. ${ce}`,
6055
7027
  },
6056
7028
  {
6057
7029
  name: 'bitrate_mode',
@@ -6085,8 +7057,8 @@ var ki,
6085
7057
  description:
6086
7058
  'Also returns the last frame as a JPEG, the same size as the video and without a watermark.',
6087
7059
  },
6088
- It,
6089
- _t,
7060
+ Kt,
7061
+ St,
6090
7062
  {
6091
7063
  name: 'first_frame_image',
6092
7064
  type: 'string',
@@ -6101,53 +7073,53 @@ var ki,
6101
7073
  'Keeps real faces in reference images. On by default. Send false to turn it off.',
6102
7074
  },
6103
7075
  ]));
6104
- de = Vi();
6105
- Ui = ['draft_task_id', 'draft_generation_id'];
7076
+ ue = zr();
7077
+ Hr = ['draft_task_id', 'draft_generation_id'];
6106
7078
  });
6107
- function ce(e) {
7079
+ function me(e) {
6108
7080
  let t = '/v1/pricing/models',
6109
- i = e?.trim();
6110
- return i ? `${t}?model=${encodeURIComponent(i)}` : t;
7081
+ r = e?.trim();
7082
+ return r ? `${t}?model=${encodeURIComponent(r)}` : t;
6111
7083
  }
6112
- var Re = b(() => {
7084
+ var Le = b(() => {
6113
7085
  'use strict';
6114
7086
  });
6115
- function Ot(e) {
7087
+ function Ut(e) {
6116
7088
  return e.length <= 1 ? (e[0] ?? '') : `${e.slice(0, -1).join(', ')} and ${e[e.length - 1]}`;
6117
7089
  }
6118
- function Dt(e) {
6119
- let t = ne().filter((s) => s.kind === e && s.unfiltered != null),
6120
- i = t.filter((s) => J.includes(s.api.model)).map((s) => s.name),
6121
- r = t.filter((s) => !J.includes(s.api.model)).map((s) => s.name);
7090
+ function Bt(e) {
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);
6122
7094
  return [
6123
- ...(i.length
6124
- ? [`${Ot(i)}: runs the Creative mode checkpoint at its published price (+5%).`]
7095
+ ...(r.length
7096
+ ? [`${Ut(r)}: runs the Creative mode checkpoint at its published price (+5%).`]
6125
7097
  : []),
6126
- ...(r.length ? [`Not available yet on ${Ot(r)}: ${le}.`] : []),
7098
+ ...(i.length ? [`Not available yet on ${Ut(i)}: ${de}.`] : []),
6127
7099
  'The Acceptable Use Policy applies.',
6128
7100
  ].join(' ');
6129
7101
  }
6130
- function dr(e) {
6131
- if (lr.has(e.name)) return e;
7102
+ function yi(e) {
7103
+ if (gi.has(e.name)) return e;
6132
7104
  let t = e.inputSchema.properties;
6133
7105
  return !t || t.callback_url
6134
7106
  ? e
6135
- : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: or } } };
7107
+ : { ...e, inputSchema: { ...e.inputSchema, properties: { ...t, callback_url: fi } } };
6136
7108
  }
6137
- function cr(e) {
7109
+ function bi(e) {
6138
7110
  let t = e.inputSchema.properties;
6139
7111
  if (!t) return e;
6140
- let i = !1,
6141
- r = {};
6142
- for (let [n, s] of Object.entries(t))
6143
- Lt.has(n) && s.type === 'string' && !s.format
6144
- ? ((r[n] = { ...s, format: 'uri' }), (i = !0))
6145
- : Lt.has(n) && s.type === 'array' && s.items?.type === 'string' && !s.items.format
6146
- ? ((r[n] = { ...s, items: { ...s.items, format: 'uri' } }), (i = !0))
6147
- : (r[n] = s);
6148
- return i ? { ...e, inputSchema: { ...e.inputSchema, properties: r } } : e;
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;
6149
7121
  }
6150
- function ur(e) {
7122
+ function ki(e) {
6151
7123
  switch (e.type) {
6152
7124
  case 'string':
6153
7125
  return {
@@ -6202,29 +7174,29 @@ function ur(e) {
6202
7174
  return { type: 'string', description: e.description };
6203
7175
  }
6204
7176
  }
6205
- function mr(e, t) {
6206
- let i = t || e.slug.replace(/[^a-zA-Z0-9_-]/g, '_'),
6207
- r = {},
6208
- n = [];
6209
- for (let o of e.parameters) ((r[o.name] = ur(o)), o.required && n.push(o.name));
6210
- let s = {
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 = {
6211
7183
  type: 'object',
6212
- properties: r,
6213
- ...(n.length > 0 ? { required: n } : {}),
7184
+ properties: i,
7185
+ ...(s.length > 0 ? { required: s } : {}),
6214
7186
  additionalProperties: !0,
6215
7187
  };
6216
7188
  return {
6217
- name: i,
7189
+ name: r,
6218
7190
  description: `[Tein AI - ${e.name} (${e.category})] ${e.description} (Pricing: ${e.priceFormatted})`,
6219
- inputSchema: s,
7191
+ inputSchema: n,
6220
7192
  };
6221
7193
  }
6222
- function fr() {
6223
- let e = q().filter((d) => d.category === 'Image'),
6224
- t = q().filter((d) => d.category === 'Video'),
6225
- i = q().filter((d) => d.category === 'Text'),
6226
- r = q().filter((d) => d.category === 'Audio'),
6227
- n = {
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 = {
6228
7200
  name: 'generate_image',
6229
7201
  description:
6230
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.',
@@ -6315,13 +7287,13 @@ function fr() {
6315
7287
  maximum: 2147483647,
6316
7288
  description: 'Nano Banana 2 and Nano Banana Pro. Omit it for a new image each time.',
6317
7289
  },
6318
- creative_mode: { type: 'boolean', default: !1, description: Dt('image') },
7290
+ creative_mode: { type: 'boolean', default: !1, description: Bt('image') },
6319
7291
  },
6320
7292
  required: ['prompt'],
6321
7293
  additionalProperties: !0,
6322
7294
  },
6323
7295
  },
6324
- s = {
7296
+ n = {
6325
7297
  name: 'generate_video',
6326
7298
  description:
6327
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.',
@@ -6352,7 +7324,7 @@ function fr() {
6352
7324
  default: '480p',
6353
7325
  description: 'Video resolution (the lowest price is the default; see each model tool).',
6354
7326
  },
6355
- creative_mode: { type: 'boolean', default: !1, description: Dt('video') },
7327
+ creative_mode: { type: 'boolean', default: !1, description: Bt('video') },
6356
7328
  priority: {
6357
7329
  type: 'boolean',
6358
7330
  default: !1,
@@ -6420,7 +7392,7 @@ function fr() {
6420
7392
  prompt: { type: 'string', description: 'The reasoning task or query to execute.' },
6421
7393
  model: {
6422
7394
  type: 'string',
6423
- enum: i.map((d) => d.slug),
7395
+ enum: r.map((d) => d.slug),
6424
7396
  default: 'gpt-6-astra',
6425
7397
  description: 'The reasoning model to use (default: gpt-6-astra).',
6426
7398
  },
@@ -6474,10 +7446,10 @@ function fr() {
6474
7446
  additionalProperties: !0,
6475
7447
  },
6476
7448
  },
6477
- p = gr();
6478
- return [n, s, o, u, l, p, c, pr];
7449
+ p = Ii();
7450
+ return [s, n, o, u, l, p, c, hi];
6479
7451
  }
6480
- function gr() {
7452
+ function Ii() {
6481
7453
  return {
6482
7454
  name: 'upload_asset',
6483
7455
  description:
@@ -6524,26 +7496,26 @@ function gr() {
6524
7496
  },
6525
7497
  };
6526
7498
  }
6527
- function Ue() {
6528
- let e = fr(),
6529
- t = q().map((i) => mr(i));
6530
- return [...e, ...t].map(dr).map(cr);
7499
+ function je() {
7500
+ let e = xi(),
7501
+ t = E().map((r) => wi(r));
7502
+ return [...e, ...t].map(yi).map(bi);
6531
7503
  }
6532
- var or,
6533
- lr,
6534
- pr,
6535
- Lt,
6536
- Vt = b(() => {
7504
+ var fi,
7505
+ gi,
7506
+ hi,
7507
+ Ft,
7508
+ jt = b(() => {
6537
7509
  'use strict';
6538
- V();
6539
- Ke();
7510
+ N();
7511
+ $e();
6540
7512
  H();
6541
- ((or = {
7513
+ ((fi = {
6542
7514
  type: 'string',
6543
7515
  description:
6544
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.',
6545
7517
  }),
6546
- (lr = new Set([
7518
+ (gi = new Set([
6547
7519
  'upload_asset',
6548
7520
  'upload_media',
6549
7521
  'upload_image',
@@ -6551,7 +7523,7 @@ var or,
6551
7523
  'check_status',
6552
7524
  'get_pricing',
6553
7525
  ])),
6554
- (pr = {
7526
+ (hi = {
6555
7527
  name: 'get_pricing',
6556
7528
  description:
6557
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.',
@@ -6566,7 +7538,7 @@ var or,
6566
7538
  additionalProperties: !1,
6567
7539
  },
6568
7540
  }));
6569
- Lt = new Set([
7541
+ Ft = new Set([
6570
7542
  'image',
6571
7543
  'images',
6572
7544
  'image_url',
@@ -6583,31 +7555,31 @@ var or,
6583
7555
  'lipsyncing_audio',
6584
7556
  ]);
6585
7557
  });
6586
- var Wt = {};
6587
- ri(Wt, {
6588
- forgetToolSchemas: () => kr,
6589
- jsonRpcAnswer: () => Bt,
6590
- preprocessLocalFiles: () => zt,
6591
- startStdioServer: () => Ht,
7558
+ var er = {};
7559
+ lr(er, {
7560
+ forgetToolSchemas: () => Mi,
7561
+ jsonRpcAnswer: () => Ht,
7562
+ preprocessLocalFiles: () => Xt,
7563
+ startStdioServer: () => Zt,
6592
7564
  });
6593
- function hr(e) {
6594
- let t = (i) =>
6595
- !!i && typeof i == 'object' && i.jsonrpc === '2.0' && ('result' in i || 'error' in i);
7565
+ function Pi(e) {
7566
+ let t = (r) =>
7567
+ !!r && typeof r == 'object' && r.jsonrpc === '2.0' && ('result' in r || 'error' in r);
6596
7568
  return Array.isArray(e) ? e.length > 0 && e.every(t) : t(e);
6597
7569
  }
6598
- function Bt(e, t, i) {
6599
- let r = e?.id,
6600
- n = r == null,
6601
- s = null;
7570
+ function Ht(e, t, r) {
7571
+ let i = e?.id,
7572
+ s = i == null,
7573
+ n = null;
6602
7574
  try {
6603
- s = i ? JSON.parse(i) : null;
7575
+ n = r ? JSON.parse(r) : null;
6604
7576
  } catch {
6605
- s = null;
7577
+ n = null;
6606
7578
  }
6607
- if (s !== null && hr(s)) return n ? null : s;
6608
- if (n) return null;
6609
- if (!i && t >= 200 && t < 300) return;
6610
- let o = s?.error,
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,
6611
7583
  u =
6612
7584
  typeof o == 'string'
6613
7585
  ? o
@@ -6617,7 +7589,7 @@ function Bt(e, t, i) {
6617
7589
  l = o && typeof o == 'object' && typeof o.code == 'string' ? o.code : null;
6618
7590
  return {
6619
7591
  jsonrpc: '2.0',
6620
- id: r,
7592
+ id: i,
6621
7593
  error: {
6622
7594
  code: t === 401 ? -32001 : -32603,
6623
7595
  message: u,
@@ -6625,23 +7597,23 @@ function Bt(e, t, i) {
6625
7597
  },
6626
7598
  };
6627
7599
  }
6628
- function yr() {
7600
+ function Ti() {
6629
7601
  let e = process.argv.slice(2),
6630
7602
  t = e.indexOf('--api-key');
6631
7603
  return S(t >= 0 ? e[t + 1] : void 0);
6632
7604
  }
6633
- async function Ft(e, t, i) {
6634
- let r = j.default.resolve(e);
6635
- if (!R.default.existsSync(r) || !R.default.statSync(r).isFile())
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())
6636
7608
  throw new Error(`File not found: ${e}`);
6637
- let n = R.default.readFileSync(r),
6638
- s = n.toString('base64'),
6639
- o = n.length,
6640
- u = `${i.replace(/\/$/, '')}/v1/upload`,
7609
+ let s = O.default.readFileSync(i),
7610
+ n = s.toString('base64'),
7611
+ o = s.length,
7612
+ u = `${r.replace(/\/$/, '')}/v1/upload`,
6641
7613
  l = await fetch(u, {
6642
7614
  method: 'POST',
6643
7615
  headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${t}` },
6644
- body: JSON.stringify({ data: s }),
7616
+ body: JSON.stringify({ data: n }),
6645
7617
  });
6646
7618
  if (!l.ok) {
6647
7619
  let p = `Upload failed (HTTP ${l.status})`;
@@ -6659,15 +7631,15 @@ async function Ft(e, t, i) {
6659
7631
  mimeType: c.mime_type || c.mimeType || 'image/png',
6660
7632
  };
6661
7633
  }
6662
- function Gt(e) {
6663
- return br.has(j.default.extname(e).toLowerCase());
7634
+ function Yt(e) {
7635
+ return vi.has(B.default.extname(e).toLowerCase());
6664
7636
  }
6665
- function Jt(e) {
7637
+ function Qt(e) {
6666
7638
  return new Error(
6667
- `Tein uploads image, video and audio files only, and ${j.default.basename(e)} is not one.`,
7639
+ `Tein uploads image, video and audio files only, and ${B.default.basename(e)} is not one.`,
6668
7640
  );
6669
7641
  }
6670
- function wr(e) {
7642
+ function _i(e) {
6671
7643
  let t = e.trim();
6672
7644
  if (
6673
7645
  !t ||
@@ -6677,27 +7649,27 @@ function wr(e) {
6677
7649
  `)
6678
7650
  )
6679
7651
  return null;
6680
- let i = j.default.resolve(t);
6681
- return R.default.existsSync(i) && R.default.statSync(i).isFile() ? i : null;
7652
+ let r = B.default.resolve(t);
7653
+ return O.default.existsSync(r) && O.default.statSync(r).isFile() ? r : null;
6682
7654
  }
6683
- function Be(e) {
7655
+ function ze(e) {
6684
7656
  if (Array.isArray(e))
6685
7657
  for (let t of e) {
6686
- let i = t;
6687
- typeof i.name == 'string' &&
6688
- i.inputSchema &&
6689
- typeof i.inputSchema == 'object' &&
6690
- Q.set(i.name, i.inputSchema);
7658
+ let r = t;
7659
+ typeof r.name == 'string' &&
7660
+ r.inputSchema &&
7661
+ typeof r.inputSchema == 'object' &&
7662
+ Q.set(r.name, r.inputSchema);
6691
7663
  }
6692
7664
  }
6693
- function kr() {
6694
- (Q.clear(), (je = 0));
7665
+ function Mi() {
7666
+ (Q.clear(), (Ge = 0));
6695
7667
  }
6696
- async function xr(e, t) {
6697
- if (!(Date.now() - je < 6e4)) {
6698
- je = Date.now();
7668
+ async function Ki(e, t) {
7669
+ if (!(Date.now() - Ge < 6e4)) {
7670
+ Ge = Date.now();
6699
7671
  try {
6700
- let r = await (
7672
+ let i = await (
6701
7673
  await fetch(e, {
6702
7674
  method: 'POST',
6703
7675
  headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${t}` },
@@ -6705,39 +7677,39 @@ async function xr(e, t) {
6705
7677
  signal: AbortSignal.timeout(1e4),
6706
7678
  })
6707
7679
  ).json();
6708
- Be(r.result?.tools);
7680
+ ze(i.result?.tools);
6709
7681
  } catch {}
6710
7682
  }
6711
7683
  }
6712
- function vr(e) {
7684
+ function Si(e) {
6713
7685
  return e
6714
7686
  ? e.type === 'string'
6715
7687
  ? e.format === 'uri'
6716
7688
  : e.type === 'array' && e.items?.format === 'uri'
6717
7689
  : !1;
6718
7690
  }
6719
- async function Nt(e, t, i) {
7691
+ async function Gt(e, t, r) {
6720
7692
  if (typeof e != 'string') return e;
6721
- let r = wr(e);
6722
- if (!r) return e;
6723
- if (!Gt(r)) throw Jt(r);
6724
- return (await Ft(r, t, i)).url;
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;
6725
7697
  }
6726
- async function zt(e, t, i, r, n) {
6727
- (Q.size === 0 && Be(Ue()), Q.has(e) || (await xr(n, i)));
6728
- let s = Q.get(e)?.properties;
6729
- if (!s) return t;
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;
6730
7702
  let o = { ...t };
6731
7703
  for (let [u, l] of Object.entries(t))
6732
- if (vr(s[u]))
7704
+ if (Si(n[u]))
6733
7705
  if (Array.isArray(l)) {
6734
7706
  let c = [];
6735
- for (let p of l) c.push(await Nt(p, i, r));
7707
+ for (let p of l) c.push(await Gt(p, r, i));
6736
7708
  o[u] = c;
6737
- } else o[u] = await Nt(l, i, r);
7709
+ } else o[u] = await Gt(l, r, i);
6738
7710
  return o;
6739
7711
  }
6740
- function Ir(e) {
7712
+ function qi(e) {
6741
7713
  let t = e.id ?? null;
6742
7714
  switch (e.method) {
6743
7715
  case 'initialize':
@@ -6755,7 +7727,7 @@ function Ir(e) {
6755
7727
  case 'ping':
6756
7728
  return { jsonrpc: '2.0', id: t, result: {} };
6757
7729
  case 'tools/list':
6758
- return { jsonrpc: '2.0', id: t, result: { tools: Ue() } };
7730
+ return { jsonrpc: '2.0', id: t, result: { tools: je() } };
6759
7731
  case 'tools/call':
6760
7732
  return {
6761
7733
  jsonrpc: '2.0',
@@ -6778,25 +7750,25 @@ function Ir(e) {
6778
7750
  };
6779
7751
  }
6780
7752
  }
6781
- async function Ht() {
6782
- if (Ut) return;
6783
- Ut = !0;
6784
- let e = yr(),
7753
+ async function Zt() {
7754
+ if (zt) return;
7755
+ zt = !0;
7756
+ let e = Ti(),
6785
7757
  t = x(),
6786
- i = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
6787
- (jt.default
7758
+ r = process.env.TEIN_MCP_URL || 'https://mcp.tein.ai/mcp';
7759
+ (Jt.default
6788
7760
  .createInterface({ input: process.stdin, output: process.stdout, terminal: !1 })
6789
- .on('line', async (n) => {
6790
- let s = n.trim();
6791
- if (s)
7761
+ .on('line', async (s) => {
7762
+ let n = s.trim();
7763
+ if (n)
6792
7764
  try {
6793
- let o = JSON.parse(s);
7765
+ let o = JSON.parse(n);
6794
7766
  if (o && o.method === 'tools/call' && o.params) {
6795
7767
  let l = o.params.name,
6796
7768
  c = o.params.arguments || {};
6797
7769
  if (l === 'get_pricing') {
6798
7770
  let p = typeof c.model == 'string' ? c.model.trim() : '',
6799
- d = `${t.replace(/\/+$/, '')}${ce(p)}`;
7771
+ d = `${t.replace(/\/+$/, '')}${me(p)}`;
6800
7772
  try {
6801
7773
  let m = await fetch(d, { signal: AbortSignal.timeout(1e4) }),
6802
7774
  h = await m.text();
@@ -6843,19 +7815,19 @@ async function Ht() {
6843
7815
  !p.startsWith('data:')
6844
7816
  )
6845
7817
  try {
6846
- let d = j.default.resolve(p.trim());
6847
- if (R.default.existsSync(d) && R.default.statSync(d).isFile() && e) {
6848
- if (!Gt(d)) throw Jt(d);
6849
- let m = await Ft(d, e, t),
7818
+ let d = B.default.resolve(p.trim());
7819
+ if (O.default.existsSync(d) && O.default.statSync(d).isFile() && e) {
7820
+ if (!Yt(d)) throw Qt(d);
7821
+ let m = await Wt(d, e, t),
6850
7822
  h = (m.sizeBytes / 1024).toFixed(1),
6851
- ue =
7823
+ fe =
6852
7824
  m.mimeType.startsWith('image/') ||
6853
7825
  /\.(png|jpe?g|webp|gif|svg)$/i.test(m.url)
6854
7826
  ? `
6855
7827
 
6856
7828
  ![Uploaded Asset](${m.url})`
6857
7829
  : '',
6858
- me = {
7830
+ ge = {
6859
7831
  jsonrpc: '2.0',
6860
7832
  id: o.id,
6861
7833
  result: {
@@ -6866,7 +7838,7 @@ async function Ht() {
6866
7838
 
6867
7839
  - **URL:** ${m.url}
6868
7840
  - **Type:** \`${m.mimeType}\`
6869
- - **Size:** ${h} KB${ue}
7841
+ - **Size:** ${h} KB${fe}
6870
7842
 
6871
7843
  Pass this URL to any Tein generation tool.`,
6872
7844
  },
@@ -6875,7 +7847,7 @@ Pass this URL to any Tein generation tool.`,
6875
7847
  },
6876
7848
  };
6877
7849
  process.stdout.write(
6878
- JSON.stringify(me) +
7850
+ JSON.stringify(ge) +
6879
7851
  `
6880
7852
  `,
6881
7853
  );
@@ -6902,7 +7874,7 @@ Pass this URL to any Tein generation tool.`,
6902
7874
  }
6903
7875
  if (e)
6904
7876
  try {
6905
- o.params.arguments = await zt(String(l), c, e, t, i);
7877
+ o.params.arguments = await Xt(String(l), c, e, t, r);
6906
7878
  } catch (p) {
6907
7879
  let d = p instanceof Error ? p.message : String(p);
6908
7880
  process.stdout.write(
@@ -6927,16 +7899,16 @@ Pass this URL to any Tein generation tool.`,
6927
7899
  }
6928
7900
  if (e)
6929
7901
  try {
6930
- let l = await fetch(i, {
7902
+ let l = await fetch(r, {
6931
7903
  method: 'POST',
6932
7904
  headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${e}` },
6933
7905
  body: JSON.stringify(o),
6934
7906
  }),
6935
7907
  c = await l.text(),
6936
- p = Bt(o, l.status, c);
7908
+ p = Ht(o, l.status, c);
6937
7909
  if (p === null) return;
6938
7910
  if (p) {
6939
- (o?.method === 'tools/list' && Be(p.result?.tools),
7911
+ (o?.method === 'tools/list' && ze(p.result?.tools),
6940
7912
  process.stdout.write(
6941
7913
  JSON.stringify(p) +
6942
7914
  `
@@ -6945,7 +7917,7 @@ Pass this URL to any Tein generation tool.`,
6945
7917
  return;
6946
7918
  }
6947
7919
  } catch {}
6948
- let u = Ir(o);
7920
+ let u = qi(o);
6949
7921
  u !== null &&
6950
7922
  process.stdout.write(
6951
7923
  JSON.stringify(u) +
@@ -6968,22 +7940,22 @@ Pass this URL to any Tein generation tool.`,
6968
7940
  process.stderr.write(`Tein AI MCP Server running on stdio transport.
6969
7941
  `));
6970
7942
  }
6971
- var R,
6972
- j,
6973
- jt,
6974
- br,
7943
+ var O,
7944
+ B,
7945
+ Jt,
7946
+ vi,
6975
7947
  Q,
6976
- je,
6977
- Ut,
6978
- Yt = b(() => {
7948
+ Ge,
7949
+ zt,
7950
+ tr = b(() => {
6979
7951
  'use strict';
6980
- ((R = I(require('node:fs'))),
6981
- (j = I(require('node:path'))),
6982
- (jt = I(require('node:readline'))));
6983
- Re();
6984
- Vt();
6985
- E();
6986
- br = new Set([
7952
+ ((O = P(require('node:fs'))),
7953
+ (B = P(require('node:path'))),
7954
+ (Jt = P(require('node:readline'))));
7955
+ Le();
7956
+ jt();
7957
+ C();
7958
+ vi = new Set([
6987
7959
  '.png',
6988
7960
  '.jpg',
6989
7961
  '.jpeg',
@@ -7009,42 +7981,42 @@ var R,
7009
7981
  '.flac',
7010
7982
  '.opus',
7011
7983
  ]);
7012
- ((Q = new Map()), (je = 0));
7013
- Ut = !1;
7984
+ ((Q = new Map()), (Ge = 0));
7985
+ zt = !1;
7014
7986
  require.main === module &&
7015
- Ht().catch((e) => {
7987
+ Zt().catch((e) => {
7016
7988
  (process.stderr.write(`Fatal error in Tein MCP CLI: ${e}
7017
7989
  `),
7018
7990
  process.exit(1));
7019
7991
  });
7020
7992
  });
7021
- var ni =
7993
+ var dr =
7022
7994
  !process.env.NO_COLOR &&
7023
7995
  (process.stdout.isTTY || process.env.FORCE_COLOR === '1' || process.env.TERM !== 'dumb');
7024
- function w(e, t) {
7025
- return (i) => (ni ? `\x1B[${e}m${i}\x1B[${t}m` : String(i));
7996
+ function k(e, t) {
7997
+ return (r) => (dr ? `\x1B[${e}m${r}\x1B[${t}m` : String(r));
7026
7998
  }
7027
7999
  var a = {
7028
- bold: w(1, 22),
7029
- dim: w(2, 22),
7030
- italic: w(3, 23),
7031
- underline: w(4, 24),
7032
- inverse: w(7, 27),
7033
- black: w(30, 39),
7034
- red: w(31, 39),
7035
- green: w(32, 39),
7036
- yellow: w(33, 39),
7037
- blue: w(34, 39),
7038
- magenta: w(35, 39),
7039
- cyan: w(36, 39),
7040
- white: w(37, 39),
7041
- gray: w(90, 39),
7042
- bgBlue: w(44, 49),
7043
- bgMagenta: w(45, 49),
7044
- bgCyan: w(46, 49),
7045
- bgGreen: w(42, 49),
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),
7046
8018
  },
7047
- T = class {
8019
+ _ = class {
7048
8020
  constructor(t = '') {
7049
8021
  this.frames = [
7050
8022
  '\u280B',
@@ -7068,8 +8040,8 @@ var a = {
7068
8040
  process.stdout.isTTY
7069
8041
  ? (this.stop(),
7070
8042
  (this.timer = setInterval(() => {
7071
- let i = a.cyan(this.frames[this.current]);
7072
- (process.stdout.write(`\r${i} ${this.text} `),
8043
+ let r = a.cyan(this.frames[this.current]);
8044
+ (process.stdout.write(`\r${r} ${this.text} `),
7073
8045
  (this.current = (this.current + 1) % this.frames.length));
7074
8046
  }, 80)),
7075
8047
  this)
@@ -7083,20 +8055,20 @@ var a = {
7083
8055
  }
7084
8056
  succeed(t) {
7085
8057
  this.stop();
7086
- let i = t || this.text;
8058
+ let r = t || this.text;
7087
8059
  process.stdout.isTTY
7088
- ? process.stdout.write(`\r${a.green('\u2713')} ${i}
8060
+ ? process.stdout.write(`\r${a.green('\u2713')} ${r}
7089
8061
  `)
7090
- : process.stdout.write(`[\u2713] ${i}
8062
+ : process.stdout.write(`[\u2713] ${r}
7091
8063
  `);
7092
8064
  }
7093
8065
  fail(t) {
7094
8066
  this.stop();
7095
- let i = t || this.text;
8067
+ let r = t || this.text;
7096
8068
  process.stdout.isTTY
7097
- ? process.stdout.write(`\r${a.red('\u2717')} ${i}
8069
+ ? process.stdout.write(`\r${a.red('\u2717')} ${r}
7098
8070
  `)
7099
- : process.stdout.write(`[\u2717] ${i}
8071
+ : process.stdout.write(`[\u2717] ${r}
7100
8072
  `);
7101
8073
  }
7102
8074
  stop() {
@@ -7106,78 +8078,78 @@ var a = {
7106
8078
  process.stdout.isTTY && process.stdout.write('\r\x1B[K'));
7107
8079
  }
7108
8080
  };
7109
- var O = I(require('node:fs')),
7110
- A = I(require('node:path'));
7111
- var ee = I(require('node:fs')),
7112
- Je = I(require('node:path')),
7113
- ze = require('node:stream/promises');
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')),
8085
+ Ye = require('node:stream/promises');
7114
8086
  var Z = '1.1.7';
7115
- var si = new Set([
8087
+ var cr = new Set([
7116
8088
  'account_suspended',
7117
8089
  'account_terminated',
7118
8090
  'creative_mode_restricted',
7119
8091
  'unfiltered_restricted',
7120
8092
  'workspace_paused',
7121
8093
  ]),
7122
- _ = 1,
7123
- oi = 3,
7124
- k = class extends Error {
7125
- constructor(t, i, r, n = {}) {
7126
- (super(i),
8094
+ T = 1,
8095
+ ur = 3,
8096
+ w = class extends Error {
8097
+ constructor(t, r, i, s = {}) {
8098
+ (super(r),
7127
8099
  (this.name = 'TeinApiError'),
7128
8100
  (this.status = t),
7129
- r && (this.code = r),
7130
- (this.fields = n));
8101
+ i && (this.code = i),
8102
+ (this.fields = s));
7131
8103
  }
7132
8104
  get exitCode() {
7133
- return this.code && si.has(this.code) ? oi : _;
8105
+ return this.code && cr.has(this.code) ? ur : T;
7134
8106
  }
7135
8107
  };
7136
- function li(e, t, i) {
7137
- let r = `HTTP ${e}${t ? ` ${t}` : ''}`;
7138
- if (!i || typeof i != 'object') return new k(e, r);
7139
- let n = i;
7140
- if (n.error && typeof n.error == 'object' && !Array.isArray(n.error)) {
7141
- let p = n.error,
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,
7142
8114
  { code: d, message: m, ...h } = p;
7143
- return new k(e, typeof m == 'string' && m ? m : r, typeof d == 'string' ? d : void 0, h);
8115
+ return new w(e, typeof m == 'string' && m ? m : i, typeof d == 'string' ? d : void 0, h);
7144
8116
  }
7145
- let { error: s, code: o, message: u, ...l } = n,
7146
- c = (typeof s == 'string' && s) || (typeof u == 'string' && u) || r;
7147
- return new k(e, c, typeof o == 'string' ? o : void 0, l);
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);
7148
8120
  }
7149
- function Fe(e) {
8121
+ function Je(e) {
7150
8122
  return typeof e == 'number' && Number.isFinite(e) ? `$${e.toFixed(4)}` : null;
7151
8123
  }
7152
8124
  function K(e) {
7153
8125
  let t = [e.message],
7154
- i = Fe(e.fields.required),
7155
- r = Fe(e.fields.balance);
7156
- (i || r) &&
7157
- t.push([i ? `Required: ${i}` : '', r ? `Balance: ${r}` : ''].filter(Boolean).join(' '));
7158
- let n = e.fields.org_name ?? e.fields.orgName;
7159
- typeof n == 'string' && n && t.push(`Workspace: ${n}`);
7160
- let s = e.fields.url ?? e.fields.appeal_url ?? e.fields.top_up_url;
7161
- return (typeof s == 'string' && s && t.push(s), e.code && t.push(`(${e.code})`), t);
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);
7162
8134
  }
7163
- function pi(e) {
8135
+ function fr(e) {
7164
8136
  return /\.(mp4|webm|mov)(\?|$)/i.test(e)
7165
8137
  ? 'video'
7166
8138
  : /\.(mp3|wav|ogg|flac)(\?|$)/i.test(e)
7167
8139
  ? 'audio'
7168
8140
  : 'image';
7169
8141
  }
7170
- function Ge(e) {
8142
+ function He(e) {
7171
8143
  let t = [];
7172
- for (let i of e.data ?? [])
7173
- typeof i.message?.content == 'string'
7174
- ? t.push({ type: 'text', text: i.message.content })
7175
- : i.url && t.push({ type: pi(i.url), url: i.url });
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 });
7176
8148
  return t;
7177
8149
  }
7178
8150
  var M = class {
7179
- constructor(t, i) {
7180
- ((this.apiKey = t), (this.baseUrl = i.replace(/\/+$/, '')));
8151
+ constructor(t, r) {
8152
+ ((this.apiKey = t), (this.baseUrl = r.replace(/\/+$/, '')));
7181
8153
  }
7182
8154
  getHeaders() {
7183
8155
  return {
@@ -7187,126 +8159,126 @@ var M = class {
7187
8159
  'X-Tein-Client': 'cli',
7188
8160
  };
7189
8161
  }
7190
- async send(t, i, r) {
7191
- let n = await fetch(`${this.baseUrl}${i}`, {
8162
+ async send(t, r, i) {
8163
+ let s = await fetch(`${this.baseUrl}${r}`, {
7192
8164
  method: t,
7193
8165
  headers: this.getHeaders(),
7194
- ...(r === void 0 ? {} : { body: JSON.stringify(r) }),
8166
+ ...(i === void 0 ? {} : { body: JSON.stringify(i) }),
7195
8167
  });
7196
- if (!n.ok) {
7197
- let s = null;
8168
+ if (!s.ok) {
8169
+ let n = null;
7198
8170
  try {
7199
- s = await n.json();
8171
+ n = await s.json();
7200
8172
  } catch {}
7201
- throw li(n.status, n.statusText, s);
8173
+ throw mr(s.status, s.statusText, n);
7202
8174
  }
7203
- return await n.json();
8175
+ return await s.json();
7204
8176
  }
7205
8177
  async checkKey() {
7206
8178
  await this.send('GET', '/v1/jobs?limit=1');
7207
8179
  }
7208
- queueJob(t, i) {
7209
- return this.send('POST', '/v1/generate', { model: t, ...i }).then((r) => {
7210
- let n = r.status,
7211
- s =
7212
- n === 'succeeded' || n === 'failed' || n === 'expired' || n === 'cancelled'
7213
- ? n
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
7214
8186
  : 'processing',
7215
- o = Ge(r);
8187
+ o = He(i);
7216
8188
  return {
7217
- request_id: r.request_id || r.id || '',
7218
- model: r.model,
7219
- status: s,
8189
+ request_id: i.request_id || i.id || '',
8190
+ model: i.model,
8191
+ status: n,
7220
8192
  ...(o.length ? { output: o } : {}),
7221
- error: r.error && typeof r.error.message == 'string' ? r.error.message : null,
7222
- ...(r.usage ? { usage: r.usage } : {}),
8193
+ error: i.error && typeof i.error.message == 'string' ? i.error.message : null,
8194
+ ...(i.usage ? { usage: i.usage } : {}),
7223
8195
  };
7224
8196
  });
7225
8197
  }
7226
8198
  getStatus(t) {
7227
- return this.send('GET', `/v1/jobs/${encodeURIComponent(t)}`).then((i) => {
7228
- let r = i.status,
7229
- n =
7230
- r === 'succeeded' || r === 'failed' || r === 'expired' || r === 'cancelled'
7231
- ? r
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
7232
8204
  : 'processing',
7233
- s = Ge(i),
7234
- o = i.error && typeof i.error.message == 'string' ? i.error.message : null;
8205
+ n = He(r),
8206
+ o = r.error && typeof r.error.message == 'string' ? r.error.message : null;
7235
8207
  return {
7236
- request_id: i.id || t,
7237
- model: i.model,
7238
- status: n,
7239
- ...(s.length ? { output: s } : {}),
8208
+ request_id: r.id || t,
8209
+ model: r.model,
8210
+ status: s,
8211
+ ...(n.length ? { output: n } : {}),
7240
8212
  error: o,
7241
- ...(i.usage ? { usage: i.usage } : {}),
8213
+ ...(r.usage ? { usage: r.usage } : {}),
7242
8214
  };
7243
8215
  });
7244
8216
  }
7245
8217
  uploadAsset(t) {
7246
8218
  return this.send('POST', '/v1/upload', { data: t });
7247
8219
  }
7248
- async downloadOutput(t, i) {
7249
- let r = await fetch(t);
7250
- if (!r.ok) throw new Error(`The file could not be downloaded (HTTP ${r.status})`);
7251
- let n = Je.default.dirname(i);
7252
- ee.default.existsSync(n) || ee.default.mkdirSync(n, { recursive: !0 });
7253
- let s = ee.default.createWriteStream(i);
7254
- return (await (0, ze.pipeline)(r.body, s), i);
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);
7255
8227
  }
7256
8228
  };
7257
- E();
7258
- function ye(e) {
8229
+ C();
8230
+ function ke(e) {
7259
8231
  if (typeof e != 'number' || !Number.isFinite(e)) return '';
7260
8232
  if (Math.abs(e) >= 1 || Math.abs(Number(e.toFixed(4)) - e) < 1e-12) return `$${e.toFixed(4)}`;
7261
8233
  let t = Math.max(0, 3 - Number(e.toExponential(3).split('e')[1])),
7262
- i = 10 ** t,
7263
- r = Math.round(Number((e * i).toFixed(6))) / i;
7264
- return r >= 1 ? `$${r.toFixed(4)}` : `$${r.toFixed(t).replace(/0+$/, '')}`;
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+$/, '')}`;
7265
8237
  }
7266
8238
  H();
7267
- var Tt = ['images', 'input_images', 'videos', 'audios'];
7268
- function ji(e) {
7269
- for (let t of Tt) typeof e[t] == 'string' && (e[t] = [e[t]]);
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]]);
7270
8242
  }
7271
- function Bi(e) {
8243
+ function Yr(e) {
7272
8244
  if (e.startsWith('http://') || e.startsWith('https://')) return null;
7273
8245
  let t = A.default.resolve(e);
7274
- return O.default.existsSync(t) && O.default.statSync(t).isFile() ? t : null;
8246
+ return D.default.existsSync(t) && D.default.statSync(t).isFile() ? t : null;
7275
8247
  }
7276
- async function Fi(e, t) {
7277
- for (let i of Tt) {
7278
- if (!Array.isArray(e[i])) continue;
7279
- let r = [];
7280
- for (let n of e[i]) {
7281
- if (typeof n != 'string') continue;
7282
- let s = Bi(n);
7283
- r.push(s ? await t(s) : n);
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);
7284
8256
  }
7285
- e[i] = r;
8257
+ e[r] = i;
7286
8258
  }
7287
8259
  }
7288
8260
  var W = { starter: 10, plus: 25, scale: 40, enterprise: 300 };
7289
- function Gi(e) {
8261
+ function Xr(e) {
7290
8262
  if (e.count === void 0 || e.count === !0) return 1;
7291
8263
  let t = typeof e.count == 'number' ? e.count : Number(e.count),
7292
- i = W.enterprise;
8264
+ r = W.enterprise;
7293
8265
  return (
7294
- (!Number.isInteger(t) || t < 1 || t > i) &&
8266
+ (!Number.isInteger(t) || t < 1 || t > r) &&
7295
8267
  (process.stderr
7296
- .write(`${a.red('Error:')} --count must be a whole number from 1 to ${i}. The API allows Starter ${W.starter}, Plus ${W.plus}, Scale ${W.scale}, Enterprise ${W.enterprise} at once, including polling.
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.
7297
8269
  `),
7298
8270
  process.exit(1)),
7299
8271
  t
7300
8272
  );
7301
8273
  }
7302
- async function Ji(e, t, i, r, n) {
7303
- n.isJson ||
7304
- process.stderr.write(`Starting ${r} ${t} jobs together...
8274
+ async function Zr(e, t, r, i, s) {
8275
+ s.isJson ||
8276
+ process.stderr.write(`Starting ${i} ${t} jobs together...
7305
8277
  `);
7306
- let s = await Promise.all(
7307
- Array.from({ length: r }, async () => {
8278
+ let n = await Promise.all(
8279
+ Array.from({ length: i }, async () => {
7308
8280
  try {
7309
- return { job: await e.queueJob(t, i) };
8281
+ return { job: await e.queueJob(t, r) };
7310
8282
  } catch (l) {
7311
8283
  return { err: l };
7312
8284
  }
@@ -7314,22 +8286,22 @@ async function Ji(e, t, i, r, n) {
7314
8286
  ),
7315
8287
  o = [],
7316
8288
  u = [];
7317
- for (let l of s)
8289
+ for (let l of n)
7318
8290
  'job' in l && l.job
7319
8291
  ? o.push(l.job)
7320
8292
  : 'err' in l &&
7321
8293
  u.push(
7322
- l.err instanceof k
8294
+ l.err instanceof w
7323
8295
  ? l.err
7324
- : new k(0, l.err instanceof Error ? l.err.message : String(l.err)),
8296
+ : new w(0, l.err instanceof Error ? l.err.message : String(l.err)),
7325
8297
  );
7326
- if (!n.isAsync) {
8298
+ if (!s.isAsync) {
7327
8299
  let l = Date.now(),
7328
8300
  c = o.filter((p) => p.status === 'processing' && p.request_id);
7329
8301
  for (; c.length;) {
7330
- if ((await new Promise((d) => setTimeout(d, 2e3)), !n.isJson)) {
8302
+ if ((await new Promise((d) => setTimeout(d, 2e3)), !s.isJson)) {
7331
8303
  let d = Math.round((Date.now() - l) / 1e3);
7332
- process.stderr.write(`Waiting on ${c.length} of ${r} (${d}s)...
8304
+ process.stderr.write(`Waiting on ${c.length} of ${i} (${d}s)...
7333
8305
  `);
7334
8306
  }
7335
8307
  let p = await Promise.all(
@@ -7348,7 +8320,7 @@ async function Ji(e, t, i, r, n) {
7348
8320
  c = o.filter((d) => d.status === 'processing' && d.request_id);
7349
8321
  }
7350
8322
  }
7351
- if (n.isJson)
8323
+ if (s.isJson)
7352
8324
  process.stdout.write(
7353
8325
  JSON.stringify(
7354
8326
  { jobs: o, errors: u.map((l) => ({ code: l.code ?? null, message: l.message })) },
@@ -7361,7 +8333,7 @@ async function Ji(e, t, i, r, n) {
7361
8333
  else {
7362
8334
  for (let l of o)
7363
8335
  (process.stdout.write(`${l.request_id} ${l.status}`),
7364
- l.usage?.cost !== void 0 && process.stdout.write(` ${ye(l.usage.cost)}`),
8336
+ l.usage?.cost !== void 0 && process.stdout.write(` ${ke(l.usage.cost)}`),
7365
8337
  l.error && process.stdout.write(` ${l.error}`),
7366
8338
  process.stdout.write(`
7367
8339
  `));
@@ -7372,21 +8344,21 @@ async function Ji(e, t, i, r, n) {
7372
8344
  }
7373
8345
  (u.length ||
7374
8346
  o.some((l) => l.status === 'failed' || l.status === 'expired' || l.status === 'cancelled')) &&
7375
- process.exit(_);
8347
+ process.exit(T);
7376
8348
  }
7377
- function Mt(e) {
8349
+ function Ct(e) {
7378
8350
  let t = {},
7379
- i = new Set(),
7380
- r = [];
7381
- for (let n = 0; n < e.length; n++) {
7382
- let s = e[n];
7383
- if (s.startsWith('--')) {
7384
- let o = s.slice(2);
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);
7385
8357
  if (o.includes('=')) {
7386
8358
  let [u, l] = o.split('=', 2);
7387
8359
  t[u.replace(/-/g, '_')] = l;
7388
- } else if (n + 1 < e.length && !e[n + 1].startsWith('-')) {
7389
- let u = e[n + 1];
8360
+ } else if (s + 1 < e.length && !e[s + 1].startsWith('-')) {
8361
+ let u = e[s + 1];
7390
8362
  (u === 'true'
7391
8363
  ? (t[o.replace(/-/g, '_')] = !0)
7392
8364
  : u === 'false'
@@ -7394,10 +8366,10 @@ function Mt(e) {
7394
8366
  : /^-?\d+(\.\d+)?$/.test(u)
7395
8367
  ? (t[o.replace(/-/g, '_')] = Number(u))
7396
8368
  : (t[o.replace(/-/g, '_')] = u),
7397
- n++);
7398
- } else ((t[o.replace(/-/g, '_')] = !0), i.add(o));
7399
- } else if (s.startsWith('-') && s.length === 2) {
7400
- let o = s[1],
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],
7401
8373
  l =
7402
8374
  {
7403
8375
  p: 'prompt',
@@ -7411,18 +8383,18 @@ function Mt(e) {
7411
8383
  v: 'version',
7412
8384
  }[o] || o;
7413
8385
  o === 'j' || o === 'h' || o === 'v'
7414
- ? ((t[l] = !0), i.add(l))
7415
- : n + 1 < e.length && !e[n + 1].startsWith('-')
7416
- ? ((t[l] = e[n + 1]), n++)
8386
+ ? ((t[l] = !0), r.add(l))
8387
+ : s + 1 < e.length && !e[s + 1].startsWith('-')
8388
+ ? ((t[l] = e[s + 1]), s++)
7417
8389
  : (t[l] = !0);
7418
- } else r.push(s);
8390
+ } else i.push(n);
7419
8391
  }
7420
- return { command: r[0] || '', subcommand: r[1], modelSlug: r[1] || r[0], options: t, flags: i };
8392
+ return { command: i[0] || '', subcommand: i[1], modelSlug: i[1] || i[0], options: t, flags: r };
7421
8393
  }
7422
- async function Ae(e, t) {
7423
- let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
7424
- r = x(typeof t.api_url == 'string' ? t.api_url : void 0);
7425
- (i ||
8394
+ async function De(e, t) {
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 ||
7426
8398
  (process.stderr.write(`${a.red('Error:')} Authentication required.
7427
8399
  `),
7428
8400
  process.stderr
@@ -7437,11 +8409,11 @@ async function Ae(e, t) {
7437
8409
  process.stderr.write(`Run ${a.cyan('tein models')} to list all available models.
7438
8410
  `),
7439
8411
  process.exit(1)));
7440
- let n = U(e),
7441
- s = !!t.json,
8412
+ let s = U(e),
8413
+ n = !!t.json,
7442
8414
  o = !!(t.async || t.no_wait),
7443
8415
  u = typeof t.output == 'string' ? t.output : void 0,
7444
- l = Gi(t),
8416
+ l = Xr(t),
7445
8417
  c = { ...t };
7446
8418
  (delete c.json,
7447
8419
  delete c.async,
@@ -7450,71 +8422,71 @@ async function Ae(e, t) {
7450
8422
  delete c.api_key,
7451
8423
  delete c.api_url,
7452
8424
  delete c.count);
7453
- let p = Pt(n, c);
7454
- (ji(p),
8425
+ let p = qt(s, c);
8426
+ (Wr(p),
7455
8427
  typeof p.image == 'string' && !p.images && ((p.images = [p.image]), delete p.image),
7456
8428
  p.image_url &&
7457
8429
  !p.first_frame_image &&
7458
8430
  (e.startsWith('seedance') || e.startsWith('happy-horse')) &&
7459
8431
  (p.first_frame_image = p.image_url));
7460
- let d = new M(i, r),
8432
+ let d = new M(r, i),
7461
8433
  m = ['image', 'first_frame_image', 'last_frame_image', 'lipsyncing_audio', 'audio', 'video'];
7462
8434
  for (let y of m) {
7463
8435
  let f = p[y];
7464
8436
  if (typeof f == 'string' && !f.startsWith('http://') && !f.startsWith('https://')) {
7465
- let v = A.default.resolve(f);
7466
- if (O.default.existsSync(v) && O.default.statSync(v).isFile()) {
7467
- let P = new T(`Uploading local file ${A.default.basename(v)} to CDN...`);
7468
- s || P.start();
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();
7469
8441
  try {
7470
- let B = O.default.readFileSync(v),
7471
- X = await d.uploadAsset(B.toString('base64'));
7472
- ((p[y] = X.url), s || P.succeed(`Uploaded ${A.default.basename(v)} to CDN`));
7473
- } catch (B) {
7474
- let X = B instanceof Error ? B.message : String(B);
7475
- (s
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
7476
8448
  ? process.stdout.write(
7477
8449
  JSON.stringify({ error: X }) +
7478
8450
  `
7479
8451
  `,
7480
8452
  )
7481
- : P.fail(`Upload failed: ${X}`),
8453
+ : v.fail(`Upload failed: ${X}`),
7482
8454
  process.exit(1));
7483
8455
  }
7484
8456
  }
7485
8457
  }
7486
8458
  }
7487
- await Fi(p, async (y) => {
7488
- let f = new T(`Uploading local file ${A.default.basename(y)} to CDN...`);
7489
- s || f.start();
8459
+ await Qr(p, async (y) => {
8460
+ let f = new _(`Uploading local file ${A.default.basename(y)} to CDN...`);
8461
+ n || f.start();
7490
8462
  try {
7491
- let v = O.default.readFileSync(y),
7492
- P = await d.uploadAsset(v.toString('base64'));
7493
- return (s || f.succeed(`Uploaded ${A.default.basename(y)} to CDN`), P.url);
7494
- } catch (v) {
7495
- let P = v instanceof Error ? v.message : String(v);
7496
- (s
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
7497
8469
  ? process.stdout.write(
7498
- JSON.stringify({ error: P }) +
8470
+ JSON.stringify({ error: v }) +
7499
8471
  `
7500
8472
  `,
7501
8473
  )
7502
- : f.fail(`Upload failed: ${P}`),
8474
+ : f.fail(`Upload failed: ${v}`),
7503
8475
  process.exit(1));
7504
8476
  }
7505
8477
  });
7506
- let h = new T(`Submitting task for ${a.bold(e)}...`);
7507
- s || h.start();
8478
+ let h = new _(`Submitting task for ${a.bold(e)}...`);
8479
+ n || h.start();
7508
8480
  let g;
7509
8481
  try {
7510
8482
  if (l > 1) {
7511
- await Ji(d, e, p, l, { isJson: s, isAsync: o });
8483
+ await Zr(d, e, p, l, { isJson: n, isAsync: o });
7512
8484
  return;
7513
8485
  }
7514
8486
  g = await d.queueJob(e, p);
7515
8487
  } catch (y) {
7516
- let f = y instanceof k ? y : null;
7517
- (s
8488
+ let f = y instanceof w ? y : null;
8489
+ (n
7518
8490
  ? process.stdout.write(
7519
8491
  JSON.stringify(
7520
8492
  f
@@ -7532,10 +8504,10 @@ async function Ae(e, t) {
7532
8504
  `)
7533
8505
  : `Failed to start generation: ${y instanceof Error ? y.message : y}`,
7534
8506
  ),
7535
- process.exit(f ? f.exitCode : _));
8507
+ process.exit(f ? f.exitCode : T));
7536
8508
  }
7537
8509
  if (o) {
7538
- s
8510
+ n
7539
8511
  ? process.stdout.write(
7540
8512
  JSON.stringify(g, null, 2) +
7541
8513
  `
@@ -7546,18 +8518,18 @@ async function Ae(e, t) {
7546
8518
  `));
7547
8519
  return;
7548
8520
  }
7549
- let ue = Date.now(),
7550
- me = 1500;
8521
+ let fe = Date.now(),
8522
+ ge = 1500;
7551
8523
  for (; g.status === 'processing';) {
7552
- let y = Math.round((Date.now() - ue) / 1e3);
7553
- (s || h.update(`Rendering ${a.bold(e)} (${y}s elapsed)... [ID: ${g.request_id}]`),
7554
- await new Promise((f) => setTimeout(f, me)));
8524
+ let y = Math.round((Date.now() - fe) / 1e3);
8525
+ (n || h.update(`Rendering ${a.bold(e)} (${y}s elapsed)... [ID: ${g.request_id}]`),
8526
+ await new Promise((f) => setTimeout(f, ge)));
7555
8527
  try {
7556
8528
  g = await d.getStatus(g.request_id);
7557
8529
  } catch (f) {
7558
- f instanceof k &&
7559
- f.exitCode !== _ &&
7560
- (s ||
8530
+ f instanceof w &&
8531
+ f.exitCode !== T &&
8532
+ (n ||
7561
8533
  h.fail(
7562
8534
  K(f).join(`
7563
8535
  `),
@@ -7567,16 +8539,16 @@ async function Ae(e, t) {
7567
8539
  }
7568
8540
  if (
7569
8541
  ((g.status === 'failed' || g.status === 'expired' || g.status === 'cancelled') &&
7570
- (s
8542
+ (n
7571
8543
  ? process.stdout.write(
7572
8544
  JSON.stringify(g, null, 2) +
7573
8545
  `
7574
8546
  `,
7575
8547
  )
7576
8548
  : h.fail(`Generation ${g.status}: ${g.error || 'Something failed on our side.'}`),
7577
- process.exit(_)),
7578
- s || h.succeed(`Generation completed for ${a.bold(n?.name || e)}!`),
7579
- s)
8549
+ process.exit(T)),
8550
+ n || h.succeed(`Generation completed for ${a.bold(s?.name || e)}!`),
8551
+ n)
7580
8552
  ) {
7581
8553
  process.stdout.write(
7582
8554
  JSON.stringify(g, null, 2) +
@@ -7593,7 +8565,7 @@ async function Ae(e, t) {
7593
8565
  process.stdout.write(` ${a.bold('Request ID:')} ${g.request_id}
7594
8566
  `),
7595
8567
  g.usage?.cost !== void 0 &&
7596
- process.stdout.write(` ${a.bold('Cost:')} ${ye(g.usage.cost)}
8568
+ process.stdout.write(` ${a.bold('Cost:')} ${ke(g.usage.cost)}
7597
8569
  `),
7598
8570
  g.output && g.output.length > 0)
7599
8571
  ) {
@@ -7608,12 +8580,12 @@ ${a.bold('Outputs:')}
7608
8580
  `),
7609
8581
  u)
7610
8582
  ) {
7611
- let v = new T(`Downloading output to ${u}...`).start();
8583
+ let I = new _(`Downloading output to ${u}...`).start();
7612
8584
  try {
7613
8585
  (await d.downloadOutput(f.url, A.default.resolve(process.cwd(), u)),
7614
- v.succeed(`Saved to ${a.bold(u)}`));
7615
- } catch (P) {
7616
- v.fail(`Failed to download: ${P instanceof Error ? P.message : P}`);
8586
+ I.succeed(`Saved to ${a.bold(u)}`));
8587
+ } catch (v) {
8588
+ I.fail(`Failed to download: ${v instanceof Error ? v.message : v}`);
7617
8589
  }
7618
8590
  }
7619
8591
  } else
@@ -7626,24 +8598,24 @@ ${f.text}
7626
8598
  process.stdout.write(`
7627
8599
  `);
7628
8600
  }
7629
- var Kt = I(require('node:readline'));
7630
- E();
7631
- async function zi(e) {
8601
+ var Et = P(require('node:readline'));
8602
+ C();
8603
+ async function ei(e) {
7632
8604
  try {
7633
8605
  return (await new M(e, x()).checkKey(), 'ok');
7634
8606
  } catch (t) {
7635
- if (t instanceof k) {
8607
+ if (t instanceof w) {
7636
8608
  if (t.status === 401) return 'invalid';
7637
8609
  if (t.status === 403) return 'blocked';
7638
8610
  }
7639
8611
  return 'unchecked';
7640
8612
  }
7641
8613
  }
7642
- function Hi(e) {
7643
- let t = Kt.default.createInterface({ input: process.stdin, output: process.stdout });
7644
- return new Promise((i) => {
7645
- t.question(e, (r) => {
7646
- (t.close(), i(r.trim()));
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()));
7647
8619
  });
7648
8620
  });
7649
8621
  }
@@ -7651,36 +8623,36 @@ async function Y(e, t) {
7651
8623
  switch (e) {
7652
8624
  case 'login':
7653
8625
  case 'set-key': {
7654
- let i = t?.trim() || '';
7655
- (i ||
8626
+ let r = t?.trim() || '';
8627
+ (r ||
7656
8628
  (process.stdout.write(`
7657
8629
  ${a.bold('Tein AI Authentication')}
7658
8630
  `),
7659
8631
  process.stdout.write(`Get your API key at: ${a.cyan('https://tein.ai/dashboard/keys')}
7660
8632
 
7661
8633
  `),
7662
- (i = await Hi('Enter your Tein API Key (sk_live_...): '))),
7663
- !i.startsWith('sk_live_') &&
7664
- !i.startsWith('sk_test_') &&
8634
+ (r = await ti('Enter your Tein API Key (sk_live_...): '))),
8635
+ !r.startsWith('sk_live_') &&
8636
+ !r.startsWith('sk_test_') &&
7665
8637
  (process.stderr
7666
8638
  .write(`${a.red('Error:')} Invalid key format. Tein API keys start with 'sk_live_' or 'sk_test_'.
7667
8639
  `),
7668
8640
  process.exit(1)));
7669
- let r = await zi(i);
7670
- (r === 'invalid' &&
8641
+ let i = await ei(r);
8642
+ (i === 'invalid' &&
7671
8643
  (process.stderr
7672
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.
7673
8645
  `),
7674
8646
  process.exit(1)),
7675
- he({ apiKey: i }),
8647
+ be({ apiKey: r }),
7676
8648
  process.stdout.write(`
7677
- ${a.green('\u2713')} API key saved to ${a.dim(ie())}
8649
+ ${a.green('\u2713')} API key saved to ${a.dim(re())}
7678
8650
  `),
7679
- r === 'blocked'
8651
+ i === 'blocked'
7680
8652
  ? process.stdout
7681
8653
  .write(`${a.yellow('\u2139')} The key is valid, but this account cannot run requests right now. Check your dashboard.
7682
8654
  `)
7683
- : r === 'unchecked' &&
8655
+ : i === 'unchecked' &&
7684
8656
  process.stdout
7685
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.
7686
8658
  `),
@@ -7691,31 +8663,31 @@ ${a.green('\u2713')} API key saved to ${a.dim(ie())}
7691
8663
  break;
7692
8664
  }
7693
8665
  case 'logout': {
7694
- if (!L().apiKey) {
8666
+ if (!V().apiKey) {
7695
8667
  process.stdout
7696
8668
  .write(`${a.yellow('\u2139')} No active API key found. You are already logged out.
7697
8669
  `);
7698
8670
  break;
7699
8671
  }
7700
- (he({ apiKey: '' }),
8672
+ (be({ apiKey: '' }),
7701
8673
  process.stdout
7702
- .write(`${a.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${a.dim(ie())}
8674
+ .write(`${a.green('\u2713')} Logged out successfully. Stored API key has been cleared from ${a.dim(re())}
7703
8675
  `));
7704
8676
  break;
7705
8677
  }
7706
8678
  default: {
7707
- let i = S(),
7708
- r = x(),
7709
- n = L();
8679
+ let r = S(),
8680
+ i = x(),
8681
+ s = V();
7710
8682
  if (
7711
8683
  (process.stdout.write(`
7712
8684
  ${a.bold('Tein AI CLI Configuration')}
7713
8685
  `),
7714
- process.stdout.write(` Config file: ${a.dim(ie())}
8686
+ process.stdout.write(` Config file: ${a.dim(re())}
7715
8687
  `),
7716
- process.stdout.write(` API URL: ${a.cyan(r)}
8688
+ process.stdout.write(` API URL: ${a.cyan(i)}
7717
8689
  `),
7718
- !i)
8690
+ !r)
7719
8691
  )
7720
8692
  (process.stdout.write(` API Key: ${a.red('Not configured')}
7721
8693
 
@@ -7725,9 +8697,9 @@ ${a.bold('Tein AI CLI Configuration')}
7725
8697
 
7726
8698
  `));
7727
8699
  else {
7728
- let s = `${i.slice(0, 10)}...${i.slice(-4)}`;
8700
+ let n = `${r.slice(0, 10)}...${r.slice(-4)}`;
7729
8701
  process.stdout
7730
- .write(` API Key: ${a.green(s)} (${i.startsWith('sk_live_') ? 'Live Key' : 'Test Key'})
8702
+ .write(` API Key: ${a.green(n)} (${r.startsWith('sk_live_') ? 'Live Key' : 'Test Key'})
7731
8703
 
7732
8704
  `);
7733
8705
  }
@@ -7735,52 +8707,52 @@ ${a.bold('Tein AI CLI Configuration')}
7735
8707
  }
7736
8708
  }
7737
8709
  }
7738
- E();
7739
- be();
8710
+ C();
8711
+ we();
7740
8712
  H();
7741
- var Wi = 3e3;
7742
- async function St(e) {
8713
+ var ri = 3e3;
8714
+ async function At(e) {
7743
8715
  try {
7744
- let t = await fetch(`${x(e)}/v1/pricing`, { signal: AbortSignal.timeout(Wi) });
8716
+ let t = await fetch(`${x(e)}/v1/pricing`, { signal: AbortSignal.timeout(ri) });
7745
8717
  if (!t.ok) return;
7746
- let i = await t.json(),
7747
- r = {};
7748
- for (let n of i.configs ?? []) {
7749
- let s = String(n.modelSlug ?? '');
7750
- F.has(s) && (r[s] ??= []).push(Number(n.starterPrice));
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));
7751
8723
  }
7752
- bt(r);
8724
+ Pt(i);
7753
8725
  } catch {}
7754
8726
  }
7755
- var Yi = new Set(['video', 'image', 'text', 'audio', '3d']),
7756
- Qi = { llm: 'text', chat: 'text', reasoning: 'text' };
7757
- async function $t(e, t) {
7758
- await St(t);
7759
- let i = q();
8727
+ var ii = new Set(['video', 'image', 'text', 'audio', '3d']),
8728
+ ai = { llm: 'text', chat: 'text', reasoning: 'text' };
8729
+ async function Ot(e, t) {
8730
+ await At(t);
8731
+ let r = E();
7760
8732
  if (e) {
7761
- let s = e.toLowerCase(),
7762
- o = Qi[s] ?? s;
7763
- i = Yi.has(o)
7764
- ? i.filter((u) => u.category.toLowerCase() === o)
7765
- : i.filter((u) => u.kind.toLowerCase().includes(s) || u.slug.toLowerCase().includes(s));
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));
7766
8738
  }
7767
8739
  (process.stdout.write(`
7768
- ${a.bold('Tein AI Models Catalog')} (${i.length} available)
8740
+ ${a.bold('Tein AI Models Catalog')} (${r.length} available)
7769
8741
  `),
7770
8742
  process.stdout
7771
8743
  .write(`${a.dim('Run `tein info <model-slug>` to see detailed parameters and options.')}
7772
8744
 
7773
8745
  `));
7774
- let r = {};
7775
- for (let s of i) {
7776
- let o = s.category;
7777
- (r[o] || (r[o] = []), r[o].push(s));
8746
+ let i = {};
8747
+ for (let n of r) {
8748
+ let o = n.category;
8749
+ (i[o] || (i[o] = []), i[o].push(n));
7778
8750
  }
7779
- let n = ['Video', 'Image', 'Text', 'Audio', '3D'];
7780
- for (let s of n) {
7781
- let o = r[s];
8751
+ let s = ['Video', 'Image', 'Text', 'Audio', '3D'];
8752
+ for (let n of s) {
8753
+ let o = i[n];
7782
8754
  if (!(!o || o.length === 0)) {
7783
- process.stdout.write(`${a.bold(a.cyan(`\u2500\u2500 ${s} Models \u2500\u2500`))}
8755
+ process.stdout.write(`${a.bold(a.cyan(`\u2500\u2500 ${n} Models \u2500\u2500`))}
7784
8756
  `);
7785
8757
  for (let u of o) {
7786
8758
  let l = u.slug.padEnd(24),
@@ -7798,55 +8770,55 @@ ${a.bold('Tein AI Models Catalog')} (${i.length} available)
7798
8770
 
7799
8771
  `);
7800
8772
  }
7801
- async function Ct(e, t) {
7802
- F.has(e) && (await St(t));
7803
- let i = U(e);
7804
- (i ||
8773
+ async function Rt(e, t) {
8774
+ j.has(e) && (await At(t));
8775
+ let r = U(e);
8776
+ (r ||
7805
8777
  (process.stderr.write(`${a.red('Error:')} Model "${e}" not found in Tein AI registry.
7806
8778
  `),
7807
8779
  process.stderr.write(`Run ${a.cyan('tein models')} to see all available model slugs.
7808
8780
  `),
7809
8781
  process.exit(1)),
7810
8782
  process.stdout.write(`
7811
- ${a.bold(a.cyan(i.name))} (${a.bold(i.slug)})
8783
+ ${a.bold(a.cyan(r.name))} (${a.bold(r.slug)})
7812
8784
  `),
7813
- process.stdout.write(` ${a.gray(i.description)}
8785
+ process.stdout.write(` ${a.gray(r.description)}
7814
8786
 
7815
8787
  `),
7816
8788
  process.stdout.write(`${a.bold('Metadata:')}
7817
8789
  `),
7818
- process.stdout.write(` Category: ${a.yellow(i.category)}
8790
+ process.stdout.write(` Category: ${a.yellow(r.category)}
7819
8791
  `),
7820
- process.stdout.write(` Kind: ${i.kind}
8792
+ process.stdout.write(` Kind: ${r.kind}
7821
8793
  `),
7822
- process.stdout.write(` Vendor: ${i.vendor}
8794
+ process.stdout.write(` Vendor: ${r.vendor}
7823
8795
  `),
7824
- process.stdout.write(` Pricing: ${a.green(i.priceFormatted)}
8796
+ process.stdout.write(` Pricing: ${a.green(r.priceFormatted)}
7825
8797
 
7826
8798
  `),
7827
8799
  process.stdout.write(`${a.bold('Parameters:')}
7828
8800
  `));
7829
- for (let r of i.parameters) {
7830
- let n = r.required ? a.red('(required)') : a.dim('(optional)'),
7831
- s = r.default !== void 0 ? a.dim(` [default: ${r.default}]`) : '';
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}]`) : '';
7832
8804
  (process.stdout
7833
- .write(` ${a.bold(`--${r.name.replace(/_/g, '-')}`)} ${a.yellow(`<${r.type}>`)} ${n}${s}
8805
+ .write(` ${a.bold(`--${i.name.replace(/_/g, '-')}`)} ${a.yellow(`<${i.type}>`)} ${s}${n}
7834
8806
  `),
7835
- r.description &&
7836
- process.stdout.write(` ${a.gray(r.description)}
8807
+ i.description &&
8808
+ process.stdout.write(` ${a.gray(i.description)}
7837
8809
  `),
7838
- r.options &&
7839
- r.options.length > 0 &&
7840
- process.stdout.write(` Allowed values: ${a.dim(r.options.join(', '))}
8810
+ i.options &&
8811
+ i.options.length > 0 &&
8812
+ process.stdout.write(` Allowed values: ${a.dim(i.options.join(', '))}
7841
8813
  `),
7842
- (r.min !== void 0 || r.max !== void 0) &&
7843
- process.stdout.write(` Range: ${r.min ?? ''} to ${r.max ?? ''}
8814
+ (i.min !== void 0 || i.max !== void 0) &&
8815
+ process.stdout.write(` Range: ${i.min ?? ''} to ${i.max ?? ''}
7844
8816
  `),
7845
8817
  process.stdout.write(`
7846
8818
  `));
7847
8819
  }
7848
8820
  if (
7849
- (i.parameters.some((r) => r.name === 'callback_url') ||
8821
+ (r.parameters.some((i) => i.name === 'callback_url') ||
7850
8822
  (process.stdout
7851
8823
  .write(` ${a.bold('--callback-url')} ${a.yellow('<string>')} ${a.dim('(optional)')}
7852
8824
  `),
@@ -7856,33 +8828,33 @@ ${a.bold(a.cyan(i.name))} (${a.bold(i.slug)})
7856
8828
  `)),
7857
8829
  process.stdout.write(`${a.bold('Sample CLI Usage:')}
7858
8830
  `),
7859
- i.category === 'Video')
8831
+ r.category === 'Video')
7860
8832
  )
7861
8833
  process.stdout
7862
- .write(` ${a.cyan(`tein run ${i.slug} --prompt "Cinematic camera drone shot of a coastline" --aspect-ratio 16:9 --duration 5 -o output.mp4`)}
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`)}
7863
8835
 
7864
8836
  `);
7865
- else if (i.category === 'Image') {
7866
- let r = i.parameters.some((n) => n.name === 'aspect_ratio') ? ' --aspect-ratio 16:9' : '';
8837
+ else if (r.category === 'Image') {
8838
+ let i = r.parameters.some((s) => s.name === 'aspect_ratio') ? ' --aspect-ratio 16:9' : '';
7867
8839
  process.stdout
7868
- .write(` ${a.cyan(`tein run ${i.slug} --prompt "Cyberpunk city in the rain, 8k render"${r} -o output.png`)}
8840
+ .write(` ${a.cyan(`tein run ${r.slug} --prompt "Cyberpunk city in the rain, 8k render"${i} -o output.png`)}
7869
8841
 
7870
8842
  `);
7871
8843
  } else
7872
- i.category === 'Audio'
8844
+ r.category === 'Audio'
7873
8845
  ? process.stdout
7874
- .write(` ${a.cyan(`tein run ${i.slug} --prompt "Hello world from Tein AI" --speaker en_female_warm -o speech.wav`)}
8846
+ .write(` ${a.cyan(`tein run ${r.slug} --prompt "Hello world from Tein AI" --speaker en_female_warm -o speech.wav`)}
7875
8847
 
7876
8848
  `)
7877
8849
  : process.stdout
7878
- .write(` ${a.cyan(`tein run ${i.slug} --prompt "Explain quantum computing in simple terms"`)}
8850
+ .write(` ${a.cyan(`tein run ${r.slug} --prompt "Explain quantum computing in simple terms"`)}
7879
8851
 
7880
8852
  `);
7881
8853
  }
7882
- E();
7883
- Re();
7884
- var Xi = 1e4,
7885
- De = {
8854
+ C();
8855
+ Le();
8856
+ var si = 1e4,
8857
+ Ne = {
7886
8858
  price: '',
7887
8859
  creativeMode: 'Creative mode',
7888
8860
  priority: 'Priority',
@@ -7892,109 +8864,109 @@ var Xi = 1e4,
7892
8864
  priorityDraft: 'Priority + Draft',
7893
8865
  creativeModePriorityDraft: 'Creative mode + Priority + Draft',
7894
8866
  },
7895
- Zi = Object.keys(De),
7896
- er = {
8867
+ ni = Object.keys(Ne),
8868
+ oi = {
7897
8869
  creativeMode: 'unfiltered',
7898
8870
  creativeModePriority: 'unfilteredPriority',
7899
8871
  creativeModeDraft: 'unfilteredDraft',
7900
8872
  creativeModePriorityDraft: 'unfilteredPriorityDraft',
7901
8873
  };
7902
- function tr(e, t) {
7903
- let i = er[t];
7904
- return e[t] ?? (i ? e[i] : void 0);
8874
+ function li(e, t) {
8875
+ let r = oi[t];
8876
+ return e[t] ?? (r ? e[r] : void 0);
7905
8877
  }
7906
- async function ir(e, t) {
7907
- let i = `${x(e)}${ce(t)}`,
7908
- r;
8878
+ async function pi(e, t) {
8879
+ let r = `${x(e)}${me(t)}`,
8880
+ i;
7909
8881
  try {
7910
- r = await fetch(i, { signal: AbortSignal.timeout(Xi) });
8882
+ i = await fetch(r, { signal: AbortSignal.timeout(si) });
7911
8883
  } catch {
7912
- throw new Error(`Could not reach ${i}`);
8884
+ throw new Error(`Could not reach ${r}`);
7913
8885
  }
7914
- let n = await r.json().catch(() => null);
7915
- if (!r.ok || !n || n.object !== 'list' || !n.board) {
7916
- let s =
7917
- n && typeof n.error == 'string'
7918
- ? n.error
7919
- : n && typeof n.error == 'object' && n.error?.message
7920
- ? n.error.message
7921
- : `Pricing request failed (${r.status})`;
7922
- throw new Error(s);
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);
7923
8895
  }
7924
- return n;
8896
+ return s;
7925
8897
  }
7926
- function Oe(e) {
8898
+ function Ve(e) {
7927
8899
  let t = e.toFixed(4).replace(/0+$/, '').replace(/\.$/, ''),
7928
- [i, r = ''] = t.split('.');
7929
- return `$${i}.${r.padEnd(2, '0')}`;
8900
+ [r, i = ''] = t.split('.');
8901
+ return `$${r}.${i.padEnd(2, '0')}`;
7930
8902
  }
7931
- function Le(e) {
8903
+ function Ue(e) {
7932
8904
  if (!e || typeof e.starter != 'number') return null;
7933
8905
  let t = typeof e.plus == 'number' ? e.plus : e.starter,
7934
- i = typeof e.scale == 'number' ? e.scale : t;
7935
- return `Starter ${Oe(e.starter)} Plus ${Oe(t)} Scale ${Oe(i)}`;
8906
+ r = typeof e.scale == 'number' ? e.scale : t;
8907
+ return `Starter ${Ve(e.starter)} Plus ${Ve(t)} Scale ${Ve(r)}`;
7936
8908
  }
7937
- function rr(e) {
8909
+ function di(e) {
7938
8910
  if (typeof e.label == 'string' && e.label.trim()) return e.label.trim();
7939
8911
  let t = [];
7940
- for (let i of ['endpoint', 'resolution', 'quality', 'mode', 'task', 'component', 'token']) {
7941
- let r = e[i];
7942
- r != null && r !== '' && t.push(String(r));
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));
7943
8915
  }
7944
8916
  return (
7945
8917
  e.withVideo === !0 && t.push('with video'),
7946
8918
  t.length ? t.join(' \xB7 ') : String(e.id ?? 'default')
7947
8919
  );
7948
8920
  }
7949
- function ar(e, t) {
7950
- let i = rr(e);
7951
- for (let r of Zi) {
7952
- let n = Le(tr(e, r));
7953
- if (!n) continue;
7954
- let s = De[r] ? ` (${De[r]})` : '';
7955
- t.push(` ${i}${s} ${n}`);
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}`);
7956
8928
  }
7957
8929
  }
7958
- function nr(e, t) {
7959
- let i = e.quality ? ` quality=${e.quality}` : '';
8930
+ function ui(e, t) {
8931
+ let r = e.quality ? ` quality=${e.quality}` : '';
7960
8932
  t.push(
7961
- ` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${i}`)}`,
8933
+ ` ${a.bold(e.slug.padEnd(26))} ${a.gray(e.name)} ${a.dim(`${e.kind} ${e.unit} model=${e.model}${r}`)}`,
7962
8934
  );
7963
- for (let n of e.variants ?? []) ar(n, t);
7964
- let r = e.addons;
7965
- if (Array.isArray(r))
7966
- for (let n of r) {
7967
- if (!n || typeof n != 'object') continue;
7968
- let s = n,
7969
- o = typeof s.label == 'string' ? s.label : String(s.id ?? 'add-on'),
7970
- u = Le(s.price);
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);
7971
8943
  u && t.push(` ${o} (add-on) ${u}`);
7972
8944
  }
7973
8945
  t.push('');
7974
8946
  }
7975
- function sr(e) {
8947
+ function mi(e) {
7976
8948
  let t = [],
7977
- i = e.board.checked ? ` \xB7 checked ${e.board.checked}` : '';
7978
- (t.push(`${a.bold('Tein prices')} ${a.green(e.currency)} ${e.count} models${i}`),
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}`),
7979
8951
  t.push(
7980
8952
  `${a.dim('Starter, Plus and Scale. Creative mode, Priority and draft show only where published.')}`,
7981
8953
  ),
7982
8954
  t.push(''));
7983
- let r = new Map();
8955
+ let i = new Map();
7984
8956
  for (let l of e.board.models) {
7985
8957
  let c = l.kind || 'other',
7986
- p = r.get(c) ?? [];
7987
- (p.push(l), r.set(c, p));
8958
+ p = i.get(c) ?? [];
8959
+ (p.push(l), i.set(c, p));
7988
8960
  }
7989
- let n = ['video', 'image', 'audio', 'llm', 'text', '3d'],
7990
- s = [...r.keys()].sort((l, c) => {
7991
- let p = n.indexOf(l),
7992
- d = n.indexOf(c);
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);
7993
8965
  return (p === -1 ? 99 : p) - (d === -1 ? 99 : d);
7994
8966
  });
7995
- for (let l of s) {
8967
+ for (let l of n) {
7996
8968
  t.push(`${a.bold(a.cyan(`\u2500\u2500 ${l} \u2500\u2500`))}`);
7997
- for (let c of r.get(l) ?? []) nr(c, t);
8969
+ for (let c of i.get(l) ?? []) ui(c, t);
7998
8970
  }
7999
8971
  let o = new Set(e.board.models.map((l) => l.slug.toLowerCase())),
8000
8972
  u = (e.configs ?? []).filter((l) => !o.has(String(l.modelSlug ?? '').toLowerCase()));
@@ -8011,7 +8983,7 @@ function sr(e) {
8011
8983
  t.push(` ${a.bold(c.padEnd(26))} ${a.gray(d)}`);
8012
8984
  for (let m of p) {
8013
8985
  let h = String(m.displayLabel ?? m.billingUnit ?? 'price'),
8014
- g = Le(m.prices);
8986
+ g = Ue(m.prices);
8015
8987
  g && t.push(` ${h} ${g}`);
8016
8988
  }
8017
8989
  t.push('');
@@ -8024,13 +8996,13 @@ function sr(e) {
8024
8996
  `
8025
8997
  );
8026
8998
  }
8027
- async function Et(e) {
8999
+ async function Dt(e) {
8028
9000
  let t;
8029
9001
  try {
8030
- t = await ir(e.apiUrl, e.model);
8031
- } catch (i) {
8032
- let r = i instanceof Error ? i.message : String(i);
8033
- (process.stderr.write(`${a.red('Error:')} ${r}
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}
8034
9006
  `),
8035
9007
  process.exit(1));
8036
9008
  }
@@ -8038,15 +9010,15 @@ async function Et(e) {
8038
9010
  e.json
8039
9011
  ? `${JSON.stringify(t, null, 2)}
8040
9012
  `
8041
- : sr(t),
9013
+ : mi(t),
8042
9014
  );
8043
9015
  }
8044
- var qt = I(require('node:path'));
8045
- E();
8046
- async function At(e, t) {
8047
- let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
8048
- r = x(typeof t.api_url == 'string' ? t.api_url : void 0);
8049
- (i ||
9016
+ var Lt = P(require('node:path'));
9017
+ C();
9018
+ async function Vt(e, t) {
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 ||
8050
9022
  (process.stderr.write(`${a.red('Error:')} Authentication required.
8051
9023
  `),
8052
9024
  process.stderr
@@ -8059,18 +9031,18 @@ async function At(e, t) {
8059
9031
  process.stderr.write(`Usage: ${a.cyan('tein status <request-id> [--wait] [-o output.mp4]')}
8060
9032
  `),
8061
9033
  process.exit(1)));
8062
- let n = !!t.json,
8063
- s = !!t.wait,
9034
+ let s = !!t.json,
9035
+ n = !!t.wait,
8064
9036
  o = typeof t.output == 'string' ? t.output : void 0,
8065
- u = new M(i, r),
8066
- l = new T(`Checking status of ${a.bold(e)}...`);
8067
- n || l.start();
9037
+ u = new M(r, i),
9038
+ l = new _(`Checking status of ${a.bold(e)}...`);
9039
+ s || l.start();
8068
9040
  let c;
8069
9041
  try {
8070
9042
  c = await u.getStatus(e);
8071
9043
  } catch (p) {
8072
- (p instanceof k &&
8073
- (n
9044
+ (p instanceof w &&
9045
+ (s
8074
9046
  ? process.stdout.write(
8075
9047
  JSON.stringify(
8076
9048
  { error: { code: p.code ?? null, message: p.message, ...p.fields } },
@@ -8085,14 +9057,14 @@ async function At(e, t) {
8085
9057
  `),
8086
9058
  ),
8087
9059
  process.exit(p.exitCode)),
8088
- n || l.fail(p instanceof Error ? p.message : String(p)),
8089
- process.exit(_));
9060
+ s || l.fail(p instanceof Error ? p.message : String(p)),
9061
+ process.exit(T));
8090
9062
  }
8091
- if (s && c.status === 'processing') {
9063
+ if (n && c.status === 'processing') {
8092
9064
  let p = Date.now();
8093
9065
  for (; c.status === 'processing';) {
8094
9066
  let d = Math.round((Date.now() - p) / 1e3);
8095
- (n || l.update(`Waiting for ${a.bold(c.model)} (${d}s elapsed)...`),
9067
+ (s || l.update(`Waiting for ${a.bold(c.model)} (${d}s elapsed)...`),
8096
9068
  await new Promise((m) => setTimeout(m, 1500)));
8097
9069
  try {
8098
9070
  c = await u.getStatus(e);
@@ -8100,13 +9072,13 @@ async function At(e, t) {
8100
9072
  }
8101
9073
  }
8102
9074
  if (
8103
- (n ||
9075
+ (s ||
8104
9076
  (c.status === 'succeeded'
8105
9077
  ? l.succeed('Task completed!')
8106
9078
  : c.status === 'failed' || c.status === 'expired' || c.status === 'cancelled'
8107
9079
  ? l.fail(`Task ${c.status}: ${c.error || 'Something failed on our side.'}`)
8108
9080
  : l.stop()),
8109
- n)
9081
+ s)
8110
9082
  ) {
8111
9083
  process.stdout.write(
8112
9084
  JSON.stringify(c, null, 2) +
@@ -8136,9 +9108,9 @@ ${a.bold('Outputs:')}
8136
9108
  `),
8137
9109
  o)
8138
9110
  ) {
8139
- let d = new T(`Downloading output to ${o}...`).start();
9111
+ let d = new _(`Downloading output to ${o}...`).start();
8140
9112
  try {
8141
- (await u.downloadOutput(p.url, qt.default.resolve(process.cwd(), o)),
9113
+ (await u.downloadOutput(p.url, Lt.default.resolve(process.cwd(), o)),
8142
9114
  d.succeed(`Saved to ${a.bold(o)}`));
8143
9115
  } catch (m) {
8144
9116
  d.fail(`Failed to download: ${m instanceof Error ? m.message : m}`);
@@ -8153,14 +9125,14 @@ ${p.text}
8153
9125
  process.stdout.write(`
8154
9126
  `);
8155
9127
  }
8156
- var Ve = I(require('node:fs')),
8157
- Ne = I(require('node:path'));
8158
- E();
8159
- async function Rt(e, t = {}) {
8160
- let i = S(typeof t.api_key == 'string' ? t.api_key : void 0),
8161
- r = x(typeof t.api_url == 'string' ? t.api_url : void 0),
8162
- n = !!t.json;
8163
- (i ||
9128
+ var Be = P(require('node:fs')),
9129
+ Fe = P(require('node:path'));
9130
+ C();
9131
+ async function Nt(e, t = {}) {
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 ||
8164
9136
  (process.stderr.write(`${a.red('Error:')} Authentication required.
8165
9137
  `),
8166
9138
  process.stderr
@@ -8173,19 +9145,19 @@ async function Rt(e, t = {}) {
8173
9145
  process.stderr.write(`Usage: ${a.cyan('tein upload <image.png|video.mp4>')}
8174
9146
  `),
8175
9147
  process.exit(1)));
8176
- let s = Ne.default.resolve(e);
8177
- Ve.default.existsSync(s) ||
8178
- (process.stderr.write(`${a.red('Error:')} File not found: ${s}
9148
+ let n = Fe.default.resolve(e);
9149
+ Be.default.existsSync(n) ||
9150
+ (process.stderr.write(`${a.red('Error:')} File not found: ${n}
8179
9151
  `),
8180
9152
  process.exit(1));
8181
- let o = Ne.default.basename(s),
8182
- l = Ve.default.readFileSync(s).toString('base64'),
8183
- c = new M(i, r),
8184
- p = new T(`Uploading ${a.bold(o)} to Tein AI CDN...`);
8185
- n || p.start();
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();
8186
9158
  try {
8187
9159
  let d = await c.uploadAsset(l);
8188
- n
9160
+ s
8189
9161
  ? process.stdout.write(
8190
9162
  JSON.stringify(d, null, 2) +
8191
9163
  `
@@ -8203,26 +9175,26 @@ ${a.bold('CDN URL:')} ${a.green(d.url)}
8203
9175
 
8204
9176
  `));
8205
9177
  } catch (d) {
8206
- let m = d instanceof k ? d : null,
9178
+ let m = d instanceof w ? d : null,
8207
9179
  h = m
8208
9180
  ? K(m).join(`
8209
9181
  `)
8210
9182
  : d instanceof Error
8211
9183
  ? d.message
8212
9184
  : String(d);
8213
- (n
9185
+ (s
8214
9186
  ? process.stdout.write(
8215
9187
  JSON.stringify({ error: { code: m?.code ?? null, message: m?.message ?? h } }, null, 2) +
8216
9188
  `
8217
9189
  `,
8218
9190
  )
8219
9191
  : p.fail(`Upload failed: ${h}`),
8220
- process.exit(m ? m.exitCode : _));
9192
+ process.exit(m ? m.exitCode : T));
8221
9193
  }
8222
9194
  }
8223
9195
  H();
8224
- Te();
8225
- function Qt() {
9196
+ Se();
9197
+ function rr() {
8226
9198
  process.stdout.write(`
8227
9199
  ${a.bold(a.cyan('Tein AI CLI'))} - Official Command-Line Interface for Tein AI models
8228
9200
 
@@ -8282,11 +9254,11 @@ ${a.bold('EXAMPLES:')}
8282
9254
 
8283
9255
  `);
8284
9256
  }
8285
- async function _r() {
9257
+ async function $i() {
8286
9258
  let e = process.argv.slice(2),
8287
- t = Mt(e);
9259
+ t = Ct(e);
8288
9260
  if (t.flags.has('help') || t.options.help || t.command === 'help') {
8289
- Qt();
9261
+ rr();
8290
9262
  return;
8291
9263
  }
8292
9264
  if (t.flags.has('version') || t.options.version || t.command === 'version') {
@@ -8313,15 +9285,15 @@ async function _r() {
8313
9285
  }
8314
9286
  case 'models':
8315
9287
  case 'list': {
8316
- await $t(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
9288
+ await Ot(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0);
8317
9289
  break;
8318
9290
  }
8319
9291
  case 'pricing':
8320
9292
  case 'prices': {
8321
- let i = t.options.model,
8322
- r = t.subcommand || (typeof i == 'string' ? i : void 0);
8323
- await Et({
8324
- model: r,
9293
+ let r = t.options.model,
9294
+ i = t.subcommand || (typeof r == 'string' ? r : void 0);
9295
+ await Dt({
9296
+ model: i,
8325
9297
  json: !!t.options.json,
8326
9298
  apiUrl: typeof t.options.api_url == 'string' ? t.options.api_url : void 0,
8327
9299
  });
@@ -8335,49 +9307,49 @@ async function _r() {
8335
9307
  process.stderr.write(`Usage: ${a.cyan('tein info <model-slug>')}
8336
9308
  `),
8337
9309
  process.exit(1)),
8338
- await Ct(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
9310
+ await Rt(t.subcommand, typeof t.options.api_url == 'string' ? t.options.api_url : void 0));
8339
9311
  break;
8340
9312
  }
8341
9313
  case 'upload': {
8342
- let i = t.subcommand || '';
8343
- await Rt(i, t.options);
9314
+ let r = t.subcommand || '';
9315
+ await Nt(r, t.options);
8344
9316
  break;
8345
9317
  }
8346
9318
  case 'run':
8347
9319
  case 'generate': {
8348
- let i = t.subcommand || '';
8349
- await Ae(i, t.options);
9320
+ let r = t.subcommand || '';
9321
+ await De(r, t.options);
8350
9322
  break;
8351
9323
  }
8352
9324
  case 'status': {
8353
- let i = t.subcommand || '';
8354
- await At(i, t.options);
9325
+ let r = t.subcommand || '';
9326
+ await Vt(r, t.options);
8355
9327
  break;
8356
9328
  }
8357
9329
  case 'mcp': {
8358
- let { startStdioServer: i } = await Promise.resolve().then(() => (Yt(), Wt));
8359
- await i();
9330
+ let { startStdioServer: r } = await Promise.resolve().then(() => (tr(), er));
9331
+ await r();
8360
9332
  break;
8361
9333
  }
8362
9334
  default: {
8363
9335
  if (t.command && !t.command.startsWith('-')) {
8364
9336
  (!U(t.command) &&
8365
- !oe[t.command] &&
9337
+ !pe[t.command] &&
8366
9338
  (process.stderr.write(`
8367
9339
  ${a.red('Error:')} Unknown command or model "${t.command}".
8368
9340
  Run ${a.cyan('tein --help')} for the commands, or ${a.cyan('tein models')} for the model slugs.
8369
9341
  `),
8370
- process.exit(_)),
8371
- await Ae(t.command, t.options));
9342
+ process.exit(T)),
9343
+ await De(t.command, t.options));
8372
9344
  return;
8373
9345
  }
8374
- Qt();
9346
+ rr();
8375
9347
  break;
8376
9348
  }
8377
9349
  }
8378
9350
  }
8379
- _r().catch((e) => {
8380
- (e instanceof k &&
9351
+ $i().catch((e) => {
9352
+ (e instanceof w &&
8381
9353
  (process.stderr.write(`
8382
9354
  ${a.red('Error:')} ${K(e).join(`
8383
9355
  `)}
@@ -8386,5 +9358,5 @@ ${a.red('Error:')} ${K(e).join(`
8386
9358
  process.stderr.write(`
8387
9359
  ${a.red('Fatal error:')} ${e instanceof Error ? e.message : e}
8388
9360
  `),
8389
- process.exit(_));
9361
+ process.exit(T));
8390
9362
  });