@combycode/llm-sdk 1.5.0 → 1.6.0

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/dist/index.js CHANGED
@@ -1829,6 +1829,31 @@ function parseRetryAfter(headers) {
1829
1829
  return void 0;
1830
1830
  }
1831
1831
 
1832
+ // src/llm/output-errors.ts
1833
+ var AgentRunError = class extends Error {
1834
+ /** Machine-readable failure reason (e.g. `'invalid_final_output'`). */
1835
+ reason;
1836
+ constructor(reason, message, options) {
1837
+ super(message, options);
1838
+ this.name = "AgentRunError";
1839
+ this.reason = reason;
1840
+ }
1841
+ };
1842
+ var InvalidFinalOutputError = class extends AgentRunError {
1843
+ reason = "invalid_final_output";
1844
+ /** The raw model output that failed to parse. */
1845
+ rawText;
1846
+ constructor(rawText, options) {
1847
+ super(
1848
+ "invalid_final_output",
1849
+ `Model final output did not match the requested schema: ${options?.cause instanceof Error ? options.cause.message : "parse failed"}`,
1850
+ options
1851
+ );
1852
+ this.name = "InvalidFinalOutputError";
1853
+ this.rawText = rawText;
1854
+ }
1855
+ };
1856
+
1832
1857
  // src/network/semaphore.ts
1833
1858
  var Semaphore = class {
1834
1859
  constructor(max) {
@@ -2843,7 +2868,7 @@ var catalog_default = {
2843
2868
  family: "claude-opus",
2844
2869
  version: "4",
2845
2870
  status: "legacy",
2846
- active: true,
2871
+ active: false,
2847
2872
  deprecation: {
2848
2873
  date: "2026-05-14",
2849
2874
  source: "litellm"
@@ -3187,7 +3212,7 @@ var catalog_default = {
3187
3212
  family: "claude-sonnet",
3188
3213
  version: "4",
3189
3214
  status: "legacy",
3190
- active: true,
3215
+ active: false,
3191
3216
  deprecation: {
3192
3217
  date: "2026-05-14",
3193
3218
  source: "litellm"
@@ -3354,50 +3379,35 @@ var catalog_default = {
3354
3379
  version: "4.5",
3355
3380
  status: "stable",
3356
3381
  active: true
3357
- }
3358
- };
3359
-
3360
- // src/llm/providers/google/catalog.json
3361
- var catalog_default2 = {
3362
- "google/gemini-2.5-pro": {
3363
- providerModelName: "gemini-2.5-pro",
3382
+ },
3383
+ "anthropic/claude-fable-5": {
3384
+ providerModelName: "claude-fable-5",
3364
3385
  aliases: [
3365
- "gemini-2.5-pro"
3386
+ "claude-fable-5"
3366
3387
  ],
3367
3388
  pricing: {
3368
- inputPerMTok: 1.25,
3369
- outputPerMTok: 10,
3370
- cacheReadPerMTok: 0.125,
3389
+ inputPerMTok: 10,
3390
+ outputPerMTok: 50,
3391
+ cacheReadPerMTok: 1,
3371
3392
  tiers: {
3372
3393
  batch: {
3373
- inputPerMTok: 0.625,
3374
- outputPerMTok: 5,
3375
- cacheReadPerMTok: 0.125
3376
- },
3377
- flex: {
3378
- inputPerMTok: 0.625,
3379
- outputPerMTok: 5,
3380
- cacheReadPerMTok: 0.125
3381
- },
3382
- priority: {
3383
- inputPerMTok: 2.25,
3384
- outputPerMTok: 18,
3385
- cacheReadPerMTok: 0.225
3394
+ inputPerMTok: 5,
3395
+ outputPerMTok: 25
3386
3396
  }
3387
3397
  }
3388
3398
  },
3389
- preferredApi: "generate",
3399
+ preferredApi: "messages",
3390
3400
  supportedApis: [
3391
- "generate"
3401
+ "messages"
3392
3402
  ],
3393
- contextWindow: 1048576,
3394
- maxOutput: 65536,
3403
+ contextWindow: 1e6,
3404
+ maxOutput: 128e3,
3395
3405
  capabilities: {
3396
3406
  toolUse: true,
3397
3407
  streaming: true,
3398
3408
  structuredOutput: true,
3399
3409
  vision: true,
3400
- audio: true,
3410
+ audio: false,
3401
3411
  video: false,
3402
3412
  imageGeneration: false,
3403
3413
  audioGeneration: false,
@@ -3414,103 +3424,44 @@ var catalog_default2 = {
3414
3424
  inputModalities: [
3415
3425
  "text",
3416
3426
  "image",
3417
- "audio"
3427
+ "pdf"
3418
3428
  ],
3419
3429
  outputModalities: [
3420
3430
  "text"
3421
3431
  ],
3422
- family: "gemini-pro",
3423
- version: "2.5",
3432
+ family: "claude-fable",
3433
+ version: "5",
3424
3434
  status: "stable",
3425
3435
  active: true
3426
3436
  },
3427
- "google/gemini-3.1-pro": {
3428
- providerModelName: "gemini-3.1-pro-preview",
3437
+ "anthropic/claude-sonnet-5": {
3438
+ providerModelName: "claude-sonnet-5",
3429
3439
  aliases: [
3430
- "gemini-3.1-pro-preview"
3440
+ "claude-sonnet-5"
3431
3441
  ],
3432
3442
  pricing: {
3433
3443
  inputPerMTok: 2,
3434
- outputPerMTok: 12,
3444
+ outputPerMTok: 10,
3435
3445
  cacheReadPerMTok: 0.2,
3436
3446
  tiers: {
3437
3447
  batch: {
3438
3448
  inputPerMTok: 1,
3439
- outputPerMTok: 6,
3440
- cacheReadPerMTok: 0.2
3441
- },
3442
- flex: {
3443
- inputPerMTok: 1,
3444
- outputPerMTok: 6,
3445
- cacheReadPerMTok: 0.2
3446
- },
3447
- priority: {
3448
- inputPerMTok: 3.6,
3449
- outputPerMTok: 21.6,
3450
- cacheReadPerMTok: 0.36
3449
+ outputPerMTok: 5
3451
3450
  }
3452
3451
  }
3453
3452
  },
3454
- preferredApi: "generate",
3455
- supportedApis: [
3456
- "generate"
3457
- ],
3458
- contextWindow: 1048576,
3459
- maxOutput: 65536,
3460
- capabilities: {
3461
- toolUse: true,
3462
- streaming: true,
3463
- structuredOutput: true,
3464
- vision: true,
3465
- audio: true,
3466
- video: false,
3467
- imageGeneration: false,
3468
- audioGeneration: false,
3469
- videoGeneration: false
3470
- },
3471
- reasoning: {
3472
- supported: true,
3473
- automatic: false,
3474
- effortControl: false,
3475
- encryptedContent: false,
3476
- summaryAvailable: false
3477
- },
3478
- type: "chat",
3479
- inputModalities: [
3480
- "text",
3481
- "image",
3482
- "audio"
3483
- ],
3484
- outputModalities: [
3485
- "text"
3486
- ],
3487
- family: "gemini-pro",
3488
- version: "3.1",
3489
- status: "preview",
3490
- active: true
3491
- },
3492
- "google/gemini-3.1-pro-customtools": {
3493
- providerModelName: "gemini-3.1-pro-preview-customtools",
3494
- aliases: [
3495
- "gemini-3.1-pro-preview-customtools"
3496
- ],
3497
- pricing: {
3498
- inputPerMTok: 2,
3499
- outputPerMTok: 12,
3500
- cacheReadPerMTok: 0.2
3501
- },
3502
- preferredApi: "generate",
3453
+ preferredApi: "messages",
3503
3454
  supportedApis: [
3504
- "generate"
3455
+ "messages"
3505
3456
  ],
3506
- contextWindow: 1048576,
3507
- maxOutput: 65536,
3457
+ contextWindow: 1e6,
3458
+ maxOutput: 128e3,
3508
3459
  capabilities: {
3509
3460
  toolUse: true,
3510
3461
  streaming: true,
3511
3462
  structuredOutput: true,
3512
3463
  vision: true,
3513
- audio: true,
3464
+ audio: false,
3514
3465
  video: false,
3515
3466
  imageGeneration: false,
3516
3467
  audioGeneration: false,
@@ -3527,66 +3478,49 @@ var catalog_default2 = {
3527
3478
  inputModalities: [
3528
3479
  "text",
3529
3480
  "image",
3530
- "audio"
3481
+ "pdf"
3531
3482
  ],
3532
3483
  outputModalities: [
3533
3484
  "text"
3534
3485
  ],
3535
- family: "gemini-pro",
3536
- version: "3.1",
3537
- status: "preview",
3486
+ family: "claude-sonnet",
3487
+ version: "5",
3488
+ status: "stable",
3538
3489
  active: true
3539
3490
  },
3540
- "google/gemini-2.5-flash": {
3541
- providerModelName: "gemini-2.5-flash",
3491
+ "anthropic/claude-mythos-5": {
3492
+ providerModelName: "claude-mythos-5",
3542
3493
  aliases: [
3543
- "gemini-2.5-flash"
3494
+ "claude-mythos-5"
3544
3495
  ],
3545
3496
  pricing: {
3546
- inputPerMTok: 0.3,
3547
- outputPerMTok: 2.5,
3548
- cacheReadPerMTok: 0.03,
3549
- audioInputPerMTok: 1,
3497
+ inputPerMTok: 10,
3498
+ outputPerMTok: 50,
3499
+ cacheReadPerMTok: 1,
3550
3500
  tiers: {
3551
3501
  batch: {
3552
- inputPerMTok: 0.15,
3553
- outputPerMTok: 1.25,
3554
- cacheReadPerMTok: 0.03,
3555
- audioInputPerMTok: 0.5
3556
- },
3557
- flex: {
3558
- inputPerMTok: 0.15,
3559
- outputPerMTok: 1.25,
3560
- cacheReadPerMTok: 0.03,
3561
- audioInputPerMTok: 0.5
3562
- },
3563
- priority: {
3564
- inputPerMTok: 0.54,
3565
- outputPerMTok: 4.5,
3566
- cacheReadPerMTok: 0.054,
3567
- audioInputPerMTok: 1.8
3502
+ inputPerMTok: 5,
3503
+ outputPerMTok: 25
3568
3504
  }
3569
3505
  }
3570
3506
  },
3571
- preferredApi: "generate",
3507
+ preferredApi: "messages",
3572
3508
  supportedApis: [
3573
- "generate"
3509
+ "messages"
3574
3510
  ],
3575
- contextWindow: 1048576,
3576
- maxOutput: 65536,
3577
3511
  capabilities: {
3578
3512
  toolUse: true,
3579
3513
  streaming: true,
3580
3514
  structuredOutput: true,
3581
- vision: true,
3582
- audio: true,
3515
+ vision: false,
3516
+ audio: false,
3583
3517
  video: false,
3584
3518
  imageGeneration: false,
3585
3519
  audioGeneration: false,
3586
3520
  videoGeneration: false
3587
3521
  },
3588
3522
  reasoning: {
3589
- supported: true,
3523
+ supported: false,
3590
3524
  automatic: false,
3591
3525
  effortControl: false,
3592
3526
  encryptedContent: false,
@@ -3594,46 +3528,45 @@ var catalog_default2 = {
3594
3528
  },
3595
3529
  type: "chat",
3596
3530
  inputModalities: [
3597
- "text",
3598
- "image",
3599
- "audio"
3531
+ "text"
3600
3532
  ],
3601
3533
  outputModalities: [
3602
3534
  "text"
3603
3535
  ],
3604
- family: "gemini-flash",
3605
- version: "2.5",
3536
+ family: "claude-mythos",
3537
+ version: "5",
3606
3538
  status: "stable",
3607
- active: true
3608
- },
3609
- "google/gemini-3-flash": {
3610
- providerModelName: "gemini-3-flash-preview",
3539
+ active: true,
3540
+ availability: "limited"
3541
+ }
3542
+ };
3543
+
3544
+ // src/llm/providers/google/catalog.json
3545
+ var catalog_default2 = {
3546
+ "google/gemini-2.5-pro": {
3547
+ providerModelName: "gemini-2.5-pro",
3611
3548
  aliases: [
3612
- "gemini-3-flash-preview"
3549
+ "gemini-2.5-pro"
3613
3550
  ],
3614
3551
  pricing: {
3615
- inputPerMTok: 0.5,
3616
- outputPerMTok: 3,
3617
- cacheReadPerMTok: 0.05,
3618
- audioInputPerMTok: 1,
3552
+ inputPerMTok: 1.25,
3553
+ outputPerMTok: 10,
3554
+ cacheReadPerMTok: 0.125,
3619
3555
  tiers: {
3620
3556
  batch: {
3621
- inputPerMTok: 0.25,
3622
- outputPerMTok: 1.5,
3623
- cacheReadPerMTok: 0.05,
3624
- audioInputPerMTok: 0.5
3557
+ inputPerMTok: 0.625,
3558
+ outputPerMTok: 5,
3559
+ cacheReadPerMTok: 0.125
3625
3560
  },
3626
3561
  flex: {
3627
- inputPerMTok: 0.25,
3628
- outputPerMTok: 1.5,
3629
- cacheReadPerMTok: 0.05,
3630
- audioInputPerMTok: 0.5
3562
+ inputPerMTok: 0.625,
3563
+ outputPerMTok: 5,
3564
+ cacheReadPerMTok: 0.125
3631
3565
  },
3632
3566
  priority: {
3633
- inputPerMTok: 0.9,
3634
- outputPerMTok: 5.4,
3635
- cacheReadPerMTok: 0.09,
3636
- audioInputPerMTok: 1.8
3567
+ inputPerMTok: 2.25,
3568
+ outputPerMTok: 18,
3569
+ cacheReadPerMTok: 0.225
3637
3570
  }
3638
3571
  }
3639
3572
  },
@@ -3670,35 +3603,286 @@ var catalog_default2 = {
3670
3603
  outputModalities: [
3671
3604
  "text"
3672
3605
  ],
3673
- family: "gemini-flash",
3674
- version: "3",
3675
- status: "preview",
3606
+ family: "gemini-pro",
3607
+ version: "2.5",
3608
+ status: "stable",
3676
3609
  active: true
3677
3610
  },
3678
- "google/gemini-3.5-flash": {
3679
- providerModelName: "gemini-3.5-flash",
3611
+ "google/gemini-3.1-pro": {
3612
+ providerModelName: "gemini-3.1-pro-preview",
3680
3613
  aliases: [
3681
- "gemini-3.5-flash"
3614
+ "gemini-3.1-pro-preview"
3682
3615
  ],
3683
3616
  pricing: {
3684
- inputPerMTok: 1.5,
3685
- outputPerMTok: 9,
3686
- cacheReadPerMTok: 0.15,
3617
+ inputPerMTok: 2,
3618
+ outputPerMTok: 12,
3619
+ cacheReadPerMTok: 0.2,
3687
3620
  tiers: {
3688
3621
  batch: {
3689
- inputPerMTok: 0.75,
3690
- outputPerMTok: 4.5,
3691
- cacheReadPerMTok: 0.075
3622
+ inputPerMTok: 1,
3623
+ outputPerMTok: 6,
3624
+ cacheReadPerMTok: 0.2
3692
3625
  },
3693
3626
  flex: {
3694
- inputPerMTok: 0.75,
3695
- outputPerMTok: 4.5,
3696
- cacheReadPerMTok: 0.08
3627
+ inputPerMTok: 1,
3628
+ outputPerMTok: 6,
3629
+ cacheReadPerMTok: 0.2
3697
3630
  },
3698
3631
  priority: {
3699
- inputPerMTok: 2.7,
3700
- outputPerMTok: 16.2,
3701
- cacheReadPerMTok: 0.27
3632
+ inputPerMTok: 3.6,
3633
+ outputPerMTok: 21.6,
3634
+ cacheReadPerMTok: 0.36
3635
+ }
3636
+ }
3637
+ },
3638
+ preferredApi: "generate",
3639
+ supportedApis: [
3640
+ "generate"
3641
+ ],
3642
+ contextWindow: 1048576,
3643
+ maxOutput: 65536,
3644
+ capabilities: {
3645
+ toolUse: true,
3646
+ streaming: true,
3647
+ structuredOutput: true,
3648
+ vision: true,
3649
+ audio: true,
3650
+ video: false,
3651
+ imageGeneration: false,
3652
+ audioGeneration: false,
3653
+ videoGeneration: false
3654
+ },
3655
+ reasoning: {
3656
+ supported: true,
3657
+ automatic: false,
3658
+ effortControl: false,
3659
+ encryptedContent: false,
3660
+ summaryAvailable: false
3661
+ },
3662
+ type: "chat",
3663
+ inputModalities: [
3664
+ "text",
3665
+ "image",
3666
+ "audio"
3667
+ ],
3668
+ outputModalities: [
3669
+ "text"
3670
+ ],
3671
+ family: "gemini-pro",
3672
+ version: "3.1",
3673
+ status: "preview",
3674
+ active: true
3675
+ },
3676
+ "google/gemini-3.1-pro-customtools": {
3677
+ providerModelName: "gemini-3.1-pro-preview-customtools",
3678
+ aliases: [
3679
+ "gemini-3.1-pro-preview-customtools"
3680
+ ],
3681
+ pricing: {
3682
+ inputPerMTok: 2,
3683
+ outputPerMTok: 12,
3684
+ cacheReadPerMTok: 0.2
3685
+ },
3686
+ preferredApi: "generate",
3687
+ supportedApis: [
3688
+ "generate"
3689
+ ],
3690
+ contextWindow: 1048576,
3691
+ maxOutput: 65536,
3692
+ capabilities: {
3693
+ toolUse: true,
3694
+ streaming: true,
3695
+ structuredOutput: true,
3696
+ vision: true,
3697
+ audio: true,
3698
+ video: false,
3699
+ imageGeneration: false,
3700
+ audioGeneration: false,
3701
+ videoGeneration: false
3702
+ },
3703
+ reasoning: {
3704
+ supported: true,
3705
+ automatic: false,
3706
+ effortControl: false,
3707
+ encryptedContent: false,
3708
+ summaryAvailable: false
3709
+ },
3710
+ type: "chat",
3711
+ inputModalities: [
3712
+ "text",
3713
+ "image",
3714
+ "audio"
3715
+ ],
3716
+ outputModalities: [
3717
+ "text"
3718
+ ],
3719
+ family: "gemini-pro",
3720
+ version: "3.1",
3721
+ status: "preview",
3722
+ active: true
3723
+ },
3724
+ "google/gemini-2.5-flash": {
3725
+ providerModelName: "gemini-2.5-flash",
3726
+ aliases: [
3727
+ "gemini-2.5-flash"
3728
+ ],
3729
+ pricing: {
3730
+ inputPerMTok: 0.3,
3731
+ outputPerMTok: 2.5,
3732
+ cacheReadPerMTok: 0.03,
3733
+ audioInputPerMTok: 1,
3734
+ tiers: {
3735
+ batch: {
3736
+ inputPerMTok: 0.15,
3737
+ outputPerMTok: 1.25,
3738
+ cacheReadPerMTok: 0.03,
3739
+ audioInputPerMTok: 0.5
3740
+ },
3741
+ flex: {
3742
+ inputPerMTok: 0.15,
3743
+ outputPerMTok: 1.25,
3744
+ cacheReadPerMTok: 0.03,
3745
+ audioInputPerMTok: 0.5
3746
+ },
3747
+ priority: {
3748
+ inputPerMTok: 0.54,
3749
+ outputPerMTok: 4.5,
3750
+ cacheReadPerMTok: 0.054,
3751
+ audioInputPerMTok: 1.8
3752
+ }
3753
+ }
3754
+ },
3755
+ preferredApi: "generate",
3756
+ supportedApis: [
3757
+ "generate"
3758
+ ],
3759
+ contextWindow: 1048576,
3760
+ maxOutput: 65536,
3761
+ capabilities: {
3762
+ toolUse: true,
3763
+ streaming: true,
3764
+ structuredOutput: true,
3765
+ vision: true,
3766
+ audio: true,
3767
+ video: false,
3768
+ imageGeneration: false,
3769
+ audioGeneration: false,
3770
+ videoGeneration: false
3771
+ },
3772
+ reasoning: {
3773
+ supported: true,
3774
+ automatic: false,
3775
+ effortControl: false,
3776
+ encryptedContent: false,
3777
+ summaryAvailable: false
3778
+ },
3779
+ type: "chat",
3780
+ inputModalities: [
3781
+ "text",
3782
+ "image",
3783
+ "audio"
3784
+ ],
3785
+ outputModalities: [
3786
+ "text"
3787
+ ],
3788
+ family: "gemini-flash",
3789
+ version: "2.5",
3790
+ status: "stable",
3791
+ active: true
3792
+ },
3793
+ "google/gemini-3-flash": {
3794
+ providerModelName: "gemini-3-flash-preview",
3795
+ aliases: [
3796
+ "gemini-3-flash-preview"
3797
+ ],
3798
+ pricing: {
3799
+ inputPerMTok: 0.5,
3800
+ outputPerMTok: 3,
3801
+ cacheReadPerMTok: 0.05,
3802
+ audioInputPerMTok: 1,
3803
+ tiers: {
3804
+ batch: {
3805
+ inputPerMTok: 0.25,
3806
+ outputPerMTok: 1.5,
3807
+ cacheReadPerMTok: 0.05,
3808
+ audioInputPerMTok: 0.5
3809
+ },
3810
+ flex: {
3811
+ inputPerMTok: 0.25,
3812
+ outputPerMTok: 1.5,
3813
+ cacheReadPerMTok: 0.05,
3814
+ audioInputPerMTok: 0.5
3815
+ },
3816
+ priority: {
3817
+ inputPerMTok: 0.9,
3818
+ outputPerMTok: 5.4,
3819
+ cacheReadPerMTok: 0.09,
3820
+ audioInputPerMTok: 1.8
3821
+ }
3822
+ }
3823
+ },
3824
+ preferredApi: "generate",
3825
+ supportedApis: [
3826
+ "generate"
3827
+ ],
3828
+ contextWindow: 1048576,
3829
+ maxOutput: 65536,
3830
+ capabilities: {
3831
+ toolUse: true,
3832
+ streaming: true,
3833
+ structuredOutput: true,
3834
+ vision: true,
3835
+ audio: true,
3836
+ video: false,
3837
+ imageGeneration: false,
3838
+ audioGeneration: false,
3839
+ videoGeneration: false
3840
+ },
3841
+ reasoning: {
3842
+ supported: true,
3843
+ automatic: false,
3844
+ effortControl: false,
3845
+ encryptedContent: false,
3846
+ summaryAvailable: false
3847
+ },
3848
+ type: "chat",
3849
+ inputModalities: [
3850
+ "text",
3851
+ "image",
3852
+ "audio"
3853
+ ],
3854
+ outputModalities: [
3855
+ "text"
3856
+ ],
3857
+ family: "gemini-flash",
3858
+ version: "3",
3859
+ status: "preview",
3860
+ active: true
3861
+ },
3862
+ "google/gemini-3.5-flash": {
3863
+ providerModelName: "gemini-3.5-flash",
3864
+ aliases: [
3865
+ "gemini-3.5-flash"
3866
+ ],
3867
+ pricing: {
3868
+ inputPerMTok: 1.5,
3869
+ outputPerMTok: 9,
3870
+ cacheReadPerMTok: 0.15,
3871
+ tiers: {
3872
+ batch: {
3873
+ inputPerMTok: 0.75,
3874
+ outputPerMTok: 4.5,
3875
+ cacheReadPerMTok: 0.075
3876
+ },
3877
+ flex: {
3878
+ inputPerMTok: 0.75,
3879
+ outputPerMTok: 4.5,
3880
+ cacheReadPerMTok: 0.08
3881
+ },
3882
+ priority: {
3883
+ inputPerMTok: 2.7,
3884
+ outputPerMTok: 16.2,
3885
+ cacheReadPerMTok: 0.27
3702
3886
  }
3703
3887
  }
3704
3888
  },
@@ -4549,7 +4733,8 @@ var catalog_default2 = {
4549
4733
  outputPerMTok: 4.5,
4550
4734
  audioInputPerMTok: 3,
4551
4735
  audioOutputPerMTok: 12,
4552
- perMinute: 5e-3
4736
+ perMinute: 5e-3,
4737
+ perSecond: 2e-3
4553
4738
  },
4554
4739
  preferredApi: "generate",
4555
4740
  supportedApis: [
@@ -4598,7 +4783,9 @@ var catalog_default2 = {
4598
4783
  pricing: {
4599
4784
  inputPerMTok: 3.5,
4600
4785
  outputPerMTok: 21,
4601
- perMinute: 53e-4
4786
+ perMinute: 53e-4,
4787
+ audioInputPerMTok: 53e-4,
4788
+ audioOutputPerMTok: 0.0315
4602
4789
  },
4603
4790
  preferredApi: "generate",
4604
4791
  supportedApis: [
@@ -5172,7 +5359,8 @@ var catalog_default2 = {
5172
5359
  "720p": 0.1,
5173
5360
  "1080p": 0.12,
5174
5361
  "4k": 0.3
5175
- }
5362
+ },
5363
+ perSecond: 0.1
5176
5364
  },
5177
5365
  preferredApi: "generate",
5178
5366
  supportedApis: [
@@ -5319,7 +5507,8 @@ var catalog_default2 = {
5319
5507
  "720p": 0.1,
5320
5508
  "1080p": 0.12,
5321
5509
  "4k": 0.3
5322
- }
5510
+ },
5511
+ perSecond: 0.1
5323
5512
  },
5324
5513
  preferredApi: "generate",
5325
5514
  supportedApis: [
@@ -5390,8 +5579,10 @@ var catalog_default2 = {
5390
5579
  pricing: {
5391
5580
  perUnit: {
5392
5581
  "720p": 0.05,
5393
- "1080p": 0.08
5394
- }
5582
+ "1080p": 0.08,
5583
+ "4k": 0
5584
+ },
5585
+ perSecond: 0.05
5395
5586
  },
5396
5587
  preferredApi: "generate",
5397
5588
  supportedApis: [
@@ -5692,6 +5883,129 @@ var catalog_default2 = {
5692
5883
  version: "1.6",
5693
5884
  status: "preview",
5694
5885
  active: true
5886
+ },
5887
+ "google/gemini-3.1-flash-lite-image": {
5888
+ providerModelName: "gemini-3.1-flash-lite-image",
5889
+ aliases: [
5890
+ "gemini-3.1-flash-lite-image"
5891
+ ],
5892
+ pricing: {
5893
+ inputPerMTok: 0.25,
5894
+ outputPerMTok: 1.5,
5895
+ perUnit: {
5896
+ "1k": 0.0336
5897
+ }
5898
+ },
5899
+ preferredApi: "generate",
5900
+ supportedApis: [
5901
+ "generate"
5902
+ ],
5903
+ contextWindow: 65536,
5904
+ maxOutput: 65536,
5905
+ capabilities: {
5906
+ toolUse: false,
5907
+ streaming: true,
5908
+ structuredOutput: false,
5909
+ vision: true,
5910
+ audio: false,
5911
+ video: false,
5912
+ imageGeneration: true,
5913
+ audioGeneration: false,
5914
+ videoGeneration: false
5915
+ },
5916
+ reasoning: {
5917
+ supported: true,
5918
+ automatic: false,
5919
+ effortControl: false,
5920
+ encryptedContent: false,
5921
+ summaryAvailable: false
5922
+ },
5923
+ type: "image",
5924
+ inputModalities: [
5925
+ "text",
5926
+ "image"
5927
+ ],
5928
+ outputModalities: [
5929
+ "image"
5930
+ ],
5931
+ family: "gemini-image",
5932
+ version: "3.1",
5933
+ status: "stable",
5934
+ active: true,
5935
+ mediaParams: {
5936
+ aspectRatio: {
5937
+ values: [
5938
+ "1:1",
5939
+ "1:4",
5940
+ "1:8",
5941
+ "2:3",
5942
+ "3:2",
5943
+ "3:4",
5944
+ "4:1",
5945
+ "4:3",
5946
+ "4:5",
5947
+ "5:4",
5948
+ "9:16",
5949
+ "16:9",
5950
+ "21:9"
5951
+ ],
5952
+ default: "1:1"
5953
+ },
5954
+ imageSize: {
5955
+ values: [
5956
+ "512",
5957
+ "1K",
5958
+ "2K",
5959
+ "4K"
5960
+ ],
5961
+ default: "1K"
5962
+ }
5963
+ }
5964
+ },
5965
+ "google/gemini-omni-flash": {
5966
+ providerModelName: "gemini-omni-flash-preview",
5967
+ aliases: [
5968
+ "gemini-omni-flash-preview"
5969
+ ],
5970
+ pricing: {
5971
+ inputPerMTok: 1.5
5972
+ },
5973
+ preferredApi: "generate",
5974
+ supportedApis: [
5975
+ "generate"
5976
+ ],
5977
+ contextWindow: 131072,
5978
+ maxOutput: 65536,
5979
+ capabilities: {
5980
+ toolUse: true,
5981
+ streaming: true,
5982
+ structuredOutput: true,
5983
+ vision: false,
5984
+ audio: true,
5985
+ video: false,
5986
+ imageGeneration: false,
5987
+ audioGeneration: false,
5988
+ videoGeneration: false
5989
+ },
5990
+ reasoning: {
5991
+ supported: false,
5992
+ automatic: false,
5993
+ effortControl: false,
5994
+ encryptedContent: false,
5995
+ summaryAvailable: false
5996
+ },
5997
+ type: "audio-chat",
5998
+ inputModalities: [
5999
+ "text",
6000
+ "audio"
6001
+ ],
6002
+ outputModalities: [
6003
+ "text"
6004
+ ],
6005
+ family: "gemini-audio",
6006
+ version: "1",
6007
+ status: "preview",
6008
+ active: true
5695
6009
  }
5696
6010
  };
5697
6011
 
@@ -7291,9 +7605,10 @@ var catalog_default3 = {
7291
7605
  "gpt-4o-mini-2024-07-18"
7292
7606
  ],
7293
7607
  pricing: {
7294
- inputPerMTok: 1.25,
7295
- outputPerMTok: 5,
7296
- perMinute: 3e-3
7608
+ inputPerMTok: 0.15,
7609
+ outputPerMTok: 0.6,
7610
+ perMinute: 3e-3,
7611
+ cacheReadPerMTok: 0.075
7297
7612
  },
7298
7613
  preferredApi: "responses",
7299
7614
  supportedApis: [
@@ -7946,8 +8261,8 @@ var catalog_default3 = {
7946
8261
  "gpt-realtime-2025-08-28"
7947
8262
  ],
7948
8263
  pricing: {
7949
- inputPerMTok: 4,
7950
- outputPerMTok: 24,
8264
+ inputPerMTok: 32,
8265
+ outputPerMTok: 64,
7951
8266
  cacheReadPerMTok: 0.4,
7952
8267
  audioInputPerMTok: 32,
7953
8268
  audioOutputPerMTok: 64
@@ -8046,8 +8361,8 @@ var catalog_default3 = {
8046
8361
  "gpt-realtime-2"
8047
8362
  ],
8048
8363
  pricing: {
8049
- inputPerMTok: 4,
8050
- outputPerMTok: 24,
8364
+ inputPerMTok: 32,
8365
+ outputPerMTok: 64,
8051
8366
  cacheReadPerMTok: 0.4,
8052
8367
  audioInputPerMTok: 32,
8053
8368
  audioOutputPerMTok: 64
@@ -8182,7 +8497,8 @@ var catalog_default3 = {
8182
8497
  family: "gpt-realtime",
8183
8498
  version: "1",
8184
8499
  status: "stable",
8185
- active: true
8500
+ active: true,
8501
+ contextWindow: 128e3
8186
8502
  },
8187
8503
  "openai/gpt-realtime-whisper": {
8188
8504
  providerModelName: "gpt-realtime-whisper",
@@ -8225,7 +8541,8 @@ var catalog_default3 = {
8225
8541
  family: "gpt-realtime",
8226
8542
  version: "1",
8227
8543
  status: "stable",
8228
- active: true
8544
+ active: true,
8545
+ contextWindow: 128e3
8229
8546
  },
8230
8547
  "openai/o1": {
8231
8548
  providerModelName: "o1",
@@ -8334,7 +8651,8 @@ var catalog_default3 = {
8334
8651
  },
8335
8652
  preferredApi: "responses",
8336
8653
  supportedApis: [
8337
- "responses"
8654
+ "responses",
8655
+ "completions"
8338
8656
  ],
8339
8657
  contextWindow: 2e5,
8340
8658
  maxOutput: 1e5,
@@ -8468,9 +8786,9 @@ var catalog_default3 = {
8468
8786
  "o4-mini-2025-04-16"
8469
8787
  ],
8470
8788
  pricing: {
8471
- inputPerMTok: 4,
8472
- outputPerMTok: 16,
8473
- cacheReadPerMTok: 1,
8789
+ inputPerMTok: 1.1,
8790
+ outputPerMTok: 4.4,
8791
+ cacheReadPerMTok: 0.275,
8474
8792
  tiers: {
8475
8793
  batch: {
8476
8794
  inputPerMTok: 2,
@@ -8807,167 +9125,171 @@ var catalog_default3 = {
8807
9125
  "tts-1",
8808
9126
  "tts-1-1106"
8809
9127
  ],
8810
- pricing: { perMChars: 15 },
8811
- preferredApi: "responses",
8812
- supportedApis: [
8813
- "responses",
8814
- "completions"
8815
- ],
8816
- capabilities: {
8817
- toolUse: false,
8818
- streaming: true,
8819
- structuredOutput: false,
8820
- vision: false,
8821
- audio: false,
8822
- video: false,
8823
- imageGeneration: false,
8824
- audioGeneration: true,
8825
- videoGeneration: false
8826
- },
8827
- reasoning: {
8828
- supported: false,
8829
- automatic: false,
8830
- effortControl: false,
8831
- encryptedContent: false,
8832
- summaryAvailable: false
8833
- },
8834
- type: "tts",
8835
- inputModalities: [
8836
- "text"
8837
- ],
8838
- outputModalities: [
8839
- "audio"
8840
- ],
8841
- family: "tts",
8842
- version: "1",
8843
- status: "legacy",
8844
- active: true,
8845
- mediaParams: {
8846
- voice: {
8847
- values: [
8848
- "alloy",
8849
- "ash",
8850
- "ballad",
8851
- "coral",
8852
- "echo",
8853
- "fable",
8854
- "onyx",
8855
- "nova",
8856
- "sage",
8857
- "shimmer",
8858
- "verse",
8859
- "marin",
8860
- "cedar"
8861
- ],
8862
- default: "alloy"
8863
- },
8864
- format: {
8865
- values: [
8866
- "mp3",
8867
- "opus",
8868
- "aac",
8869
- "flac",
8870
- "wav",
8871
- "pcm"
8872
- ],
8873
- default: "mp3"
8874
- },
8875
- speed: {
8876
- min: 0.25,
8877
- max: 4,
8878
- default: 1
8879
- }
8880
- }
8881
- },
8882
- "openai/tts-1-hd": {
8883
- providerModelName: "tts-1-hd",
8884
- aliases: [
8885
- "tts-1-hd",
8886
- "tts-1-hd-1106"
8887
- ],
8888
- pricing: { perMChars: 30 },
8889
- preferredApi: "responses",
8890
- supportedApis: [
8891
- "responses",
8892
- "completions"
8893
- ],
8894
- capabilities: {
8895
- toolUse: false,
8896
- streaming: true,
8897
- structuredOutput: false,
8898
- vision: false,
8899
- audio: false,
8900
- video: false,
8901
- imageGeneration: false,
8902
- audioGeneration: true,
8903
- videoGeneration: false
8904
- },
8905
- reasoning: {
8906
- supported: false,
8907
- automatic: false,
8908
- effortControl: false,
8909
- encryptedContent: false,
8910
- summaryAvailable: false
8911
- },
8912
- type: "tts",
8913
- inputModalities: [
8914
- "text"
8915
- ],
8916
- outputModalities: [
8917
- "audio"
8918
- ],
8919
- family: "tts",
8920
- version: "1",
8921
- status: "legacy",
8922
- active: true,
8923
- mediaParams: {
8924
- voice: {
8925
- values: [
8926
- "alloy",
8927
- "ash",
8928
- "ballad",
8929
- "coral",
8930
- "echo",
8931
- "fable",
8932
- "onyx",
8933
- "nova",
8934
- "sage",
8935
- "shimmer",
8936
- "verse",
8937
- "marin",
8938
- "cedar"
8939
- ],
8940
- default: "alloy"
8941
- },
8942
- format: {
8943
- values: [
8944
- "mp3",
8945
- "opus",
8946
- "aac",
8947
- "flac",
8948
- "wav",
8949
- "pcm"
8950
- ],
8951
- default: "mp3"
8952
- },
8953
- speed: {
8954
- min: 0.25,
8955
- max: 4,
8956
- default: 1
8957
- }
8958
- }
8959
- },
8960
- "openai/gpt-4o-mini-tts": {
8961
- providerModelName: "gpt-4o-mini-tts",
8962
- aliases: [
8963
- "gpt-4o-mini-tts",
8964
- "gpt-4o-mini-tts-2025-03-20",
8965
- "gpt-4o-mini-tts-2025-12-15"
8966
- ],
8967
9128
  pricing: {
8968
- inputPerMTok: 2.5,
8969
- outputPerMTok: 10,
8970
- audioOutputPerMTok: 12
9129
+ perMChars: 15
9130
+ },
9131
+ preferredApi: "responses",
9132
+ supportedApis: [
9133
+ "responses",
9134
+ "completions"
9135
+ ],
9136
+ capabilities: {
9137
+ toolUse: false,
9138
+ streaming: true,
9139
+ structuredOutput: false,
9140
+ vision: false,
9141
+ audio: false,
9142
+ video: false,
9143
+ imageGeneration: false,
9144
+ audioGeneration: true,
9145
+ videoGeneration: false
9146
+ },
9147
+ reasoning: {
9148
+ supported: false,
9149
+ automatic: false,
9150
+ effortControl: false,
9151
+ encryptedContent: false,
9152
+ summaryAvailable: false
9153
+ },
9154
+ type: "tts",
9155
+ inputModalities: [
9156
+ "text"
9157
+ ],
9158
+ outputModalities: [
9159
+ "audio"
9160
+ ],
9161
+ family: "tts",
9162
+ version: "1",
9163
+ status: "legacy",
9164
+ active: true,
9165
+ mediaParams: {
9166
+ voice: {
9167
+ values: [
9168
+ "alloy",
9169
+ "ash",
9170
+ "ballad",
9171
+ "coral",
9172
+ "echo",
9173
+ "fable",
9174
+ "onyx",
9175
+ "nova",
9176
+ "sage",
9177
+ "shimmer",
9178
+ "verse",
9179
+ "marin",
9180
+ "cedar"
9181
+ ],
9182
+ default: "alloy"
9183
+ },
9184
+ format: {
9185
+ values: [
9186
+ "mp3",
9187
+ "opus",
9188
+ "aac",
9189
+ "flac",
9190
+ "wav",
9191
+ "pcm"
9192
+ ],
9193
+ default: "mp3"
9194
+ },
9195
+ speed: {
9196
+ min: 0.25,
9197
+ max: 4,
9198
+ default: 1
9199
+ }
9200
+ }
9201
+ },
9202
+ "openai/tts-1-hd": {
9203
+ providerModelName: "tts-1-hd",
9204
+ aliases: [
9205
+ "tts-1-hd",
9206
+ "tts-1-hd-1106"
9207
+ ],
9208
+ pricing: {
9209
+ perMChars: 30
9210
+ },
9211
+ preferredApi: "responses",
9212
+ supportedApis: [
9213
+ "responses",
9214
+ "completions"
9215
+ ],
9216
+ capabilities: {
9217
+ toolUse: false,
9218
+ streaming: true,
9219
+ structuredOutput: false,
9220
+ vision: false,
9221
+ audio: false,
9222
+ video: false,
9223
+ imageGeneration: false,
9224
+ audioGeneration: true,
9225
+ videoGeneration: false
9226
+ },
9227
+ reasoning: {
9228
+ supported: false,
9229
+ automatic: false,
9230
+ effortControl: false,
9231
+ encryptedContent: false,
9232
+ summaryAvailable: false
9233
+ },
9234
+ type: "tts",
9235
+ inputModalities: [
9236
+ "text"
9237
+ ],
9238
+ outputModalities: [
9239
+ "audio"
9240
+ ],
9241
+ family: "tts",
9242
+ version: "1",
9243
+ status: "legacy",
9244
+ active: true,
9245
+ mediaParams: {
9246
+ voice: {
9247
+ values: [
9248
+ "alloy",
9249
+ "ash",
9250
+ "ballad",
9251
+ "coral",
9252
+ "echo",
9253
+ "fable",
9254
+ "onyx",
9255
+ "nova",
9256
+ "sage",
9257
+ "shimmer",
9258
+ "verse",
9259
+ "marin",
9260
+ "cedar"
9261
+ ],
9262
+ default: "alloy"
9263
+ },
9264
+ format: {
9265
+ values: [
9266
+ "mp3",
9267
+ "opus",
9268
+ "aac",
9269
+ "flac",
9270
+ "wav",
9271
+ "pcm"
9272
+ ],
9273
+ default: "mp3"
9274
+ },
9275
+ speed: {
9276
+ min: 0.25,
9277
+ max: 4,
9278
+ default: 1
9279
+ }
9280
+ }
9281
+ },
9282
+ "openai/gpt-4o-mini-tts": {
9283
+ providerModelName: "gpt-4o-mini-tts",
9284
+ aliases: [
9285
+ "gpt-4o-mini-tts",
9286
+ "gpt-4o-mini-tts-2025-03-20",
9287
+ "gpt-4o-mini-tts-2025-12-15"
9288
+ ],
9289
+ pricing: {
9290
+ inputPerMTok: 2.5,
9291
+ outputPerMTok: 10,
9292
+ audioOutputPerMTok: 12
8971
9293
  },
8972
9294
  preferredApi: "responses",
8973
9295
  supportedApis: [
@@ -9045,7 +9367,9 @@ var catalog_default3 = {
9045
9367
  aliases: [
9046
9368
  "whisper-1"
9047
9369
  ],
9048
- pricing: { perMinute: 6e-3 },
9370
+ pricing: {
9371
+ perMinute: 6e-3
9372
+ },
9049
9373
  preferredApi: "responses",
9050
9374
  supportedApis: [
9051
9375
  "responses",
@@ -9079,7 +9403,8 @@ var catalog_default3 = {
9079
9403
  family: "whisper",
9080
9404
  version: "1",
9081
9405
  status: "legacy",
9082
- active: true
9406
+ active: true,
9407
+ contextWindow: 16e3
9083
9408
  },
9084
9409
  "openai/gpt-4o-transcribe": {
9085
9410
  providerModelName: "gpt-4o-transcribe",
@@ -9271,6 +9596,300 @@ var catalog_default3 = {
9271
9596
  version: "1",
9272
9597
  status: "stable",
9273
9598
  active: true
9599
+ },
9600
+ "openai/gpt-realtime-2.1-mini": {
9601
+ providerModelName: "gpt-realtime-2.1-mini",
9602
+ aliases: [
9603
+ "gpt-realtime-2.1-mini"
9604
+ ],
9605
+ pricing: {
9606
+ inputPerMTok: 10,
9607
+ cacheReadPerMTok: 0.3,
9608
+ outputPerMTok: 20
9609
+ },
9610
+ preferredApi: "responses",
9611
+ supportedApis: [
9612
+ "responses",
9613
+ "completions"
9614
+ ],
9615
+ contextWindow: 128e3,
9616
+ maxOutput: 4096,
9617
+ capabilities: {
9618
+ toolUse: true,
9619
+ streaming: true,
9620
+ structuredOutput: false,
9621
+ vision: false,
9622
+ audio: true,
9623
+ video: false,
9624
+ imageGeneration: false,
9625
+ audioGeneration: false,
9626
+ videoGeneration: false
9627
+ },
9628
+ reasoning: {
9629
+ supported: false,
9630
+ automatic: false,
9631
+ effortControl: false,
9632
+ encryptedContent: false,
9633
+ summaryAvailable: false
9634
+ },
9635
+ type: "realtime",
9636
+ inputModalities: [
9637
+ "text",
9638
+ "audio"
9639
+ ],
9640
+ outputModalities: [
9641
+ "text"
9642
+ ],
9643
+ family: "gpt-realtime",
9644
+ version: "2.1",
9645
+ status: "stable",
9646
+ active: true
9647
+ },
9648
+ "openai/gpt-realtime-2.1": {
9649
+ providerModelName: "gpt-realtime-2.1",
9650
+ aliases: [
9651
+ "gpt-realtime-2.1"
9652
+ ],
9653
+ pricing: {
9654
+ inputPerMTok: 32,
9655
+ cacheReadPerMTok: 0.4,
9656
+ outputPerMTok: 64
9657
+ },
9658
+ preferredApi: "responses",
9659
+ supportedApis: [
9660
+ "responses",
9661
+ "completions"
9662
+ ],
9663
+ contextWindow: 128e3,
9664
+ maxOutput: 32e3,
9665
+ capabilities: {
9666
+ toolUse: true,
9667
+ streaming: true,
9668
+ structuredOutput: false,
9669
+ vision: false,
9670
+ audio: true,
9671
+ video: false,
9672
+ imageGeneration: false,
9673
+ audioGeneration: false,
9674
+ videoGeneration: false
9675
+ },
9676
+ reasoning: {
9677
+ supported: false,
9678
+ automatic: false,
9679
+ effortControl: false,
9680
+ encryptedContent: false,
9681
+ summaryAvailable: false
9682
+ },
9683
+ type: "realtime",
9684
+ inputModalities: [
9685
+ "text",
9686
+ "audio"
9687
+ ],
9688
+ outputModalities: [
9689
+ "text"
9690
+ ],
9691
+ family: "gpt-realtime",
9692
+ version: "2.1",
9693
+ status: "stable",
9694
+ active: true
9695
+ },
9696
+ "openai/gpt-5.6-sol": {
9697
+ providerModelName: "gpt-5.6-sol",
9698
+ aliases: [
9699
+ "gpt-5.6-sol"
9700
+ ],
9701
+ pricing: {
9702
+ inputPerMTok: 5,
9703
+ outputPerMTok: 30,
9704
+ cacheReadPerMTok: 0.5,
9705
+ tiers: {
9706
+ batch: {
9707
+ inputPerMTok: 2.5,
9708
+ outputPerMTok: 15,
9709
+ cacheReadPerMTok: 0.25
9710
+ },
9711
+ flex: {
9712
+ inputPerMTok: 2.5,
9713
+ outputPerMTok: 15,
9714
+ cacheReadPerMTok: 0.25
9715
+ },
9716
+ priority: {
9717
+ inputPerMTok: 10,
9718
+ outputPerMTok: 60,
9719
+ cacheReadPerMTok: 1
9720
+ }
9721
+ }
9722
+ },
9723
+ preferredApi: "responses",
9724
+ supportedApis: [
9725
+ "responses",
9726
+ "completions"
9727
+ ],
9728
+ contextWindow: 105e4,
9729
+ maxOutput: 128e3,
9730
+ capabilities: {
9731
+ toolUse: true,
9732
+ streaming: true,
9733
+ structuredOutput: true,
9734
+ vision: true,
9735
+ audio: false,
9736
+ video: false,
9737
+ imageGeneration: false,
9738
+ audioGeneration: false,
9739
+ videoGeneration: false,
9740
+ webSearch: true
9741
+ },
9742
+ reasoning: {
9743
+ supported: true,
9744
+ automatic: false,
9745
+ effortControl: false,
9746
+ encryptedContent: false,
9747
+ summaryAvailable: false
9748
+ },
9749
+ type: "chat",
9750
+ inputModalities: [
9751
+ "text",
9752
+ "image"
9753
+ ],
9754
+ outputModalities: [
9755
+ "text"
9756
+ ],
9757
+ family: "gpt-sol",
9758
+ version: "5.6",
9759
+ status: "stable",
9760
+ active: true
9761
+ },
9762
+ "openai/gpt-5.6-terra": {
9763
+ providerModelName: "gpt-5.6-terra",
9764
+ aliases: [
9765
+ "gpt-5.6-terra"
9766
+ ],
9767
+ pricing: {
9768
+ inputPerMTok: 2.5,
9769
+ outputPerMTok: 15,
9770
+ cacheReadPerMTok: 0.25,
9771
+ tiers: {
9772
+ batch: {
9773
+ inputPerMTok: 1.25,
9774
+ outputPerMTok: 7.5,
9775
+ cacheReadPerMTok: 0.125
9776
+ },
9777
+ flex: {
9778
+ inputPerMTok: 1.25,
9779
+ outputPerMTok: 7.5,
9780
+ cacheReadPerMTok: 0.125
9781
+ },
9782
+ priority: {
9783
+ inputPerMTok: 5,
9784
+ outputPerMTok: 30,
9785
+ cacheReadPerMTok: 0.5
9786
+ }
9787
+ }
9788
+ },
9789
+ preferredApi: "responses",
9790
+ supportedApis: [
9791
+ "responses",
9792
+ "completions"
9793
+ ],
9794
+ contextWindow: 105e4,
9795
+ maxOutput: 128e3,
9796
+ capabilities: {
9797
+ toolUse: true,
9798
+ streaming: true,
9799
+ structuredOutput: true,
9800
+ vision: true,
9801
+ audio: false,
9802
+ video: false,
9803
+ imageGeneration: false,
9804
+ audioGeneration: false,
9805
+ videoGeneration: false,
9806
+ webSearch: true
9807
+ },
9808
+ reasoning: {
9809
+ supported: true,
9810
+ automatic: false,
9811
+ effortControl: false,
9812
+ encryptedContent: false,
9813
+ summaryAvailable: false
9814
+ },
9815
+ type: "chat",
9816
+ inputModalities: [
9817
+ "text",
9818
+ "image"
9819
+ ],
9820
+ outputModalities: [
9821
+ "text"
9822
+ ],
9823
+ family: "gpt-terra",
9824
+ version: "5.6",
9825
+ status: "stable",
9826
+ active: true
9827
+ },
9828
+ "openai/gpt-5.6-luna": {
9829
+ providerModelName: "gpt-5.6-luna",
9830
+ aliases: [
9831
+ "gpt-5.6-luna"
9832
+ ],
9833
+ pricing: {
9834
+ inputPerMTok: 1,
9835
+ outputPerMTok: 6,
9836
+ cacheReadPerMTok: 0.1,
9837
+ tiers: {
9838
+ batch: {
9839
+ inputPerMTok: 0.5,
9840
+ outputPerMTok: 3,
9841
+ cacheReadPerMTok: 0.05
9842
+ },
9843
+ flex: {
9844
+ inputPerMTok: 0.5,
9845
+ outputPerMTok: 3,
9846
+ cacheReadPerMTok: 0.05
9847
+ },
9848
+ priority: {
9849
+ inputPerMTok: 2,
9850
+ outputPerMTok: 12,
9851
+ cacheReadPerMTok: 0.2
9852
+ }
9853
+ }
9854
+ },
9855
+ preferredApi: "responses",
9856
+ supportedApis: [
9857
+ "responses",
9858
+ "completions"
9859
+ ],
9860
+ contextWindow: 105e4,
9861
+ maxOutput: 128e3,
9862
+ capabilities: {
9863
+ toolUse: true,
9864
+ streaming: true,
9865
+ structuredOutput: true,
9866
+ vision: true,
9867
+ audio: false,
9868
+ video: false,
9869
+ imageGeneration: false,
9870
+ audioGeneration: false,
9871
+ videoGeneration: false,
9872
+ webSearch: true
9873
+ },
9874
+ reasoning: {
9875
+ supported: true,
9876
+ automatic: false,
9877
+ effortControl: false,
9878
+ encryptedContent: false,
9879
+ summaryAvailable: false
9880
+ },
9881
+ type: "chat",
9882
+ inputModalities: [
9883
+ "text",
9884
+ "image"
9885
+ ],
9886
+ outputModalities: [
9887
+ "text"
9888
+ ],
9889
+ family: "gpt-luna",
9890
+ version: "5.6",
9891
+ status: "stable",
9892
+ active: true
9274
9893
  }
9275
9894
  };
9276
9895
 
@@ -9378,7 +9997,7 @@ var catalog_default4 = {
9378
9997
  supportedApis: [
9379
9998
  "completions"
9380
9999
  ],
9381
- contextWindow: 128e3,
10000
+ contextWindow: 1e6,
9382
10001
  capabilities: {
9383
10002
  toolUse: false,
9384
10003
  streaming: true,
@@ -9737,7 +10356,7 @@ var catalog_default4 = {
9737
10356
  capabilities: {
9738
10357
  toolUse: false,
9739
10358
  streaming: true,
9740
- structuredOutput: false,
10359
+ structuredOutput: true,
9741
10360
  vision: false,
9742
10361
  audio: false,
9743
10362
  video: false,
@@ -12337,7 +12956,7 @@ var catalog_default4 = {
12337
12956
  "openai/gpt-oss-120b:free"
12338
12957
  ],
12339
12958
  pricing: {
12340
- inputPerMTok: 0.039,
12959
+ inputPerMTok: 0.036,
12341
12960
  outputPerMTok: 0.18
12342
12961
  },
12343
12962
  preferredApi: "completions",
@@ -13388,7 +14007,8 @@ var catalog_default4 = {
13388
14007
  "openrouter/gemini-3-pro-image": {
13389
14008
  providerModelName: "google/gemini-3-pro-image-preview",
13390
14009
  aliases: [
13391
- "google/gemini-3-pro-image-preview"
14010
+ "google/gemini-3-pro-image-preview",
14011
+ "google/gemini-3-pro-image"
13392
14012
  ],
13393
14013
  pricing: {
13394
14014
  inputPerMTok: 2,
@@ -13460,7 +14080,8 @@ var catalog_default4 = {
13460
14080
  "openrouter/gemini-3.1-flash-image": {
13461
14081
  providerModelName: "google/gemini-3.1-flash-image-preview",
13462
14082
  aliases: [
13463
- "google/gemini-3.1-flash-image-preview"
14083
+ "google/gemini-3.1-flash-image-preview",
14084
+ "google/gemini-3.1-flash-image"
13464
14085
  ],
13465
14086
  pricing: {
13466
14087
  inputPerMTok: 0.5,
@@ -13993,8 +14614,8 @@ var catalog_default4 = {
13993
14614
  "x-ai/grok-4.20-multi-agent"
13994
14615
  ],
13995
14616
  pricing: {
13996
- inputPerMTok: 2,
13997
- outputPerMTok: 6,
14617
+ inputPerMTok: 1.25,
14618
+ outputPerMTok: 2.5,
13998
14619
  cacheReadPerMTok: 0.2
13999
14620
  },
14000
14621
  preferredApi: "completions",
@@ -14176,8 +14797,8 @@ var catalog_default4 = {
14176
14797
  "deepseek/deepseek-chat-v3-0324"
14177
14798
  ],
14178
14799
  pricing: {
14179
- inputPerMTok: 0.2,
14180
- outputPerMTok: 0.77,
14800
+ inputPerMTok: 0.24,
14801
+ outputPerMTok: 0.9,
14181
14802
  cacheReadPerMTok: 0.135
14182
14803
  },
14183
14804
  preferredApi: "completions",
@@ -14270,8 +14891,9 @@ var catalog_default4 = {
14270
14891
  "deepseek/deepseek-v3.2-exp"
14271
14892
  ],
14272
14893
  pricing: {
14273
- inputPerMTok: 0.2288,
14274
- outputPerMTok: 0.3432
14894
+ inputPerMTok: 0.2145,
14895
+ outputPerMTok: 0.32175,
14896
+ cacheReadPerMTok: 0.02145
14275
14897
  },
14276
14898
  preferredApi: "completions",
14277
14899
  supportedApis: [
@@ -14315,9 +14937,9 @@ var catalog_default4 = {
14315
14937
  "deepseek/deepseek-v4-flash"
14316
14938
  ],
14317
14939
  pricing: {
14318
- inputPerMTok: 0.098,
14319
- outputPerMTok: 0.196,
14320
- cacheReadPerMTok: 0.02
14940
+ inputPerMTok: 0.077,
14941
+ outputPerMTok: 0.154,
14942
+ cacheReadPerMTok: 0.0154
14321
14943
  },
14322
14944
  preferredApi: "completions",
14323
14945
  supportedApis: [
@@ -14679,8 +15301,8 @@ var catalog_default4 = {
14679
15301
  "qwen/qwen3-8b"
14680
15302
  ],
14681
15303
  pricing: {
14682
- inputPerMTok: 0.05,
14683
- outputPerMTok: 0.4,
15304
+ inputPerMTok: 0.117,
15305
+ outputPerMTok: 0.455,
14684
15306
  cacheReadPerMTok: 0.05
14685
15307
  },
14686
15308
  preferredApi: "completions",
@@ -15141,14 +15763,15 @@ var catalog_default4 = {
15141
15763
  "qwen/qwen3.5-397b-a17b"
15142
15764
  ],
15143
15765
  pricing: {
15144
- inputPerMTok: 0.39,
15145
- outputPerMTok: 2.34
15766
+ inputPerMTok: 0.385,
15767
+ outputPerMTok: 2.45,
15768
+ cacheReadPerMTok: 0.111
15146
15769
  },
15147
15770
  preferredApi: "completions",
15148
15771
  supportedApis: [
15149
15772
  "completions"
15150
15773
  ],
15151
- contextWindow: 262144,
15774
+ contextWindow: 256e3,
15152
15775
  maxOutput: 65536,
15153
15776
  capabilities: {
15154
15777
  toolUse: true,
@@ -15187,8 +15810,9 @@ var catalog_default4 = {
15187
15810
  "qwen/qwen3.6-27b"
15188
15811
  ],
15189
15812
  pricing: {
15190
- inputPerMTok: 0.2885,
15191
- outputPerMTok: 3.17
15813
+ inputPerMTok: 0.285,
15814
+ outputPerMTok: 2.4,
15815
+ cacheReadPerMTok: 0.15
15192
15816
  },
15193
15817
  preferredApi: "completions",
15194
15818
  supportedApis: [
@@ -15233,7 +15857,7 @@ var catalog_default4 = {
15233
15857
  "qwen/qwen3.6-35b-a3b"
15234
15858
  ],
15235
15859
  pricing: {
15236
- inputPerMTok: 0.15,
15860
+ inputPerMTok: 0.14,
15237
15861
  outputPerMTok: 1,
15238
15862
  cacheReadPerMTok: 0.05
15239
15863
  },
@@ -15838,8 +16462,8 @@ var catalog_default4 = {
15838
16462
  "qwen/qwen3-vl-8b-thinking"
15839
16463
  ],
15840
16464
  pricing: {
15841
- inputPerMTok: 0.08,
15842
- outputPerMTok: 0.5
16465
+ inputPerMTok: 0.117,
16466
+ outputPerMTok: 0.455
15843
16467
  },
15844
16468
  preferredApi: "completions",
15845
16469
  supportedApis: [
@@ -16254,8 +16878,8 @@ var catalog_default4 = {
16254
16878
  "meta-llama/llama-3.2-3b-instruct:free"
16255
16879
  ],
16256
16880
  pricing: {
16257
- inputPerMTok: 0.0509,
16258
- outputPerMTok: 0.335
16881
+ inputPerMTok: 0.05,
16882
+ outputPerMTok: 0.33
16259
16883
  },
16260
16884
  preferredApi: "completions",
16261
16885
  supportedApis: [
@@ -16337,7 +16961,11 @@ var catalog_default4 = {
16337
16961
  family: "llama",
16338
16962
  version: "3.2",
16339
16963
  status: "legacy",
16340
- active: true
16964
+ active: true,
16965
+ deprecation: {
16966
+ shutdownDate: "2026-07-17",
16967
+ source: "openrouter"
16968
+ }
16341
16969
  },
16342
16970
  "openrouter/llama-3.3-70b": {
16343
16971
  providerModelName: "meta-llama/llama-3.3-70b-instruct",
@@ -16515,7 +17143,8 @@ var catalog_default4 = {
16515
17143
  family: "llama-guard",
16516
17144
  version: "3",
16517
17145
  status: "stable",
16518
- active: true
17146
+ active: true,
17147
+ contextWindow: 163840
16519
17148
  },
16520
17149
  "openrouter/llama-guard-4-12b": {
16521
17150
  providerModelName: "meta-llama/llama-guard-4-12b",
@@ -17219,9 +17848,9 @@ var catalog_default4 = {
17219
17848
  "moonshotai/kimi-k2.6"
17220
17849
  ],
17221
17850
  pricing: {
17222
- inputPerMTok: 0.68,
17851
+ inputPerMTok: 0.66,
17223
17852
  outputPerMTok: 3.41,
17224
- cacheReadPerMTok: 0.34
17853
+ cacheReadPerMTok: 0.15
17225
17854
  },
17226
17855
  preferredApi: "completions",
17227
17856
  supportedApis: [
@@ -17308,7 +17937,7 @@ var catalog_default4 = {
17308
17937
  status: "legacy",
17309
17938
  active: true,
17310
17939
  deprecation: {
17311
- shutdownDate: "2026-06-19",
17940
+ shutdownDate: "2026-12-31",
17312
17941
  source: "openrouter"
17313
17942
  }
17314
17943
  },
@@ -17459,9 +18088,9 @@ var catalog_default4 = {
17459
18088
  "z-ai/glm-5.1"
17460
18089
  ],
17461
18090
  pricing: {
17462
- inputPerMTok: 0.98,
17463
- outputPerMTok: 3.08,
17464
- cacheReadPerMTok: 0.182
18091
+ inputPerMTok: 0.966,
18092
+ outputPerMTok: 3.036,
18093
+ cacheReadPerMTok: 0.1794
17465
18094
  },
17466
18095
  preferredApi: "completions",
17467
18096
  supportedApis: [
@@ -17598,7 +18227,7 @@ var catalog_default4 = {
17598
18227
  ],
17599
18228
  pricing: {
17600
18229
  inputPerMTok: 0.255,
17601
- outputPerMTok: 1,
18230
+ outputPerMTok: 1.02,
17602
18231
  cacheReadPerMTok: 0.03
17603
18232
  },
17604
18233
  preferredApi: "completions",
@@ -17689,8 +18318,8 @@ var catalog_default4 = {
17689
18318
  "minimax/minimax-m2.7"
17690
18319
  ],
17691
18320
  pricing: {
17692
- inputPerMTok: 0.25,
17693
- outputPerMTok: 1,
18321
+ inputPerMTok: 0.24,
18322
+ outputPerMTok: 0.96,
17694
18323
  cacheReadPerMTok: 0.05
17695
18324
  },
17696
18325
  preferredApi: "completions",
@@ -17909,7 +18538,11 @@ var catalog_default4 = {
17909
18538
  family: "nemotron",
17910
18539
  version: "1.5",
17911
18540
  status: "stable",
17912
- active: true
18541
+ active: true,
18542
+ deprecation: {
18543
+ shutdownDate: "2026-07-17",
18544
+ source: "openrouter"
18545
+ }
17913
18546
  },
17914
18547
  "openrouter/nemotron-3-nano-30b-a3b": {
17915
18548
  providerModelName: "nvidia/nemotron-3-nano-30b-a3b",
@@ -17965,7 +18598,7 @@ var catalog_default4 = {
17965
18598
  "nvidia/nemotron-3-super-120b-a12b:free"
17966
18599
  ],
17967
18600
  pricing: {
17968
- inputPerMTok: 0.09,
18601
+ inputPerMTok: 0.08,
17969
18602
  outputPerMTok: 0.45
17970
18603
  },
17971
18604
  preferredApi: "completions",
@@ -18011,8 +18644,8 @@ var catalog_default4 = {
18011
18644
  ],
18012
18645
  pricing: {
18013
18646
  inputPerMTok: 0.5,
18014
- outputPerMTok: 2.5,
18015
- cacheReadPerMTok: 0.15
18647
+ outputPerMTok: 2.2,
18648
+ cacheReadPerMTok: 0.1
18016
18649
  },
18017
18650
  preferredApi: "completions",
18018
18651
  supportedApis: [
@@ -18512,7 +19145,7 @@ var catalog_default4 = {
18512
19145
  "microsoft/phi-4"
18513
19146
  ],
18514
19147
  pricing: {
18515
- inputPerMTok: 0.065,
19148
+ inputPerMTok: 0.07,
18516
19149
  outputPerMTok: 0.14
18517
19150
  },
18518
19151
  preferredApi: "completions",
@@ -19379,8 +20012,8 @@ var catalog_default4 = {
19379
20012
  "arcee-ai/trinity-large-thinking"
19380
20013
  ],
19381
20014
  pricing: {
19382
- inputPerMTok: 0.22,
19383
- outputPerMTok: 0.85,
20015
+ inputPerMTok: 0.25,
20016
+ outputPerMTok: 0.8,
19384
20017
  cacheReadPerMTok: 0.06
19385
20018
  },
19386
20019
  preferredApi: "completions",
@@ -20329,7 +20962,7 @@ var catalog_default4 = {
20329
20962
  "stepfun/step-3.5-flash"
20330
20963
  ],
20331
20964
  pricing: {
20332
- inputPerMTok: 0.09,
20965
+ inputPerMTok: 0.1,
20333
20966
  outputPerMTok: 0.3,
20334
20967
  cacheReadPerMTok: 0.02
20335
20968
  },
@@ -20464,7 +21097,9 @@ var catalog_default4 = {
20464
21097
  "openrouter/hunyuan-hy3": {
20465
21098
  providerModelName: "tencent/hy3-preview",
20466
21099
  aliases: [
20467
- "tencent/hy3-preview"
21100
+ "tencent/hy3-preview",
21101
+ "tencent/hy3",
21102
+ "tencent/hy3:free"
20468
21103
  ],
20469
21104
  pricing: {
20470
21105
  inputPerMTok: 0.063,
@@ -20648,9 +21283,9 @@ var catalog_default4 = {
20648
21283
  "xiaomi/mimo-v2.5"
20649
21284
  ],
20650
21285
  pricing: {
20651
- inputPerMTok: 0.14,
21286
+ inputPerMTok: 0.105,
20652
21287
  outputPerMTok: 0.28,
20653
- cacheReadPerMTok: 28e-4
21288
+ cacheReadPerMTok: 0.028
20654
21289
  },
20655
21290
  preferredApi: "completions",
20656
21291
  supportedApis: [
@@ -20739,11 +21374,13 @@ var catalog_default4 = {
20739
21374
  "openrouter/nex-n2-pro": {
20740
21375
  providerModelName: "nex-agi/nex-n2-pro:free",
20741
21376
  aliases: [
20742
- "nex-agi/nex-n2-pro:free"
21377
+ "nex-agi/nex-n2-pro:free",
21378
+ "nex-agi/nex-n2-pro"
20743
21379
  ],
20744
21380
  pricing: {
20745
- inputPerMTok: 0,
20746
- outputPerMTok: 0
21381
+ inputPerMTok: 0.25,
21382
+ outputPerMTok: 1,
21383
+ cacheReadPerMTok: 0.025
20747
21384
  },
20748
21385
  preferredApi: "completions",
20749
21386
  supportedApis: [
@@ -20831,7 +21468,8 @@ var catalog_default4 = {
20831
21468
  "openrouter/laguna-m.1": {
20832
21469
  providerModelName: "poolside/laguna-m.1:free",
20833
21470
  aliases: [
20834
- "poolside/laguna-m.1:free"
21471
+ "poolside/laguna-m.1:free",
21472
+ "poolside/laguna-m.1"
20835
21473
  ],
20836
21474
  pricing: {
20837
21475
  inputPerMTok: 0,
@@ -21011,7 +21649,8 @@ var catalog_default4 = {
21011
21649
  "openrouter/dolphin-mistral-24b-venice": {
21012
21650
  providerModelName: "cognitivecomputations/dolphin-mistral-24b-venice-edition:free",
21013
21651
  aliases: [
21014
- "cognitivecomputations/dolphin-mistral-24b-venice-edition:free"
21652
+ "cognitivecomputations/dolphin-mistral-24b-venice-edition:free",
21653
+ "cognitivecomputations/dolphin-mistral-24b-venice-edition"
21015
21654
  ],
21016
21655
  pricing: {
21017
21656
  inputPerMTok: 0,
@@ -21050,7 +21689,11 @@ var catalog_default4 = {
21050
21689
  family: "roleplay-finetunes",
21051
21690
  version: "1",
21052
21691
  status: "stable",
21053
- active: true
21692
+ active: true,
21693
+ deprecation: {
21694
+ shutdownDate: "2026-07-19",
21695
+ source: "openrouter"
21696
+ }
21054
21697
  },
21055
21698
  "openrouter/mythomax-l2-13b": {
21056
21699
  providerModelName: "gryphe/mythomax-l2-13b",
@@ -21286,15 +21929,15 @@ var catalog_default4 = {
21286
21929
  "thedrummer/rocinante-12b"
21287
21930
  ],
21288
21931
  pricing: {
21289
- inputPerMTok: 0.17,
21290
- outputPerMTok: 0.43
21932
+ inputPerMTok: 0.25,
21933
+ outputPerMTok: 0.5
21291
21934
  },
21292
21935
  preferredApi: "completions",
21293
21936
  supportedApis: [
21294
21937
  "completions"
21295
21938
  ],
21296
- contextWindow: 32768,
21297
- maxOutput: 32768,
21939
+ contextWindow: 65536,
21940
+ maxOutput: 65536,
21298
21941
  capabilities: {
21299
21942
  toolUse: true,
21300
21943
  streaming: true,
@@ -21460,35 +22103,23 @@ var catalog_default4 = {
21460
22103
  version: "2",
21461
22104
  status: "legacy",
21462
22105
  active: true
21463
- }
21464
- };
21465
-
21466
- // src/llm/providers/xai/catalog.json
21467
- var catalog_default5 = {
21468
- "xai/grok-4.20": {
21469
- providerModelName: "grok-4.20-0309-reasoning",
22106
+ },
22107
+ "openrouter/claude-sonnet-5": {
22108
+ providerModelName: "anthropic/claude-sonnet-5",
21470
22109
  aliases: [
21471
- "grok-4.20-0309-reasoning"
22110
+ "anthropic/claude-sonnet-5"
21472
22111
  ],
21473
22112
  pricing: {
21474
- inputPerMTok: 1.25,
21475
- outputPerMTok: 2.5,
21476
- cacheReadPerMTok: 0.2,
21477
- tiers: {
21478
- "long-context": {
21479
- inputPerMTok: 2.5,
21480
- outputPerMTok: 5,
21481
- cacheReadPerMTok: 0.4
21482
- }
21483
- }
22113
+ inputPerMTok: 2,
22114
+ outputPerMTok: 10,
22115
+ cacheReadPerMTok: 0.2
21484
22116
  },
21485
- preferredApi: "responses",
22117
+ preferredApi: "completions",
21486
22118
  supportedApis: [
21487
- "responses",
21488
22119
  "completions"
21489
22120
  ],
21490
- contextWindow: 2e6,
21491
- maxOutput: 2e6,
22121
+ contextWindow: 1e6,
22122
+ maxOutput: 128e3,
21492
22123
  capabilities: {
21493
22124
  toolUse: true,
21494
22125
  streaming: true,
@@ -21501,7 +22132,7 @@ var catalog_default5 = {
21501
22132
  videoGeneration: false
21502
22133
  },
21503
22134
  reasoning: {
21504
- supported: false,
22135
+ supported: true,
21505
22136
  automatic: false,
21506
22137
  effortControl: false,
21507
22138
  encryptedContent: false,
@@ -21515,33 +22146,27 @@ var catalog_default5 = {
21515
22146
  outputModalities: [
21516
22147
  "text"
21517
22148
  ],
21518
- family: "grok",
21519
- version: "4.20",
22149
+ family: "claude-sonnet",
22150
+ version: "5",
21520
22151
  status: "stable",
21521
22152
  active: true
21522
22153
  },
21523
- "xai/grok-4.20-non-reasoning": {
21524
- providerModelName: "grok-4.20-0309-non-reasoning",
22154
+ "openrouter/gpt-5.6-luna": {
22155
+ providerModelName: "openai/gpt-5.6-luna",
21525
22156
  aliases: [
21526
- "grok-4.20-0309-non-reasoning"
22157
+ "openai/gpt-5.6-luna"
21527
22158
  ],
21528
22159
  pricing: {
21529
- inputPerMTok: 1.25,
21530
- outputPerMTok: 2.5,
21531
- cacheReadPerMTok: 0.2,
21532
- tiers: {
21533
- "long-context": {
21534
- inputPerMTok: 2.5,
21535
- outputPerMTok: 5,
21536
- cacheReadPerMTok: 0.4
21537
- }
21538
- }
22160
+ inputPerMTok: 1,
22161
+ outputPerMTok: 6,
22162
+ cacheReadPerMTok: 0.1
21539
22163
  },
21540
- preferredApi: "responses",
22164
+ preferredApi: "completions",
21541
22165
  supportedApis: [
21542
- "responses",
21543
22166
  "completions"
21544
22167
  ],
22168
+ contextWindow: 105e4,
22169
+ maxOutput: 128e3,
21545
22170
  capabilities: {
21546
22171
  toolUse: true,
21547
22172
  streaming: true,
@@ -21554,7 +22179,7 @@ var catalog_default5 = {
21554
22179
  videoGeneration: false
21555
22180
  },
21556
22181
  reasoning: {
21557
- supported: false,
22182
+ supported: true,
21558
22183
  automatic: false,
21559
22184
  effortControl: false,
21560
22185
  encryptedContent: false,
@@ -21568,33 +22193,332 @@ var catalog_default5 = {
21568
22193
  outputModalities: [
21569
22194
  "text"
21570
22195
  ],
21571
- family: "grok",
21572
- version: "4.20",
22196
+ family: "gpt",
22197
+ version: "5.6",
21573
22198
  status: "stable",
21574
22199
  active: true
21575
22200
  },
21576
- "xai/grok-4.20-multi-agent": {
21577
- providerModelName: "grok-4.20-multi-agent-0309",
22201
+ "openrouter/gpt-5.6-terra": {
22202
+ providerModelName: "openai/gpt-5.6-terra",
21578
22203
  aliases: [
21579
- "grok-4.20-multi-agent-0309"
22204
+ "openai/gpt-5.6-terra"
21580
22205
  ],
21581
22206
  pricing: {
21582
- inputPerMTok: 1.25,
21583
- outputPerMTok: 2.5,
21584
- cacheReadPerMTok: 0.2,
21585
- tiers: {
21586
- "long-context": {
21587
- inputPerMTok: 2.5,
21588
- outputPerMTok: 5,
21589
- cacheReadPerMTok: 0.4
21590
- }
22207
+ inputPerMTok: 2.5,
22208
+ outputPerMTok: 15,
22209
+ cacheReadPerMTok: 0.25
22210
+ },
22211
+ preferredApi: "completions",
22212
+ supportedApis: [
22213
+ "completions"
22214
+ ],
22215
+ contextWindow: 105e4,
22216
+ maxOutput: 128e3,
22217
+ capabilities: {
22218
+ toolUse: true,
22219
+ streaming: true,
22220
+ structuredOutput: true,
22221
+ vision: true,
22222
+ audio: false,
22223
+ video: false,
22224
+ imageGeneration: false,
22225
+ audioGeneration: false,
22226
+ videoGeneration: false
22227
+ },
22228
+ reasoning: {
22229
+ supported: true,
22230
+ automatic: false,
22231
+ effortControl: false,
22232
+ encryptedContent: false,
22233
+ summaryAvailable: false
22234
+ },
22235
+ type: "chat",
22236
+ inputModalities: [
22237
+ "text",
22238
+ "image"
22239
+ ],
22240
+ outputModalities: [
22241
+ "text"
22242
+ ],
22243
+ family: "gpt",
22244
+ version: "5.6",
22245
+ status: "stable",
22246
+ active: true
22247
+ },
22248
+ "openrouter/gpt-5.6-sol": {
22249
+ providerModelName: "openai/gpt-5.6-sol",
22250
+ aliases: [
22251
+ "openai/gpt-5.6-sol"
22252
+ ],
22253
+ pricing: {
22254
+ inputPerMTok: 5,
22255
+ outputPerMTok: 30,
22256
+ cacheReadPerMTok: 0.5
22257
+ },
22258
+ preferredApi: "completions",
22259
+ supportedApis: [
22260
+ "completions"
22261
+ ],
22262
+ contextWindow: 105e4,
22263
+ maxOutput: 128e3,
22264
+ capabilities: {
22265
+ toolUse: true,
22266
+ streaming: true,
22267
+ structuredOutput: true,
22268
+ vision: true,
22269
+ audio: false,
22270
+ video: false,
22271
+ imageGeneration: false,
22272
+ audioGeneration: false,
22273
+ videoGeneration: false
22274
+ },
22275
+ reasoning: {
22276
+ supported: true,
22277
+ automatic: false,
22278
+ effortControl: false,
22279
+ encryptedContent: false,
22280
+ summaryAvailable: false
22281
+ },
22282
+ type: "chat",
22283
+ inputModalities: [
22284
+ "text",
22285
+ "image"
22286
+ ],
22287
+ outputModalities: [
22288
+ "text"
22289
+ ],
22290
+ family: "gpt",
22291
+ version: "5.6",
22292
+ status: "stable",
22293
+ active: true
22294
+ },
22295
+ "openrouter/gpt-5.6-luna-pro": {
22296
+ providerModelName: "openai/gpt-5.6-luna-pro",
22297
+ aliases: [
22298
+ "openai/gpt-5.6-luna-pro"
22299
+ ],
22300
+ pricing: {
22301
+ inputPerMTok: 1,
22302
+ outputPerMTok: 6,
22303
+ cacheReadPerMTok: 0.1
22304
+ },
22305
+ preferredApi: "completions",
22306
+ supportedApis: [
22307
+ "completions"
22308
+ ],
22309
+ contextWindow: 105e4,
22310
+ maxOutput: 128e3,
22311
+ capabilities: {
22312
+ toolUse: true,
22313
+ streaming: true,
22314
+ structuredOutput: true,
22315
+ vision: true,
22316
+ audio: false,
22317
+ video: false,
22318
+ imageGeneration: false,
22319
+ audioGeneration: false,
22320
+ videoGeneration: false
22321
+ },
22322
+ reasoning: {
22323
+ supported: true,
22324
+ automatic: false,
22325
+ effortControl: false,
22326
+ encryptedContent: false,
22327
+ summaryAvailable: false
22328
+ },
22329
+ type: "chat",
22330
+ inputModalities: [
22331
+ "text",
22332
+ "image"
22333
+ ],
22334
+ outputModalities: [
22335
+ "text"
22336
+ ],
22337
+ family: "gpt-pro",
22338
+ version: "5.6",
22339
+ status: "stable",
22340
+ active: true
22341
+ },
22342
+ "openrouter/gpt-5.6-terra-pro": {
22343
+ providerModelName: "openai/gpt-5.6-terra-pro",
22344
+ aliases: [
22345
+ "openai/gpt-5.6-terra-pro"
22346
+ ],
22347
+ pricing: {
22348
+ inputPerMTok: 2.5,
22349
+ outputPerMTok: 15,
22350
+ cacheReadPerMTok: 0.25
22351
+ },
22352
+ preferredApi: "completions",
22353
+ supportedApis: [
22354
+ "completions"
22355
+ ],
22356
+ contextWindow: 105e4,
22357
+ maxOutput: 128e3,
22358
+ capabilities: {
22359
+ toolUse: true,
22360
+ streaming: true,
22361
+ structuredOutput: true,
22362
+ vision: true,
22363
+ audio: false,
22364
+ video: false,
22365
+ imageGeneration: false,
22366
+ audioGeneration: false,
22367
+ videoGeneration: false
22368
+ },
22369
+ reasoning: {
22370
+ supported: true,
22371
+ automatic: false,
22372
+ effortControl: false,
22373
+ encryptedContent: false,
22374
+ summaryAvailable: false
22375
+ },
22376
+ type: "chat",
22377
+ inputModalities: [
22378
+ "text",
22379
+ "image"
22380
+ ],
22381
+ outputModalities: [
22382
+ "text"
22383
+ ],
22384
+ family: "gpt-pro",
22385
+ version: "5.6",
22386
+ status: "stable",
22387
+ active: true
22388
+ },
22389
+ "openrouter/gpt-5.6-sol-pro": {
22390
+ providerModelName: "openai/gpt-5.6-sol-pro",
22391
+ aliases: [
22392
+ "openai/gpt-5.6-sol-pro"
22393
+ ],
22394
+ pricing: {
22395
+ inputPerMTok: 5,
22396
+ outputPerMTok: 30,
22397
+ cacheReadPerMTok: 0.5
22398
+ },
22399
+ preferredApi: "completions",
22400
+ supportedApis: [
22401
+ "completions"
22402
+ ],
22403
+ contextWindow: 105e4,
22404
+ maxOutput: 128e3,
22405
+ capabilities: {
22406
+ toolUse: true,
22407
+ streaming: true,
22408
+ structuredOutput: true,
22409
+ vision: true,
22410
+ audio: false,
22411
+ video: false,
22412
+ imageGeneration: false,
22413
+ audioGeneration: false,
22414
+ videoGeneration: false
22415
+ },
22416
+ reasoning: {
22417
+ supported: true,
22418
+ automatic: false,
22419
+ effortControl: false,
22420
+ encryptedContent: false,
22421
+ summaryAvailable: false
22422
+ },
22423
+ type: "chat",
22424
+ inputModalities: [
22425
+ "text",
22426
+ "image"
22427
+ ],
22428
+ outputModalities: [
22429
+ "text"
22430
+ ],
22431
+ family: "gpt-pro",
22432
+ version: "5.6",
22433
+ status: "stable",
22434
+ active: true
22435
+ },
22436
+ "openrouter/gemini-3.1-flash-lite-image": {
22437
+ providerModelName: "google/gemini-3.1-flash-lite-image",
22438
+ aliases: [
22439
+ "google/gemini-3.1-flash-lite-image"
22440
+ ],
22441
+ pricing: {
22442
+ inputPerMTok: 0.25,
22443
+ outputPerMTok: 1.5
22444
+ },
22445
+ preferredApi: "completions",
22446
+ supportedApis: [
22447
+ "completions"
22448
+ ],
22449
+ contextWindow: 65536,
22450
+ maxOutput: 66e3,
22451
+ capabilities: {
22452
+ toolUse: false,
22453
+ streaming: true,
22454
+ structuredOutput: false,
22455
+ vision: true,
22456
+ audio: false,
22457
+ video: false,
22458
+ imageGeneration: true,
22459
+ audioGeneration: false,
22460
+ videoGeneration: false
22461
+ },
22462
+ reasoning: {
22463
+ supported: true,
22464
+ automatic: false,
22465
+ effortControl: false,
22466
+ encryptedContent: false,
22467
+ summaryAvailable: false
22468
+ },
22469
+ type: "image",
22470
+ inputModalities: [
22471
+ "text",
22472
+ "image"
22473
+ ],
22474
+ outputModalities: [
22475
+ "image"
22476
+ ],
22477
+ family: "gemini-image",
22478
+ version: "3.1",
22479
+ status: "stable",
22480
+ active: true,
22481
+ mediaParams: {
22482
+ aspectRatio: {
22483
+ values: [
22484
+ "1:1",
22485
+ "2:3",
22486
+ "3:2",
22487
+ "3:4",
22488
+ "4:3",
22489
+ "4:5",
22490
+ "5:4",
22491
+ "9:16",
22492
+ "16:9",
22493
+ "21:9"
22494
+ ]
22495
+ },
22496
+ imageSize: {
22497
+ values: [
22498
+ "0.5K",
22499
+ "1K",
22500
+ "2K",
22501
+ "4K"
22502
+ ],
22503
+ default: "1K"
21591
22504
  }
22505
+ }
22506
+ },
22507
+ "openrouter/grok-4.5": {
22508
+ providerModelName: "x-ai/grok-4.5",
22509
+ aliases: [
22510
+ "x-ai/grok-4.5"
22511
+ ],
22512
+ pricing: {
22513
+ inputPerMTok: 2,
22514
+ outputPerMTok: 6,
22515
+ cacheReadPerMTok: 0.5
21592
22516
  },
21593
- preferredApi: "responses",
22517
+ preferredApi: "completions",
21594
22518
  supportedApis: [
21595
- "responses"
22519
+ "completions"
21596
22520
  ],
21597
- contextWindow: 2e6,
22521
+ contextWindow: 5e5,
21598
22522
  capabilities: {
21599
22523
  toolUse: true,
21600
22524
  streaming: true,
@@ -21607,7 +22531,7 @@ var catalog_default5 = {
21607
22531
  videoGeneration: false
21608
22532
  },
21609
22533
  reasoning: {
21610
- supported: false,
22534
+ supported: true,
21611
22535
  automatic: false,
21612
22536
  effortControl: false,
21613
22537
  encryptedContent: false,
@@ -21622,34 +22546,1030 @@ var catalog_default5 = {
21622
22546
  "text"
21623
22547
  ],
21624
22548
  family: "grok",
21625
- version: "4.20",
22549
+ version: "4.5",
21626
22550
  status: "stable",
21627
22551
  active: true
21628
22552
  },
21629
- "xai/grok-4.3": {
21630
- providerModelName: "grok-4.3",
22553
+ "openrouter/glm-5.2": {
22554
+ providerModelName: "z-ai/glm-5.2",
21631
22555
  aliases: [
21632
- "grok-4.3"
22556
+ "z-ai/glm-5.2"
21633
22557
  ],
21634
22558
  pricing: {
21635
- inputPerMTok: 1.25,
21636
- outputPerMTok: 2.5,
21637
- cacheReadPerMTok: 0.2,
21638
- tiers: {
21639
- "long-context": {
21640
- inputPerMTok: 2.5,
21641
- outputPerMTok: 5,
21642
- cacheReadPerMTok: 0.4
21643
- }
21644
- }
22559
+ inputPerMTok: 0.35,
22560
+ outputPerMTok: 1.1,
22561
+ cacheReadPerMTok: 0.065
21645
22562
  },
21646
- preferredApi: "responses",
22563
+ preferredApi: "completions",
21647
22564
  supportedApis: [
21648
- "responses",
21649
22565
  "completions"
21650
22566
  ],
21651
- contextWindow: 1e6,
21652
- maxOutput: 1e6,
22567
+ contextWindow: 1048576,
22568
+ maxOutput: 128e3,
22569
+ capabilities: {
22570
+ toolUse: true,
22571
+ streaming: true,
22572
+ structuredOutput: true,
22573
+ vision: false,
22574
+ audio: false,
22575
+ video: false,
22576
+ imageGeneration: false,
22577
+ audioGeneration: false,
22578
+ videoGeneration: false
22579
+ },
22580
+ reasoning: {
22581
+ supported: true,
22582
+ automatic: false,
22583
+ effortControl: false,
22584
+ encryptedContent: false,
22585
+ summaryAvailable: false
22586
+ },
22587
+ type: "chat",
22588
+ inputModalities: [
22589
+ "text"
22590
+ ],
22591
+ outputModalities: [
22592
+ "text"
22593
+ ],
22594
+ family: "glm",
22595
+ version: "5.2",
22596
+ status: "stable",
22597
+ active: true
22598
+ },
22599
+ "openrouter/glm-5v-turbo": {
22600
+ providerModelName: "z-ai/glm-5v-turbo",
22601
+ aliases: [
22602
+ "z-ai/glm-5v-turbo"
22603
+ ],
22604
+ pricing: {
22605
+ inputPerMTok: 1.2,
22606
+ outputPerMTok: 4,
22607
+ cacheReadPerMTok: 0.24
22608
+ },
22609
+ preferredApi: "completions",
22610
+ supportedApis: [
22611
+ "completions"
22612
+ ],
22613
+ contextWindow: 202752,
22614
+ maxOutput: 131072,
22615
+ capabilities: {
22616
+ toolUse: true,
22617
+ streaming: true,
22618
+ structuredOutput: true,
22619
+ vision: true,
22620
+ audio: false,
22621
+ video: false,
22622
+ imageGeneration: false,
22623
+ audioGeneration: false,
22624
+ videoGeneration: false
22625
+ },
22626
+ reasoning: {
22627
+ supported: true,
22628
+ automatic: false,
22629
+ effortControl: false,
22630
+ encryptedContent: false,
22631
+ summaryAvailable: false
22632
+ },
22633
+ type: "vision",
22634
+ inputModalities: [
22635
+ "text",
22636
+ "image"
22637
+ ],
22638
+ outputModalities: [
22639
+ "text"
22640
+ ],
22641
+ family: "glm",
22642
+ version: "5",
22643
+ status: "stable",
22644
+ active: true,
22645
+ deprecation: {
22646
+ shutdownDate: "2098-12-31",
22647
+ source: "openrouter"
22648
+ }
22649
+ },
22650
+ "openrouter/aion-3.0-mini": {
22651
+ providerModelName: "aion-labs/aion-3.0-mini",
22652
+ aliases: [
22653
+ "aion-labs/aion-3.0-mini"
22654
+ ],
22655
+ pricing: {
22656
+ inputPerMTok: 0.7,
22657
+ outputPerMTok: 1.4,
22658
+ cacheReadPerMTok: 0.18
22659
+ },
22660
+ preferredApi: "completions",
22661
+ supportedApis: [
22662
+ "completions"
22663
+ ],
22664
+ contextWindow: 131072,
22665
+ maxOutput: 32768,
22666
+ capabilities: {
22667
+ toolUse: true,
22668
+ streaming: true,
22669
+ structuredOutput: true,
22670
+ vision: false,
22671
+ audio: false,
22672
+ video: false,
22673
+ imageGeneration: false,
22674
+ audioGeneration: false,
22675
+ videoGeneration: false
22676
+ },
22677
+ reasoning: {
22678
+ supported: true,
22679
+ automatic: false,
22680
+ effortControl: false,
22681
+ encryptedContent: false,
22682
+ summaryAvailable: false
22683
+ },
22684
+ type: "chat",
22685
+ inputModalities: [
22686
+ "text"
22687
+ ],
22688
+ outputModalities: [
22689
+ "text"
22690
+ ],
22691
+ family: "aion",
22692
+ version: "3.0",
22693
+ status: "stable",
22694
+ active: true
22695
+ },
22696
+ "openrouter/aion-3.0": {
22697
+ providerModelName: "aion-labs/aion-3.0",
22698
+ aliases: [
22699
+ "aion-labs/aion-3.0"
22700
+ ],
22701
+ pricing: {
22702
+ inputPerMTok: 3,
22703
+ outputPerMTok: 6,
22704
+ cacheReadPerMTok: 0.75
22705
+ },
22706
+ preferredApi: "completions",
22707
+ supportedApis: [
22708
+ "completions"
22709
+ ],
22710
+ contextWindow: 131072,
22711
+ maxOutput: 32768,
22712
+ capabilities: {
22713
+ toolUse: true,
22714
+ streaming: true,
22715
+ structuredOutput: true,
22716
+ vision: false,
22717
+ audio: false,
22718
+ video: false,
22719
+ imageGeneration: false,
22720
+ audioGeneration: false,
22721
+ videoGeneration: false
22722
+ },
22723
+ reasoning: {
22724
+ supported: true,
22725
+ automatic: false,
22726
+ effortControl: false,
22727
+ encryptedContent: false,
22728
+ summaryAvailable: false
22729
+ },
22730
+ type: "chat",
22731
+ inputModalities: [
22732
+ "text"
22733
+ ],
22734
+ outputModalities: [
22735
+ "text"
22736
+ ],
22737
+ family: "aion",
22738
+ version: "3.0",
22739
+ status: "stable",
22740
+ active: true
22741
+ },
22742
+ "openrouter/nex-n2-mini": {
22743
+ providerModelName: "nex-agi/nex-n2-mini",
22744
+ aliases: [
22745
+ "nex-agi/nex-n2-mini"
22746
+ ],
22747
+ pricing: {
22748
+ inputPerMTok: 0.025,
22749
+ outputPerMTok: 0.1,
22750
+ cacheReadPerMTok: 25e-4
22751
+ },
22752
+ preferredApi: "completions",
22753
+ supportedApis: [
22754
+ "completions"
22755
+ ],
22756
+ contextWindow: 262144,
22757
+ maxOutput: 262144,
22758
+ capabilities: {
22759
+ toolUse: true,
22760
+ streaming: true,
22761
+ structuredOutput: true,
22762
+ vision: true,
22763
+ audio: false,
22764
+ video: false,
22765
+ imageGeneration: false,
22766
+ audioGeneration: false,
22767
+ videoGeneration: false
22768
+ },
22769
+ reasoning: {
22770
+ supported: true,
22771
+ automatic: false,
22772
+ effortControl: false,
22773
+ encryptedContent: false,
22774
+ summaryAvailable: false
22775
+ },
22776
+ type: "chat",
22777
+ inputModalities: [
22778
+ "text",
22779
+ "image"
22780
+ ],
22781
+ outputModalities: [
22782
+ "text"
22783
+ ],
22784
+ family: "nex",
22785
+ version: "2",
22786
+ status: "stable",
22787
+ active: true
22788
+ },
22789
+ "openrouter/laguna-xs.2.1": {
22790
+ providerModelName: "poolside/laguna-xs-2.1",
22791
+ aliases: [
22792
+ "poolside/laguna-xs-2.1",
22793
+ "poolside/laguna-xs-2.1:free"
22794
+ ],
22795
+ pricing: {
22796
+ inputPerMTok: 0.06,
22797
+ outputPerMTok: 0.12,
22798
+ cacheReadPerMTok: 0.03
22799
+ },
22800
+ preferredApi: "completions",
22801
+ supportedApis: [
22802
+ "completions"
22803
+ ],
22804
+ contextWindow: 262144,
22805
+ maxOutput: 32768,
22806
+ capabilities: {
22807
+ toolUse: true,
22808
+ streaming: true,
22809
+ structuredOutput: true,
22810
+ vision: false,
22811
+ audio: false,
22812
+ video: false,
22813
+ imageGeneration: false,
22814
+ audioGeneration: false,
22815
+ videoGeneration: false
22816
+ },
22817
+ reasoning: {
22818
+ supported: true,
22819
+ automatic: false,
22820
+ effortControl: false,
22821
+ encryptedContent: false,
22822
+ summaryAvailable: false
22823
+ },
22824
+ type: "code",
22825
+ inputModalities: [
22826
+ "text"
22827
+ ],
22828
+ outputModalities: [
22829
+ "text"
22830
+ ],
22831
+ family: "laguna",
22832
+ version: "2.1",
22833
+ status: "preview",
22834
+ active: true
22835
+ },
22836
+ "openrouter/fugu-ultra": {
22837
+ providerModelName: "sakana/fugu-ultra",
22838
+ aliases: [
22839
+ "sakana/fugu-ultra"
22840
+ ],
22841
+ pricing: {
22842
+ inputPerMTok: 5,
22843
+ outputPerMTok: 30,
22844
+ cacheReadPerMTok: 0.5
22845
+ },
22846
+ preferredApi: "completions",
22847
+ supportedApis: [
22848
+ "completions"
22849
+ ],
22850
+ contextWindow: 1e6,
22851
+ maxOutput: 128e3,
22852
+ capabilities: {
22853
+ toolUse: true,
22854
+ streaming: true,
22855
+ structuredOutput: true,
22856
+ vision: true,
22857
+ audio: false,
22858
+ video: false,
22859
+ imageGeneration: false,
22860
+ audioGeneration: false,
22861
+ videoGeneration: false,
22862
+ webSearch: true
22863
+ },
22864
+ reasoning: {
22865
+ supported: true,
22866
+ automatic: false,
22867
+ effortControl: false,
22868
+ encryptedContent: false,
22869
+ summaryAvailable: false
22870
+ },
22871
+ type: "chat",
22872
+ inputModalities: [
22873
+ "text",
22874
+ "image"
22875
+ ],
22876
+ outputModalities: [
22877
+ "text"
22878
+ ],
22879
+ family: "fugu",
22880
+ version: "1",
22881
+ status: "stable",
22882
+ active: true
22883
+ },
22884
+ "openrouter/north-mini-code": {
22885
+ providerModelName: "cohere/north-mini-code:free",
22886
+ aliases: [
22887
+ "cohere/north-mini-code:free"
22888
+ ],
22889
+ pricing: {
22890
+ inputPerMTok: 0,
22891
+ outputPerMTok: 0
22892
+ },
22893
+ preferredApi: "completions",
22894
+ supportedApis: [
22895
+ "completions"
22896
+ ],
22897
+ contextWindow: 256e3,
22898
+ maxOutput: 64e3,
22899
+ capabilities: {
22900
+ toolUse: true,
22901
+ streaming: true,
22902
+ structuredOutput: true,
22903
+ vision: false,
22904
+ audio: false,
22905
+ video: false,
22906
+ imageGeneration: false,
22907
+ audioGeneration: false,
22908
+ videoGeneration: false
22909
+ },
22910
+ reasoning: {
22911
+ supported: true,
22912
+ automatic: false,
22913
+ effortControl: false,
22914
+ encryptedContent: false,
22915
+ summaryAvailable: false
22916
+ },
22917
+ type: "code",
22918
+ inputModalities: [
22919
+ "text"
22920
+ ],
22921
+ outputModalities: [
22922
+ "text"
22923
+ ],
22924
+ family: "north-code",
22925
+ version: "1",
22926
+ status: "stable",
22927
+ active: true
22928
+ },
22929
+ "openrouter/kimi-k2.7-code": {
22930
+ providerModelName: "moonshotai/kimi-k2.7-code",
22931
+ aliases: [
22932
+ "moonshotai/kimi-k2.7-code"
22933
+ ],
22934
+ pricing: {
22935
+ inputPerMTok: 0.72,
22936
+ outputPerMTok: 3.49,
22937
+ cacheReadPerMTok: 0.159
22938
+ },
22939
+ preferredApi: "completions",
22940
+ supportedApis: [
22941
+ "completions"
22942
+ ],
22943
+ contextWindow: 262144,
22944
+ maxOutput: 262144,
22945
+ capabilities: {
22946
+ toolUse: true,
22947
+ streaming: true,
22948
+ structuredOutput: true,
22949
+ vision: true,
22950
+ audio: false,
22951
+ video: false,
22952
+ imageGeneration: false,
22953
+ audioGeneration: false,
22954
+ videoGeneration: false
22955
+ },
22956
+ reasoning: {
22957
+ supported: true,
22958
+ automatic: false,
22959
+ effortControl: false,
22960
+ encryptedContent: false,
22961
+ summaryAvailable: false
22962
+ },
22963
+ type: "code",
22964
+ inputModalities: [
22965
+ "text",
22966
+ "image"
22967
+ ],
22968
+ outputModalities: [
22969
+ "text"
22970
+ ],
22971
+ family: "kimi-code",
22972
+ version: "2.7",
22973
+ status: "stable",
22974
+ active: true
22975
+ }
22976
+ };
22977
+
22978
+ // src/llm/providers/xai/catalog.json
22979
+ var catalog_default5 = {
22980
+ "xai/grok-4.20": {
22981
+ providerModelName: "grok-4.20-0309-reasoning",
22982
+ aliases: [
22983
+ "grok-4.20-0309-reasoning"
22984
+ ],
22985
+ pricing: {
22986
+ inputPerMTok: 1.25,
22987
+ outputPerMTok: 2.5,
22988
+ cacheReadPerMTok: 0.2,
22989
+ tiers: {
22990
+ "long-context": {
22991
+ inputPerMTok: 2.5,
22992
+ outputPerMTok: 5,
22993
+ cacheReadPerMTok: 0.4
22994
+ }
22995
+ }
22996
+ },
22997
+ preferredApi: "responses",
22998
+ supportedApis: [
22999
+ "responses",
23000
+ "completions"
23001
+ ],
23002
+ contextWindow: 2e6,
23003
+ maxOutput: 2e6,
23004
+ capabilities: {
23005
+ toolUse: true,
23006
+ streaming: true,
23007
+ structuredOutput: true,
23008
+ vision: true,
23009
+ audio: false,
23010
+ video: false,
23011
+ imageGeneration: false,
23012
+ audioGeneration: false,
23013
+ videoGeneration: false
23014
+ },
23015
+ reasoning: {
23016
+ supported: false,
23017
+ automatic: false,
23018
+ effortControl: false,
23019
+ encryptedContent: false,
23020
+ summaryAvailable: false
23021
+ },
23022
+ type: "chat",
23023
+ inputModalities: [
23024
+ "text",
23025
+ "image"
23026
+ ],
23027
+ outputModalities: [
23028
+ "text"
23029
+ ],
23030
+ family: "grok",
23031
+ version: "4.20",
23032
+ status: "stable",
23033
+ active: true
23034
+ },
23035
+ "xai/grok-4.20-non-reasoning": {
23036
+ providerModelName: "grok-4.20-0309-non-reasoning",
23037
+ aliases: [
23038
+ "grok-4.20-0309-non-reasoning"
23039
+ ],
23040
+ pricing: {
23041
+ inputPerMTok: 1.25,
23042
+ outputPerMTok: 2.5,
23043
+ cacheReadPerMTok: 0.2,
23044
+ tiers: {
23045
+ "long-context": {
23046
+ inputPerMTok: 2.5,
23047
+ outputPerMTok: 5,
23048
+ cacheReadPerMTok: 0.4
23049
+ }
23050
+ }
23051
+ },
23052
+ preferredApi: "responses",
23053
+ supportedApis: [
23054
+ "responses",
23055
+ "completions"
23056
+ ],
23057
+ capabilities: {
23058
+ toolUse: true,
23059
+ streaming: true,
23060
+ structuredOutput: true,
23061
+ vision: true,
23062
+ audio: false,
23063
+ video: false,
23064
+ imageGeneration: false,
23065
+ audioGeneration: false,
23066
+ videoGeneration: false
23067
+ },
23068
+ reasoning: {
23069
+ supported: false,
23070
+ automatic: false,
23071
+ effortControl: false,
23072
+ encryptedContent: false,
23073
+ summaryAvailable: false
23074
+ },
23075
+ type: "chat",
23076
+ inputModalities: [
23077
+ "text",
23078
+ "image"
23079
+ ],
23080
+ outputModalities: [
23081
+ "text"
23082
+ ],
23083
+ family: "grok",
23084
+ version: "4.20",
23085
+ status: "stable",
23086
+ active: true,
23087
+ contextWindow: 2e6
23088
+ },
23089
+ "xai/grok-4.20-multi-agent": {
23090
+ providerModelName: "grok-4.20-multi-agent-0309",
23091
+ aliases: [
23092
+ "grok-4.20-multi-agent-0309"
23093
+ ],
23094
+ pricing: {
23095
+ inputPerMTok: 1.25,
23096
+ outputPerMTok: 2.5,
23097
+ cacheReadPerMTok: 0.2,
23098
+ tiers: {
23099
+ "long-context": {
23100
+ inputPerMTok: 2.5,
23101
+ outputPerMTok: 5,
23102
+ cacheReadPerMTok: 0.4
23103
+ }
23104
+ }
23105
+ },
23106
+ preferredApi: "responses",
23107
+ supportedApis: [
23108
+ "responses"
23109
+ ],
23110
+ contextWindow: 2e6,
23111
+ capabilities: {
23112
+ toolUse: true,
23113
+ streaming: true,
23114
+ structuredOutput: true,
23115
+ vision: true,
23116
+ audio: false,
23117
+ video: false,
23118
+ imageGeneration: false,
23119
+ audioGeneration: false,
23120
+ videoGeneration: false
23121
+ },
23122
+ reasoning: {
23123
+ supported: false,
23124
+ automatic: false,
23125
+ effortControl: false,
23126
+ encryptedContent: false,
23127
+ summaryAvailable: false
23128
+ },
23129
+ type: "chat",
23130
+ inputModalities: [
23131
+ "text",
23132
+ "image"
23133
+ ],
23134
+ outputModalities: [
23135
+ "text"
23136
+ ],
23137
+ family: "grok",
23138
+ version: "4.20",
23139
+ status: "stable",
23140
+ active: true
23141
+ },
23142
+ "xai/grok-4.3": {
23143
+ providerModelName: "grok-4.3",
23144
+ aliases: [
23145
+ "grok-4.3"
23146
+ ],
23147
+ pricing: {
23148
+ inputPerMTok: 1.25,
23149
+ outputPerMTok: 2.5,
23150
+ cacheReadPerMTok: 0.2,
23151
+ tiers: {
23152
+ "long-context": {
23153
+ inputPerMTok: 2.5,
23154
+ outputPerMTok: 5,
23155
+ cacheReadPerMTok: 0.4
23156
+ }
23157
+ }
23158
+ },
23159
+ preferredApi: "responses",
23160
+ supportedApis: [
23161
+ "responses",
23162
+ "completions"
23163
+ ],
23164
+ contextWindow: 1e6,
23165
+ maxOutput: 1e6,
23166
+ capabilities: {
23167
+ toolUse: true,
23168
+ streaming: true,
23169
+ structuredOutput: true,
23170
+ vision: true,
23171
+ audio: false,
23172
+ video: false,
23173
+ imageGeneration: false,
23174
+ audioGeneration: false,
23175
+ videoGeneration: false
23176
+ },
23177
+ reasoning: {
23178
+ supported: false,
23179
+ automatic: false,
23180
+ effortControl: false,
23181
+ encryptedContent: false,
23182
+ summaryAvailable: false
23183
+ },
23184
+ type: "chat",
23185
+ inputModalities: [
23186
+ "text",
23187
+ "image"
23188
+ ],
23189
+ outputModalities: [
23190
+ "text"
23191
+ ],
23192
+ family: "grok",
23193
+ version: "4.3",
23194
+ status: "stable",
23195
+ active: true
23196
+ },
23197
+ "xai/grok-build-0.1": {
23198
+ providerModelName: "grok-build-0.1",
23199
+ aliases: [
23200
+ "grok-build-0.1"
23201
+ ],
23202
+ pricing: {
23203
+ inputPerMTok: 1,
23204
+ outputPerMTok: 2,
23205
+ cacheReadPerMTok: 0.2,
23206
+ tiers: {
23207
+ "long-context": {
23208
+ inputPerMTok: 2,
23209
+ outputPerMTok: 4,
23210
+ cacheReadPerMTok: 0.4
23211
+ }
23212
+ }
23213
+ },
23214
+ preferredApi: "responses",
23215
+ supportedApis: [
23216
+ "responses",
23217
+ "completions"
23218
+ ],
23219
+ contextWindow: 256e3,
23220
+ capabilities: {
23221
+ toolUse: true,
23222
+ streaming: true,
23223
+ structuredOutput: true,
23224
+ vision: true,
23225
+ audio: false,
23226
+ video: false,
23227
+ imageGeneration: false,
23228
+ audioGeneration: false,
23229
+ videoGeneration: false
23230
+ },
23231
+ reasoning: {
23232
+ supported: false,
23233
+ automatic: false,
23234
+ effortControl: false,
23235
+ encryptedContent: false,
23236
+ summaryAvailable: false
23237
+ },
23238
+ type: "code",
23239
+ inputModalities: [
23240
+ "text",
23241
+ "image"
23242
+ ],
23243
+ outputModalities: [
23244
+ "text"
23245
+ ],
23246
+ family: "grok",
23247
+ version: "0.1",
23248
+ status: "preview",
23249
+ active: true
23250
+ },
23251
+ "xai/grok-imagine-image": {
23252
+ providerModelName: "grok-imagine-image",
23253
+ aliases: [
23254
+ "grok-imagine-image"
23255
+ ],
23256
+ pricing: {
23257
+ perUnit: {
23258
+ "1k": 0.02,
23259
+ "2k": 0.02
23260
+ },
23261
+ perImage: 0.02
23262
+ },
23263
+ preferredApi: "responses",
23264
+ supportedApis: [
23265
+ "responses",
23266
+ "completions"
23267
+ ],
23268
+ capabilities: {
23269
+ toolUse: false,
23270
+ streaming: true,
23271
+ structuredOutput: false,
23272
+ vision: true,
23273
+ audio: false,
23274
+ video: false,
23275
+ imageGeneration: true,
23276
+ audioGeneration: false,
23277
+ videoGeneration: false
23278
+ },
23279
+ reasoning: {
23280
+ supported: false,
23281
+ automatic: false,
23282
+ effortControl: false,
23283
+ encryptedContent: false,
23284
+ summaryAvailable: false
23285
+ },
23286
+ type: "image",
23287
+ inputModalities: [
23288
+ "text",
23289
+ "image"
23290
+ ],
23291
+ outputModalities: [
23292
+ "image"
23293
+ ],
23294
+ family: "grok-imagine-image",
23295
+ version: "1",
23296
+ status: "stable",
23297
+ active: true,
23298
+ mediaParams: {
23299
+ aspectRatio: {
23300
+ values: [
23301
+ "1:1",
23302
+ "3:4",
23303
+ "4:3",
23304
+ "9:16",
23305
+ "16:9",
23306
+ "2:3",
23307
+ "3:2",
23308
+ "9:19.5",
23309
+ "19.5:9",
23310
+ "9:20",
23311
+ "20:9",
23312
+ "1:2",
23313
+ "2:1",
23314
+ "auto"
23315
+ ]
23316
+ },
23317
+ resolution: {
23318
+ values: [
23319
+ "1k",
23320
+ "2k"
23321
+ ]
23322
+ }
23323
+ }
23324
+ },
23325
+ "xai/grok-imagine-image-quality": {
23326
+ providerModelName: "grok-imagine-image-quality",
23327
+ aliases: [
23328
+ "grok-imagine-image-quality"
23329
+ ],
23330
+ pricing: {
23331
+ perUnit: {
23332
+ "1k": 0.05,
23333
+ "2k": 0.07
23334
+ },
23335
+ perImage: 0.05
23336
+ },
23337
+ preferredApi: "responses",
23338
+ supportedApis: [
23339
+ "responses",
23340
+ "completions"
23341
+ ],
23342
+ capabilities: {
23343
+ toolUse: false,
23344
+ streaming: true,
23345
+ structuredOutput: false,
23346
+ vision: true,
23347
+ audio: false,
23348
+ video: false,
23349
+ imageGeneration: true,
23350
+ audioGeneration: false,
23351
+ videoGeneration: false
23352
+ },
23353
+ reasoning: {
23354
+ supported: false,
23355
+ automatic: false,
23356
+ effortControl: false,
23357
+ encryptedContent: false,
23358
+ summaryAvailable: false
23359
+ },
23360
+ type: "image",
23361
+ inputModalities: [
23362
+ "text",
23363
+ "image"
23364
+ ],
23365
+ outputModalities: [
23366
+ "image"
23367
+ ],
23368
+ family: "grok-imagine-image",
23369
+ version: "1",
23370
+ status: "stable",
23371
+ active: true,
23372
+ mediaParams: {
23373
+ aspectRatio: {
23374
+ values: [
23375
+ "1:1",
23376
+ "3:4",
23377
+ "4:3",
23378
+ "9:16",
23379
+ "16:9",
23380
+ "2:3",
23381
+ "3:2",
23382
+ "9:19.5",
23383
+ "19.5:9",
23384
+ "9:20",
23385
+ "20:9",
23386
+ "1:2",
23387
+ "2:1",
23388
+ "auto"
23389
+ ]
23390
+ },
23391
+ resolution: {
23392
+ values: [
23393
+ "1k",
23394
+ "2k"
23395
+ ]
23396
+ }
23397
+ }
23398
+ },
23399
+ "xai/grok-imagine-video": {
23400
+ providerModelName: "grok-imagine-video",
23401
+ aliases: [
23402
+ "grok-imagine-video"
23403
+ ],
23404
+ pricing: {
23405
+ perSecond: 0.01,
23406
+ perUnit: {
23407
+ "480p": 0.05,
23408
+ "720p": 0.07
23409
+ },
23410
+ perImage: 2e-3
23411
+ },
23412
+ preferredApi: "responses",
23413
+ supportedApis: [
23414
+ "responses",
23415
+ "completions"
23416
+ ],
23417
+ capabilities: {
23418
+ toolUse: false,
23419
+ streaming: true,
23420
+ structuredOutput: false,
23421
+ vision: true,
23422
+ audio: false,
23423
+ video: false,
23424
+ imageGeneration: false,
23425
+ audioGeneration: false,
23426
+ videoGeneration: true
23427
+ },
23428
+ reasoning: {
23429
+ supported: false,
23430
+ automatic: false,
23431
+ effortControl: false,
23432
+ encryptedContent: false,
23433
+ summaryAvailable: false
23434
+ },
23435
+ type: "video",
23436
+ inputModalities: [
23437
+ "text",
23438
+ "image"
23439
+ ],
23440
+ outputModalities: [
23441
+ "video"
23442
+ ],
23443
+ family: "grok-imagine-video",
23444
+ version: "1",
23445
+ status: "stable",
23446
+ active: true,
23447
+ mediaParams: {
23448
+ duration: {
23449
+ min: 1,
23450
+ max: 15,
23451
+ default: 8
23452
+ },
23453
+ aspectRatio: {
23454
+ values: [
23455
+ "1:1",
23456
+ "16:9",
23457
+ "9:16",
23458
+ "4:3",
23459
+ "3:4",
23460
+ "3:2",
23461
+ "2:3"
23462
+ ]
23463
+ },
23464
+ resolution: {
23465
+ values: [
23466
+ "480p",
23467
+ "720p",
23468
+ "1080p"
23469
+ ]
23470
+ }
23471
+ }
23472
+ },
23473
+ "xai/grok-imagine-video-1.5": {
23474
+ providerModelName: "grok-imagine-video-1.5-preview",
23475
+ aliases: [
23476
+ "grok-imagine-video-1.5-preview",
23477
+ "grok-imagine-video-1.5"
23478
+ ],
23479
+ pricing: {
23480
+ perSecond: 0.01,
23481
+ perUnit: {
23482
+ "480p": 0.08,
23483
+ "720p": 0.14,
23484
+ "1080p": 0.25
23485
+ },
23486
+ perImage: 0.01
23487
+ },
23488
+ preferredApi: "responses",
23489
+ supportedApis: [
23490
+ "responses",
23491
+ "completions"
23492
+ ],
23493
+ capabilities: {
23494
+ toolUse: false,
23495
+ streaming: true,
23496
+ structuredOutput: false,
23497
+ vision: true,
23498
+ audio: false,
23499
+ video: false,
23500
+ imageGeneration: false,
23501
+ audioGeneration: false,
23502
+ videoGeneration: true
23503
+ },
23504
+ reasoning: {
23505
+ supported: false,
23506
+ automatic: false,
23507
+ effortControl: false,
23508
+ encryptedContent: false,
23509
+ summaryAvailable: false
23510
+ },
23511
+ type: "video",
23512
+ inputModalities: [
23513
+ "text",
23514
+ "image"
23515
+ ],
23516
+ outputModalities: [
23517
+ "video"
23518
+ ],
23519
+ family: "grok-imagine-video",
23520
+ version: "1.5",
23521
+ status: "preview",
23522
+ active: true,
23523
+ mediaParams: {
23524
+ duration: {
23525
+ min: 1,
23526
+ max: 15,
23527
+ default: 8
23528
+ },
23529
+ aspectRatio: {
23530
+ values: [
23531
+ "1:1",
23532
+ "16:9",
23533
+ "9:16",
23534
+ "4:3",
23535
+ "3:4",
23536
+ "3:2",
23537
+ "2:3"
23538
+ ]
23539
+ },
23540
+ resolution: {
23541
+ values: [
23542
+ "480p",
23543
+ "720p",
23544
+ "1080p"
23545
+ ]
23546
+ }
23547
+ }
23548
+ },
23549
+ "xai/grok-4.5": {
23550
+ providerModelName: "grok-4.5",
23551
+ aliases: [
23552
+ "grok-4.5"
23553
+ ],
23554
+ pricing: {
23555
+ inputPerMTok: 2,
23556
+ outputPerMTok: 6,
23557
+ cacheReadPerMTok: 0.5,
23558
+ tiers: {
23559
+ "long-context": {
23560
+ inputPerMTok: 4,
23561
+ outputPerMTok: 12,
23562
+ cacheReadPerMTok: 1
23563
+ }
23564
+ }
23565
+ },
23566
+ preferredApi: "responses",
23567
+ supportedApis: [
23568
+ "responses",
23569
+ "completions"
23570
+ ],
23571
+ contextWindow: 5e5,
23572
+ maxOutput: 5e5,
21653
23573
  capabilities: {
21654
23574
  toolUse: true,
21655
23575
  streaming: true,
@@ -21677,366 +23597,17 @@ var catalog_default5 = {
21677
23597
  "text"
21678
23598
  ],
21679
23599
  family: "grok",
21680
- version: "4.3",
23600
+ version: "4.5",
21681
23601
  status: "stable",
21682
23602
  active: true
21683
- },
21684
- "xai/grok-build-0.1": {
21685
- providerModelName: "grok-build-0.1",
21686
- aliases: [
21687
- "grok-build-0.1"
21688
- ],
21689
- pricing: {
21690
- inputPerMTok: 1,
21691
- outputPerMTok: 2,
21692
- cacheReadPerMTok: 0.2,
21693
- tiers: {
21694
- "long-context": {
21695
- inputPerMTok: 2,
21696
- outputPerMTok: 4,
21697
- cacheReadPerMTok: 0.4
21698
- }
21699
- }
21700
- },
21701
- preferredApi: "responses",
21702
- supportedApis: [
21703
- "responses",
21704
- "completions"
21705
- ],
21706
- contextWindow: 256e3,
21707
- capabilities: {
21708
- toolUse: true,
21709
- streaming: true,
21710
- structuredOutput: true,
21711
- vision: true,
21712
- audio: false,
21713
- video: false,
21714
- imageGeneration: false,
21715
- audioGeneration: false,
21716
- videoGeneration: false
21717
- },
21718
- reasoning: {
21719
- supported: false,
21720
- automatic: false,
21721
- effortControl: false,
21722
- encryptedContent: false,
21723
- summaryAvailable: false
21724
- },
21725
- type: "code",
21726
- inputModalities: [
21727
- "text",
21728
- "image"
21729
- ],
21730
- outputModalities: [
21731
- "text"
21732
- ],
21733
- family: "grok",
21734
- version: "0.1",
21735
- status: "preview",
21736
- active: true
21737
- },
21738
- "xai/grok-imagine-image": {
21739
- providerModelName: "grok-imagine-image",
21740
- aliases: [
21741
- "grok-imagine-image"
21742
- ],
21743
- pricing: {
21744
- perUnit: {
21745
- "1k": 2e-3,
21746
- "2k": 0.02
21747
- },
21748
- perImage: 0.02
21749
- },
21750
- preferredApi: "responses",
21751
- supportedApis: [
21752
- "responses",
21753
- "completions"
21754
- ],
21755
- capabilities: {
21756
- toolUse: false,
21757
- streaming: true,
21758
- structuredOutput: false,
21759
- vision: true,
21760
- audio: false,
21761
- video: false,
21762
- imageGeneration: true,
21763
- audioGeneration: false,
21764
- videoGeneration: false
21765
- },
21766
- reasoning: {
21767
- supported: false,
21768
- automatic: false,
21769
- effortControl: false,
21770
- encryptedContent: false,
21771
- summaryAvailable: false
21772
- },
21773
- type: "image",
21774
- inputModalities: [
21775
- "text",
21776
- "image"
21777
- ],
21778
- outputModalities: [
21779
- "image"
21780
- ],
21781
- family: "grok-imagine-image",
21782
- version: "1",
21783
- status: "stable",
21784
- active: true,
21785
- mediaParams: {
21786
- aspectRatio: {
21787
- values: [
21788
- "1:1",
21789
- "3:4",
21790
- "4:3",
21791
- "9:16",
21792
- "16:9",
21793
- "2:3",
21794
- "3:2",
21795
- "9:19.5",
21796
- "19.5:9",
21797
- "9:20",
21798
- "20:9",
21799
- "1:2",
21800
- "2:1",
21801
- "auto"
21802
- ]
21803
- },
21804
- resolution: {
21805
- values: [
21806
- "1k",
21807
- "2k"
21808
- ]
21809
- }
21810
- }
21811
- },
21812
- "xai/grok-imagine-image-quality": {
21813
- providerModelName: "grok-imagine-image-quality",
21814
- aliases: [
21815
- "grok-imagine-image-quality"
21816
- ],
21817
- pricing: {
21818
- perUnit: {
21819
- "1k": 0.01,
21820
- "2k": 0.05
21821
- },
21822
- perImage: 0.04
21823
- },
21824
- preferredApi: "responses",
21825
- supportedApis: [
21826
- "responses",
21827
- "completions"
21828
- ],
21829
- capabilities: {
21830
- toolUse: false,
21831
- streaming: true,
21832
- structuredOutput: false,
21833
- vision: true,
21834
- audio: false,
21835
- video: false,
21836
- imageGeneration: true,
21837
- audioGeneration: false,
21838
- videoGeneration: false
21839
- },
21840
- reasoning: {
21841
- supported: false,
21842
- automatic: false,
21843
- effortControl: false,
21844
- encryptedContent: false,
21845
- summaryAvailable: false
21846
- },
21847
- type: "image",
21848
- inputModalities: [
21849
- "text",
21850
- "image"
21851
- ],
21852
- outputModalities: [
21853
- "image"
21854
- ],
21855
- family: "grok-imagine-image",
21856
- version: "1",
21857
- status: "stable",
21858
- active: true,
21859
- mediaParams: {
21860
- aspectRatio: {
21861
- values: [
21862
- "1:1",
21863
- "3:4",
21864
- "4:3",
21865
- "9:16",
21866
- "16:9",
21867
- "2:3",
21868
- "3:2",
21869
- "9:19.5",
21870
- "19.5:9",
21871
- "9:20",
21872
- "20:9",
21873
- "1:2",
21874
- "2:1",
21875
- "auto"
21876
- ]
21877
- },
21878
- resolution: {
21879
- values: [
21880
- "1k",
21881
- "2k"
21882
- ]
21883
- }
21884
- }
21885
- },
21886
- "xai/grok-imagine-video": {
21887
- providerModelName: "grok-imagine-video",
21888
- aliases: [
21889
- "grok-imagine-video"
21890
- ],
21891
- pricing: {
21892
- perSecond: 0.01,
21893
- perUnit: {
21894
- "480p": 2e-3,
21895
- "720p": 0.05,
21896
- "1080p": 0.07
21897
- }
21898
- },
21899
- preferredApi: "responses",
21900
- supportedApis: [
21901
- "responses",
21902
- "completions"
21903
- ],
21904
- capabilities: {
21905
- toolUse: false,
21906
- streaming: true,
21907
- structuredOutput: false,
21908
- vision: true,
21909
- audio: false,
21910
- video: false,
21911
- imageGeneration: false,
21912
- audioGeneration: false,
21913
- videoGeneration: true
21914
- },
21915
- reasoning: {
21916
- supported: false,
21917
- automatic: false,
21918
- effortControl: false,
21919
- encryptedContent: false,
21920
- summaryAvailable: false
21921
- },
21922
- type: "video",
21923
- inputModalities: [
21924
- "text",
21925
- "image"
21926
- ],
21927
- outputModalities: [
21928
- "video"
21929
- ],
21930
- family: "grok-imagine-video",
21931
- version: "1",
21932
- status: "stable",
21933
- active: true,
21934
- mediaParams: {
21935
- duration: {
21936
- min: 1,
21937
- max: 15,
21938
- default: 8
21939
- },
21940
- aspectRatio: {
21941
- values: [
21942
- "1:1",
21943
- "16:9",
21944
- "9:16",
21945
- "4:3",
21946
- "3:4",
21947
- "3:2",
21948
- "2:3"
21949
- ]
21950
- },
21951
- resolution: {
21952
- values: [
21953
- "480p",
21954
- "720p",
21955
- "1080p"
21956
- ]
21957
- }
21958
- }
21959
- },
21960
- "xai/grok-imagine-video-1.5": {
21961
- providerModelName: "grok-imagine-video-1.5-preview",
21962
- aliases: [
21963
- "grok-imagine-video-1.5-preview"
21964
- ],
21965
- pricing: {
21966
- perSecond: 0.01,
21967
- perUnit: {
21968
- "480p": 0.08,
21969
- "720p": 0.14
21970
- }
21971
- },
21972
- preferredApi: "responses",
21973
- supportedApis: [
21974
- "responses",
21975
- "completions"
21976
- ],
21977
- capabilities: {
21978
- toolUse: false,
21979
- streaming: true,
21980
- structuredOutput: false,
21981
- vision: true,
21982
- audio: false,
21983
- video: false,
21984
- imageGeneration: false,
21985
- audioGeneration: false,
21986
- videoGeneration: true
21987
- },
21988
- reasoning: {
21989
- supported: false,
21990
- automatic: false,
21991
- effortControl: false,
21992
- encryptedContent: false,
21993
- summaryAvailable: false
21994
- },
21995
- type: "video",
21996
- inputModalities: [
21997
- "text",
21998
- "image"
21999
- ],
22000
- outputModalities: [
22001
- "video"
22002
- ],
22003
- family: "grok-imagine-video",
22004
- version: "1.5",
22005
- status: "preview",
22006
- active: true,
22007
- mediaParams: {
22008
- duration: {
22009
- min: 1,
22010
- max: 15,
22011
- default: 8
22012
- },
22013
- aspectRatio: {
22014
- values: [
22015
- "1:1",
22016
- "16:9",
22017
- "9:16",
22018
- "4:3",
22019
- "3:4",
22020
- "3:2",
22021
- "2:3"
22022
- ]
22023
- },
22024
- resolution: {
22025
- values: [
22026
- "480p",
22027
- "720p",
22028
- "1080p"
22029
- ]
22030
- }
22031
- }
22032
23603
  }
22033
23604
  };
22034
23605
 
22035
23606
  // src/llm/providers/builtin-tools.ts
22036
23607
  var PROVIDER_BUILTIN_TOOLS = {
22037
- anthropic: ["web_search", "code_interpreter"],
23608
+ anthropic: ["web_search", "web_fetch", "code_interpreter"],
22038
23609
  openai: ["web_search", "code_interpreter"],
22039
- google: ["web_search", "code_interpreter"],
23610
+ google: ["web_search", "web_fetch", "code_interpreter"],
22040
23611
  xai: ["web_search", "code_interpreter"],
22041
23612
  openrouter: ["web_search"]
22042
23613
  };
@@ -22398,7 +23969,11 @@ function contentRequest(ctx, file) {
22398
23969
  "x-api-key": ctx.apiKey,
22399
23970
  "anthropic-version": "2023-06-01",
22400
23971
  "anthropic-beta": "files-api-2025-04-14",
22401
- accept: "application/binary"
23972
+ accept: "application/binary",
23973
+ // Enable CORS for direct browser requests (same header the completion
23974
+ // adapter sets); harmless on Node/Bun. Without it the browser blocks the
23975
+ // file download by CORS.
23976
+ ...isBrowser() ? { "anthropic-dangerous-direct-browser-access": "true" } : {}
22402
23977
  }
22403
23978
  };
22404
23979
  }
@@ -22419,7 +23994,11 @@ function providerAuth(ctx, url) {
22419
23994
  const base = ctx.baseURL ?? DEFAULT_BASE[ctx.provider];
22420
23995
  if (!url.startsWith(base)) return {};
22421
23996
  if (ctx.provider === "anthropic") {
22422
- return { "x-api-key": ctx.apiKey, "anthropic-version": "2023-06-01" };
23997
+ return {
23998
+ "x-api-key": ctx.apiKey,
23999
+ "anthropic-version": "2023-06-01",
24000
+ ...isBrowser() ? { "anthropic-dangerous-direct-browser-access": "true" } : {}
24001
+ };
22423
24002
  }
22424
24003
  if (ctx.provider === "google") return { "x-goog-api-key": ctx.apiKey };
22425
24004
  return { authorization: `Bearer ${ctx.apiKey}` };
@@ -22583,6 +24162,20 @@ function resolveServerState(args) {
22583
24162
  // src/llm/client-internal.ts
22584
24163
  var PRIORITY_INTERACTIVE = 1;
22585
24164
  var PRIORITY_BACKGROUND = 2;
24165
+ function buildAssistantMessage(response, origin) {
24166
+ const stateful = origin.api === "responses" || origin.api === "interactions";
24167
+ return {
24168
+ role: "assistant",
24169
+ content: response.content,
24170
+ id: response.id || crypto.randomUUID(),
24171
+ createdAt: Date.now(),
24172
+ origin: {
24173
+ provider: origin.provider,
24174
+ model: origin.model,
24175
+ ...stateful && response.id ? { serverStateId: response.id } : {}
24176
+ }
24177
+ };
24178
+ }
22586
24179
  function normalizeInput(input) {
22587
24180
  if (typeof input === "string") {
22588
24181
  return [{ role: "user", content: input }];
@@ -22613,7 +24206,11 @@ function contentToText(content) {
22613
24206
  }
22614
24207
  function parseStructured(text) {
22615
24208
  const stripped = text.trim().replace(/^```(?:json)?\s*/i, "").replace(/```\s*$/i, "").trim();
22616
- return JSON.parse(stripped);
24209
+ try {
24210
+ return JSON.parse(stripped);
24211
+ } catch (cause) {
24212
+ throw new InvalidFinalOutputError(text, { cause });
24213
+ }
22617
24214
  }
22618
24215
  function buildContext(client, options) {
22619
24216
  const provided = options.ctx ?? {};
@@ -22734,18 +24331,11 @@ var LLMClient = class {
22734
24331
  * const r2 = await llm.complete(messages); // sends id + only the new turn
22735
24332
  */
22736
24333
  assistantMessage(response) {
22737
- const stateful = this.api === "responses" || this.api === "interactions";
22738
- return {
22739
- role: "assistant",
22740
- content: response.content,
22741
- id: response.id || crypto.randomUUID(),
22742
- createdAt: Date.now(),
22743
- origin: {
22744
- provider: this.provider,
22745
- model: this.model,
22746
- ...stateful && response.id ? { serverStateId: response.id } : {}
22747
- }
22748
- };
24334
+ return buildAssistantMessage(response, {
24335
+ provider: this.provider,
24336
+ model: this.model,
24337
+ api: this.api
24338
+ });
22749
24339
  }
22750
24340
  // ─── Moderation helpers ───────────────────────────────────────────────
22751
24341
  /** Resolve the OpenAI key the emulated moderation path needs. Reuses the
@@ -22810,6 +24400,8 @@ var LLMClient = class {
22810
24400
  maxTokens: options.maxTokens,
22811
24401
  temperature: options.temperature,
22812
24402
  topP: options.topP,
24403
+ presencePenalty: options.presencePenalty,
24404
+ frequencyPenalty: options.frequencyPenalty,
22813
24405
  stop: options.stop,
22814
24406
  tools: options.tools,
22815
24407
  toolChoice: options.toolChoice,
@@ -22936,11 +24528,24 @@ var LLMClient = class {
22936
24528
  * leading/trailing markdown fences from the model reply, then JSON.parses
22937
24529
  * to T. Throws if the parse fails — callers should catch + retry. */
22938
24530
  async structuredComplete(input, schema, options = {}) {
22939
- const res = await this.complete(input, {
22940
- ...options,
22941
- structured: { ...options.structured ?? {}, schema }
22942
- });
22943
- return parseStructured(res.text);
24531
+ const structured = { ...options.structured ?? {}, schema };
24532
+ const repairAttempts = Math.max(0, structured.repairAttempts ?? 0);
24533
+ const messages = normalizeInput(input);
24534
+ for (let attempt = 0; ; attempt++) {
24535
+ const res = await this.complete(messages, { ...options, structured });
24536
+ try {
24537
+ return parseStructured(res.text);
24538
+ } catch (err) {
24539
+ if (!(err instanceof InvalidFinalOutputError) || attempt >= repairAttempts) throw err;
24540
+ messages.push(
24541
+ { role: "assistant", content: res.text },
24542
+ {
24543
+ role: "user",
24544
+ content: `Your previous reply was not valid JSON for the required schema (${err.message}). Reply with ONLY the JSON object matching the schema \u2014 no prose, no code fences.`
24545
+ }
24546
+ );
24547
+ }
24548
+ }
22944
24549
  }
22945
24550
  async *stream(input, options = {}) {
22946
24551
  if (!this.fetchStreamFn) {
@@ -22957,6 +24562,8 @@ var LLMClient = class {
22957
24562
  maxTokens: options.maxTokens,
22958
24563
  temperature: options.temperature,
22959
24564
  topP: options.topP,
24565
+ presencePenalty: options.presencePenalty,
24566
+ frequencyPenalty: options.frequencyPenalty,
22960
24567
  stop: options.stop,
22961
24568
  tools: options.tools,
22962
24569
  toolChoice: options.toolChoice,
@@ -23061,8 +24668,15 @@ var LLMClient = class {
23061
24668
  case "file":
23062
24669
  files.push(event.file);
23063
24670
  break;
23064
- case "builtin_tool_start":
23065
- builtinToolCalls.push({ tool: event.tool, ...event.id ? { id: event.id } : {} });
24671
+ case "builtin_tool_end":
24672
+ builtinToolCalls.push({
24673
+ tool: event.tool,
24674
+ ...event.id ? { id: event.id } : {},
24675
+ ...event.code ? { code: event.code } : {},
24676
+ ...event.output ? { output: event.output } : {},
24677
+ ...event.query ? { query: event.query } : {},
24678
+ ...event.url ? { url: event.url } : {}
24679
+ });
23066
24680
  break;
23067
24681
  case "moderation":
23068
24682
  moderationReport = this.mergeModeration(
@@ -23328,10 +24942,12 @@ var NATIVE_TO_UNIFIED = {
23328
24942
  code_interpreter_call: "code_interpreter",
23329
24943
  // Anthropic server_tool_use names
23330
24944
  web_search: "web_search",
24945
+ web_fetch: "web_fetch",
23331
24946
  code_execution: "code_interpreter",
23332
24947
  bash_code_execution: "code_interpreter",
23333
24948
  // Anthropic *_tool_result block types
23334
24949
  web_search_tool_result: "web_search",
24950
+ web_fetch_tool_result: "web_fetch",
23335
24951
  code_execution_tool_result: "code_interpreter",
23336
24952
  bash_code_execution_tool_result: "code_interpreter"
23337
24953
  };
@@ -23382,6 +24998,24 @@ function filesFromCodeExecBlock(block) {
23382
24998
  }
23383
24999
  return files;
23384
25000
  }
25001
+ function builtinInputPayload(tool, input) {
25002
+ if (!input) return {};
25003
+ if (tool === "code_interpreter") {
25004
+ const code = input.code ?? input.command;
25005
+ return typeof code === "string" ? { code } : {};
25006
+ }
25007
+ if (tool === "web_search") {
25008
+ return typeof input.query === "string" ? { query: input.query } : {};
25009
+ }
25010
+ if (tool === "web_fetch") {
25011
+ return typeof input.url === "string" ? { url: input.url } : {};
25012
+ }
25013
+ return {};
25014
+ }
25015
+ function resultStdout(content) {
25016
+ const c = content;
25017
+ return c && typeof c.stdout === "string" ? c.stdout : void 0;
25018
+ }
23385
25019
  var AnthropicAdapter = class {
23386
25020
  name = "anthropic";
23387
25021
  apiKey;
@@ -23429,7 +25063,21 @@ var AnthropicAdapter = class {
23429
25063
  body.tools = req.tools.map((t, i) => {
23430
25064
  if (!isFunctionTool(t)) {
23431
25065
  if (t.type === "web_search") {
23432
- return { type: "web_search_20250305", name: "web_search", max_uses: 5 };
25066
+ return {
25067
+ type: "web_search_20260318",
25068
+ name: "web_search",
25069
+ max_uses: 5,
25070
+ allowed_callers: ["direct"],
25071
+ ...t.params
25072
+ };
25073
+ }
25074
+ if (t.type === "web_fetch") {
25075
+ return {
25076
+ type: "web_fetch_20260318",
25077
+ name: "web_fetch",
25078
+ allowed_callers: ["direct"],
25079
+ ...t.params
25080
+ };
23433
25081
  }
23434
25082
  if (t.type === "code_interpreter") {
23435
25083
  return { type: "code_execution_20260521", name: "code_execution" };
@@ -23477,6 +25125,10 @@ var AnthropicAdapter = class {
23477
25125
  });
23478
25126
  const headers = {};
23479
25127
  if (hasFileRef) headers["anthropic-beta"] = "files-api-2025-04-14";
25128
+ const userProfileId = req.providerOptions?.userProfileId;
25129
+ if (typeof userProfileId === "string" && userProfileId) {
25130
+ headers["anthropic-user-profile-id"] = userProfileId;
25131
+ }
23480
25132
  const usesCodeExec = req.tools?.some(
23481
25133
  (t) => !isFunctionTool(t) && t.type === "code_interpreter"
23482
25134
  );
@@ -23564,11 +25216,20 @@ var AnthropicAdapter = class {
23564
25216
  content.push(tc);
23565
25217
  toolCalls.push(tc);
23566
25218
  } else if (block.type === "server_tool_use") {
25219
+ const tool = unifiedBuiltinTool(block.name);
23567
25220
  builtinToolCalls.push({
23568
- tool: unifiedBuiltinTool(block.name),
23569
- ...typeof block.id === "string" ? { id: block.id } : {}
25221
+ tool,
25222
+ ...typeof block.id === "string" ? { id: block.id } : {},
25223
+ ...builtinInputPayload(tool, block.input)
23570
25224
  });
23571
25225
  } else {
25226
+ if (typeof block.type === "string" && block.type.endsWith("_tool_result")) {
25227
+ const output = resultStdout(block.content);
25228
+ if (output) {
25229
+ const call = builtinToolCalls.find((c) => c.id === block.tool_use_id);
25230
+ if (call) call.output = output;
25231
+ }
25232
+ }
23572
25233
  files.push(...filesFromCodeExecBlock(block));
23573
25234
  }
23574
25235
  }
@@ -23592,6 +25253,17 @@ var AnthropicAdapter = class {
23592
25253
  };
23593
25254
  }
23594
25255
  parseStreamEvent(event) {
25256
+ return this.streamEvents(event, { pending: /* @__PURE__ */ new Map() });
25257
+ }
25258
+ /** Stateful — Anthropic streams `server_tool_use` input via `input_json_delta`
25259
+ * (empty at block start) and returns the result in a separate `*_tool_result`
25260
+ * block. The closure accumulates each call's input (code / query) and attaches it
25261
+ * to the matching `builtin_tool_end`. */
25262
+ createStreamParser() {
25263
+ const state = { pending: /* @__PURE__ */ new Map() };
25264
+ return (event) => this.streamEvents(event, state);
25265
+ }
25266
+ streamEvents(event, state) {
23595
25267
  if (event.event === "ping") return [];
23596
25268
  const data = JSON.parse(event.data);
23597
25269
  const type = data.type;
@@ -23601,33 +25273,58 @@ var AnthropicAdapter = class {
23601
25273
  if (delta.type === "thinking_delta")
23602
25274
  return [{ type: "thinking", text: delta.thinking }];
23603
25275
  if (delta.type === "input_json_delta") {
25276
+ if (state.current) {
25277
+ state.current.json += delta.partial_json ?? "";
25278
+ return [];
25279
+ }
23604
25280
  return [{ type: "tool_call_delta", id: "", arguments: delta.partial_json }];
23605
25281
  }
23606
25282
  }
23607
25283
  if (type === "content_block_start") {
23608
25284
  const block = data.content_block;
23609
25285
  if (block.type === "tool_use") {
25286
+ state.current = void 0;
23610
25287
  return [{ type: "tool_call_start", id: block.id, name: block.name }];
23611
25288
  }
23612
25289
  const events = [];
23613
25290
  const blockType = block.type;
23614
25291
  if (blockType === "server_tool_use") {
25292
+ const tool = unifiedBuiltinTool(block.name);
25293
+ state.current = { id: block.id ?? "", tool, json: "" };
23615
25294
  events.push({
23616
25295
  type: "builtin_tool_start",
23617
- tool: unifiedBuiltinTool(block.name),
25296
+ tool,
23618
25297
  ...typeof block.id === "string" ? { id: block.id } : {}
23619
25298
  });
23620
25299
  } else if (blockType?.endsWith("_tool_result")) {
25300
+ const tool = unifiedBuiltinTool(blockType);
25301
+ const id = typeof block.tool_use_id === "string" ? block.tool_use_id : void 0;
25302
+ const input = id ? state.pending.get(id) : void 0;
25303
+ if (id) state.pending.delete(id);
25304
+ const output = resultStdout(block.content);
23621
25305
  events.push({
23622
25306
  type: "builtin_tool_end",
23623
- tool: unifiedBuiltinTool(blockType),
23624
- ...typeof block.tool_use_id === "string" ? { id: block.tool_use_id } : {}
25307
+ tool,
25308
+ ...id ? { id } : {},
25309
+ ...input?.code ? { code: input.code } : {},
25310
+ ...input?.query ? { query: input.query } : {},
25311
+ ...input?.url ? { url: input.url } : {},
25312
+ ...output ? { output } : {}
23625
25313
  });
23626
25314
  }
23627
25315
  for (const file of filesFromCodeExecBlock(block)) events.push({ type: "file", file });
23628
25316
  return events;
23629
25317
  }
23630
25318
  if (type === "content_block_stop") {
25319
+ if (state.current) {
25320
+ let input = {};
25321
+ try {
25322
+ input = JSON.parse(state.current.json || "{}");
25323
+ } catch {
25324
+ }
25325
+ state.pending.set(state.current.id, builtinInputPayload(state.current.tool, input));
25326
+ state.current = void 0;
25327
+ }
23631
25328
  }
23632
25329
  if (type === "message_delta") {
23633
25330
  const delta = data.delta;
@@ -23649,11 +25346,6 @@ var AnthropicAdapter = class {
23649
25346
  }
23650
25347
  return [];
23651
25348
  }
23652
- /** Stateless — every event is self-contained (code-execution result blocks
23653
- * arrive complete in a single content_block_start). */
23654
- createStreamParser() {
23655
- return (event) => this.parseStreamEvent(event);
23656
- }
23657
25349
  parseUsage(u) {
23658
25350
  if (!u) return emptyUsage();
23659
25351
  const inputTokens = u.input_tokens ?? 0;
@@ -23964,6 +25656,8 @@ var GoogleAdapter = class {
23964
25656
  if (req.maxTokens) config.maxOutputTokens = req.maxTokens;
23965
25657
  if (req.temperature !== void 0) config.temperature = req.temperature;
23966
25658
  if (req.topP !== void 0) config.topP = req.topP;
25659
+ if (req.presencePenalty !== void 0) config.presencePenalty = req.presencePenalty;
25660
+ if (req.frequencyPenalty !== void 0) config.frequencyPenalty = req.frequencyPenalty;
23967
25661
  if (req.stop) config.stopSequences = req.stop;
23968
25662
  if (req.outputModalities?.includes("audio")) {
23969
25663
  config.responseModalities = ["AUDIO"];
@@ -23999,6 +25693,9 @@ var GoogleAdapter = class {
23999
25693
  if (req.tools.some((t) => !isFunctionTool(t) && t.type === "code_interpreter")) {
24000
25694
  tools.push({ codeExecution: {} });
24001
25695
  }
25696
+ if (req.tools.some((t) => !isFunctionTool(t) && t.type === "web_fetch")) {
25697
+ tools.push({ urlContext: {} });
25698
+ }
24002
25699
  if (tools.length) body.tools = tools;
24003
25700
  }
24004
25701
  if (req.toolChoice) {
@@ -24162,8 +25859,32 @@ var GoogleAdapter = class {
24162
25859
  { MAX_TOKENS: "length", SAFETY: "content_filter" }
24163
25860
  );
24164
25861
  const builtinToolCalls = [];
24165
- if (hasCodeExec) builtinToolCalls.push({ tool: "code_interpreter" });
24166
- if (candidate.groundingMetadata) builtinToolCalls.push({ tool: "web_search" });
25862
+ const codes = parts.filter((p) => p.executableCode?.code).map((p) => p.executableCode.code);
25863
+ const outputs = parts.filter((p) => p.codeExecutionResult).map((p) => String(p.codeExecutionResult.output ?? ""));
25864
+ if (codes.length) {
25865
+ codes.forEach((code, i) => {
25866
+ builtinToolCalls.push({
25867
+ tool: "code_interpreter",
25868
+ code,
25869
+ ...outputs[i] ? { output: outputs[i] } : {}
25870
+ });
25871
+ });
25872
+ } else if (hasCodeExec) {
25873
+ builtinToolCalls.push({ tool: "code_interpreter", ...outputs[0] ? { output: outputs[0] } : {} });
25874
+ }
25875
+ const grounding = candidate.groundingMetadata;
25876
+ if (grounding) {
25877
+ const q = grounding.webSearchQueries?.[0];
25878
+ builtinToolCalls.push({ tool: "web_search", ...typeof q === "string" ? { query: q } : {} });
25879
+ }
25880
+ const urlCtx = candidate.urlContextMetadata;
25881
+ const urlMeta = urlCtx?.urlMetadata;
25882
+ if (Array.isArray(urlMeta)) {
25883
+ for (const m of urlMeta) {
25884
+ const url = m.retrievedUrl;
25885
+ builtinToolCalls.push({ tool: "web_fetch", ...typeof url === "string" ? { url } : {} });
25886
+ }
25887
+ }
24167
25888
  return {
24168
25889
  id: crypto.randomUUID(),
24169
25890
  // Google doesn't return a response ID in generateContent
@@ -24214,8 +25935,21 @@ var GoogleAdapter = class {
24214
25935
  if (part.text !== void 0 && !part.thought)
24215
25936
  events.push({ type: "text", text: part.text });
24216
25937
  if (part.thought && part.text) events.push({ type: "thinking", text: part.text });
24217
- if (part.executableCode) events.push({ type: "builtin_tool_start", tool: "code_interpreter" });
24218
- if (part.codeExecutionResult) events.push({ type: "builtin_tool_end", tool: "code_interpreter" });
25938
+ if (part.executableCode) {
25939
+ const code = part.executableCode.code;
25940
+ state.pendingCode = typeof code === "string" ? code : void 0;
25941
+ events.push({ type: "builtin_tool_start", tool: "code_interpreter" });
25942
+ }
25943
+ if (part.codeExecutionResult) {
25944
+ const output = part.codeExecutionResult.output;
25945
+ events.push({
25946
+ type: "builtin_tool_end",
25947
+ tool: "code_interpreter",
25948
+ ...state.pendingCode ? { code: state.pendingCode } : {},
25949
+ ...typeof output === "string" && output ? { output } : {}
25950
+ });
25951
+ state.pendingCode = void 0;
25952
+ }
24219
25953
  if (part.inlineData) {
24220
25954
  const inline = part.inlineData;
24221
25955
  const mime = inline.mimeType;
@@ -24248,8 +25982,26 @@ var GoogleAdapter = class {
24248
25982
  }
24249
25983
  if (candidate.groundingMetadata && !state.webSearchEmitted) {
24250
25984
  state.webSearchEmitted = true;
25985
+ const q = candidate.groundingMetadata.webSearchQueries?.[0];
24251
25986
  events.push({ type: "builtin_tool_start", tool: "web_search" });
24252
- events.push({ type: "builtin_tool_end", tool: "web_search" });
25987
+ events.push({
25988
+ type: "builtin_tool_end",
25989
+ tool: "web_search",
25990
+ ...typeof q === "string" ? { query: q } : {}
25991
+ });
25992
+ }
25993
+ const streamUrlMeta = candidate.urlContextMetadata?.urlMetadata;
25994
+ if (Array.isArray(streamUrlMeta) && !state.urlFetchEmitted) {
25995
+ state.urlFetchEmitted = true;
25996
+ for (const m of streamUrlMeta) {
25997
+ const url = m.retrievedUrl;
25998
+ events.push({ type: "builtin_tool_start", tool: "web_fetch" });
25999
+ events.push({
26000
+ type: "builtin_tool_end",
26001
+ tool: "web_fetch",
26002
+ ...typeof url === "string" ? { url } : {}
26003
+ });
26004
+ }
24253
26005
  }
24254
26006
  const fr = candidate.finishReason;
24255
26007
  if (fr)
@@ -24319,6 +26071,8 @@ var GoogleInteractionsAdapter = class {
24319
26071
  if (req.maxTokens) genConfig.max_output_tokens = req.maxTokens;
24320
26072
  if (req.temperature !== void 0) genConfig.temperature = req.temperature;
24321
26073
  if (req.topP !== void 0) genConfig.top_p = req.topP;
26074
+ if (req.presencePenalty !== void 0) genConfig.presence_penalty = req.presencePenalty;
26075
+ if (req.frequencyPenalty !== void 0) genConfig.frequency_penalty = req.frequencyPenalty;
24322
26076
  if (req.stop) genConfig.stop_sequences = req.stop;
24323
26077
  if (req.tools?.length) {
24324
26078
  body.tools = req.tools.filter(isFunctionTool).map((t) => ({
@@ -24334,6 +26088,8 @@ var GoogleInteractionsAdapter = class {
24334
26088
  };
24335
26089
  }
24336
26090
  if (Object.keys(genConfig).length > 0) body.generation_config = genConfig;
26091
+ const cachedContent = req.providerOptions?.cachedContent;
26092
+ if (typeof cachedContent === "string" && cachedContent) body.cached_content = cachedContent;
24337
26093
  if (req.structured) {
24338
26094
  body.response_format = {
24339
26095
  type: "text",
@@ -24491,47 +26247,77 @@ var GoogleInteractionsAdapter = class {
24491
26247
  raw
24492
26248
  };
24493
26249
  }
24494
- parseStreamEvent(event) {
26250
+ /** Translate one Interactions SSE event to unified events. The 2.10 wire is a
26251
+ * step machine (verified live): `step.start` opens a typed step (`model_output`,
26252
+ * `function_call`, `thought`…), `step.delta` streams its payload (`{type:'text'}`,
26253
+ * `{type:'arguments_delta'}`, `{type:'thought_summary'}`, internal
26254
+ * `thought_signature`), `step.stop` closes it, and `interaction.completed` /
26255
+ * `interaction.failed` finish the turn (usage under `interaction.usage`). A
26256
+ * function call's `arguments_delta` carries no id, so we correlate it to the
26257
+ * currently-open call id held in `state`. */
26258
+ streamEvents(event, state) {
24495
26259
  const data = JSON.parse(event.data);
24496
26260
  const type = data.event_type ?? data.type;
24497
26261
  const events = [];
24498
- if (type === "content.delta") {
24499
- const delta = data.delta;
24500
- if (delta?.type === "text") {
24501
- events.push({ type: "text", text: delta.text });
24502
- }
24503
- if (delta?.type === "function_call") {
24504
- events.push({
24505
- type: "tool_call_start",
24506
- id: delta.id ?? "",
24507
- name: delta.name ?? ""
24508
- });
24509
- if (delta.arguments) {
24510
- events.push({
24511
- type: "tool_call_delta",
24512
- id: delta.id ?? "",
24513
- arguments: JSON.stringify(delta.arguments)
24514
- });
26262
+ if (type === "step.start") {
26263
+ const step = data.step ?? {};
26264
+ if (step.type === "function_call") {
26265
+ const id = step.id ?? "";
26266
+ state.callId = id;
26267
+ state.sawToolCall = true;
26268
+ events.push({ type: "tool_call_start", id, name: step.name ?? "" });
26269
+ const args = step.arguments;
26270
+ if (args && Object.keys(args).length > 0) {
26271
+ events.push({ type: "tool_call_delta", id, arguments: JSON.stringify(args) });
24515
26272
  }
24516
- events.push({ type: "tool_call_end", id: delta.id ?? "" });
24517
26273
  }
26274
+ return events;
26275
+ }
26276
+ if (type === "step.delta") {
26277
+ const delta = data.delta ?? {};
26278
+ const dtype = delta.type;
26279
+ if (dtype === "text") {
26280
+ events.push({ type: "text", text: delta.text ?? "" });
26281
+ } else if (dtype === "thought_summary") {
26282
+ events.push({ type: "thinking", text: delta.text ?? "" });
26283
+ } else if (dtype === "arguments_delta") {
26284
+ events.push({ type: "tool_call_delta", id: state.callId ?? "", arguments: delta.arguments ?? "" });
26285
+ }
26286
+ return events;
24518
26287
  }
24519
- if (type === "interaction.complete") {
26288
+ if (type === "step.stop") {
26289
+ if (state.callId) {
26290
+ events.push({ type: "tool_call_end", id: state.callId });
26291
+ state.callId = void 0;
26292
+ }
26293
+ return events;
26294
+ }
26295
+ if (type === "interaction.completed" || type === "interaction.failed") {
26296
+ if (state.callId) {
26297
+ events.push({ type: "tool_call_end", id: state.callId });
26298
+ state.callId = void 0;
26299
+ }
24520
26300
  const interaction = data.interaction ?? {};
24521
- const usage = interaction.usage;
26301
+ const usage = interaction.usage ?? data.metadata?.total_usage;
24522
26302
  if (usage) events.push({ type: "usage", usage: this.parseUsage(usage) });
24523
26303
  events.push({
24524
26304
  type: "done",
24525
- finishReason: extractFinishReason(false, interaction.status, {
26305
+ finishReason: extractFinishReason(state.sawToolCall, interaction.status, {
24526
26306
  failed: "error"
24527
26307
  })
24528
26308
  });
26309
+ return events;
24529
26310
  }
24530
26311
  return events;
24531
26312
  }
24532
- /** Stateless — the Interactions adapter surfaces no code-execution file outputs. */
26313
+ parseStreamEvent(event) {
26314
+ return this.streamEvents(event, { sawToolCall: false });
26315
+ }
26316
+ /** Per-stream stateful parser — correlates a function call's streamed arguments
26317
+ * and end to the call opened by its `step.start`. */
24533
26318
  createStreamParser() {
24534
- return (event) => this.parseStreamEvent(event);
26319
+ const state = { sawToolCall: false };
26320
+ return (event) => this.streamEvents(event, state);
24535
26321
  }
24536
26322
  parseUsage(u) {
24537
26323
  if (!u) return emptyUsage();
@@ -25262,6 +27048,8 @@ var OpenAIAdapter = class {
25262
27048
  };
25263
27049
  if (req.temperature !== void 0) body.temperature = req.temperature;
25264
27050
  if (req.topP !== void 0) body.top_p = req.topP;
27051
+ if (req.presencePenalty !== void 0) body.presence_penalty = req.presencePenalty;
27052
+ if (req.frequencyPenalty !== void 0) body.frequency_penalty = req.frequencyPenalty;
25265
27053
  if (req.stop) body.stop = req.stop;
25266
27054
  const tier = openaiRequestTier(req.serviceTier);
25267
27055
  if (tier) body.service_tier = tier;
@@ -26017,32 +27805,98 @@ function filenameForMime(mimeType) {
26017
27805
  if (mimeType.startsWith("image/")) return `file.${mimeType.slice("image/".length)}`;
26018
27806
  return "file.bin";
26019
27807
  }
27808
+ function codeOutputFromResponsesItem(item) {
27809
+ const parts = [];
27810
+ for (const out of item.outputs ?? []) {
27811
+ if (out.type !== "logs" || typeof out.logs !== "string") continue;
27812
+ try {
27813
+ const j = JSON.parse(out.logs);
27814
+ if (typeof j.stdout === "string") {
27815
+ parts.push(j.stdout);
27816
+ continue;
27817
+ }
27818
+ } catch {
27819
+ }
27820
+ parts.push(out.logs);
27821
+ }
27822
+ return parts.length ? parts.join("") : void 0;
27823
+ }
27824
+ function searchActionPayload(item) {
27825
+ const action = item.action;
27826
+ if (!action) return {};
27827
+ const out = {};
27828
+ if (Array.isArray(action.queries) && typeof action.queries[0] === "string")
27829
+ out.query = action.queries[0];
27830
+ else if (typeof action.query === "string") out.query = action.query;
27831
+ if (typeof action.url === "string") out.url = action.url;
27832
+ return out;
27833
+ }
26020
27834
  var RESPONSES_BUILTIN_ITEMS = /* @__PURE__ */ new Set(["web_search_call", "code_interpreter_call"]);
26021
27835
  function builtinCallFromResponsesItem(item) {
26022
27836
  const type = item.type;
26023
27837
  if (!RESPONSES_BUILTIN_ITEMS.has(type)) return null;
27838
+ const call = { tool: unifiedBuiltinTool(type) };
27839
+ if (typeof item.id === "string") call.id = item.id;
27840
+ if (type === "code_interpreter_call") {
27841
+ if (typeof item.code === "string") call.code = item.code;
27842
+ const output = codeOutputFromResponsesItem(item);
27843
+ if (output) call.output = output;
27844
+ } else if (type === "web_search_call") {
27845
+ const { query, url } = searchActionPayload(item);
27846
+ if (query) call.query = query;
27847
+ if (url) call.url = url;
27848
+ }
27849
+ return call;
27850
+ }
27851
+ function builtinEndPayload(call) {
26024
27852
  return {
26025
- tool: unifiedBuiltinTool(type),
26026
- ...typeof item.id === "string" ? { id: item.id } : {}
27853
+ ...call.id ? { id: call.id } : {},
27854
+ ...call.code ? { code: call.code } : {},
27855
+ ...call.output ? { output: call.output } : {},
27856
+ ...call.query ? { query: call.query } : {},
27857
+ ...call.url ? { url: call.url } : {}
26027
27858
  };
26028
27859
  }
27860
+ var IMAGE_EXTS = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "gif", "webp", "svg", "bmp"]);
27861
+ function fileExt(name) {
27862
+ const i = name.lastIndexOf(".");
27863
+ return i >= 0 ? name.slice(i + 1).toLowerCase() : "";
27864
+ }
27865
+ function isDisplayArtifact(c) {
27866
+ if (!c.filename) return false;
27867
+ const ext = fileExt(c.filename);
27868
+ return c.filename === `${c.fileId}.${ext}` && IMAGE_EXTS.has(ext) && c.span[0] === c.span[1];
27869
+ }
26029
27870
  function filesFromResponsesOutputItem(item) {
26030
27871
  const files = [];
26031
27872
  const type = item.type;
26032
27873
  if (type === "message") {
27874
+ const citations = [];
26033
27875
  for (const c of item.content ?? []) {
26034
27876
  if (c.type !== "output_text") continue;
26035
27877
  for (const a of c.annotations ?? []) {
26036
27878
  if (a.type === "container_file_citation" && typeof a.file_id === "string") {
26037
- files.push({
26038
- id: a.file_id,
26039
- ...typeof a.filename === "string" ? { name: a.filename } : {},
26040
- ...typeof a.container_id === "string" ? { ref: { containerId: a.container_id } } : {},
26041
- source: "code_execution"
27879
+ citations.push({
27880
+ fileId: a.file_id,
27881
+ filename: typeof a.filename === "string" ? a.filename : void 0,
27882
+ containerId: typeof a.container_id === "string" ? a.container_id : void 0,
27883
+ span: [Number(a.start_index) || 0, Number(a.end_index) || 0]
26042
27884
  });
26043
27885
  }
26044
27886
  }
26045
27887
  }
27888
+ const hasSavedImage = citations.some(
27889
+ (c) => !isDisplayArtifact(c) && IMAGE_EXTS.has(fileExt(c.filename ?? ""))
27890
+ );
27891
+ for (const c of citations) {
27892
+ if (hasSavedImage && isDisplayArtifact(c)) continue;
27893
+ files.push({
27894
+ id: c.fileId,
27895
+ ...c.filename ? { name: c.filename } : {},
27896
+ ...c.containerId ? { ref: { containerId: c.containerId } } : {},
27897
+ source: "code_execution"
27898
+ });
27899
+ }
26046
27900
  }
26047
27901
  if (type === "code_interpreter_call") {
26048
27902
  for (const out of item.outputs ?? []) {
@@ -26346,7 +28200,7 @@ var OpenAIResponsesAdapter = class {
26346
28200
  for (const file of this.filesFromOutputItem(item)) events.push({ type: "file", file });
26347
28201
  const builtin = builtinCallFromResponsesItem(item ?? {});
26348
28202
  if (builtin) {
26349
- events.push({ type: "builtin_tool_end", tool: builtin.tool, ...builtin.id ? { id: builtin.id } : {} });
28203
+ events.push({ type: "builtin_tool_end", tool: builtin.tool, ...builtinEndPayload(builtin) });
26350
28204
  }
26351
28205
  if (item?.type === "function_call") {
26352
28206
  events.push({ type: "tool_call_end", id: item.call_id ?? "" });
@@ -26984,6 +28838,14 @@ var XAIMediaAdapter = class {
26984
28838
  }
26985
28839
  };
26986
28840
 
28841
+ // src/llm/providers/xai/tiers.ts
28842
+ function xaiRequestTier(t) {
28843
+ if (!t) return void 0;
28844
+ if (t === "priority") return "priority";
28845
+ if (t === "standard" || t === "default") return "default";
28846
+ return void 0;
28847
+ }
28848
+
26987
28849
  // src/llm/providers/xai/responses.ts
26988
28850
  function xaiCodeExecFiles(item) {
26989
28851
  if (item.type !== "code_interpreter_call") return [];
@@ -27027,6 +28889,9 @@ var XAIResponsesAdapter = class extends OpenAIResponsesAdapter {
27027
28889
  if (!req.model.includes("multi-agent")) {
27028
28890
  delete body.reasoning;
27029
28891
  }
28892
+ const xaiTier = xaiRequestTier(req.serviceTier);
28893
+ if (xaiTier) body.service_tier = xaiTier;
28894
+ else delete body.service_tier;
27030
28895
  const usesCodeInterpreter = req.tools?.some(
27031
28896
  (t) => !isFunctionTool(t) && t.type === "code_interpreter"
27032
28897
  );
@@ -28245,6 +30110,7 @@ var AgentLoop = class _AgentLoop {
28245
30110
  let lastResponse = null;
28246
30111
  let reason = "done";
28247
30112
  let errorMsg;
30113
+ let caughtError;
28248
30114
  let guardrailTripReason;
28249
30115
  try {
28250
30116
  while (true) {
@@ -28293,7 +30159,11 @@ var AgentLoop = class _AgentLoop {
28293
30159
  totalLlmTimeMs += stepLatency;
28294
30160
  addUsage(totalUsage, lastResponse.usage);
28295
30161
  this._history.append(
28296
- { role: "assistant", content: lastResponse.content },
30162
+ buildAssistantMessage(lastResponse, {
30163
+ provider: this.client.provider,
30164
+ model: this.client.model,
30165
+ api: this.client.api
30166
+ }),
28297
30167
  { model: this.client.model, usage: lastResponse.usage, latencyMs: stepLatency }
28298
30168
  );
28299
30169
  const hasToolCalls = lastResponse.finishReason === "tool_use" && lastResponse.toolCalls.length > 0;
@@ -28347,6 +30217,7 @@ var AgentLoop = class _AgentLoop {
28347
30217
  } catch (e) {
28348
30218
  reason = "error";
28349
30219
  errorMsg = e instanceof Error ? e.message : String(e);
30220
+ caughtError = e;
28350
30221
  await this.hooks.emit("onRunError", {
28351
30222
  runId,
28352
30223
  agentId: this.id,
@@ -28397,6 +30268,7 @@ var AgentLoop = class _AgentLoop {
28397
30268
  totalToolTimeMs,
28398
30269
  runTrace
28399
30270
  });
30271
+ if (reason === "error") throw caughtError ?? new Error(errorMsg ?? "agent run failed");
28400
30272
  return finalResponse;
28401
30273
  }
28402
30274
  /** Run `complete` with a JSON Schema enforced via `structured`, then
@@ -28423,6 +30295,7 @@ var AgentLoop = class _AgentLoop {
28423
30295
  let lastResponse = null;
28424
30296
  let reason = "done";
28425
30297
  let errorMsg;
30298
+ let caughtError;
28426
30299
  let guardrailTripReason;
28427
30300
  try {
28428
30301
  while (true) {
@@ -28484,7 +30357,14 @@ var AgentLoop = class _AgentLoop {
28484
30357
  finalText = state.stepText;
28485
30358
  lastResponse = stepResponse;
28486
30359
  this._history.append(
28487
- { role: "assistant", content },
30360
+ {
30361
+ ...buildAssistantMessage(lastResponse, {
30362
+ provider: this.client.provider,
30363
+ model: this.client.model,
30364
+ api: this.client.api
30365
+ }),
30366
+ content
30367
+ },
28488
30368
  { model: this.client.model, usage: state.stepUsage, latencyMs: stepLatency }
28489
30369
  );
28490
30370
  const hasToolCalls = state.stepToolCalls.length > 0;
@@ -28546,6 +30426,7 @@ var AgentLoop = class _AgentLoop {
28546
30426
  } catch (e) {
28547
30427
  reason = "error";
28548
30428
  errorMsg = e instanceof Error ? e.message : String(e);
30429
+ caughtError = e;
28549
30430
  await this.hooks.emit("onRunError", {
28550
30431
  runId,
28551
30432
  agentId: this.id,
@@ -28594,6 +30475,7 @@ var AgentLoop = class _AgentLoop {
28594
30475
  totalToolTimeMs,
28595
30476
  runTrace
28596
30477
  });
30478
+ if (reason === "error") throw caughtError ?? new Error(errorMsg ?? "agent run failed");
28597
30479
  yield { type: "done", response: finalResponse };
28598
30480
  }
28599
30481
  /** Yield tool_call_start events for all tool calls in this step. */
@@ -36975,6 +38857,7 @@ var CAP_KEYS = {
36975
38857
  var BUILTIN_TOOL_KEYS = {
36976
38858
  search: "web_search",
36977
38859
  web_search: "web_search",
38860
+ web_fetch: "web_fetch",
36978
38861
  code_interpreter: "code_interpreter"
36979
38862
  };
36980
38863
  var KNOWN_KEYS = /* @__PURE__ */ new Set([
@@ -38524,6 +40407,7 @@ function createRetrieval(backend, config) {
38524
40407
  export {
38525
40408
  AgentBus,
38526
40409
  AgentLoop,
40410
+ AgentRunError,
38527
40411
  AnthropicAdapter,
38528
40412
  AnthropicBatchAdapter,
38529
40413
  AnthropicCountApi,
@@ -38579,6 +40463,7 @@ export {
38579
40463
  INPUT_SIZE_BUCKET_LABELS,
38580
40464
  InMemoryVectorStore,
38581
40465
  InternalToolRunner,
40466
+ InvalidFinalOutputError,
38582
40467
  JSON_API_SYSTEM_PROMPT,
38583
40468
  LAYER_AGENTLOOP_CONTEXT,
38584
40469
  LAYER_AGENTLOOP_SYSTEM,