@byte_fluffy/nexra-sdk 0.1.0-alpha.48 → 0.1.0-alpha.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -120,6 +120,30 @@ const result = await nexra.tasks.wait(task.id);
120
120
  Seedance 2.0 supports 4–15 seconds and Seedance 2.5 supports 4–30 seconds.
121
121
  The existing ByteDance model IDs retain their own supplies and prices.
122
122
 
123
+ ## MiniMax H3 Max
124
+
125
+ `0.1.0-alpha.49` adds the official `minimax/MiniMax-H3-Max` model. It supports
126
+ 480P/768P output, 5–15 seconds, and image, video and audio references.
127
+
128
+ ```ts
129
+ const model = "minimax/MiniMax-H3-Max";
130
+ const state = await nexra.catalog.model(model, "video.generate");
131
+ // The selected environment owns availability and current sale prices.
132
+ console.log(state.available, state.prices);
133
+
134
+ const task = await nexra.tasks.create(model, {
135
+ content: [{ type: "text", role: "prompt", text: "A paper boat drifts across a rain puddle." }],
136
+ duration: 5,
137
+ resolution: "480P",
138
+ aspect_ratio: "16:9",
139
+ });
140
+ const result = await nexra.tasks.wait(task.id);
141
+ ```
142
+
143
+ Use the selected environment's published prices for estimates. The SDK's bundled
144
+ catalog describes the model contract; channel costs and sale prices remain in
145
+ the live catalog.
146
+
123
147
  ## Banana 2.1
124
148
 
125
149
  Use `google/gemini-nano-banana-2.1` for Banana 2.1. The model supports
package/dist/catalog.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { a as JsonObject } from './json-Cz0MkWQn.js';
2
- import { H as HttpTransport, N as NexraCatalogChangeParams, a as NexraCatalogChangePage, b as NexraCatalogModelState, c as NexraSalePriceList, C as CreateNexraQuoteRequest, d as NexraQuote, e as CreateNexraDisplayQuoteBatchRequest, f as NexraDisplayQuoteBatch, g as NexraCatalogRevision, h as NexraModelSpec, i as NexraModelEndpointSpec, j as NexraModelSpecFilter } from './media-geometry-BS4DZh4B.js';
3
- export { M as MediaGeometryField, k as MediaGeometryProjection, l as NexraBillingCurrency, m as NexraCatalogModelIdentity, n as NexraModelOperation, o as NexraSalePrice, p as NexraSettlement, U as UnifiedMediaGeometry, q as applyMediaGeometry, r as decodeMediaGeometry, s as encodeMediaGeometry, t as projectMediaGeometry } from './media-geometry-BS4DZh4B.js';
2
+ import { H as HttpTransport, N as NexraCatalogChangeParams, a as NexraCatalogChangePage, b as NexraCatalogModelState, c as NexraSalePriceList, C as CreateNexraQuoteRequest, d as NexraQuote, e as CreateNexraDisplayQuoteBatchRequest, f as NexraDisplayQuoteBatch, g as NexraCatalogRevision, h as NexraModelSpec, i as NexraModelEndpointSpec, j as NexraModelSpecFilter } from './media-geometry-COln1N_2.js';
3
+ export { M as MediaGeometryField, k as MediaGeometryProjection, l as NexraBillingCurrency, m as NexraCatalogModelIdentity, n as NexraModelOperation, o as NexraSalePrice, p as NexraSettlement, U as UnifiedMediaGeometry, q as applyMediaGeometry, r as decodeMediaGeometry, s as encodeMediaGeometry, t as projectMediaGeometry } from './media-geometry-COln1N_2.js';
4
4
 
5
5
  declare function formatModelDisplayName(displayName: string, identity?: {
6
6
  modelId: string;
package/dist/catalog.js CHANGED
@@ -9,8 +9,8 @@ import {
9
9
  listModelSpecs,
10
10
  projectMediaGeometry,
11
11
  resolveNexraLanguageReasoning
12
- } from "./chunk-2IWCEEDI.js";
13
- import "./chunk-NR4EWD3X.js";
12
+ } from "./chunk-AO4HOLPJ.js";
13
+ import "./chunk-BS3B6F7W.js";
14
14
  export {
15
15
  CatalogClient,
16
16
  applyMediaGeometry,
@@ -2,7 +2,7 @@ import {
2
2
  normalizePublicErrorInput,
3
3
  pickPublicErrorFields,
4
4
  sortRatioDisplayOrder
5
- } from "./chunk-NR4EWD3X.js";
5
+ } from "./chunk-BS3B6F7W.js";
6
6
 
7
7
  // src/catalog/generated/audio.generated.json
8
8
  var audio_generated_default = [
@@ -3251,8 +3251,19 @@ var image_generated_default = [
3251
3251
  {
3252
3252
  type: "string",
3253
3253
  minLength: 1,
3254
- format: "uri",
3255
- pattern: "^(https?://|data:image/)"
3254
+ pattern: "^(https?://|data:image/)",
3255
+ if: {
3256
+ pattern: "^data:image\\/[^,]*;base64,"
3257
+ },
3258
+ then: {
3259
+ pattern: "^data:image\\/[A-Za-z0-9!$&'()*+;=:@./%_~?-]+;base64,[A-Za-z0-9+/%]+={0,2}$",
3260
+ not: {
3261
+ pattern: "\\s|%(?![0-9A-Fa-f]{2})"
3262
+ }
3263
+ },
3264
+ else: {
3265
+ format: "uri"
3266
+ }
3256
3267
  },
3257
3268
  {
3258
3269
  type: "object",
@@ -3607,8 +3618,19 @@ var image_generated_default = [
3607
3618
  {
3608
3619
  type: "string",
3609
3620
  minLength: 1,
3610
- format: "uri",
3611
- pattern: "^(https?://|data:image/)"
3621
+ pattern: "^(https?://|data:image/)",
3622
+ if: {
3623
+ pattern: "^data:image\\/[^,]*;base64,"
3624
+ },
3625
+ then: {
3626
+ pattern: "^data:image\\/[A-Za-z0-9!$&'()*+;=:@./%_~?-]+;base64,[A-Za-z0-9+/%]+={0,2}$",
3627
+ not: {
3628
+ pattern: "\\s|%(?![0-9A-Fa-f]{2})"
3629
+ }
3630
+ },
3631
+ else: {
3632
+ format: "uri"
3633
+ }
3612
3634
  },
3613
3635
  {
3614
3636
  type: "object",
@@ -6695,8 +6717,19 @@ var image_generated_default = [
6695
6717
  {
6696
6718
  type: "string",
6697
6719
  minLength: 1,
6698
- format: "uri",
6699
- pattern: "^(https?://|data:image/)"
6720
+ pattern: "^(https?://|data:image/)",
6721
+ if: {
6722
+ pattern: "^data:image\\/[^,]*;base64,"
6723
+ },
6724
+ then: {
6725
+ pattern: "^data:image\\/[A-Za-z0-9!$&'()*+;=:@./%_~?-]+;base64,[A-Za-z0-9+/%]+={0,2}$",
6726
+ not: {
6727
+ pattern: "\\s|%(?![0-9A-Fa-f]{2})"
6728
+ }
6729
+ },
6730
+ else: {
6731
+ format: "uri"
6732
+ }
6700
6733
  },
6701
6734
  {
6702
6735
  type: "object",
@@ -37198,6 +37231,553 @@ var language_generated_default = [
37198
37231
 
37199
37232
  // src/catalog/generated/video.generated.json
37200
37233
  var video_generated_default = [
37234
+ {
37235
+ id: "minimax/MiniMax-H3-Max",
37236
+ contractVersion: 1,
37237
+ developer: "minimax",
37238
+ displayName: "MiniMax H3 Max",
37239
+ summary: "Generate 5\u201315 second MiniMax H3 Max video with image, video, and audio references at 480p or 768p resolution.",
37240
+ kind: "video",
37241
+ family: "MiniMax H3",
37242
+ versionLabel: "H3 Max",
37243
+ aliases: [],
37244
+ capabilities: {
37245
+ inputModalities: [
37246
+ "text",
37247
+ "image",
37248
+ "video",
37249
+ "audio"
37250
+ ],
37251
+ outputModalities: [
37252
+ "video"
37253
+ ],
37254
+ inputModes: [
37255
+ "text-to-video",
37256
+ "image-to-video",
37257
+ "video-to-video",
37258
+ "audio-to-video"
37259
+ ],
37260
+ features: []
37261
+ },
37262
+ operations: [
37263
+ {
37264
+ operation: "video.generate",
37265
+ inputModalities: [
37266
+ "text",
37267
+ "image",
37268
+ "video",
37269
+ "audio"
37270
+ ],
37271
+ outputModalities: [
37272
+ "video"
37273
+ ],
37274
+ inputSchema: {
37275
+ $schema: "https://json-schema.org/draft/2020-12/schema",
37276
+ type: "object",
37277
+ properties: {
37278
+ content: {
37279
+ type: "array",
37280
+ minItems: 1,
37281
+ items: {
37282
+ oneOf: [
37283
+ {
37284
+ type: "object",
37285
+ properties: {
37286
+ type: {
37287
+ const: "text"
37288
+ },
37289
+ text: {
37290
+ type: "string",
37291
+ minLength: 1,
37292
+ maxLength: 7e3,
37293
+ title: "\u63D0\u793A\u8BCD"
37294
+ },
37295
+ role: {
37296
+ type: "string",
37297
+ const: "prompt"
37298
+ }
37299
+ },
37300
+ required: [
37301
+ "type",
37302
+ "text",
37303
+ "role"
37304
+ ],
37305
+ additionalProperties: false,
37306
+ title: "\u63D0\u793A\u8BCD"
37307
+ },
37308
+ {
37309
+ type: "object",
37310
+ properties: {
37311
+ type: {
37312
+ const: "image"
37313
+ },
37314
+ source: {
37315
+ oneOf: [
37316
+ {
37317
+ type: "string",
37318
+ minLength: 1
37319
+ },
37320
+ {
37321
+ type: "object",
37322
+ properties: {
37323
+ assetId: {
37324
+ type: "string",
37325
+ minLength: 1
37326
+ }
37327
+ },
37328
+ required: [
37329
+ "assetId"
37330
+ ],
37331
+ additionalProperties: false
37332
+ }
37333
+ ]
37334
+ },
37335
+ role: {
37336
+ type: "string",
37337
+ enum: [
37338
+ "first_frame",
37339
+ "last_frame",
37340
+ "reference"
37341
+ ]
37342
+ }
37343
+ },
37344
+ required: [
37345
+ "type",
37346
+ "source"
37347
+ ],
37348
+ additionalProperties: false,
37349
+ title: "\u56FE\u7247"
37350
+ },
37351
+ {
37352
+ type: "object",
37353
+ properties: {
37354
+ type: {
37355
+ const: "video"
37356
+ },
37357
+ source: {
37358
+ oneOf: [
37359
+ {
37360
+ type: "string",
37361
+ minLength: 1
37362
+ },
37363
+ {
37364
+ type: "object",
37365
+ properties: {
37366
+ assetId: {
37367
+ type: "string",
37368
+ minLength: 1
37369
+ }
37370
+ },
37371
+ required: [
37372
+ "assetId"
37373
+ ],
37374
+ additionalProperties: false
37375
+ }
37376
+ ]
37377
+ },
37378
+ role: {
37379
+ type: "string",
37380
+ const: "reference"
37381
+ }
37382
+ },
37383
+ required: [
37384
+ "type",
37385
+ "source",
37386
+ "role"
37387
+ ],
37388
+ additionalProperties: false,
37389
+ title: "\u53C2\u8003\u89C6\u9891"
37390
+ },
37391
+ {
37392
+ type: "object",
37393
+ properties: {
37394
+ type: {
37395
+ const: "audio"
37396
+ },
37397
+ source: {
37398
+ oneOf: [
37399
+ {
37400
+ type: "string",
37401
+ minLength: 1
37402
+ },
37403
+ {
37404
+ type: "object",
37405
+ properties: {
37406
+ assetId: {
37407
+ type: "string",
37408
+ minLength: 1
37409
+ }
37410
+ },
37411
+ required: [
37412
+ "assetId"
37413
+ ],
37414
+ additionalProperties: false
37415
+ }
37416
+ ]
37417
+ },
37418
+ role: {
37419
+ type: "string",
37420
+ const: "reference"
37421
+ }
37422
+ },
37423
+ required: [
37424
+ "type",
37425
+ "source",
37426
+ "role"
37427
+ ],
37428
+ additionalProperties: false,
37429
+ title: "\u53C2\u8003\u97F3\u9891"
37430
+ }
37431
+ ]
37432
+ },
37433
+ "x-ui": {
37434
+ control: "content-parts",
37435
+ order: 0,
37436
+ defaultInputMode: "reference"
37437
+ },
37438
+ title: "\u8F93\u5165\u5185\u5BB9",
37439
+ allOf: [
37440
+ {
37441
+ type: "array",
37442
+ contains: {
37443
+ type: "object",
37444
+ properties: {
37445
+ type: {
37446
+ const: "text"
37447
+ }
37448
+ },
37449
+ required: [
37450
+ "type"
37451
+ ]
37452
+ },
37453
+ minContains: 1,
37454
+ maxContains: 1
37455
+ },
37456
+ {
37457
+ type: "array",
37458
+ contains: {
37459
+ type: "object",
37460
+ properties: {
37461
+ type: {
37462
+ const: "image"
37463
+ },
37464
+ role: {
37465
+ const: "first_frame"
37466
+ }
37467
+ },
37468
+ required: [
37469
+ "type"
37470
+ ]
37471
+ },
37472
+ minContains: 0,
37473
+ maxContains: 1
37474
+ },
37475
+ {
37476
+ type: "array",
37477
+ contains: {
37478
+ type: "object",
37479
+ properties: {
37480
+ type: {
37481
+ const: "image"
37482
+ },
37483
+ role: {
37484
+ const: "last_frame"
37485
+ }
37486
+ },
37487
+ required: [
37488
+ "type",
37489
+ "role"
37490
+ ]
37491
+ },
37492
+ minContains: 0,
37493
+ maxContains: 1
37494
+ },
37495
+ {
37496
+ type: "array",
37497
+ contains: {
37498
+ type: "object",
37499
+ properties: {
37500
+ type: {
37501
+ const: "image"
37502
+ },
37503
+ role: {
37504
+ const: "reference"
37505
+ }
37506
+ },
37507
+ required: [
37508
+ "type",
37509
+ "role"
37510
+ ]
37511
+ },
37512
+ minContains: 0,
37513
+ maxContains: 9
37514
+ },
37515
+ {
37516
+ type: "array",
37517
+ contains: {
37518
+ type: "object",
37519
+ properties: {
37520
+ type: {
37521
+ const: "video"
37522
+ },
37523
+ role: {
37524
+ const: "reference"
37525
+ }
37526
+ },
37527
+ required: [
37528
+ "type",
37529
+ "role"
37530
+ ]
37531
+ },
37532
+ minContains: 0,
37533
+ maxContains: 3
37534
+ },
37535
+ {
37536
+ type: "array",
37537
+ contains: {
37538
+ type: "object",
37539
+ properties: {
37540
+ type: {
37541
+ const: "audio"
37542
+ },
37543
+ role: {
37544
+ const: "reference"
37545
+ }
37546
+ },
37547
+ required: [
37548
+ "type",
37549
+ "role"
37550
+ ]
37551
+ },
37552
+ minContains: 0,
37553
+ maxContains: 3
37554
+ }
37555
+ ],
37556
+ description: "\u6309\u987A\u5E8F\u63D0\u4F9B\u63D0\u793A\u8BCD\uFF0C\u4EE5\u53CA\u53EF\u9009\u7684\u9996\u5C3E\u5E27\u6216\u53C2\u8003\u56FE\u7247\u3001\u89C6\u9891\u548C\u97F3\u9891\u3002",
37557
+ maxItems: 16
37558
+ },
37559
+ aspect_ratio: {
37560
+ type: "string",
37561
+ enum: [
37562
+ "adaptive",
37563
+ "21:9",
37564
+ "16:9",
37565
+ "4:3",
37566
+ "1:1",
37567
+ "3:4",
37568
+ "9:16"
37569
+ ],
37570
+ title: "\u753B\u9762\u6BD4\u4F8B",
37571
+ "x-ui": {
37572
+ order: 10,
37573
+ control: "segmented"
37574
+ }
37575
+ },
37576
+ resolution: {
37577
+ type: "string",
37578
+ enum: [
37579
+ "480P",
37580
+ "768P"
37581
+ ],
37582
+ title: "\u5206\u8FA8\u7387",
37583
+ "x-ui": {
37584
+ order: 11,
37585
+ control: "segmented"
37586
+ }
37587
+ },
37588
+ duration: {
37589
+ type: "integer",
37590
+ minimum: 5,
37591
+ maximum: 15,
37592
+ multipleOf: 1,
37593
+ title: "\u89C6\u9891\u65F6\u957F",
37594
+ "x-ui": {
37595
+ order: 12,
37596
+ control: "range",
37597
+ unit: "\u79D2"
37598
+ }
37599
+ }
37600
+ },
37601
+ required: [
37602
+ "content",
37603
+ "resolution",
37604
+ "duration"
37605
+ ],
37606
+ additionalProperties: false,
37607
+ allOf: [
37608
+ {
37609
+ if: {
37610
+ properties: {
37611
+ content: {
37612
+ type: "array",
37613
+ contains: {
37614
+ type: "object",
37615
+ properties: {
37616
+ type: {
37617
+ const: "image"
37618
+ },
37619
+ role: {
37620
+ enum: [
37621
+ "first_frame",
37622
+ "last_frame"
37623
+ ]
37624
+ }
37625
+ },
37626
+ required: [
37627
+ "type"
37628
+ ]
37629
+ },
37630
+ minContains: 1
37631
+ }
37632
+ }
37633
+ },
37634
+ then: {
37635
+ properties: {
37636
+ content: {
37637
+ type: "array",
37638
+ not: {
37639
+ type: "array",
37640
+ contains: {
37641
+ anyOf: [
37642
+ {
37643
+ type: "object",
37644
+ properties: {
37645
+ type: {
37646
+ const: "image"
37647
+ },
37648
+ role: {
37649
+ const: "reference"
37650
+ }
37651
+ },
37652
+ required: [
37653
+ "type",
37654
+ "role"
37655
+ ]
37656
+ },
37657
+ {
37658
+ type: "object",
37659
+ properties: {
37660
+ type: {
37661
+ const: "video"
37662
+ },
37663
+ role: {
37664
+ const: "reference"
37665
+ }
37666
+ },
37667
+ required: [
37668
+ "type",
37669
+ "role"
37670
+ ]
37671
+ },
37672
+ {
37673
+ type: "object",
37674
+ properties: {
37675
+ type: {
37676
+ const: "audio"
37677
+ },
37678
+ role: {
37679
+ const: "reference"
37680
+ }
37681
+ },
37682
+ required: [
37683
+ "type",
37684
+ "role"
37685
+ ]
37686
+ }
37687
+ ]
37688
+ }
37689
+ }
37690
+ }
37691
+ }
37692
+ }
37693
+ },
37694
+ {
37695
+ if: {
37696
+ required: [
37697
+ "aspect_ratio"
37698
+ ],
37699
+ properties: {
37700
+ aspect_ratio: {
37701
+ const: "adaptive"
37702
+ }
37703
+ }
37704
+ },
37705
+ then: {
37706
+ properties: {
37707
+ content: {
37708
+ type: "array",
37709
+ contains: {
37710
+ type: "object",
37711
+ properties: {
37712
+ type: {
37713
+ enum: [
37714
+ "image",
37715
+ "video",
37716
+ "audio"
37717
+ ]
37718
+ }
37719
+ },
37720
+ required: [
37721
+ "type"
37722
+ ]
37723
+ },
37724
+ minContains: 1
37725
+ }
37726
+ }
37727
+ }
37728
+ },
37729
+ {
37730
+ if: {
37731
+ properties: {
37732
+ content: {
37733
+ type: "array",
37734
+ items: {
37735
+ type: "object",
37736
+ properties: {
37737
+ type: {
37738
+ const: "text"
37739
+ }
37740
+ }
37741
+ }
37742
+ }
37743
+ }
37744
+ },
37745
+ then: {
37746
+ required: [
37747
+ "aspect_ratio"
37748
+ ]
37749
+ }
37750
+ }
37751
+ ]
37752
+ },
37753
+ outputSchema: {},
37754
+ metering: {
37755
+ schemaVersion: 1,
37756
+ kind: "non_token",
37757
+ metrics: [
37758
+ {
37759
+ metric: "requests",
37760
+ requirement: "required"
37761
+ },
37762
+ {
37763
+ metric: "input_images",
37764
+ requirement: "required"
37765
+ },
37766
+ {
37767
+ metric: "output_video_seconds",
37768
+ requirement: "required"
37769
+ },
37770
+ {
37771
+ metric: "input_video_seconds",
37772
+ requirement: "conditional",
37773
+ whenFeature: "task_input_video_v1"
37774
+ }
37775
+ ]
37776
+ }
37777
+ }
37778
+ ],
37779
+ endpoints: []
37780
+ },
37201
37781
  {
37202
37782
  id: "depth-anything/video-depth-anything-small",
37203
37783
  contractVersion: 1,
@@ -60739,7 +61319,7 @@ var NexraWaitTimeoutError = class extends Error {
60739
61319
  };
60740
61320
 
60741
61321
  // src/generated/version.generated.ts
60742
- var SDK_VERSION = "0.1.0-alpha.48";
61322
+ var SDK_VERSION = "0.1.0-alpha.49";
60743
61323
 
60744
61324
  // src/transport.ts
60745
61325
  var DEFAULT_BASE_URL = "https://api.nexra-ai.com/v1";
@@ -10,6 +10,13 @@ var MEDIA_KINDS = [
10
10
 
11
11
  // ../contracts/src/public-error-catalog.ts
12
12
  var PUBLIC_ERROR_CATALOG = {
13
+ invalid_model_quotation_selection: { "zh-CN": "\u6240\u9009\u6A21\u578B\u6216\u6E20\u9053\u5DF2\u4E0D\u53EF\u5BFC\u51FA\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u540E\u91CD\u8BD5\u3002", en: "The selected models or channels are no longer available for export. Update your selection and try again." },
14
+ api_key_spending_limit_exceeded: { "zh-CN": "\u5F53\u524D\u5BC6\u94A5\u7684\u5269\u4F59\u6D88\u8D39\u989D\u5EA6\u4E0D\u8DB3\uFF0C\u8BF7\u8054\u7CFB\u7EC4\u7EC7\u7BA1\u7406\u5458\u589E\u52A0\u989D\u5EA6\u3002", en: "This key has insufficient remaining spending allowance. Ask an organization administrator to increase it." },
15
+ organization_key_limit_invalid: { "zh-CN": "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u6D88\u8D39\u989D\u5EA6\uFF0C\u91D1\u989D\u6700\u591A\u4FDD\u7559 8 \u4F4D\u5C0F\u6570\uFF1B\u8C03\u6574\u91D1\u989D\u987B\u5927\u4E8E 0\u3002", en: "Enter a valid spending allowance with up to 8 decimal places. An adjustment must be greater than zero." },
16
+ organization_key_limit_unset: { "zh-CN": "\u5F53\u524D\u5BC6\u94A5\u5C1A\u672A\u8BBE\u7F6E\u6D88\u8D39\u989D\u5EA6\uFF0C\u8BF7\u5148\u589E\u52A0\u989D\u5EA6\u540E\u518D\u51CF\u5C11\u3002", en: "This key has no spending allowance configured. Set it with an increase before decreasing it." },
17
+ organization_key_limit_below_committed: { "zh-CN": "\u8C03\u6574\u540E\u7684\u6D88\u8D39\u989D\u5EA6\u4E0D\u80FD\u4F4E\u4E8E\u5DF2\u6D88\u8D39\u4E0E\u8BF7\u6C42\u9884\u5360\u7684\u5408\u8BA1\u91D1\u989D\u3002", en: "The resulting allowance cannot be less than settled spending plus pending reservations." },
18
+ organization_key_limit_exceeds_wallet: { "zh-CN": "\u5BC6\u94A5\u53EF\u7528\u6D88\u8D39\u989D\u5EA6\u4E0D\u80FD\u8D85\u8FC7\u94B1\u5305\u5F53\u524D\u53EF\u7528\u4F59\u989D\uFF0C\u8BF7\u8C03\u6574\u989D\u5EA6\u6216\u5145\u503C\u540E\u91CD\u8BD5\u3002", en: "The key's available spending allowance cannot exceed the wallet's current available balance. Reduce it or add funds." },
19
+ organization_key_limit_conflict: { "zh-CN": "\u8FD9\u6B21\u989D\u5EA6\u64CD\u4F5C\u5DF2\u88AB\u5904\u7406\uFF0C\u8BF7\u5173\u95ED\u540E\u91CD\u65B0\u6253\u5F00\u518D\u8BD5\u3002", en: "This allowance change has already been processed. Close and reopen the form to try again." },
13
20
  google_channel_rate_limited: { "zh-CN": "\u5F53\u524D\u6587\u672C\u6A21\u578B\u670D\u52A1\u7E41\u5FD9\u6216\u53D7\u5230\u9650\u6D41\uFF08429\uFF09\u3002\u8BF7\u7A0D\u540E\u518D\u8BD5\uFF1B\u82E5\u6301\u7EED\u51FA\u73B0\uFF0C\u53EF\u5207\u6362\u5176\u4ED6\u6587\u672C\u6A21\u578B\uFF0C\u518D\u53D1\u9001\u6D88\u606F\u7EE7\u7EED\u3002", en: "The current text model service is busy or rate limited (429). Try again later; if the problem persists, switch to another text model and send a message to continue." },
14
21
  queue_wait_timeout: { "zh-CN": "\u4EFB\u52A1\u6392\u961F\u7B49\u5F85\u6267\u884C\u8D85\u8FC7\u65F6\u9650\uFF0C\u5C1A\u672A\u63D0\u4EA4\u7ED9\u6A21\u578B\u670D\u52A1\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\uFF1B\u6301\u7EED\u8D85\u65F6\u65F6\u51ED\u8BF7\u6C42 ID \u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u3002", en: "The task exceeded its queue wait limit before submission to the model service. Try again later; contact a platform administrator with the request ID if queue timeouts persist." },
15
22
  task_execution_timeout: { "zh-CN": "\u4EFB\u52A1\u8D85\u8FC7\u603B\u65F6\u9650\uFF0C\u5DF2\u7ED3\u675F\u3002\u4E0A\u6E38\u53EF\u80FD\u4ECD\u5728\u5904\u7406\uFF0C\u8BF7\u5148\u6838\u5BF9\u539F\u8BF7\u6C42\u7ED3\u679C\uFF0C\u907F\u514D\u91CD\u590D\u63D0\u4EA4\u3002", en: "The task exceeded its total time limit and has ended. The upstream service may still be processing it; check the original request before submitting again." },
@@ -43,6 +50,18 @@ var PUBLIC_ERROR_CATALOG = {
43
50
  session_required: { "zh-CN": "\u6B64\u5165\u53E3\u53EA\u63A5\u53D7\u5DF2\u767B\u5F55\u7684\u8D26\u6237\u4F1A\u8BDD\u3002\u8BF7\u5728\u7F51\u9875\u4E2D\u767B\u5F55\u540E\u8BBF\u95EE\uFF0CAPI Key \u4E0D\u80FD\u66FF\u4EE3\u8BE5\u4F1A\u8BDD\u3002", en: "This endpoint requires a signed-in account session. Sign in through the web application; an API key cannot replace this session." },
44
51
  origin_not_allowed: { "zh-CN": "\u5F53\u524D\u7F51\u9875\u6765\u6E90\u4E0D\u5728\u63A5\u53E3\u5141\u8BB8\u7684\u6765\u6E90\u8303\u56F4\u5185\u3002\u8BF7\u4F7F\u7528\u53D7\u4FE1\u4EFB\u7684\u7AD9\u70B9\uFF0C\u6216\u8054\u7CFB\u7BA1\u7406\u5458\u6838\u5BF9\u6765\u6E90\u914D\u7F6E\u3002", en: "The web page's origin is not allowed by this endpoint. Use a trusted site or ask an administrator to review the allowed origins." },
45
52
  admin_user_conflict: { "zh-CN": "\u7528\u6237\u7BA1\u7406\u64CD\u4F5C\u4E0E\u5F53\u524D\u8D26\u6237\u72B6\u6001\u3001\u5E76\u53D1\u53D8\u66F4\u6216\u7BA1\u7406\u5458\u4FDD\u62A4\u89C4\u5219\u51B2\u7A81\u3002\u8BF7\u5237\u65B0\u7528\u6237\u8BB0\u5F55\uFF0C\u5E76\u6838\u5BF9\u7BA1\u7406\u5458\u5173\u7CFB\u548C\u64CD\u4F5C\u9650\u5236\u3002", en: "The user management operation conflicts with the account state, a concurrent change, or administrator safeguards. Refresh the user record and review administrator relationships and operation restrictions." },
53
+ organization_member_conflict: { "zh-CN": "\u8BE5\u7528\u6237\u5DF2\u662F\u672C\u7EC4\u7EC7\u7684\u6210\u5458\u3002", en: "This user is already a member of the organization." },
54
+ organization_super_admin_protected: { "zh-CN": "\u7EC4\u7EC7\u521B\u5EFA\u8005\u4E3A\u8D85\u7EA7\u7BA1\u7406\u5458\uFF0C\u4E0D\u80FD\u88AB\u964D\u7EA7\u6216\u79FB\u9664\u3002", en: "The organization creator is its super administrator and cannot be demoted or removed." },
55
+ organization_last_admin: { "zh-CN": "\u7EC4\u7EC7\u81F3\u5C11\u8981\u4FDD\u7559\u4E00\u540D\u7BA1\u7406\u5458\u3002", en: "An organization must retain at least one administrator." },
56
+ organization_key_assignee_unavailable: { "zh-CN": "\u53EA\u80FD\u5C06 Key \u5206\u914D\u7ED9\u672C\u7EC4\u7EC7\u7684\u6709\u6548\u6210\u5458\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002", en: "Keys can only be assigned to active members of this organization. Review the selected members." },
57
+ organization_invitation_unavailable: { "zh-CN": "\u9080\u8BF7\u94FE\u63A5\u65E0\u6548\u3001\u5DF2\u8FC7\u671F\u6216\u5DF2\u505C\u7528\uFF0C\u8BF7\u8054\u7CFB\u7EC4\u7EC7\u7BA1\u7406\u5458\u83B7\u53D6\u65B0\u94FE\u63A5\u3002", en: "This invitation link is invalid, expired, or disabled. Ask the organization administrator for a new link." },
58
+ organization_member_removed: { "zh-CN": "\u4F60\u5DF2\u88AB\u79FB\u51FA\u8BE5\u7EC4\u7EC7\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u901A\u8FC7\u7528\u6237 ID \u91CD\u65B0\u6DFB\u52A0\u3002", en: "You were removed from this organization. Ask an administrator to add your user ID again." },
59
+ organization_default_key_unavailable: { "zh-CN": "\u5F53\u524D\u7EC4\u7EC7\u6CA1\u6709\u53EF\u7528\u7684 API Key\uFF0C\u8BF7\u8054\u7CFB\u7EC4\u7EC7\u7BA1\u7406\u5458\u3002", en: "This organization has no available API key. Contact an organization administrator." },
60
+ organization_key_assignment_required: { "zh-CN": "\u6CA1\u6709\u5DF2\u5206\u914D\u7684\u53EF\u7528\u5BC6\u94A5\uFF0C\u8BF7\u8054\u7CFB\u7EC4\u7EC7\u7BA1\u7406\u5458\u5206\u914D\u3002", en: "No available key is assigned to you. Ask an organization administrator to assign one." },
61
+ organization_key_selection_required: { "zh-CN": "\u8BF7\u5148\u5728 Nexra \u4E2D\u9009\u62E9\u672C\u6B21\u8C03\u7528\u4F7F\u7528\u7684\u5BC6\u94A5\u3002", en: "Select a key in Nexra before making this request." },
62
+ organization_execution_key_unavailable: { "zh-CN": "\u6B64\u524D\u9009\u7528\u7684\u5BC6\u94A5\u5DF2\u4E0D\u53EF\u7528\u6216\u6743\u9650\u5DF2\u64A4\u56DE\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6216\u8054\u7CFB\u7EC4\u7EC7\u7BA1\u7406\u5458\u3002", en: "Your selected key is unavailable or access was withdrawn. Select another key or contact an organization administrator." },
63
+ organization_default_key_change_unavailable: { "zh-CN": "\u81F3\u5C11\u9700\u8981\u4E24\u4E2A\u53EF\u7528\u7684\u7EC4\u7EC7 Key \u624D\u80FD\u66F4\u6539\u9ED8\u8BA4 Key\u3002", en: "At least two available organization keys are required to change the default key." },
64
+ personal_key_unavailable: { "zh-CN": "\u5F53\u524D\u4E2A\u4EBA\u8EAB\u4EFD\u6CA1\u6709\u53EF\u7528\u7684 API \u5BC6\u94A5\uFF0C\u8BF7\u5148\u521B\u5EFA\u4E2A\u4EBA\u5BC6\u94A5\u3002", en: "Your personal identity has no available API key. Create a personal key first." },
46
65
  api_key_not_found: { "zh-CN": "\u672A\u627E\u5230\u53EF\u64CD\u4F5C\u7684 API Key\uFF0C\u6216\u8BE5 Key \u4E0D\u5C5E\u4E8E\u5F53\u524D\u8BBF\u95EE\u8303\u56F4\u3002\u8BF7\u5237\u65B0 Key \u5217\u8868\u5E76\u6838\u5BF9 Key ID\u3002", en: "No accessible API key was found for this operation. Refresh the key list and check the key ID." },
47
66
  asset_certification_not_found: { "zh-CN": "\u672A\u627E\u5230\u8BE5\u8D44\u6E90\u7684\u8BA4\u8BC1\u8BB0\u5F55\u3002\u8BF7\u6838\u5BF9\u8D44\u6E90 ID\uFF0C\u5E76\u786E\u8BA4\u8D44\u6E90\u5DF2\u53D1\u8D77\u8BA4\u8BC1\u3002", en: "No certification record was found for this asset. Check the asset ID and whether certification has been requested." },
48
67
  asset_content_unavailable: { "zh-CN": "\u8D44\u6E90\u8BB0\u5F55\u5B58\u5728\uFF0C\u4F46\u76EE\u524D\u65E0\u6CD5\u8BFB\u53D6\u5176\u5185\u5BB9\u3002\u8BF7\u67E5\u770B\u8D44\u6E90\u72B6\u6001\uFF1B\u6301\u7EED\u5F02\u5E38\u65F6\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u6838\u5BF9\u5B58\u50A8\u8BB0\u5F55\u3002", en: "The asset record exists, but its content cannot currently be read. Check the asset status and ask a platform administrator to inspect its storage record if the problem persists." },
@@ -183,6 +202,7 @@ var PUBLIC_ERROR_CATALOG = {
183
202
  native_source_not_ready: { "zh-CN": "\u6765\u6E90\u89C6\u9891\u4EFB\u52A1\u672A\u8FBE\u5230\u6210\u529F\u5B8C\u6210\u72B6\u6001\uFF0C\u4E0D\u80FD\u7528\u4E8E\u8FD9\u6B21 Native \u64CD\u4F5C\u3002\u8BF7\u5148\u67E5\u8BE2\u539F\u4EFB\u52A1\u72B6\u6001\uFF0C\u518D\u4F7F\u7528\u5F53\u524D\u8D26\u6237\u5DF2\u6210\u529F\u5B8C\u6210\u7684\u89C6\u9891\u4EFB\u52A1 ID\u3002", en: "The source video task has not reached a successful completion state and cannot be used for this native operation. Check the original task and use a successfully completed video task owned by this account." },
184
203
  native_task_id_required: { "zh-CN": "Native \u4EFB\u52A1\u67E5\u8BE2\u7F3A\u5C11\u4EFB\u52A1\u6807\u8BC6\u3002\u8BF7\u5728\u63A5\u53E3\u8981\u6C42\u7684\u8DEF\u5F84\u6216\u53C2\u6570\u4E2D\u63D0\u4F9B\u539F\u4EFB\u52A1 ID\u3002", en: "The native task query is missing a task identifier. Provide the original task ID in the path or parameter required by the endpoint." },
185
204
  native_task_list_unsupported: { "zh-CN": "\u6B64 Native \u5165\u53E3\u4E0D\u652F\u6301\u5217\u51FA\u8D26\u6237\u4EFB\u52A1\u3002\u8BF7\u4F7F\u7528\u5177\u4F53\u4EFB\u52A1 ID \u67E5\u8BE2\uFF0C\u6216\u901A\u8FC7 Nexra \u4EFB\u52A1\u5217\u8868\u67E5\u770B\u5F53\u524D\u8D26\u6237\u7684\u4EFB\u52A1\u3002", en: "This native endpoint does not support listing account tasks. Query a specific task ID or use the Nexra task list to view tasks owned by your account." },
205
+ task_execution_unavailable: { "zh-CN": "\u4EFB\u52A1\u6267\u884C\u670D\u52A1\u6682\u4E0D\u53EF\u7528\uFF0C\u672C\u6B21\u672A\u521B\u5EFA\u4EFB\u52A1\u6216\u9884\u5360\u8D39\u7528\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\uFF1B\u6301\u7EED\u5931\u8D25\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u68C0\u67E5\u961F\u5217\u548C Worker\u3002", en: "Task execution is unavailable. No task or billing hold was created. Retry later; if it persists, ask an administrator to check the queue and Worker." },
186
206
  native_task_service_unavailable: { "zh-CN": "\u6B64\u539F\u751F\u63A5\u53E3\u7684\u4EFB\u52A1\u521B\u5EFA\u670D\u52A1\u672A\u5C31\u7EEA\u3002\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u68C0\u67E5\u670D\u52A1\u914D\u7F6E\uFF0C\u52FF\u7ED5\u8FC7\u8BE5\u5165\u53E3\u7684\u8BA1\u8D39\u6D41\u7A0B\u3002", en: "The task creation service for this native endpoint is not ready. Ask a platform administrator to check its configuration rather than bypassing the endpoint's billing flow." },
187
207
  not_found: { "zh-CN": "\u672A\u627E\u5230\u5F53\u524D\u8BBF\u95EE\u8303\u56F4\u5185\u7684\u76EE\u6807\u8D44\u6E90\u3002\u8BF7\u68C0\u67E5\u63A5\u53E3\u8DEF\u5F84\u3001\u8D44\u6E90 ID \u548C\u8BBF\u95EE\u8EAB\u4EFD\u3002", en: "The target resource was not found within your access scope. Check the endpoint path, resource ID, and identity used to access it." },
188
208
  operation_required: { "zh-CN": "\u8BF7\u6C42\u7F3A\u5C11\u6A21\u578B\u64CD\u4F5C\u540D\u79F0\u3002\u8BF7\u4F7F\u7528\u6A21\u578B\u76EE\u5F55\u4E2D\u8BE5\u6A21\u578B\u652F\u6301\u7684 operation\u3002", en: "The request is missing a model operation. Use an operation supported by the model in the catalog." },
@@ -419,6 +439,7 @@ var NEXRA_GENERATION_OPERATIONS = [
419
439
  "image.generate",
420
440
  "video.generate",
421
441
  "audio.generate",
442
+ "audio.transcribe",
422
443
  "image.upscale",
423
444
  "video.upscale",
424
445
  "video.depth",
@@ -428,6 +449,7 @@ var NEXRA_MEDIA_OPERATIONS = [
428
449
  "image.generate",
429
450
  "video.generate",
430
451
  "audio.generate",
452
+ "audio.transcribe",
431
453
  "image.upscale",
432
454
  "video.upscale",
433
455
  "video.depth",
@@ -437,6 +459,7 @@ var NEXRA_PUBLISHED_MEDIA_OPERATIONS = [
437
459
  "image.generate",
438
460
  "video.generate",
439
461
  "audio.generate",
462
+ "audio.transcribe",
440
463
  "image.upscale",
441
464
  "video.upscale",
442
465
  "video.depth",
@@ -460,6 +483,7 @@ var NEXRA_MEDIA_FEATURES = [
460
483
  "reference-video",
461
484
  "reference-audio",
462
485
  "omni-reference",
486
+ "asr",
463
487
  "tts",
464
488
  "music",
465
489
  "sfx",
@@ -492,6 +516,13 @@ var NEXRA_MEDIA_OPERATION_DEFINITIONS = Object.freeze([
492
516
  features: ["tts", "music", "sfx", "voice-reference", "voice-design"],
493
517
  parameterKeys: ["voice", "language", "duration", "output_format", "sample_rate", "speed", "volume", "pitch", "emotion", "instrumental", "loop", "prompt_influence", "seed"]
494
518
  },
519
+ {
520
+ operation: "audio.transcribe",
521
+ status: "active",
522
+ outputKind: "text",
523
+ features: ["asr"],
524
+ parameterKeys: ["input_format", "language", "punctuate", "diarize", "timestamps"]
525
+ },
495
526
  {
496
527
  operation: "image.upscale",
497
528
  status: "active",
@@ -649,6 +680,17 @@ var NEXRA_MEDIA_INPUT_SCHEMAS = Object.freeze({
649
680
  seed: { type: "integer", minimum: 0, "x-ui": { order: 22, control: "number" } }
650
681
  }
651
682
  ),
683
+ "audio.transcribe": inputSchema(
684
+ [mediaPartSchema("audio", ["source"])],
685
+ {
686
+ input_format: { type: "string", minLength: 1, "x-ui": { order: 9 } },
687
+ language: { type: "string", minLength: 1, "x-ui": { order: 10 } },
688
+ punctuate: { type: "boolean", "x-ui": { order: 11, control: "switch" } },
689
+ diarize: { type: "boolean", "x-ui": { order: 12, control: "switch" } },
690
+ timestamps: { type: "boolean", "x-ui": { order: 13, control: "switch" } }
691
+ },
692
+ { minItems: 1, maxItems: 1 }
693
+ ),
652
694
  "image.upscale": inputSchema(
653
695
  [mediaPartSchema("image", ["source"])],
654
696
  {
@@ -706,6 +748,7 @@ function isNexraMediaInput(value) {
706
748
  function nexraMediaOperationForMode(mode) {
707
749
  if (["text-to-image", "image-to-image"].includes(mode)) return "image.generate";
708
750
  if (["text-to-video", "image-to-video", "multimodal-to-video", "avatar-video"].includes(mode)) return "video.generate";
751
+ if (mode === "audio-to-text") return "audio.transcribe";
709
752
  if (["text-to-speech", "text-to-music", "text-to-sfx"].includes(mode)) return "audio.generate";
710
753
  if (mode === "image-upscale") return "image.upscale";
711
754
  if (mode === "video-upscale") return "video.upscale";
@@ -871,6 +914,9 @@ function sortRatioDisplayOrder(values) {
871
914
  return [...values].sort(compareRatioDisplayOrder);
872
915
  }
873
916
 
917
+ // ../contracts/src/volcengine-asr.ts
918
+ var ASR_MAX_FRAME_BYTES = 8 * 1024 * 1024;
919
+
874
920
  export {
875
921
  MEDIA_KINDS,
876
922
  isPublicErrorCode,
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- export { A as AssetImportRequest, a as AssetInput, b as AssetReference, c as AssetUploadOptions, M as MEDIA_KINDS, d as MediaAsset, e as MediaAssetStatus, f as MediaKind, N as NexraImageLayer, g as NexraImageLayerDecompositionOutput } from './media-Co8S2qEM.js';
2
- import { H as HttpTransport, u as ModelSearchParams, T as TaskModelSummary, v as TaskModel, w as ModelSchema, x as ModelResourceList, y as NexraClientOptions } from './media-geometry-BS4DZh4B.js';
3
- export { e as CreateNexraDisplayQuoteBatchRequest, C as CreateNexraQuoteRequest, F as FetchLike, M as MediaGeometryField, k as MediaGeometryProjection, z as ModelCapabilitySummary, A as ModelDateVersion, B as ModelEndpointSummary, D as ModelModality, E as ModelResourceOption, l as NexraBillingCurrency, g as NexraCatalogRevision, f as NexraDisplayQuoteBatch, G as NexraDisplayQuoteBatchEntry, n as NexraModelOperation, h as NexraModelSpec, j as NexraModelSpecFilter, d as NexraQuote, o as NexraSalePrice, c as NexraSalePriceList, p as NexraSettlement, U as UnifiedMediaGeometry, q as applyMediaGeometry, r as decodeMediaGeometry, s as encodeMediaGeometry, t as projectMediaGeometry } from './media-geometry-BS4DZh4B.js';
1
+ export { A as AssetImportRequest, a as AssetInput, b as AssetReference, c as AssetUploadOptions, M as MEDIA_KINDS, d as MediaAsset, e as MediaAssetStatus, f as MediaKind, N as NexraImageLayer, g as NexraImageLayerDecompositionOutput } from './media-DzOxLGs-.js';
2
+ import { H as HttpTransport, u as ModelSearchParams, T as TaskModelSummary, v as TaskModel, w as ModelSchema, x as ModelResourceList, y as NexraClientOptions } from './media-geometry-COln1N_2.js';
3
+ export { e as CreateNexraDisplayQuoteBatchRequest, C as CreateNexraQuoteRequest, F as FetchLike, M as MediaGeometryField, k as MediaGeometryProjection, z as ModelCapabilitySummary, A as ModelDateVersion, B as ModelEndpointSummary, D as ModelModality, E as ModelResourceOption, l as NexraBillingCurrency, g as NexraCatalogRevision, f as NexraDisplayQuoteBatch, G as NexraDisplayQuoteBatchEntry, n as NexraModelOperation, h as NexraModelSpec, j as NexraModelSpecFilter, d as NexraQuote, o as NexraSalePrice, c as NexraSalePriceList, p as NexraSettlement, U as UnifiedMediaGeometry, q as applyMediaGeometry, r as decodeMediaGeometry, s as encodeMediaGeometry, t as projectMediaGeometry } from './media-geometry-COln1N_2.js';
4
4
  import { C as CursorPage, J as JsonValue } from './json-Cz0MkWQn.js';
5
5
  export { a as JsonObject, b as JsonPrimitive } from './json-Cz0MkWQn.js';
6
6
  import { N as NexraError, P as PublicErrorFields } from './errors-DJZuAKoO.js';
7
7
  export { A as ApiErrorPayload, a as PublicError, b as PublicErrorContext, e as extractUpstreamErrorMessage } from './errors-DJZuAKoO.js';
8
- import { V as Voice, C as CreateVoiceRequest, a as VoiceCreation, A as AssetsClient, T as TasksClient, R as RunTaskOptions, b as RunResult, c as TaskResult } from './voices-Bzt4nV1r.js';
9
- export { d as CreateTaskOptions, e as CreateTaskRequest, f as RequestDetails, g as TASK_STATUSES, h as TaskCost, i as TaskError, j as TaskEvent, k as TaskEventType, l as TaskListParams, m as TaskPage, n as TaskProgress, o as TaskReceipt, p as TaskStatus, q as TaskTiming, r as TaskUsage, s as TaskWebhookConfig, t as TerminalTaskStatus, u as VerifyWebhookOptions, W as WaitTaskOptions, v as WatchTaskOptions, w as isTerminalTaskStatus, x as verifyWebhook } from './voices-Bzt4nV1r.js';
8
+ import { V as Voice, C as CreateVoiceRequest, a as VoiceCreation, A as AssetsClient, T as TasksClient, R as RunTaskOptions, b as RunResult, c as TaskResult } from './voices-xyPqhQqR.js';
9
+ export { d as CreateTaskOptions, e as CreateTaskRequest, f as RequestDetails, g as TASK_STATUSES, h as TaskCost, i as TaskError, j as TaskEvent, k as TaskEventType, l as TaskListParams, m as TaskPage, n as TaskProgress, o as TaskReceipt, p as TaskStatus, q as TaskTiming, r as TaskUsage, s as TaskWebhookConfig, t as TerminalTaskStatus, u as VerifyWebhookOptions, W as WaitTaskOptions, v as WatchTaskOptions, w as isTerminalTaskStatus, x as verifyWebhook } from './voices-xyPqhQqR.js';
10
10
  import { CatalogClient } from './catalog.js';
11
11
  export { formatModelDisplayName, getModelSpec, listModelSpecs } from './catalog.js';
12
12
  export { ceilDecimal, multiplyDecimal } from './decimal.js';
package/dist/index.js CHANGED
@@ -20,14 +20,14 @@ import {
20
20
  projectMediaGeometry,
21
21
  queryString,
22
22
  sleep
23
- } from "./chunk-2IWCEEDI.js";
23
+ } from "./chunk-AO4HOLPJ.js";
24
24
  import {
25
25
  MEDIA_KINDS,
26
26
  TASK_STATUSES,
27
27
  createTaskRequest,
28
28
  extractUpstreamErrorMessage,
29
29
  isTerminalTaskStatus
30
- } from "./chunk-NR4EWD3X.js";
30
+ } from "./chunk-BS3B6F7W.js";
31
31
 
32
32
  // src/assets.ts
33
33
  var AssetsClient = class {
@@ -1,7 +1,7 @@
1
1
  import { APICallError, LanguageModelV4 } from '@ai-sdk/provider';
2
2
  import { NexraLanguageProtocol } from './catalog.js';
3
3
  export { NexraLanguageModelBinding } from './catalog.js';
4
- import { F as FetchLike } from './media-geometry-BS4DZh4B.js';
4
+ import { F as FetchLike } from './media-geometry-COln1N_2.js';
5
5
  import { N as NexraError } from './errors-DJZuAKoO.js';
6
6
  import './json-Cz0MkWQn.js';
7
7
 
package/dist/language.js CHANGED
@@ -6,12 +6,12 @@ import {
6
6
  jsonBody,
7
7
  parseServerSentEvents,
8
8
  resolveNexraLanguageReasoning
9
- } from "./chunk-2IWCEEDI.js";
9
+ } from "./chunk-AO4HOLPJ.js";
10
10
  import {
11
11
  isPublicErrorCode,
12
12
  publicErrorMessage,
13
13
  resolvePublicErrorLocale
14
- } from "./chunk-NR4EWD3X.js";
14
+ } from "./chunk-BS3B6F7W.js";
15
15
 
16
16
  // src/language/index.ts
17
17
  import { createAnthropic } from "@ai-sdk/anthropic";
@@ -60,13 +60,13 @@ interface AssetCertificationWaitOptions {
60
60
 
61
61
  declare const NEXRA_MEDIA_API_VERSION: 1;
62
62
  /** Catalog-level generation taxonomy. Text keeps its native endpoint protocols. */
63
- declare const NEXRA_GENERATION_OPERATIONS: readonly ["text.generate", "image.generate", "video.generate", "audio.generate", "image.upscale", "video.upscale", "video.depth", "video.segment"];
63
+ declare const NEXRA_GENERATION_OPERATIONS: readonly ["text.generate", "image.generate", "video.generate", "audio.generate", "audio.transcribe", "image.upscale", "video.upscale", "video.depth", "video.segment"];
64
64
  type NexraGenerationOperation = (typeof NEXRA_GENERATION_OPERATIONS)[number];
65
- declare const NEXRA_MEDIA_OPERATIONS: readonly ["image.generate", "video.generate", "audio.generate", "image.upscale", "video.upscale", "video.depth", "video.segment"];
65
+ declare const NEXRA_MEDIA_OPERATIONS: readonly ["image.generate", "video.generate", "audio.generate", "audio.transcribe", "image.upscale", "video.upscale", "video.depth", "video.segment"];
66
66
  type NexraMediaOperation = (typeof NEXRA_MEDIA_OPERATIONS)[number];
67
- declare const NEXRA_PUBLISHED_MEDIA_OPERATIONS: readonly ["image.generate", "video.generate", "audio.generate", "image.upscale", "video.upscale", "video.depth", "video.segment"];
67
+ declare const NEXRA_PUBLISHED_MEDIA_OPERATIONS: readonly ["image.generate", "video.generate", "audio.generate", "audio.transcribe", "image.upscale", "video.upscale", "video.depth", "video.segment"];
68
68
  type NexraPublishedMediaOperation = (typeof NEXRA_PUBLISHED_MEDIA_OPERATIONS)[number];
69
- declare const NEXRA_MEDIA_FEATURES: readonly ["text-to-image", "image-to-image", "image-reference", "image-edit", "image-inpaint", "image-control", "text-to-video", "first-frame", "first-last-frame", "image-to-video", "video-to-video", "audio-to-video", "avatar-video", "reference-image", "reference-video", "reference-audio", "omni-reference", "tts", "music", "sfx", "voice-reference", "voice-design", "scale-factor", "target-resolution", "video-depth", "video-segment"];
69
+ declare const NEXRA_MEDIA_FEATURES: readonly ["text-to-image", "image-to-image", "image-reference", "image-edit", "image-inpaint", "image-control", "text-to-video", "first-frame", "first-last-frame", "image-to-video", "video-to-video", "audio-to-video", "avatar-video", "reference-image", "reference-video", "reference-audio", "omni-reference", "asr", "tts", "music", "sfx", "voice-reference", "voice-design", "scale-factor", "target-resolution", "video-depth", "video-segment"];
70
70
  type NexraMediaFeature = (typeof NEXRA_MEDIA_FEATURES)[number];
71
71
  /** JSON wire locator. SDK-only Blob/File support is normalized into one of these forms. */
72
72
  type NexraMediaSource = string | AssetReference;
@@ -181,6 +181,14 @@ type NexraAudioGenerateInput = Readonly<{
181
181
  prompt_influence?: number;
182
182
  seed?: number;
183
183
  }>;
184
+ type NexraAudioTranscribeInput = Readonly<{
185
+ content: readonly [NexraAudioContentPart];
186
+ language?: string;
187
+ input_format: string;
188
+ punctuate?: boolean;
189
+ diarize?: boolean;
190
+ timestamps?: boolean;
191
+ }>;
184
192
  type NexraImageUpscaleInput = Readonly<{
185
193
  content: readonly [NexraImageContentPart];
186
194
  enable_hdr?: boolean;
@@ -216,6 +224,7 @@ type NexraMediaInputByOperation = Readonly<{
216
224
  "image.generate": NexraImageGenerateInput;
217
225
  "video.generate": NexraVideoGenerateInput;
218
226
  "audio.generate": NexraAudioGenerateInput;
227
+ "audio.transcribe": NexraAudioTranscribeInput;
219
228
  "image.upscale": NexraImageUpscaleInput;
220
229
  "video.upscale": NexraVideoUpscaleInput;
221
230
  "video.depth": NexraVideoDepthInput;
@@ -271,7 +280,7 @@ type NexraMediaParameterConstraint = Readonly<{
271
280
  type NexraMediaOperationDefinition = Readonly<{
272
281
  operation: NexraMediaOperation;
273
282
  status: "active" | "hold";
274
- outputKind: NexraMediaKind;
283
+ outputKind: NexraMediaKind | "text";
275
284
  features: readonly NexraMediaFeature[];
276
285
  parameterKeys: readonly string[];
277
286
  }>;
@@ -293,6 +302,12 @@ declare const NEXRA_MEDIA_OPERATION_DEFINITIONS: readonly [{
293
302
  readonly outputKind: "audio";
294
303
  readonly features: readonly ["tts", "music", "sfx", "voice-reference", "voice-design"];
295
304
  readonly parameterKeys: readonly ["voice", "language", "duration", "output_format", "sample_rate", "speed", "volume", "pitch", "emotion", "instrumental", "loop", "prompt_influence", "seed"];
305
+ }, {
306
+ readonly operation: "audio.transcribe";
307
+ readonly status: "active";
308
+ readonly outputKind: "text";
309
+ readonly features: readonly ["asr"];
310
+ readonly parameterKeys: readonly ["input_format", "language", "punctuate", "diarize", "timestamps"];
296
311
  }, {
297
312
  readonly operation: "image.upscale";
298
313
  readonly status: "active";
@@ -325,4 +340,4 @@ declare function nexraMediaOperationForMode(mode: string): NexraPublishedMediaOp
325
340
  /** Narrow the shared category vocabulary for one Experience Center input mode. */
326
341
  declare function nexraMediaInputSchemaForMode(mode: string): JsonObject | undefined;
327
342
 
328
- export { type AssetImportRequest as A, type NexraMediaInputMode as B, type NexraMediaInputSlot as C, type NexraMediaKind as D, type NexraMediaOperation as E, type NexraMediaOperationDefinition as F, type NexraMediaParameter as G, type NexraMediaParameterConstraint as H, type NexraMediaSource as I, type NexraPublishedMediaOperation as J, type NexraResourceContentPart as K, type NexraTextContentPart as L, MEDIA_KINDS as M, type NexraImageLayer as N, type NexraVideoContentPart as O, type NexraVideoDepthInput as P, type NexraVideoGenerateInput as Q, type NexraVideoKeyframeContentPart as R, type NexraVideoUpscaleInput as S, isNexraMediaInput as T, nexraMediaInputSchema as U, nexraMediaInputSchemaForMode as V, nexraMediaOperationForMode as W, type AssetInput as a, type AssetReference as b, type AssetUploadOptions as c, type MediaAsset as d, type MediaAssetStatus as e, type MediaKind as f, type NexraImageLayerDecompositionOutput as g, type AssetCertificationRequest as h, type AssetCertification as i, type AssetCertificationWaitOptions as j, NEXRA_GENERATION_OPERATIONS as k, NEXRA_MEDIA_API_VERSION as l, NEXRA_MEDIA_FEATURES as m, NEXRA_MEDIA_INPUT_SCHEMAS as n, NEXRA_MEDIA_OPERATIONS as o, NEXRA_MEDIA_OPERATION_DEFINITIONS as p, NEXRA_PUBLISHED_MEDIA_OPERATIONS as q, type NexraAudioContentPart as r, type NexraAudioGenerateInput as s, type NexraGenerationOperation as t, type NexraImageContentPart as u, type NexraImageGenerateInput as v, type NexraImageUpscaleInput as w, type NexraMediaContentPart as x, type NexraMediaFeature as y, type NexraMediaInputByOperation as z };
343
+ export { type AssetImportRequest as A, type NexraMediaInputByOperation as B, type NexraMediaInputMode as C, type NexraMediaInputSlot as D, type NexraMediaKind as E, type NexraMediaOperation as F, type NexraMediaOperationDefinition as G, type NexraMediaParameter as H, type NexraMediaParameterConstraint as I, type NexraMediaSource as J, type NexraPublishedMediaOperation as K, type NexraResourceContentPart as L, MEDIA_KINDS as M, type NexraImageLayer as N, type NexraTextContentPart as O, type NexraVideoContentPart as P, type NexraVideoDepthInput as Q, type NexraVideoGenerateInput as R, type NexraVideoKeyframeContentPart as S, type NexraVideoUpscaleInput as T, isNexraMediaInput as U, nexraMediaInputSchema as V, nexraMediaInputSchemaForMode as W, nexraMediaOperationForMode as X, type AssetInput as a, type AssetReference as b, type AssetUploadOptions as c, type MediaAsset as d, type MediaAssetStatus as e, type MediaKind as f, type NexraImageLayerDecompositionOutput as g, type AssetCertificationRequest as h, type AssetCertification as i, type AssetCertificationWaitOptions as j, NEXRA_GENERATION_OPERATIONS as k, NEXRA_MEDIA_API_VERSION as l, NEXRA_MEDIA_FEATURES as m, NEXRA_MEDIA_INPUT_SCHEMAS as n, NEXRA_MEDIA_OPERATIONS as o, NEXRA_MEDIA_OPERATION_DEFINITIONS as p, NEXRA_PUBLISHED_MEDIA_OPERATIONS as q, type NexraAudioContentPart as r, type NexraAudioGenerateInput as s, type NexraAudioTranscribeInput as t, type NexraGenerationOperation as u, type NexraImageContentPart as v, type NexraImageGenerateInput as w, type NexraImageUpscaleInput as x, type NexraMediaContentPart as y, type NexraMediaFeature as z };
@@ -32,6 +32,7 @@ type ModelModality = "language" | "embedding" | "reranker" | "image" | "video" |
32
32
  /** A concrete operation of a code-owned endpoint contract, shared by API and UI. */
33
33
  type ModelHttpOperation = Readonly<{
34
34
  key: string;
35
+ transport?: "http" | "websocket";
35
36
  kind: "request" | "create" | "query" | "cancel" | "delete" | "stream" | "generate" | "edit";
36
37
  httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
37
38
  pathTemplate: string;
@@ -44,6 +45,8 @@ type ModelHttpOperation = Readonly<{
44
45
  pathParameters?: Readonly<JsonObject>;
45
46
  /** Operation-specific body; binary fields describe multipart file parts. */
46
47
  bodyParameters?: Readonly<JsonObject>;
48
+ /** Initial JSON configuration carried by a WebSocket message, not a GET body. */
49
+ messageParameters?: Readonly<JsonObject>;
47
50
  responseBody?: Readonly<JsonObject>;
48
51
  requestBody?: Readonly<{
49
52
  properties: readonly string[];
package/dist/media.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { k as NEXRA_GENERATION_OPERATIONS, l as NEXRA_MEDIA_API_VERSION, m as NEXRA_MEDIA_FEATURES, n as NEXRA_MEDIA_INPUT_SCHEMAS, o as NEXRA_MEDIA_OPERATIONS, p as NEXRA_MEDIA_OPERATION_DEFINITIONS, q as NEXRA_PUBLISHED_MEDIA_OPERATIONS, r as NexraAudioContentPart, s as NexraAudioGenerateInput, t as NexraGenerationOperation, u as NexraImageContentPart, v as NexraImageGenerateInput, N as NexraImageLayer, g as NexraImageLayerDecompositionOutput, w as NexraImageUpscaleInput, x as NexraMediaContentPart, y as NexraMediaFeature, z as NexraMediaInputByOperation, B as NexraMediaInputMode, C as NexraMediaInputSlot, D as NexraMediaKind, E as NexraMediaOperation, F as NexraMediaOperationDefinition, G as NexraMediaParameter, H as NexraMediaParameterConstraint, I as NexraMediaSource, J as NexraPublishedMediaOperation, K as NexraResourceContentPart, L as NexraTextContentPart, O as NexraVideoContentPart, P as NexraVideoDepthInput, Q as NexraVideoGenerateInput, R as NexraVideoKeyframeContentPart, S as NexraVideoUpscaleInput, T as isNexraMediaInput, U as nexraMediaInputSchema, V as nexraMediaInputSchemaForMode, W as nexraMediaOperationForMode } from './media-Co8S2qEM.js';
1
+ export { k as NEXRA_GENERATION_OPERATIONS, l as NEXRA_MEDIA_API_VERSION, m as NEXRA_MEDIA_FEATURES, n as NEXRA_MEDIA_INPUT_SCHEMAS, o as NEXRA_MEDIA_OPERATIONS, p as NEXRA_MEDIA_OPERATION_DEFINITIONS, q as NEXRA_PUBLISHED_MEDIA_OPERATIONS, r as NexraAudioContentPart, s as NexraAudioGenerateInput, t as NexraAudioTranscribeInput, u as NexraGenerationOperation, v as NexraImageContentPart, w as NexraImageGenerateInput, N as NexraImageLayer, g as NexraImageLayerDecompositionOutput, x as NexraImageUpscaleInput, y as NexraMediaContentPart, z as NexraMediaFeature, B as NexraMediaInputByOperation, C as NexraMediaInputMode, D as NexraMediaInputSlot, E as NexraMediaKind, F as NexraMediaOperation, G as NexraMediaOperationDefinition, H as NexraMediaParameter, I as NexraMediaParameterConstraint, J as NexraMediaSource, K as NexraPublishedMediaOperation, L as NexraResourceContentPart, O as NexraTextContentPart, P as NexraVideoContentPart, Q as NexraVideoDepthInput, R as NexraVideoGenerateInput, S as NexraVideoKeyframeContentPart, T as NexraVideoUpscaleInput, U as isNexraMediaInput, V as nexraMediaInputSchema, W as nexraMediaInputSchemaForMode, X as nexraMediaOperationForMode } from './media-DzOxLGs-.js';
2
2
  import './json-Cz0MkWQn.js';
package/dist/media.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  nexraMediaInputSchema,
11
11
  nexraMediaInputSchemaForMode,
12
12
  nexraMediaOperationForMode
13
- } from "./chunk-NR4EWD3X.js";
13
+ } from "./chunk-BS3B6F7W.js";
14
14
  export {
15
15
  NEXRA_GENERATION_OPERATIONS,
16
16
  NEXRA_MEDIA_API_VERSION,
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { A as AssetImportRequest, a as AssetInput, b as AssetReference, c as AssetUploadOptions, d as MediaAsset, e as MediaAssetStatus, f as MediaKind, N as NexraImageLayer, g as NexraImageLayerDecompositionOutput } from './media-Co8S2qEM.js';
2
- export { e as CreateNexraDisplayQuoteBatchRequest, C as CreateNexraQuoteRequest, F as FetchLike, M as MediaGeometryField, k as MediaGeometryProjection, z as ModelCapabilitySummary, A as ModelDateVersion, B as ModelEndpointSummary, D as ModelModality, x as ModelResourceList, E as ModelResourceOption, w as ModelSchema, u as ModelSearchParams, l as NexraBillingCurrency, g as NexraCatalogRevision, y as NexraClientOptions, f as NexraDisplayQuoteBatch, G as NexraDisplayQuoteBatchEntry, n as NexraModelOperation, h as NexraModelSpec, j as NexraModelSpecFilter, d as NexraQuote, o as NexraSalePrice, c as NexraSalePriceList, p as NexraSettlement, v as TaskModel, T as TaskModelSummary, U as UnifiedMediaGeometry } from './media-geometry-BS4DZh4B.js';
1
+ export { A as AssetImportRequest, a as AssetInput, b as AssetReference, c as AssetUploadOptions, d as MediaAsset, e as MediaAssetStatus, f as MediaKind, N as NexraImageLayer, g as NexraImageLayerDecompositionOutput } from './media-DzOxLGs-.js';
2
+ export { e as CreateNexraDisplayQuoteBatchRequest, C as CreateNexraQuoteRequest, F as FetchLike, M as MediaGeometryField, k as MediaGeometryProjection, z as ModelCapabilitySummary, A as ModelDateVersion, B as ModelEndpointSummary, D as ModelModality, x as ModelResourceList, E as ModelResourceOption, w as ModelSchema, u as ModelSearchParams, l as NexraBillingCurrency, g as NexraCatalogRevision, y as NexraClientOptions, f as NexraDisplayQuoteBatch, G as NexraDisplayQuoteBatchEntry, n as NexraModelOperation, h as NexraModelSpec, j as NexraModelSpecFilter, d as NexraQuote, o as NexraSalePrice, c as NexraSalePriceList, p as NexraSettlement, v as TaskModel, T as TaskModelSummary, U as UnifiedMediaGeometry } from './media-geometry-COln1N_2.js';
3
3
  export { C as CursorPage, a as JsonObject, b as JsonPrimitive, J as JsonValue } from './json-Cz0MkWQn.js';
4
4
  export { A as ApiErrorPayload, N as NexraError, a as PublicError, b as PublicErrorContext, P as PublicErrorFields } from './errors-DJZuAKoO.js';
5
- export { d as CreateTaskOptions, e as CreateTaskRequest, C as CreateVoiceRequest, f as RequestDetails, b as RunResult, R as RunTaskOptions, c as Task, h as TaskCost, i as TaskError, j as TaskEvent, k as TaskEventType, l as TaskListParams, m as TaskPage, n as TaskProgress, o as TaskReceipt, c as TaskResult, p as TaskStatus, q as TaskTiming, r as TaskUsage, s as TaskWebhookConfig, t as TerminalTaskStatus, u as VerifyWebhookOptions, V as Voice, a as VoiceCreation, W as WaitTaskOptions, v as WatchTaskOptions } from './voices-Bzt4nV1r.js';
5
+ export { d as CreateTaskOptions, e as CreateTaskRequest, C as CreateVoiceRequest, f as RequestDetails, b as RunResult, R as RunTaskOptions, c as Task, h as TaskCost, i as TaskError, j as TaskEvent, k as TaskEventType, l as TaskListParams, m as TaskPage, n as TaskProgress, o as TaskReceipt, c as TaskResult, p as TaskStatus, q as TaskTiming, r as TaskUsage, s as TaskWebhookConfig, t as TerminalTaskStatus, u as VerifyWebhookOptions, V as Voice, a as VoiceCreation, W as WaitTaskOptions, v as WatchTaskOptions } from './voices-xyPqhQqR.js';
@@ -1,5 +1,5 @@
1
- import { c as AssetUploadOptions, d as MediaAsset, A as AssetImportRequest, h as AssetCertificationRequest, i as AssetCertification, j as AssetCertificationWaitOptions } from './media-Co8S2qEM.js';
2
- import { H as HttpTransport, p as NexraSettlement } from './media-geometry-BS4DZh4B.js';
1
+ import { c as AssetUploadOptions, d as MediaAsset, A as AssetImportRequest, h as AssetCertificationRequest, i as AssetCertification, j as AssetCertificationWaitOptions } from './media-DzOxLGs-.js';
2
+ import { H as HttpTransport, p as NexraSettlement } from './media-geometry-COln1N_2.js';
3
3
  import { a as JsonObject, J as JsonValue, C as CursorPage } from './json-Cz0MkWQn.js';
4
4
  import { P as PublicErrorFields, a as PublicError, b as PublicErrorContext, N as NexraError } from './errors-DJZuAKoO.js';
5
5
 
@@ -93,7 +93,7 @@ interface TaskCost {
93
93
  amount: string;
94
94
  currency: string;
95
95
  }
96
- type TaskBillingReason = "request_failed" | "request_cancelled" | "billing_usage_unavailable" | "billing_usage_invalid" | "billing_usage_incomplete" | "billing_evidence_invalid" | "billing_evidence_incomplete" | "billing_hold_unavailable" | "billing_price_unavailable" | "billing_pricing_unavailable";
96
+ type TaskBillingReason = "request_failed" | "request_cancelled" | "billing_usage_unavailable" | "billing_usage_invalid" | "billing_usage_incomplete" | "billing_evidence_invalid" | "billing_evidence_incomplete" | "billing_hold_unavailable" | "billing_price_unavailable" | "billing_pricing_unavailable" | "api_key_spending_limit_exceeded";
97
97
  interface TaskQueueSnapshot {
98
98
  phase: "waiting_capacity" | "waiting_channel" | "dispatch_pending" | "waiting_upstream";
99
99
  since: string;
@@ -209,6 +209,8 @@ interface RequestDetails extends PublicErrorFields {
209
209
  id: string;
210
210
  /** Owning Nexra account, used to separate users in system request history. */
211
211
  accountId?: string | null;
212
+ /** Owning organization for organization-key requests, including calls without a personal account. */
213
+ organizationId?: string | null;
212
214
  nexraRequestId?: string;
213
215
  taskId: string | null;
214
216
  method: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byte_fluffy/nexra-sdk",
3
- "version": "0.1.0-alpha.48",
3
+ "version": "0.1.0-alpha.49",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "sideEffects": false,