@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.
@@ -1902,6 +1902,31 @@ function parseRetryAfter(headers) {
1902
1902
  return void 0;
1903
1903
  }
1904
1904
 
1905
+ // src/llm/output-errors.ts
1906
+ var AgentRunError = class extends Error {
1907
+ /** Machine-readable failure reason (e.g. `'invalid_final_output'`). */
1908
+ reason;
1909
+ constructor(reason, message, options) {
1910
+ super(message, options);
1911
+ this.name = "AgentRunError";
1912
+ this.reason = reason;
1913
+ }
1914
+ };
1915
+ var InvalidFinalOutputError = class extends AgentRunError {
1916
+ reason = "invalid_final_output";
1917
+ /** The raw model output that failed to parse. */
1918
+ rawText;
1919
+ constructor(rawText, options) {
1920
+ super(
1921
+ "invalid_final_output",
1922
+ `Model final output did not match the requested schema: ${options?.cause instanceof Error ? options.cause.message : "parse failed"}`,
1923
+ options
1924
+ );
1925
+ this.name = "InvalidFinalOutputError";
1926
+ this.rawText = rawText;
1927
+ }
1928
+ };
1929
+
1905
1930
  // src/network/semaphore.ts
1906
1931
  var Semaphore = class {
1907
1932
  constructor(max) {
@@ -2916,7 +2941,7 @@ var catalog_default = {
2916
2941
  family: "claude-opus",
2917
2942
  version: "4",
2918
2943
  status: "legacy",
2919
- active: true,
2944
+ active: false,
2920
2945
  deprecation: {
2921
2946
  date: "2026-05-14",
2922
2947
  source: "litellm"
@@ -3260,7 +3285,7 @@ var catalog_default = {
3260
3285
  family: "claude-sonnet",
3261
3286
  version: "4",
3262
3287
  status: "legacy",
3263
- active: true,
3288
+ active: false,
3264
3289
  deprecation: {
3265
3290
  date: "2026-05-14",
3266
3291
  source: "litellm"
@@ -3427,50 +3452,35 @@ var catalog_default = {
3427
3452
  version: "4.5",
3428
3453
  status: "stable",
3429
3454
  active: true
3430
- }
3431
- };
3432
-
3433
- // src/llm/providers/google/catalog.json
3434
- var catalog_default2 = {
3435
- "google/gemini-2.5-pro": {
3436
- providerModelName: "gemini-2.5-pro",
3455
+ },
3456
+ "anthropic/claude-fable-5": {
3457
+ providerModelName: "claude-fable-5",
3437
3458
  aliases: [
3438
- "gemini-2.5-pro"
3459
+ "claude-fable-5"
3439
3460
  ],
3440
3461
  pricing: {
3441
- inputPerMTok: 1.25,
3442
- outputPerMTok: 10,
3443
- cacheReadPerMTok: 0.125,
3462
+ inputPerMTok: 10,
3463
+ outputPerMTok: 50,
3464
+ cacheReadPerMTok: 1,
3444
3465
  tiers: {
3445
3466
  batch: {
3446
- inputPerMTok: 0.625,
3447
- outputPerMTok: 5,
3448
- cacheReadPerMTok: 0.125
3449
- },
3450
- flex: {
3451
- inputPerMTok: 0.625,
3452
- outputPerMTok: 5,
3453
- cacheReadPerMTok: 0.125
3454
- },
3455
- priority: {
3456
- inputPerMTok: 2.25,
3457
- outputPerMTok: 18,
3458
- cacheReadPerMTok: 0.225
3467
+ inputPerMTok: 5,
3468
+ outputPerMTok: 25
3459
3469
  }
3460
3470
  }
3461
3471
  },
3462
- preferredApi: "generate",
3472
+ preferredApi: "messages",
3463
3473
  supportedApis: [
3464
- "generate"
3474
+ "messages"
3465
3475
  ],
3466
- contextWindow: 1048576,
3467
- maxOutput: 65536,
3476
+ contextWindow: 1e6,
3477
+ maxOutput: 128e3,
3468
3478
  capabilities: {
3469
3479
  toolUse: true,
3470
3480
  streaming: true,
3471
3481
  structuredOutput: true,
3472
3482
  vision: true,
3473
- audio: true,
3483
+ audio: false,
3474
3484
  video: false,
3475
3485
  imageGeneration: false,
3476
3486
  audioGeneration: false,
@@ -3487,103 +3497,44 @@ var catalog_default2 = {
3487
3497
  inputModalities: [
3488
3498
  "text",
3489
3499
  "image",
3490
- "audio"
3500
+ "pdf"
3491
3501
  ],
3492
3502
  outputModalities: [
3493
3503
  "text"
3494
3504
  ],
3495
- family: "gemini-pro",
3496
- version: "2.5",
3505
+ family: "claude-fable",
3506
+ version: "5",
3497
3507
  status: "stable",
3498
3508
  active: true
3499
3509
  },
3500
- "google/gemini-3.1-pro": {
3501
- providerModelName: "gemini-3.1-pro-preview",
3510
+ "anthropic/claude-sonnet-5": {
3511
+ providerModelName: "claude-sonnet-5",
3502
3512
  aliases: [
3503
- "gemini-3.1-pro-preview"
3513
+ "claude-sonnet-5"
3504
3514
  ],
3505
3515
  pricing: {
3506
3516
  inputPerMTok: 2,
3507
- outputPerMTok: 12,
3517
+ outputPerMTok: 10,
3508
3518
  cacheReadPerMTok: 0.2,
3509
3519
  tiers: {
3510
3520
  batch: {
3511
3521
  inputPerMTok: 1,
3512
- outputPerMTok: 6,
3513
- cacheReadPerMTok: 0.2
3514
- },
3515
- flex: {
3516
- inputPerMTok: 1,
3517
- outputPerMTok: 6,
3518
- cacheReadPerMTok: 0.2
3519
- },
3520
- priority: {
3521
- inputPerMTok: 3.6,
3522
- outputPerMTok: 21.6,
3523
- cacheReadPerMTok: 0.36
3522
+ outputPerMTok: 5
3524
3523
  }
3525
3524
  }
3526
3525
  },
3527
- preferredApi: "generate",
3528
- supportedApis: [
3529
- "generate"
3530
- ],
3531
- contextWindow: 1048576,
3532
- maxOutput: 65536,
3533
- capabilities: {
3534
- toolUse: true,
3535
- streaming: true,
3536
- structuredOutput: true,
3537
- vision: true,
3538
- audio: true,
3539
- video: false,
3540
- imageGeneration: false,
3541
- audioGeneration: false,
3542
- videoGeneration: false
3543
- },
3544
- reasoning: {
3545
- supported: true,
3546
- automatic: false,
3547
- effortControl: false,
3548
- encryptedContent: false,
3549
- summaryAvailable: false
3550
- },
3551
- type: "chat",
3552
- inputModalities: [
3553
- "text",
3554
- "image",
3555
- "audio"
3556
- ],
3557
- outputModalities: [
3558
- "text"
3559
- ],
3560
- family: "gemini-pro",
3561
- version: "3.1",
3562
- status: "preview",
3563
- active: true
3564
- },
3565
- "google/gemini-3.1-pro-customtools": {
3566
- providerModelName: "gemini-3.1-pro-preview-customtools",
3567
- aliases: [
3568
- "gemini-3.1-pro-preview-customtools"
3569
- ],
3570
- pricing: {
3571
- inputPerMTok: 2,
3572
- outputPerMTok: 12,
3573
- cacheReadPerMTok: 0.2
3574
- },
3575
- preferredApi: "generate",
3526
+ preferredApi: "messages",
3576
3527
  supportedApis: [
3577
- "generate"
3528
+ "messages"
3578
3529
  ],
3579
- contextWindow: 1048576,
3580
- maxOutput: 65536,
3530
+ contextWindow: 1e6,
3531
+ maxOutput: 128e3,
3581
3532
  capabilities: {
3582
3533
  toolUse: true,
3583
3534
  streaming: true,
3584
3535
  structuredOutput: true,
3585
3536
  vision: true,
3586
- audio: true,
3537
+ audio: false,
3587
3538
  video: false,
3588
3539
  imageGeneration: false,
3589
3540
  audioGeneration: false,
@@ -3600,66 +3551,49 @@ var catalog_default2 = {
3600
3551
  inputModalities: [
3601
3552
  "text",
3602
3553
  "image",
3603
- "audio"
3554
+ "pdf"
3604
3555
  ],
3605
3556
  outputModalities: [
3606
3557
  "text"
3607
3558
  ],
3608
- family: "gemini-pro",
3609
- version: "3.1",
3610
- status: "preview",
3559
+ family: "claude-sonnet",
3560
+ version: "5",
3561
+ status: "stable",
3611
3562
  active: true
3612
3563
  },
3613
- "google/gemini-2.5-flash": {
3614
- providerModelName: "gemini-2.5-flash",
3564
+ "anthropic/claude-mythos-5": {
3565
+ providerModelName: "claude-mythos-5",
3615
3566
  aliases: [
3616
- "gemini-2.5-flash"
3567
+ "claude-mythos-5"
3617
3568
  ],
3618
3569
  pricing: {
3619
- inputPerMTok: 0.3,
3620
- outputPerMTok: 2.5,
3621
- cacheReadPerMTok: 0.03,
3622
- audioInputPerMTok: 1,
3570
+ inputPerMTok: 10,
3571
+ outputPerMTok: 50,
3572
+ cacheReadPerMTok: 1,
3623
3573
  tiers: {
3624
3574
  batch: {
3625
- inputPerMTok: 0.15,
3626
- outputPerMTok: 1.25,
3627
- cacheReadPerMTok: 0.03,
3628
- audioInputPerMTok: 0.5
3629
- },
3630
- flex: {
3631
- inputPerMTok: 0.15,
3632
- outputPerMTok: 1.25,
3633
- cacheReadPerMTok: 0.03,
3634
- audioInputPerMTok: 0.5
3635
- },
3636
- priority: {
3637
- inputPerMTok: 0.54,
3638
- outputPerMTok: 4.5,
3639
- cacheReadPerMTok: 0.054,
3640
- audioInputPerMTok: 1.8
3575
+ inputPerMTok: 5,
3576
+ outputPerMTok: 25
3641
3577
  }
3642
3578
  }
3643
3579
  },
3644
- preferredApi: "generate",
3580
+ preferredApi: "messages",
3645
3581
  supportedApis: [
3646
- "generate"
3582
+ "messages"
3647
3583
  ],
3648
- contextWindow: 1048576,
3649
- maxOutput: 65536,
3650
3584
  capabilities: {
3651
3585
  toolUse: true,
3652
3586
  streaming: true,
3653
3587
  structuredOutput: true,
3654
- vision: true,
3655
- audio: true,
3588
+ vision: false,
3589
+ audio: false,
3656
3590
  video: false,
3657
3591
  imageGeneration: false,
3658
3592
  audioGeneration: false,
3659
3593
  videoGeneration: false
3660
3594
  },
3661
3595
  reasoning: {
3662
- supported: true,
3596
+ supported: false,
3663
3597
  automatic: false,
3664
3598
  effortControl: false,
3665
3599
  encryptedContent: false,
@@ -3667,46 +3601,45 @@ var catalog_default2 = {
3667
3601
  },
3668
3602
  type: "chat",
3669
3603
  inputModalities: [
3670
- "text",
3671
- "image",
3672
- "audio"
3604
+ "text"
3673
3605
  ],
3674
3606
  outputModalities: [
3675
3607
  "text"
3676
3608
  ],
3677
- family: "gemini-flash",
3678
- version: "2.5",
3609
+ family: "claude-mythos",
3610
+ version: "5",
3679
3611
  status: "stable",
3680
- active: true
3681
- },
3682
- "google/gemini-3-flash": {
3683
- providerModelName: "gemini-3-flash-preview",
3612
+ active: true,
3613
+ availability: "limited"
3614
+ }
3615
+ };
3616
+
3617
+ // src/llm/providers/google/catalog.json
3618
+ var catalog_default2 = {
3619
+ "google/gemini-2.5-pro": {
3620
+ providerModelName: "gemini-2.5-pro",
3684
3621
  aliases: [
3685
- "gemini-3-flash-preview"
3622
+ "gemini-2.5-pro"
3686
3623
  ],
3687
3624
  pricing: {
3688
- inputPerMTok: 0.5,
3689
- outputPerMTok: 3,
3690
- cacheReadPerMTok: 0.05,
3691
- audioInputPerMTok: 1,
3625
+ inputPerMTok: 1.25,
3626
+ outputPerMTok: 10,
3627
+ cacheReadPerMTok: 0.125,
3692
3628
  tiers: {
3693
3629
  batch: {
3694
- inputPerMTok: 0.25,
3695
- outputPerMTok: 1.5,
3696
- cacheReadPerMTok: 0.05,
3697
- audioInputPerMTok: 0.5
3630
+ inputPerMTok: 0.625,
3631
+ outputPerMTok: 5,
3632
+ cacheReadPerMTok: 0.125
3698
3633
  },
3699
3634
  flex: {
3700
- inputPerMTok: 0.25,
3701
- outputPerMTok: 1.5,
3702
- cacheReadPerMTok: 0.05,
3703
- audioInputPerMTok: 0.5
3635
+ inputPerMTok: 0.625,
3636
+ outputPerMTok: 5,
3637
+ cacheReadPerMTok: 0.125
3704
3638
  },
3705
3639
  priority: {
3706
- inputPerMTok: 0.9,
3707
- outputPerMTok: 5.4,
3708
- cacheReadPerMTok: 0.09,
3709
- audioInputPerMTok: 1.8
3640
+ inputPerMTok: 2.25,
3641
+ outputPerMTok: 18,
3642
+ cacheReadPerMTok: 0.225
3710
3643
  }
3711
3644
  }
3712
3645
  },
@@ -3743,35 +3676,286 @@ var catalog_default2 = {
3743
3676
  outputModalities: [
3744
3677
  "text"
3745
3678
  ],
3746
- family: "gemini-flash",
3747
- version: "3",
3748
- status: "preview",
3679
+ family: "gemini-pro",
3680
+ version: "2.5",
3681
+ status: "stable",
3749
3682
  active: true
3750
3683
  },
3751
- "google/gemini-3.5-flash": {
3752
- providerModelName: "gemini-3.5-flash",
3684
+ "google/gemini-3.1-pro": {
3685
+ providerModelName: "gemini-3.1-pro-preview",
3753
3686
  aliases: [
3754
- "gemini-3.5-flash"
3687
+ "gemini-3.1-pro-preview"
3755
3688
  ],
3756
3689
  pricing: {
3757
- inputPerMTok: 1.5,
3758
- outputPerMTok: 9,
3759
- cacheReadPerMTok: 0.15,
3690
+ inputPerMTok: 2,
3691
+ outputPerMTok: 12,
3692
+ cacheReadPerMTok: 0.2,
3760
3693
  tiers: {
3761
3694
  batch: {
3762
- inputPerMTok: 0.75,
3763
- outputPerMTok: 4.5,
3764
- cacheReadPerMTok: 0.075
3695
+ inputPerMTok: 1,
3696
+ outputPerMTok: 6,
3697
+ cacheReadPerMTok: 0.2
3765
3698
  },
3766
3699
  flex: {
3767
- inputPerMTok: 0.75,
3768
- outputPerMTok: 4.5,
3769
- cacheReadPerMTok: 0.08
3700
+ inputPerMTok: 1,
3701
+ outputPerMTok: 6,
3702
+ cacheReadPerMTok: 0.2
3770
3703
  },
3771
3704
  priority: {
3772
- inputPerMTok: 2.7,
3773
- outputPerMTok: 16.2,
3774
- cacheReadPerMTok: 0.27
3705
+ inputPerMTok: 3.6,
3706
+ outputPerMTok: 21.6,
3707
+ cacheReadPerMTok: 0.36
3708
+ }
3709
+ }
3710
+ },
3711
+ preferredApi: "generate",
3712
+ supportedApis: [
3713
+ "generate"
3714
+ ],
3715
+ contextWindow: 1048576,
3716
+ maxOutput: 65536,
3717
+ capabilities: {
3718
+ toolUse: true,
3719
+ streaming: true,
3720
+ structuredOutput: true,
3721
+ vision: true,
3722
+ audio: true,
3723
+ video: false,
3724
+ imageGeneration: false,
3725
+ audioGeneration: false,
3726
+ videoGeneration: false
3727
+ },
3728
+ reasoning: {
3729
+ supported: true,
3730
+ automatic: false,
3731
+ effortControl: false,
3732
+ encryptedContent: false,
3733
+ summaryAvailable: false
3734
+ },
3735
+ type: "chat",
3736
+ inputModalities: [
3737
+ "text",
3738
+ "image",
3739
+ "audio"
3740
+ ],
3741
+ outputModalities: [
3742
+ "text"
3743
+ ],
3744
+ family: "gemini-pro",
3745
+ version: "3.1",
3746
+ status: "preview",
3747
+ active: true
3748
+ },
3749
+ "google/gemini-3.1-pro-customtools": {
3750
+ providerModelName: "gemini-3.1-pro-preview-customtools",
3751
+ aliases: [
3752
+ "gemini-3.1-pro-preview-customtools"
3753
+ ],
3754
+ pricing: {
3755
+ inputPerMTok: 2,
3756
+ outputPerMTok: 12,
3757
+ cacheReadPerMTok: 0.2
3758
+ },
3759
+ preferredApi: "generate",
3760
+ supportedApis: [
3761
+ "generate"
3762
+ ],
3763
+ contextWindow: 1048576,
3764
+ maxOutput: 65536,
3765
+ capabilities: {
3766
+ toolUse: true,
3767
+ streaming: true,
3768
+ structuredOutput: true,
3769
+ vision: true,
3770
+ audio: true,
3771
+ video: false,
3772
+ imageGeneration: false,
3773
+ audioGeneration: false,
3774
+ videoGeneration: false
3775
+ },
3776
+ reasoning: {
3777
+ supported: true,
3778
+ automatic: false,
3779
+ effortControl: false,
3780
+ encryptedContent: false,
3781
+ summaryAvailable: false
3782
+ },
3783
+ type: "chat",
3784
+ inputModalities: [
3785
+ "text",
3786
+ "image",
3787
+ "audio"
3788
+ ],
3789
+ outputModalities: [
3790
+ "text"
3791
+ ],
3792
+ family: "gemini-pro",
3793
+ version: "3.1",
3794
+ status: "preview",
3795
+ active: true
3796
+ },
3797
+ "google/gemini-2.5-flash": {
3798
+ providerModelName: "gemini-2.5-flash",
3799
+ aliases: [
3800
+ "gemini-2.5-flash"
3801
+ ],
3802
+ pricing: {
3803
+ inputPerMTok: 0.3,
3804
+ outputPerMTok: 2.5,
3805
+ cacheReadPerMTok: 0.03,
3806
+ audioInputPerMTok: 1,
3807
+ tiers: {
3808
+ batch: {
3809
+ inputPerMTok: 0.15,
3810
+ outputPerMTok: 1.25,
3811
+ cacheReadPerMTok: 0.03,
3812
+ audioInputPerMTok: 0.5
3813
+ },
3814
+ flex: {
3815
+ inputPerMTok: 0.15,
3816
+ outputPerMTok: 1.25,
3817
+ cacheReadPerMTok: 0.03,
3818
+ audioInputPerMTok: 0.5
3819
+ },
3820
+ priority: {
3821
+ inputPerMTok: 0.54,
3822
+ outputPerMTok: 4.5,
3823
+ cacheReadPerMTok: 0.054,
3824
+ audioInputPerMTok: 1.8
3825
+ }
3826
+ }
3827
+ },
3828
+ preferredApi: "generate",
3829
+ supportedApis: [
3830
+ "generate"
3831
+ ],
3832
+ contextWindow: 1048576,
3833
+ maxOutput: 65536,
3834
+ capabilities: {
3835
+ toolUse: true,
3836
+ streaming: true,
3837
+ structuredOutput: true,
3838
+ vision: true,
3839
+ audio: true,
3840
+ video: false,
3841
+ imageGeneration: false,
3842
+ audioGeneration: false,
3843
+ videoGeneration: false
3844
+ },
3845
+ reasoning: {
3846
+ supported: true,
3847
+ automatic: false,
3848
+ effortControl: false,
3849
+ encryptedContent: false,
3850
+ summaryAvailable: false
3851
+ },
3852
+ type: "chat",
3853
+ inputModalities: [
3854
+ "text",
3855
+ "image",
3856
+ "audio"
3857
+ ],
3858
+ outputModalities: [
3859
+ "text"
3860
+ ],
3861
+ family: "gemini-flash",
3862
+ version: "2.5",
3863
+ status: "stable",
3864
+ active: true
3865
+ },
3866
+ "google/gemini-3-flash": {
3867
+ providerModelName: "gemini-3-flash-preview",
3868
+ aliases: [
3869
+ "gemini-3-flash-preview"
3870
+ ],
3871
+ pricing: {
3872
+ inputPerMTok: 0.5,
3873
+ outputPerMTok: 3,
3874
+ cacheReadPerMTok: 0.05,
3875
+ audioInputPerMTok: 1,
3876
+ tiers: {
3877
+ batch: {
3878
+ inputPerMTok: 0.25,
3879
+ outputPerMTok: 1.5,
3880
+ cacheReadPerMTok: 0.05,
3881
+ audioInputPerMTok: 0.5
3882
+ },
3883
+ flex: {
3884
+ inputPerMTok: 0.25,
3885
+ outputPerMTok: 1.5,
3886
+ cacheReadPerMTok: 0.05,
3887
+ audioInputPerMTok: 0.5
3888
+ },
3889
+ priority: {
3890
+ inputPerMTok: 0.9,
3891
+ outputPerMTok: 5.4,
3892
+ cacheReadPerMTok: 0.09,
3893
+ audioInputPerMTok: 1.8
3894
+ }
3895
+ }
3896
+ },
3897
+ preferredApi: "generate",
3898
+ supportedApis: [
3899
+ "generate"
3900
+ ],
3901
+ contextWindow: 1048576,
3902
+ maxOutput: 65536,
3903
+ capabilities: {
3904
+ toolUse: true,
3905
+ streaming: true,
3906
+ structuredOutput: true,
3907
+ vision: true,
3908
+ audio: true,
3909
+ video: false,
3910
+ imageGeneration: false,
3911
+ audioGeneration: false,
3912
+ videoGeneration: false
3913
+ },
3914
+ reasoning: {
3915
+ supported: true,
3916
+ automatic: false,
3917
+ effortControl: false,
3918
+ encryptedContent: false,
3919
+ summaryAvailable: false
3920
+ },
3921
+ type: "chat",
3922
+ inputModalities: [
3923
+ "text",
3924
+ "image",
3925
+ "audio"
3926
+ ],
3927
+ outputModalities: [
3928
+ "text"
3929
+ ],
3930
+ family: "gemini-flash",
3931
+ version: "3",
3932
+ status: "preview",
3933
+ active: true
3934
+ },
3935
+ "google/gemini-3.5-flash": {
3936
+ providerModelName: "gemini-3.5-flash",
3937
+ aliases: [
3938
+ "gemini-3.5-flash"
3939
+ ],
3940
+ pricing: {
3941
+ inputPerMTok: 1.5,
3942
+ outputPerMTok: 9,
3943
+ cacheReadPerMTok: 0.15,
3944
+ tiers: {
3945
+ batch: {
3946
+ inputPerMTok: 0.75,
3947
+ outputPerMTok: 4.5,
3948
+ cacheReadPerMTok: 0.075
3949
+ },
3950
+ flex: {
3951
+ inputPerMTok: 0.75,
3952
+ outputPerMTok: 4.5,
3953
+ cacheReadPerMTok: 0.08
3954
+ },
3955
+ priority: {
3956
+ inputPerMTok: 2.7,
3957
+ outputPerMTok: 16.2,
3958
+ cacheReadPerMTok: 0.27
3775
3959
  }
3776
3960
  }
3777
3961
  },
@@ -4622,7 +4806,8 @@ var catalog_default2 = {
4622
4806
  outputPerMTok: 4.5,
4623
4807
  audioInputPerMTok: 3,
4624
4808
  audioOutputPerMTok: 12,
4625
- perMinute: 5e-3
4809
+ perMinute: 5e-3,
4810
+ perSecond: 2e-3
4626
4811
  },
4627
4812
  preferredApi: "generate",
4628
4813
  supportedApis: [
@@ -4671,7 +4856,9 @@ var catalog_default2 = {
4671
4856
  pricing: {
4672
4857
  inputPerMTok: 3.5,
4673
4858
  outputPerMTok: 21,
4674
- perMinute: 53e-4
4859
+ perMinute: 53e-4,
4860
+ audioInputPerMTok: 53e-4,
4861
+ audioOutputPerMTok: 0.0315
4675
4862
  },
4676
4863
  preferredApi: "generate",
4677
4864
  supportedApis: [
@@ -5245,7 +5432,8 @@ var catalog_default2 = {
5245
5432
  "720p": 0.1,
5246
5433
  "1080p": 0.12,
5247
5434
  "4k": 0.3
5248
- }
5435
+ },
5436
+ perSecond: 0.1
5249
5437
  },
5250
5438
  preferredApi: "generate",
5251
5439
  supportedApis: [
@@ -5392,7 +5580,8 @@ var catalog_default2 = {
5392
5580
  "720p": 0.1,
5393
5581
  "1080p": 0.12,
5394
5582
  "4k": 0.3
5395
- }
5583
+ },
5584
+ perSecond: 0.1
5396
5585
  },
5397
5586
  preferredApi: "generate",
5398
5587
  supportedApis: [
@@ -5463,8 +5652,10 @@ var catalog_default2 = {
5463
5652
  pricing: {
5464
5653
  perUnit: {
5465
5654
  "720p": 0.05,
5466
- "1080p": 0.08
5467
- }
5655
+ "1080p": 0.08,
5656
+ "4k": 0
5657
+ },
5658
+ perSecond: 0.05
5468
5659
  },
5469
5660
  preferredApi: "generate",
5470
5661
  supportedApis: [
@@ -5765,6 +5956,129 @@ var catalog_default2 = {
5765
5956
  version: "1.6",
5766
5957
  status: "preview",
5767
5958
  active: true
5959
+ },
5960
+ "google/gemini-3.1-flash-lite-image": {
5961
+ providerModelName: "gemini-3.1-flash-lite-image",
5962
+ aliases: [
5963
+ "gemini-3.1-flash-lite-image"
5964
+ ],
5965
+ pricing: {
5966
+ inputPerMTok: 0.25,
5967
+ outputPerMTok: 1.5,
5968
+ perUnit: {
5969
+ "1k": 0.0336
5970
+ }
5971
+ },
5972
+ preferredApi: "generate",
5973
+ supportedApis: [
5974
+ "generate"
5975
+ ],
5976
+ contextWindow: 65536,
5977
+ maxOutput: 65536,
5978
+ capabilities: {
5979
+ toolUse: false,
5980
+ streaming: true,
5981
+ structuredOutput: false,
5982
+ vision: true,
5983
+ audio: false,
5984
+ video: false,
5985
+ imageGeneration: true,
5986
+ audioGeneration: false,
5987
+ videoGeneration: false
5988
+ },
5989
+ reasoning: {
5990
+ supported: true,
5991
+ automatic: false,
5992
+ effortControl: false,
5993
+ encryptedContent: false,
5994
+ summaryAvailable: false
5995
+ },
5996
+ type: "image",
5997
+ inputModalities: [
5998
+ "text",
5999
+ "image"
6000
+ ],
6001
+ outputModalities: [
6002
+ "image"
6003
+ ],
6004
+ family: "gemini-image",
6005
+ version: "3.1",
6006
+ status: "stable",
6007
+ active: true,
6008
+ mediaParams: {
6009
+ aspectRatio: {
6010
+ values: [
6011
+ "1:1",
6012
+ "1:4",
6013
+ "1:8",
6014
+ "2:3",
6015
+ "3:2",
6016
+ "3:4",
6017
+ "4:1",
6018
+ "4:3",
6019
+ "4:5",
6020
+ "5:4",
6021
+ "9:16",
6022
+ "16:9",
6023
+ "21:9"
6024
+ ],
6025
+ default: "1:1"
6026
+ },
6027
+ imageSize: {
6028
+ values: [
6029
+ "512",
6030
+ "1K",
6031
+ "2K",
6032
+ "4K"
6033
+ ],
6034
+ default: "1K"
6035
+ }
6036
+ }
6037
+ },
6038
+ "google/gemini-omni-flash": {
6039
+ providerModelName: "gemini-omni-flash-preview",
6040
+ aliases: [
6041
+ "gemini-omni-flash-preview"
6042
+ ],
6043
+ pricing: {
6044
+ inputPerMTok: 1.5
6045
+ },
6046
+ preferredApi: "generate",
6047
+ supportedApis: [
6048
+ "generate"
6049
+ ],
6050
+ contextWindow: 131072,
6051
+ maxOutput: 65536,
6052
+ capabilities: {
6053
+ toolUse: true,
6054
+ streaming: true,
6055
+ structuredOutput: true,
6056
+ vision: false,
6057
+ audio: true,
6058
+ video: false,
6059
+ imageGeneration: false,
6060
+ audioGeneration: false,
6061
+ videoGeneration: false
6062
+ },
6063
+ reasoning: {
6064
+ supported: false,
6065
+ automatic: false,
6066
+ effortControl: false,
6067
+ encryptedContent: false,
6068
+ summaryAvailable: false
6069
+ },
6070
+ type: "audio-chat",
6071
+ inputModalities: [
6072
+ "text",
6073
+ "audio"
6074
+ ],
6075
+ outputModalities: [
6076
+ "text"
6077
+ ],
6078
+ family: "gemini-audio",
6079
+ version: "1",
6080
+ status: "preview",
6081
+ active: true
5768
6082
  }
5769
6083
  };
5770
6084
 
@@ -7364,9 +7678,10 @@ var catalog_default3 = {
7364
7678
  "gpt-4o-mini-2024-07-18"
7365
7679
  ],
7366
7680
  pricing: {
7367
- inputPerMTok: 1.25,
7368
- outputPerMTok: 5,
7369
- perMinute: 3e-3
7681
+ inputPerMTok: 0.15,
7682
+ outputPerMTok: 0.6,
7683
+ perMinute: 3e-3,
7684
+ cacheReadPerMTok: 0.075
7370
7685
  },
7371
7686
  preferredApi: "responses",
7372
7687
  supportedApis: [
@@ -8019,8 +8334,8 @@ var catalog_default3 = {
8019
8334
  "gpt-realtime-2025-08-28"
8020
8335
  ],
8021
8336
  pricing: {
8022
- inputPerMTok: 4,
8023
- outputPerMTok: 24,
8337
+ inputPerMTok: 32,
8338
+ outputPerMTok: 64,
8024
8339
  cacheReadPerMTok: 0.4,
8025
8340
  audioInputPerMTok: 32,
8026
8341
  audioOutputPerMTok: 64
@@ -8119,8 +8434,8 @@ var catalog_default3 = {
8119
8434
  "gpt-realtime-2"
8120
8435
  ],
8121
8436
  pricing: {
8122
- inputPerMTok: 4,
8123
- outputPerMTok: 24,
8437
+ inputPerMTok: 32,
8438
+ outputPerMTok: 64,
8124
8439
  cacheReadPerMTok: 0.4,
8125
8440
  audioInputPerMTok: 32,
8126
8441
  audioOutputPerMTok: 64
@@ -8255,7 +8570,8 @@ var catalog_default3 = {
8255
8570
  family: "gpt-realtime",
8256
8571
  version: "1",
8257
8572
  status: "stable",
8258
- active: true
8573
+ active: true,
8574
+ contextWindow: 128e3
8259
8575
  },
8260
8576
  "openai/gpt-realtime-whisper": {
8261
8577
  providerModelName: "gpt-realtime-whisper",
@@ -8298,7 +8614,8 @@ var catalog_default3 = {
8298
8614
  family: "gpt-realtime",
8299
8615
  version: "1",
8300
8616
  status: "stable",
8301
- active: true
8617
+ active: true,
8618
+ contextWindow: 128e3
8302
8619
  },
8303
8620
  "openai/o1": {
8304
8621
  providerModelName: "o1",
@@ -8407,7 +8724,8 @@ var catalog_default3 = {
8407
8724
  },
8408
8725
  preferredApi: "responses",
8409
8726
  supportedApis: [
8410
- "responses"
8727
+ "responses",
8728
+ "completions"
8411
8729
  ],
8412
8730
  contextWindow: 2e5,
8413
8731
  maxOutput: 1e5,
@@ -8541,9 +8859,9 @@ var catalog_default3 = {
8541
8859
  "o4-mini-2025-04-16"
8542
8860
  ],
8543
8861
  pricing: {
8544
- inputPerMTok: 4,
8545
- outputPerMTok: 16,
8546
- cacheReadPerMTok: 1,
8862
+ inputPerMTok: 1.1,
8863
+ outputPerMTok: 4.4,
8864
+ cacheReadPerMTok: 0.275,
8547
8865
  tiers: {
8548
8866
  batch: {
8549
8867
  inputPerMTok: 2,
@@ -8880,167 +9198,171 @@ var catalog_default3 = {
8880
9198
  "tts-1",
8881
9199
  "tts-1-1106"
8882
9200
  ],
8883
- pricing: { perMChars: 15 },
8884
- preferredApi: "responses",
8885
- supportedApis: [
8886
- "responses",
8887
- "completions"
8888
- ],
8889
- capabilities: {
8890
- toolUse: false,
8891
- streaming: true,
8892
- structuredOutput: false,
8893
- vision: false,
8894
- audio: false,
8895
- video: false,
8896
- imageGeneration: false,
8897
- audioGeneration: true,
8898
- videoGeneration: false
8899
- },
8900
- reasoning: {
8901
- supported: false,
8902
- automatic: false,
8903
- effortControl: false,
8904
- encryptedContent: false,
8905
- summaryAvailable: false
8906
- },
8907
- type: "tts",
8908
- inputModalities: [
8909
- "text"
8910
- ],
8911
- outputModalities: [
8912
- "audio"
8913
- ],
8914
- family: "tts",
8915
- version: "1",
8916
- status: "legacy",
8917
- active: true,
8918
- mediaParams: {
8919
- voice: {
8920
- values: [
8921
- "alloy",
8922
- "ash",
8923
- "ballad",
8924
- "coral",
8925
- "echo",
8926
- "fable",
8927
- "onyx",
8928
- "nova",
8929
- "sage",
8930
- "shimmer",
8931
- "verse",
8932
- "marin",
8933
- "cedar"
8934
- ],
8935
- default: "alloy"
8936
- },
8937
- format: {
8938
- values: [
8939
- "mp3",
8940
- "opus",
8941
- "aac",
8942
- "flac",
8943
- "wav",
8944
- "pcm"
8945
- ],
8946
- default: "mp3"
8947
- },
8948
- speed: {
8949
- min: 0.25,
8950
- max: 4,
8951
- default: 1
8952
- }
8953
- }
8954
- },
8955
- "openai/tts-1-hd": {
8956
- providerModelName: "tts-1-hd",
8957
- aliases: [
8958
- "tts-1-hd",
8959
- "tts-1-hd-1106"
8960
- ],
8961
- pricing: { perMChars: 30 },
8962
- preferredApi: "responses",
8963
- supportedApis: [
8964
- "responses",
8965
- "completions"
8966
- ],
8967
- capabilities: {
8968
- toolUse: false,
8969
- streaming: true,
8970
- structuredOutput: false,
8971
- vision: false,
8972
- audio: false,
8973
- video: false,
8974
- imageGeneration: false,
8975
- audioGeneration: true,
8976
- videoGeneration: false
8977
- },
8978
- reasoning: {
8979
- supported: false,
8980
- automatic: false,
8981
- effortControl: false,
8982
- encryptedContent: false,
8983
- summaryAvailable: false
8984
- },
8985
- type: "tts",
8986
- inputModalities: [
8987
- "text"
8988
- ],
8989
- outputModalities: [
8990
- "audio"
8991
- ],
8992
- family: "tts",
8993
- version: "1",
8994
- status: "legacy",
8995
- active: true,
8996
- mediaParams: {
8997
- voice: {
8998
- values: [
8999
- "alloy",
9000
- "ash",
9001
- "ballad",
9002
- "coral",
9003
- "echo",
9004
- "fable",
9005
- "onyx",
9006
- "nova",
9007
- "sage",
9008
- "shimmer",
9009
- "verse",
9010
- "marin",
9011
- "cedar"
9012
- ],
9013
- default: "alloy"
9014
- },
9015
- format: {
9016
- values: [
9017
- "mp3",
9018
- "opus",
9019
- "aac",
9020
- "flac",
9021
- "wav",
9022
- "pcm"
9023
- ],
9024
- default: "mp3"
9025
- },
9026
- speed: {
9027
- min: 0.25,
9028
- max: 4,
9029
- default: 1
9030
- }
9031
- }
9032
- },
9033
- "openai/gpt-4o-mini-tts": {
9034
- providerModelName: "gpt-4o-mini-tts",
9035
- aliases: [
9036
- "gpt-4o-mini-tts",
9037
- "gpt-4o-mini-tts-2025-03-20",
9038
- "gpt-4o-mini-tts-2025-12-15"
9039
- ],
9040
9201
  pricing: {
9041
- inputPerMTok: 2.5,
9042
- outputPerMTok: 10,
9043
- audioOutputPerMTok: 12
9202
+ perMChars: 15
9203
+ },
9204
+ preferredApi: "responses",
9205
+ supportedApis: [
9206
+ "responses",
9207
+ "completions"
9208
+ ],
9209
+ capabilities: {
9210
+ toolUse: false,
9211
+ streaming: true,
9212
+ structuredOutput: false,
9213
+ vision: false,
9214
+ audio: false,
9215
+ video: false,
9216
+ imageGeneration: false,
9217
+ audioGeneration: true,
9218
+ videoGeneration: false
9219
+ },
9220
+ reasoning: {
9221
+ supported: false,
9222
+ automatic: false,
9223
+ effortControl: false,
9224
+ encryptedContent: false,
9225
+ summaryAvailable: false
9226
+ },
9227
+ type: "tts",
9228
+ inputModalities: [
9229
+ "text"
9230
+ ],
9231
+ outputModalities: [
9232
+ "audio"
9233
+ ],
9234
+ family: "tts",
9235
+ version: "1",
9236
+ status: "legacy",
9237
+ active: true,
9238
+ mediaParams: {
9239
+ voice: {
9240
+ values: [
9241
+ "alloy",
9242
+ "ash",
9243
+ "ballad",
9244
+ "coral",
9245
+ "echo",
9246
+ "fable",
9247
+ "onyx",
9248
+ "nova",
9249
+ "sage",
9250
+ "shimmer",
9251
+ "verse",
9252
+ "marin",
9253
+ "cedar"
9254
+ ],
9255
+ default: "alloy"
9256
+ },
9257
+ format: {
9258
+ values: [
9259
+ "mp3",
9260
+ "opus",
9261
+ "aac",
9262
+ "flac",
9263
+ "wav",
9264
+ "pcm"
9265
+ ],
9266
+ default: "mp3"
9267
+ },
9268
+ speed: {
9269
+ min: 0.25,
9270
+ max: 4,
9271
+ default: 1
9272
+ }
9273
+ }
9274
+ },
9275
+ "openai/tts-1-hd": {
9276
+ providerModelName: "tts-1-hd",
9277
+ aliases: [
9278
+ "tts-1-hd",
9279
+ "tts-1-hd-1106"
9280
+ ],
9281
+ pricing: {
9282
+ perMChars: 30
9283
+ },
9284
+ preferredApi: "responses",
9285
+ supportedApis: [
9286
+ "responses",
9287
+ "completions"
9288
+ ],
9289
+ capabilities: {
9290
+ toolUse: false,
9291
+ streaming: true,
9292
+ structuredOutput: false,
9293
+ vision: false,
9294
+ audio: false,
9295
+ video: false,
9296
+ imageGeneration: false,
9297
+ audioGeneration: true,
9298
+ videoGeneration: false
9299
+ },
9300
+ reasoning: {
9301
+ supported: false,
9302
+ automatic: false,
9303
+ effortControl: false,
9304
+ encryptedContent: false,
9305
+ summaryAvailable: false
9306
+ },
9307
+ type: "tts",
9308
+ inputModalities: [
9309
+ "text"
9310
+ ],
9311
+ outputModalities: [
9312
+ "audio"
9313
+ ],
9314
+ family: "tts",
9315
+ version: "1",
9316
+ status: "legacy",
9317
+ active: true,
9318
+ mediaParams: {
9319
+ voice: {
9320
+ values: [
9321
+ "alloy",
9322
+ "ash",
9323
+ "ballad",
9324
+ "coral",
9325
+ "echo",
9326
+ "fable",
9327
+ "onyx",
9328
+ "nova",
9329
+ "sage",
9330
+ "shimmer",
9331
+ "verse",
9332
+ "marin",
9333
+ "cedar"
9334
+ ],
9335
+ default: "alloy"
9336
+ },
9337
+ format: {
9338
+ values: [
9339
+ "mp3",
9340
+ "opus",
9341
+ "aac",
9342
+ "flac",
9343
+ "wav",
9344
+ "pcm"
9345
+ ],
9346
+ default: "mp3"
9347
+ },
9348
+ speed: {
9349
+ min: 0.25,
9350
+ max: 4,
9351
+ default: 1
9352
+ }
9353
+ }
9354
+ },
9355
+ "openai/gpt-4o-mini-tts": {
9356
+ providerModelName: "gpt-4o-mini-tts",
9357
+ aliases: [
9358
+ "gpt-4o-mini-tts",
9359
+ "gpt-4o-mini-tts-2025-03-20",
9360
+ "gpt-4o-mini-tts-2025-12-15"
9361
+ ],
9362
+ pricing: {
9363
+ inputPerMTok: 2.5,
9364
+ outputPerMTok: 10,
9365
+ audioOutputPerMTok: 12
9044
9366
  },
9045
9367
  preferredApi: "responses",
9046
9368
  supportedApis: [
@@ -9118,7 +9440,9 @@ var catalog_default3 = {
9118
9440
  aliases: [
9119
9441
  "whisper-1"
9120
9442
  ],
9121
- pricing: { perMinute: 6e-3 },
9443
+ pricing: {
9444
+ perMinute: 6e-3
9445
+ },
9122
9446
  preferredApi: "responses",
9123
9447
  supportedApis: [
9124
9448
  "responses",
@@ -9152,7 +9476,8 @@ var catalog_default3 = {
9152
9476
  family: "whisper",
9153
9477
  version: "1",
9154
9478
  status: "legacy",
9155
- active: true
9479
+ active: true,
9480
+ contextWindow: 16e3
9156
9481
  },
9157
9482
  "openai/gpt-4o-transcribe": {
9158
9483
  providerModelName: "gpt-4o-transcribe",
@@ -9344,6 +9669,300 @@ var catalog_default3 = {
9344
9669
  version: "1",
9345
9670
  status: "stable",
9346
9671
  active: true
9672
+ },
9673
+ "openai/gpt-realtime-2.1-mini": {
9674
+ providerModelName: "gpt-realtime-2.1-mini",
9675
+ aliases: [
9676
+ "gpt-realtime-2.1-mini"
9677
+ ],
9678
+ pricing: {
9679
+ inputPerMTok: 10,
9680
+ cacheReadPerMTok: 0.3,
9681
+ outputPerMTok: 20
9682
+ },
9683
+ preferredApi: "responses",
9684
+ supportedApis: [
9685
+ "responses",
9686
+ "completions"
9687
+ ],
9688
+ contextWindow: 128e3,
9689
+ maxOutput: 4096,
9690
+ capabilities: {
9691
+ toolUse: true,
9692
+ streaming: true,
9693
+ structuredOutput: false,
9694
+ vision: false,
9695
+ audio: true,
9696
+ video: false,
9697
+ imageGeneration: false,
9698
+ audioGeneration: false,
9699
+ videoGeneration: false
9700
+ },
9701
+ reasoning: {
9702
+ supported: false,
9703
+ automatic: false,
9704
+ effortControl: false,
9705
+ encryptedContent: false,
9706
+ summaryAvailable: false
9707
+ },
9708
+ type: "realtime",
9709
+ inputModalities: [
9710
+ "text",
9711
+ "audio"
9712
+ ],
9713
+ outputModalities: [
9714
+ "text"
9715
+ ],
9716
+ family: "gpt-realtime",
9717
+ version: "2.1",
9718
+ status: "stable",
9719
+ active: true
9720
+ },
9721
+ "openai/gpt-realtime-2.1": {
9722
+ providerModelName: "gpt-realtime-2.1",
9723
+ aliases: [
9724
+ "gpt-realtime-2.1"
9725
+ ],
9726
+ pricing: {
9727
+ inputPerMTok: 32,
9728
+ cacheReadPerMTok: 0.4,
9729
+ outputPerMTok: 64
9730
+ },
9731
+ preferredApi: "responses",
9732
+ supportedApis: [
9733
+ "responses",
9734
+ "completions"
9735
+ ],
9736
+ contextWindow: 128e3,
9737
+ maxOutput: 32e3,
9738
+ capabilities: {
9739
+ toolUse: true,
9740
+ streaming: true,
9741
+ structuredOutput: false,
9742
+ vision: false,
9743
+ audio: true,
9744
+ video: false,
9745
+ imageGeneration: false,
9746
+ audioGeneration: false,
9747
+ videoGeneration: false
9748
+ },
9749
+ reasoning: {
9750
+ supported: false,
9751
+ automatic: false,
9752
+ effortControl: false,
9753
+ encryptedContent: false,
9754
+ summaryAvailable: false
9755
+ },
9756
+ type: "realtime",
9757
+ inputModalities: [
9758
+ "text",
9759
+ "audio"
9760
+ ],
9761
+ outputModalities: [
9762
+ "text"
9763
+ ],
9764
+ family: "gpt-realtime",
9765
+ version: "2.1",
9766
+ status: "stable",
9767
+ active: true
9768
+ },
9769
+ "openai/gpt-5.6-sol": {
9770
+ providerModelName: "gpt-5.6-sol",
9771
+ aliases: [
9772
+ "gpt-5.6-sol"
9773
+ ],
9774
+ pricing: {
9775
+ inputPerMTok: 5,
9776
+ outputPerMTok: 30,
9777
+ cacheReadPerMTok: 0.5,
9778
+ tiers: {
9779
+ batch: {
9780
+ inputPerMTok: 2.5,
9781
+ outputPerMTok: 15,
9782
+ cacheReadPerMTok: 0.25
9783
+ },
9784
+ flex: {
9785
+ inputPerMTok: 2.5,
9786
+ outputPerMTok: 15,
9787
+ cacheReadPerMTok: 0.25
9788
+ },
9789
+ priority: {
9790
+ inputPerMTok: 10,
9791
+ outputPerMTok: 60,
9792
+ cacheReadPerMTok: 1
9793
+ }
9794
+ }
9795
+ },
9796
+ preferredApi: "responses",
9797
+ supportedApis: [
9798
+ "responses",
9799
+ "completions"
9800
+ ],
9801
+ contextWindow: 105e4,
9802
+ maxOutput: 128e3,
9803
+ capabilities: {
9804
+ toolUse: true,
9805
+ streaming: true,
9806
+ structuredOutput: true,
9807
+ vision: true,
9808
+ audio: false,
9809
+ video: false,
9810
+ imageGeneration: false,
9811
+ audioGeneration: false,
9812
+ videoGeneration: false,
9813
+ webSearch: true
9814
+ },
9815
+ reasoning: {
9816
+ supported: true,
9817
+ automatic: false,
9818
+ effortControl: false,
9819
+ encryptedContent: false,
9820
+ summaryAvailable: false
9821
+ },
9822
+ type: "chat",
9823
+ inputModalities: [
9824
+ "text",
9825
+ "image"
9826
+ ],
9827
+ outputModalities: [
9828
+ "text"
9829
+ ],
9830
+ family: "gpt-sol",
9831
+ version: "5.6",
9832
+ status: "stable",
9833
+ active: true
9834
+ },
9835
+ "openai/gpt-5.6-terra": {
9836
+ providerModelName: "gpt-5.6-terra",
9837
+ aliases: [
9838
+ "gpt-5.6-terra"
9839
+ ],
9840
+ pricing: {
9841
+ inputPerMTok: 2.5,
9842
+ outputPerMTok: 15,
9843
+ cacheReadPerMTok: 0.25,
9844
+ tiers: {
9845
+ batch: {
9846
+ inputPerMTok: 1.25,
9847
+ outputPerMTok: 7.5,
9848
+ cacheReadPerMTok: 0.125
9849
+ },
9850
+ flex: {
9851
+ inputPerMTok: 1.25,
9852
+ outputPerMTok: 7.5,
9853
+ cacheReadPerMTok: 0.125
9854
+ },
9855
+ priority: {
9856
+ inputPerMTok: 5,
9857
+ outputPerMTok: 30,
9858
+ cacheReadPerMTok: 0.5
9859
+ }
9860
+ }
9861
+ },
9862
+ preferredApi: "responses",
9863
+ supportedApis: [
9864
+ "responses",
9865
+ "completions"
9866
+ ],
9867
+ contextWindow: 105e4,
9868
+ maxOutput: 128e3,
9869
+ capabilities: {
9870
+ toolUse: true,
9871
+ streaming: true,
9872
+ structuredOutput: true,
9873
+ vision: true,
9874
+ audio: false,
9875
+ video: false,
9876
+ imageGeneration: false,
9877
+ audioGeneration: false,
9878
+ videoGeneration: false,
9879
+ webSearch: true
9880
+ },
9881
+ reasoning: {
9882
+ supported: true,
9883
+ automatic: false,
9884
+ effortControl: false,
9885
+ encryptedContent: false,
9886
+ summaryAvailable: false
9887
+ },
9888
+ type: "chat",
9889
+ inputModalities: [
9890
+ "text",
9891
+ "image"
9892
+ ],
9893
+ outputModalities: [
9894
+ "text"
9895
+ ],
9896
+ family: "gpt-terra",
9897
+ version: "5.6",
9898
+ status: "stable",
9899
+ active: true
9900
+ },
9901
+ "openai/gpt-5.6-luna": {
9902
+ providerModelName: "gpt-5.6-luna",
9903
+ aliases: [
9904
+ "gpt-5.6-luna"
9905
+ ],
9906
+ pricing: {
9907
+ inputPerMTok: 1,
9908
+ outputPerMTok: 6,
9909
+ cacheReadPerMTok: 0.1,
9910
+ tiers: {
9911
+ batch: {
9912
+ inputPerMTok: 0.5,
9913
+ outputPerMTok: 3,
9914
+ cacheReadPerMTok: 0.05
9915
+ },
9916
+ flex: {
9917
+ inputPerMTok: 0.5,
9918
+ outputPerMTok: 3,
9919
+ cacheReadPerMTok: 0.05
9920
+ },
9921
+ priority: {
9922
+ inputPerMTok: 2,
9923
+ outputPerMTok: 12,
9924
+ cacheReadPerMTok: 0.2
9925
+ }
9926
+ }
9927
+ },
9928
+ preferredApi: "responses",
9929
+ supportedApis: [
9930
+ "responses",
9931
+ "completions"
9932
+ ],
9933
+ contextWindow: 105e4,
9934
+ maxOutput: 128e3,
9935
+ capabilities: {
9936
+ toolUse: true,
9937
+ streaming: true,
9938
+ structuredOutput: true,
9939
+ vision: true,
9940
+ audio: false,
9941
+ video: false,
9942
+ imageGeneration: false,
9943
+ audioGeneration: false,
9944
+ videoGeneration: false,
9945
+ webSearch: true
9946
+ },
9947
+ reasoning: {
9948
+ supported: true,
9949
+ automatic: false,
9950
+ effortControl: false,
9951
+ encryptedContent: false,
9952
+ summaryAvailable: false
9953
+ },
9954
+ type: "chat",
9955
+ inputModalities: [
9956
+ "text",
9957
+ "image"
9958
+ ],
9959
+ outputModalities: [
9960
+ "text"
9961
+ ],
9962
+ family: "gpt-luna",
9963
+ version: "5.6",
9964
+ status: "stable",
9965
+ active: true
9347
9966
  }
9348
9967
  };
9349
9968
 
@@ -9451,7 +10070,7 @@ var catalog_default4 = {
9451
10070
  supportedApis: [
9452
10071
  "completions"
9453
10072
  ],
9454
- contextWindow: 128e3,
10073
+ contextWindow: 1e6,
9455
10074
  capabilities: {
9456
10075
  toolUse: false,
9457
10076
  streaming: true,
@@ -9810,7 +10429,7 @@ var catalog_default4 = {
9810
10429
  capabilities: {
9811
10430
  toolUse: false,
9812
10431
  streaming: true,
9813
- structuredOutput: false,
10432
+ structuredOutput: true,
9814
10433
  vision: false,
9815
10434
  audio: false,
9816
10435
  video: false,
@@ -12410,7 +13029,7 @@ var catalog_default4 = {
12410
13029
  "openai/gpt-oss-120b:free"
12411
13030
  ],
12412
13031
  pricing: {
12413
- inputPerMTok: 0.039,
13032
+ inputPerMTok: 0.036,
12414
13033
  outputPerMTok: 0.18
12415
13034
  },
12416
13035
  preferredApi: "completions",
@@ -13461,7 +14080,8 @@ var catalog_default4 = {
13461
14080
  "openrouter/gemini-3-pro-image": {
13462
14081
  providerModelName: "google/gemini-3-pro-image-preview",
13463
14082
  aliases: [
13464
- "google/gemini-3-pro-image-preview"
14083
+ "google/gemini-3-pro-image-preview",
14084
+ "google/gemini-3-pro-image"
13465
14085
  ],
13466
14086
  pricing: {
13467
14087
  inputPerMTok: 2,
@@ -13533,7 +14153,8 @@ var catalog_default4 = {
13533
14153
  "openrouter/gemini-3.1-flash-image": {
13534
14154
  providerModelName: "google/gemini-3.1-flash-image-preview",
13535
14155
  aliases: [
13536
- "google/gemini-3.1-flash-image-preview"
14156
+ "google/gemini-3.1-flash-image-preview",
14157
+ "google/gemini-3.1-flash-image"
13537
14158
  ],
13538
14159
  pricing: {
13539
14160
  inputPerMTok: 0.5,
@@ -14066,8 +14687,8 @@ var catalog_default4 = {
14066
14687
  "x-ai/grok-4.20-multi-agent"
14067
14688
  ],
14068
14689
  pricing: {
14069
- inputPerMTok: 2,
14070
- outputPerMTok: 6,
14690
+ inputPerMTok: 1.25,
14691
+ outputPerMTok: 2.5,
14071
14692
  cacheReadPerMTok: 0.2
14072
14693
  },
14073
14694
  preferredApi: "completions",
@@ -14249,8 +14870,8 @@ var catalog_default4 = {
14249
14870
  "deepseek/deepseek-chat-v3-0324"
14250
14871
  ],
14251
14872
  pricing: {
14252
- inputPerMTok: 0.2,
14253
- outputPerMTok: 0.77,
14873
+ inputPerMTok: 0.24,
14874
+ outputPerMTok: 0.9,
14254
14875
  cacheReadPerMTok: 0.135
14255
14876
  },
14256
14877
  preferredApi: "completions",
@@ -14343,8 +14964,9 @@ var catalog_default4 = {
14343
14964
  "deepseek/deepseek-v3.2-exp"
14344
14965
  ],
14345
14966
  pricing: {
14346
- inputPerMTok: 0.2288,
14347
- outputPerMTok: 0.3432
14967
+ inputPerMTok: 0.2145,
14968
+ outputPerMTok: 0.32175,
14969
+ cacheReadPerMTok: 0.02145
14348
14970
  },
14349
14971
  preferredApi: "completions",
14350
14972
  supportedApis: [
@@ -14388,9 +15010,9 @@ var catalog_default4 = {
14388
15010
  "deepseek/deepseek-v4-flash"
14389
15011
  ],
14390
15012
  pricing: {
14391
- inputPerMTok: 0.098,
14392
- outputPerMTok: 0.196,
14393
- cacheReadPerMTok: 0.02
15013
+ inputPerMTok: 0.077,
15014
+ outputPerMTok: 0.154,
15015
+ cacheReadPerMTok: 0.0154
14394
15016
  },
14395
15017
  preferredApi: "completions",
14396
15018
  supportedApis: [
@@ -14752,8 +15374,8 @@ var catalog_default4 = {
14752
15374
  "qwen/qwen3-8b"
14753
15375
  ],
14754
15376
  pricing: {
14755
- inputPerMTok: 0.05,
14756
- outputPerMTok: 0.4,
15377
+ inputPerMTok: 0.117,
15378
+ outputPerMTok: 0.455,
14757
15379
  cacheReadPerMTok: 0.05
14758
15380
  },
14759
15381
  preferredApi: "completions",
@@ -15214,14 +15836,15 @@ var catalog_default4 = {
15214
15836
  "qwen/qwen3.5-397b-a17b"
15215
15837
  ],
15216
15838
  pricing: {
15217
- inputPerMTok: 0.39,
15218
- outputPerMTok: 2.34
15839
+ inputPerMTok: 0.385,
15840
+ outputPerMTok: 2.45,
15841
+ cacheReadPerMTok: 0.111
15219
15842
  },
15220
15843
  preferredApi: "completions",
15221
15844
  supportedApis: [
15222
15845
  "completions"
15223
15846
  ],
15224
- contextWindow: 262144,
15847
+ contextWindow: 256e3,
15225
15848
  maxOutput: 65536,
15226
15849
  capabilities: {
15227
15850
  toolUse: true,
@@ -15260,8 +15883,9 @@ var catalog_default4 = {
15260
15883
  "qwen/qwen3.6-27b"
15261
15884
  ],
15262
15885
  pricing: {
15263
- inputPerMTok: 0.2885,
15264
- outputPerMTok: 3.17
15886
+ inputPerMTok: 0.285,
15887
+ outputPerMTok: 2.4,
15888
+ cacheReadPerMTok: 0.15
15265
15889
  },
15266
15890
  preferredApi: "completions",
15267
15891
  supportedApis: [
@@ -15306,7 +15930,7 @@ var catalog_default4 = {
15306
15930
  "qwen/qwen3.6-35b-a3b"
15307
15931
  ],
15308
15932
  pricing: {
15309
- inputPerMTok: 0.15,
15933
+ inputPerMTok: 0.14,
15310
15934
  outputPerMTok: 1,
15311
15935
  cacheReadPerMTok: 0.05
15312
15936
  },
@@ -15911,8 +16535,8 @@ var catalog_default4 = {
15911
16535
  "qwen/qwen3-vl-8b-thinking"
15912
16536
  ],
15913
16537
  pricing: {
15914
- inputPerMTok: 0.08,
15915
- outputPerMTok: 0.5
16538
+ inputPerMTok: 0.117,
16539
+ outputPerMTok: 0.455
15916
16540
  },
15917
16541
  preferredApi: "completions",
15918
16542
  supportedApis: [
@@ -16327,8 +16951,8 @@ var catalog_default4 = {
16327
16951
  "meta-llama/llama-3.2-3b-instruct:free"
16328
16952
  ],
16329
16953
  pricing: {
16330
- inputPerMTok: 0.0509,
16331
- outputPerMTok: 0.335
16954
+ inputPerMTok: 0.05,
16955
+ outputPerMTok: 0.33
16332
16956
  },
16333
16957
  preferredApi: "completions",
16334
16958
  supportedApis: [
@@ -16410,7 +17034,11 @@ var catalog_default4 = {
16410
17034
  family: "llama",
16411
17035
  version: "3.2",
16412
17036
  status: "legacy",
16413
- active: true
17037
+ active: true,
17038
+ deprecation: {
17039
+ shutdownDate: "2026-07-17",
17040
+ source: "openrouter"
17041
+ }
16414
17042
  },
16415
17043
  "openrouter/llama-3.3-70b": {
16416
17044
  providerModelName: "meta-llama/llama-3.3-70b-instruct",
@@ -16588,7 +17216,8 @@ var catalog_default4 = {
16588
17216
  family: "llama-guard",
16589
17217
  version: "3",
16590
17218
  status: "stable",
16591
- active: true
17219
+ active: true,
17220
+ contextWindow: 163840
16592
17221
  },
16593
17222
  "openrouter/llama-guard-4-12b": {
16594
17223
  providerModelName: "meta-llama/llama-guard-4-12b",
@@ -17292,9 +17921,9 @@ var catalog_default4 = {
17292
17921
  "moonshotai/kimi-k2.6"
17293
17922
  ],
17294
17923
  pricing: {
17295
- inputPerMTok: 0.68,
17924
+ inputPerMTok: 0.66,
17296
17925
  outputPerMTok: 3.41,
17297
- cacheReadPerMTok: 0.34
17926
+ cacheReadPerMTok: 0.15
17298
17927
  },
17299
17928
  preferredApi: "completions",
17300
17929
  supportedApis: [
@@ -17381,7 +18010,7 @@ var catalog_default4 = {
17381
18010
  status: "legacy",
17382
18011
  active: true,
17383
18012
  deprecation: {
17384
- shutdownDate: "2026-06-19",
18013
+ shutdownDate: "2026-12-31",
17385
18014
  source: "openrouter"
17386
18015
  }
17387
18016
  },
@@ -17532,9 +18161,9 @@ var catalog_default4 = {
17532
18161
  "z-ai/glm-5.1"
17533
18162
  ],
17534
18163
  pricing: {
17535
- inputPerMTok: 0.98,
17536
- outputPerMTok: 3.08,
17537
- cacheReadPerMTok: 0.182
18164
+ inputPerMTok: 0.966,
18165
+ outputPerMTok: 3.036,
18166
+ cacheReadPerMTok: 0.1794
17538
18167
  },
17539
18168
  preferredApi: "completions",
17540
18169
  supportedApis: [
@@ -17671,7 +18300,7 @@ var catalog_default4 = {
17671
18300
  ],
17672
18301
  pricing: {
17673
18302
  inputPerMTok: 0.255,
17674
- outputPerMTok: 1,
18303
+ outputPerMTok: 1.02,
17675
18304
  cacheReadPerMTok: 0.03
17676
18305
  },
17677
18306
  preferredApi: "completions",
@@ -17762,8 +18391,8 @@ var catalog_default4 = {
17762
18391
  "minimax/minimax-m2.7"
17763
18392
  ],
17764
18393
  pricing: {
17765
- inputPerMTok: 0.25,
17766
- outputPerMTok: 1,
18394
+ inputPerMTok: 0.24,
18395
+ outputPerMTok: 0.96,
17767
18396
  cacheReadPerMTok: 0.05
17768
18397
  },
17769
18398
  preferredApi: "completions",
@@ -17982,7 +18611,11 @@ var catalog_default4 = {
17982
18611
  family: "nemotron",
17983
18612
  version: "1.5",
17984
18613
  status: "stable",
17985
- active: true
18614
+ active: true,
18615
+ deprecation: {
18616
+ shutdownDate: "2026-07-17",
18617
+ source: "openrouter"
18618
+ }
17986
18619
  },
17987
18620
  "openrouter/nemotron-3-nano-30b-a3b": {
17988
18621
  providerModelName: "nvidia/nemotron-3-nano-30b-a3b",
@@ -18038,7 +18671,7 @@ var catalog_default4 = {
18038
18671
  "nvidia/nemotron-3-super-120b-a12b:free"
18039
18672
  ],
18040
18673
  pricing: {
18041
- inputPerMTok: 0.09,
18674
+ inputPerMTok: 0.08,
18042
18675
  outputPerMTok: 0.45
18043
18676
  },
18044
18677
  preferredApi: "completions",
@@ -18084,8 +18717,8 @@ var catalog_default4 = {
18084
18717
  ],
18085
18718
  pricing: {
18086
18719
  inputPerMTok: 0.5,
18087
- outputPerMTok: 2.5,
18088
- cacheReadPerMTok: 0.15
18720
+ outputPerMTok: 2.2,
18721
+ cacheReadPerMTok: 0.1
18089
18722
  },
18090
18723
  preferredApi: "completions",
18091
18724
  supportedApis: [
@@ -18585,7 +19218,7 @@ var catalog_default4 = {
18585
19218
  "microsoft/phi-4"
18586
19219
  ],
18587
19220
  pricing: {
18588
- inputPerMTok: 0.065,
19221
+ inputPerMTok: 0.07,
18589
19222
  outputPerMTok: 0.14
18590
19223
  },
18591
19224
  preferredApi: "completions",
@@ -19452,8 +20085,8 @@ var catalog_default4 = {
19452
20085
  "arcee-ai/trinity-large-thinking"
19453
20086
  ],
19454
20087
  pricing: {
19455
- inputPerMTok: 0.22,
19456
- outputPerMTok: 0.85,
20088
+ inputPerMTok: 0.25,
20089
+ outputPerMTok: 0.8,
19457
20090
  cacheReadPerMTok: 0.06
19458
20091
  },
19459
20092
  preferredApi: "completions",
@@ -20402,7 +21035,7 @@ var catalog_default4 = {
20402
21035
  "stepfun/step-3.5-flash"
20403
21036
  ],
20404
21037
  pricing: {
20405
- inputPerMTok: 0.09,
21038
+ inputPerMTok: 0.1,
20406
21039
  outputPerMTok: 0.3,
20407
21040
  cacheReadPerMTok: 0.02
20408
21041
  },
@@ -20537,7 +21170,9 @@ var catalog_default4 = {
20537
21170
  "openrouter/hunyuan-hy3": {
20538
21171
  providerModelName: "tencent/hy3-preview",
20539
21172
  aliases: [
20540
- "tencent/hy3-preview"
21173
+ "tencent/hy3-preview",
21174
+ "tencent/hy3",
21175
+ "tencent/hy3:free"
20541
21176
  ],
20542
21177
  pricing: {
20543
21178
  inputPerMTok: 0.063,
@@ -20721,9 +21356,9 @@ var catalog_default4 = {
20721
21356
  "xiaomi/mimo-v2.5"
20722
21357
  ],
20723
21358
  pricing: {
20724
- inputPerMTok: 0.14,
21359
+ inputPerMTok: 0.105,
20725
21360
  outputPerMTok: 0.28,
20726
- cacheReadPerMTok: 28e-4
21361
+ cacheReadPerMTok: 0.028
20727
21362
  },
20728
21363
  preferredApi: "completions",
20729
21364
  supportedApis: [
@@ -20812,11 +21447,13 @@ var catalog_default4 = {
20812
21447
  "openrouter/nex-n2-pro": {
20813
21448
  providerModelName: "nex-agi/nex-n2-pro:free",
20814
21449
  aliases: [
20815
- "nex-agi/nex-n2-pro:free"
21450
+ "nex-agi/nex-n2-pro:free",
21451
+ "nex-agi/nex-n2-pro"
20816
21452
  ],
20817
21453
  pricing: {
20818
- inputPerMTok: 0,
20819
- outputPerMTok: 0
21454
+ inputPerMTok: 0.25,
21455
+ outputPerMTok: 1,
21456
+ cacheReadPerMTok: 0.025
20820
21457
  },
20821
21458
  preferredApi: "completions",
20822
21459
  supportedApis: [
@@ -20904,7 +21541,8 @@ var catalog_default4 = {
20904
21541
  "openrouter/laguna-m.1": {
20905
21542
  providerModelName: "poolside/laguna-m.1:free",
20906
21543
  aliases: [
20907
- "poolside/laguna-m.1:free"
21544
+ "poolside/laguna-m.1:free",
21545
+ "poolside/laguna-m.1"
20908
21546
  ],
20909
21547
  pricing: {
20910
21548
  inputPerMTok: 0,
@@ -21084,7 +21722,8 @@ var catalog_default4 = {
21084
21722
  "openrouter/dolphin-mistral-24b-venice": {
21085
21723
  providerModelName: "cognitivecomputations/dolphin-mistral-24b-venice-edition:free",
21086
21724
  aliases: [
21087
- "cognitivecomputations/dolphin-mistral-24b-venice-edition:free"
21725
+ "cognitivecomputations/dolphin-mistral-24b-venice-edition:free",
21726
+ "cognitivecomputations/dolphin-mistral-24b-venice-edition"
21088
21727
  ],
21089
21728
  pricing: {
21090
21729
  inputPerMTok: 0,
@@ -21123,7 +21762,11 @@ var catalog_default4 = {
21123
21762
  family: "roleplay-finetunes",
21124
21763
  version: "1",
21125
21764
  status: "stable",
21126
- active: true
21765
+ active: true,
21766
+ deprecation: {
21767
+ shutdownDate: "2026-07-19",
21768
+ source: "openrouter"
21769
+ }
21127
21770
  },
21128
21771
  "openrouter/mythomax-l2-13b": {
21129
21772
  providerModelName: "gryphe/mythomax-l2-13b",
@@ -21359,15 +22002,15 @@ var catalog_default4 = {
21359
22002
  "thedrummer/rocinante-12b"
21360
22003
  ],
21361
22004
  pricing: {
21362
- inputPerMTok: 0.17,
21363
- outputPerMTok: 0.43
22005
+ inputPerMTok: 0.25,
22006
+ outputPerMTok: 0.5
21364
22007
  },
21365
22008
  preferredApi: "completions",
21366
22009
  supportedApis: [
21367
22010
  "completions"
21368
22011
  ],
21369
- contextWindow: 32768,
21370
- maxOutput: 32768,
22012
+ contextWindow: 65536,
22013
+ maxOutput: 65536,
21371
22014
  capabilities: {
21372
22015
  toolUse: true,
21373
22016
  streaming: true,
@@ -21533,35 +22176,23 @@ var catalog_default4 = {
21533
22176
  version: "2",
21534
22177
  status: "legacy",
21535
22178
  active: true
21536
- }
21537
- };
21538
-
21539
- // src/llm/providers/xai/catalog.json
21540
- var catalog_default5 = {
21541
- "xai/grok-4.20": {
21542
- providerModelName: "grok-4.20-0309-reasoning",
22179
+ },
22180
+ "openrouter/claude-sonnet-5": {
22181
+ providerModelName: "anthropic/claude-sonnet-5",
21543
22182
  aliases: [
21544
- "grok-4.20-0309-reasoning"
22183
+ "anthropic/claude-sonnet-5"
21545
22184
  ],
21546
22185
  pricing: {
21547
- inputPerMTok: 1.25,
21548
- outputPerMTok: 2.5,
21549
- cacheReadPerMTok: 0.2,
21550
- tiers: {
21551
- "long-context": {
21552
- inputPerMTok: 2.5,
21553
- outputPerMTok: 5,
21554
- cacheReadPerMTok: 0.4
21555
- }
21556
- }
22186
+ inputPerMTok: 2,
22187
+ outputPerMTok: 10,
22188
+ cacheReadPerMTok: 0.2
21557
22189
  },
21558
- preferredApi: "responses",
22190
+ preferredApi: "completions",
21559
22191
  supportedApis: [
21560
- "responses",
21561
22192
  "completions"
21562
22193
  ],
21563
- contextWindow: 2e6,
21564
- maxOutput: 2e6,
22194
+ contextWindow: 1e6,
22195
+ maxOutput: 128e3,
21565
22196
  capabilities: {
21566
22197
  toolUse: true,
21567
22198
  streaming: true,
@@ -21574,7 +22205,7 @@ var catalog_default5 = {
21574
22205
  videoGeneration: false
21575
22206
  },
21576
22207
  reasoning: {
21577
- supported: false,
22208
+ supported: true,
21578
22209
  automatic: false,
21579
22210
  effortControl: false,
21580
22211
  encryptedContent: false,
@@ -21588,33 +22219,27 @@ var catalog_default5 = {
21588
22219
  outputModalities: [
21589
22220
  "text"
21590
22221
  ],
21591
- family: "grok",
21592
- version: "4.20",
22222
+ family: "claude-sonnet",
22223
+ version: "5",
21593
22224
  status: "stable",
21594
22225
  active: true
21595
22226
  },
21596
- "xai/grok-4.20-non-reasoning": {
21597
- providerModelName: "grok-4.20-0309-non-reasoning",
22227
+ "openrouter/gpt-5.6-luna": {
22228
+ providerModelName: "openai/gpt-5.6-luna",
21598
22229
  aliases: [
21599
- "grok-4.20-0309-non-reasoning"
22230
+ "openai/gpt-5.6-luna"
21600
22231
  ],
21601
22232
  pricing: {
21602
- inputPerMTok: 1.25,
21603
- outputPerMTok: 2.5,
21604
- cacheReadPerMTok: 0.2,
21605
- tiers: {
21606
- "long-context": {
21607
- inputPerMTok: 2.5,
21608
- outputPerMTok: 5,
21609
- cacheReadPerMTok: 0.4
21610
- }
21611
- }
22233
+ inputPerMTok: 1,
22234
+ outputPerMTok: 6,
22235
+ cacheReadPerMTok: 0.1
21612
22236
  },
21613
- preferredApi: "responses",
22237
+ preferredApi: "completions",
21614
22238
  supportedApis: [
21615
- "responses",
21616
22239
  "completions"
21617
22240
  ],
22241
+ contextWindow: 105e4,
22242
+ maxOutput: 128e3,
21618
22243
  capabilities: {
21619
22244
  toolUse: true,
21620
22245
  streaming: true,
@@ -21627,7 +22252,7 @@ var catalog_default5 = {
21627
22252
  videoGeneration: false
21628
22253
  },
21629
22254
  reasoning: {
21630
- supported: false,
22255
+ supported: true,
21631
22256
  automatic: false,
21632
22257
  effortControl: false,
21633
22258
  encryptedContent: false,
@@ -21641,33 +22266,332 @@ var catalog_default5 = {
21641
22266
  outputModalities: [
21642
22267
  "text"
21643
22268
  ],
21644
- family: "grok",
21645
- version: "4.20",
22269
+ family: "gpt",
22270
+ version: "5.6",
21646
22271
  status: "stable",
21647
22272
  active: true
21648
22273
  },
21649
- "xai/grok-4.20-multi-agent": {
21650
- providerModelName: "grok-4.20-multi-agent-0309",
22274
+ "openrouter/gpt-5.6-terra": {
22275
+ providerModelName: "openai/gpt-5.6-terra",
21651
22276
  aliases: [
21652
- "grok-4.20-multi-agent-0309"
22277
+ "openai/gpt-5.6-terra"
21653
22278
  ],
21654
22279
  pricing: {
21655
- inputPerMTok: 1.25,
21656
- outputPerMTok: 2.5,
21657
- cacheReadPerMTok: 0.2,
21658
- tiers: {
21659
- "long-context": {
21660
- inputPerMTok: 2.5,
21661
- outputPerMTok: 5,
21662
- cacheReadPerMTok: 0.4
21663
- }
22280
+ inputPerMTok: 2.5,
22281
+ outputPerMTok: 15,
22282
+ cacheReadPerMTok: 0.25
22283
+ },
22284
+ preferredApi: "completions",
22285
+ supportedApis: [
22286
+ "completions"
22287
+ ],
22288
+ contextWindow: 105e4,
22289
+ maxOutput: 128e3,
22290
+ capabilities: {
22291
+ toolUse: true,
22292
+ streaming: true,
22293
+ structuredOutput: true,
22294
+ vision: true,
22295
+ audio: false,
22296
+ video: false,
22297
+ imageGeneration: false,
22298
+ audioGeneration: false,
22299
+ videoGeneration: false
22300
+ },
22301
+ reasoning: {
22302
+ supported: true,
22303
+ automatic: false,
22304
+ effortControl: false,
22305
+ encryptedContent: false,
22306
+ summaryAvailable: false
22307
+ },
22308
+ type: "chat",
22309
+ inputModalities: [
22310
+ "text",
22311
+ "image"
22312
+ ],
22313
+ outputModalities: [
22314
+ "text"
22315
+ ],
22316
+ family: "gpt",
22317
+ version: "5.6",
22318
+ status: "stable",
22319
+ active: true
22320
+ },
22321
+ "openrouter/gpt-5.6-sol": {
22322
+ providerModelName: "openai/gpt-5.6-sol",
22323
+ aliases: [
22324
+ "openai/gpt-5.6-sol"
22325
+ ],
22326
+ pricing: {
22327
+ inputPerMTok: 5,
22328
+ outputPerMTok: 30,
22329
+ cacheReadPerMTok: 0.5
22330
+ },
22331
+ preferredApi: "completions",
22332
+ supportedApis: [
22333
+ "completions"
22334
+ ],
22335
+ contextWindow: 105e4,
22336
+ maxOutput: 128e3,
22337
+ capabilities: {
22338
+ toolUse: true,
22339
+ streaming: true,
22340
+ structuredOutput: true,
22341
+ vision: true,
22342
+ audio: false,
22343
+ video: false,
22344
+ imageGeneration: false,
22345
+ audioGeneration: false,
22346
+ videoGeneration: false
22347
+ },
22348
+ reasoning: {
22349
+ supported: true,
22350
+ automatic: false,
22351
+ effortControl: false,
22352
+ encryptedContent: false,
22353
+ summaryAvailable: false
22354
+ },
22355
+ type: "chat",
22356
+ inputModalities: [
22357
+ "text",
22358
+ "image"
22359
+ ],
22360
+ outputModalities: [
22361
+ "text"
22362
+ ],
22363
+ family: "gpt",
22364
+ version: "5.6",
22365
+ status: "stable",
22366
+ active: true
22367
+ },
22368
+ "openrouter/gpt-5.6-luna-pro": {
22369
+ providerModelName: "openai/gpt-5.6-luna-pro",
22370
+ aliases: [
22371
+ "openai/gpt-5.6-luna-pro"
22372
+ ],
22373
+ pricing: {
22374
+ inputPerMTok: 1,
22375
+ outputPerMTok: 6,
22376
+ cacheReadPerMTok: 0.1
22377
+ },
22378
+ preferredApi: "completions",
22379
+ supportedApis: [
22380
+ "completions"
22381
+ ],
22382
+ contextWindow: 105e4,
22383
+ maxOutput: 128e3,
22384
+ capabilities: {
22385
+ toolUse: true,
22386
+ streaming: true,
22387
+ structuredOutput: true,
22388
+ vision: true,
22389
+ audio: false,
22390
+ video: false,
22391
+ imageGeneration: false,
22392
+ audioGeneration: false,
22393
+ videoGeneration: false
22394
+ },
22395
+ reasoning: {
22396
+ supported: true,
22397
+ automatic: false,
22398
+ effortControl: false,
22399
+ encryptedContent: false,
22400
+ summaryAvailable: false
22401
+ },
22402
+ type: "chat",
22403
+ inputModalities: [
22404
+ "text",
22405
+ "image"
22406
+ ],
22407
+ outputModalities: [
22408
+ "text"
22409
+ ],
22410
+ family: "gpt-pro",
22411
+ version: "5.6",
22412
+ status: "stable",
22413
+ active: true
22414
+ },
22415
+ "openrouter/gpt-5.6-terra-pro": {
22416
+ providerModelName: "openai/gpt-5.6-terra-pro",
22417
+ aliases: [
22418
+ "openai/gpt-5.6-terra-pro"
22419
+ ],
22420
+ pricing: {
22421
+ inputPerMTok: 2.5,
22422
+ outputPerMTok: 15,
22423
+ cacheReadPerMTok: 0.25
22424
+ },
22425
+ preferredApi: "completions",
22426
+ supportedApis: [
22427
+ "completions"
22428
+ ],
22429
+ contextWindow: 105e4,
22430
+ maxOutput: 128e3,
22431
+ capabilities: {
22432
+ toolUse: true,
22433
+ streaming: true,
22434
+ structuredOutput: true,
22435
+ vision: true,
22436
+ audio: false,
22437
+ video: false,
22438
+ imageGeneration: false,
22439
+ audioGeneration: false,
22440
+ videoGeneration: false
22441
+ },
22442
+ reasoning: {
22443
+ supported: true,
22444
+ automatic: false,
22445
+ effortControl: false,
22446
+ encryptedContent: false,
22447
+ summaryAvailable: false
22448
+ },
22449
+ type: "chat",
22450
+ inputModalities: [
22451
+ "text",
22452
+ "image"
22453
+ ],
22454
+ outputModalities: [
22455
+ "text"
22456
+ ],
22457
+ family: "gpt-pro",
22458
+ version: "5.6",
22459
+ status: "stable",
22460
+ active: true
22461
+ },
22462
+ "openrouter/gpt-5.6-sol-pro": {
22463
+ providerModelName: "openai/gpt-5.6-sol-pro",
22464
+ aliases: [
22465
+ "openai/gpt-5.6-sol-pro"
22466
+ ],
22467
+ pricing: {
22468
+ inputPerMTok: 5,
22469
+ outputPerMTok: 30,
22470
+ cacheReadPerMTok: 0.5
22471
+ },
22472
+ preferredApi: "completions",
22473
+ supportedApis: [
22474
+ "completions"
22475
+ ],
22476
+ contextWindow: 105e4,
22477
+ maxOutput: 128e3,
22478
+ capabilities: {
22479
+ toolUse: true,
22480
+ streaming: true,
22481
+ structuredOutput: true,
22482
+ vision: true,
22483
+ audio: false,
22484
+ video: false,
22485
+ imageGeneration: false,
22486
+ audioGeneration: false,
22487
+ videoGeneration: false
22488
+ },
22489
+ reasoning: {
22490
+ supported: true,
22491
+ automatic: false,
22492
+ effortControl: false,
22493
+ encryptedContent: false,
22494
+ summaryAvailable: false
22495
+ },
22496
+ type: "chat",
22497
+ inputModalities: [
22498
+ "text",
22499
+ "image"
22500
+ ],
22501
+ outputModalities: [
22502
+ "text"
22503
+ ],
22504
+ family: "gpt-pro",
22505
+ version: "5.6",
22506
+ status: "stable",
22507
+ active: true
22508
+ },
22509
+ "openrouter/gemini-3.1-flash-lite-image": {
22510
+ providerModelName: "google/gemini-3.1-flash-lite-image",
22511
+ aliases: [
22512
+ "google/gemini-3.1-flash-lite-image"
22513
+ ],
22514
+ pricing: {
22515
+ inputPerMTok: 0.25,
22516
+ outputPerMTok: 1.5
22517
+ },
22518
+ preferredApi: "completions",
22519
+ supportedApis: [
22520
+ "completions"
22521
+ ],
22522
+ contextWindow: 65536,
22523
+ maxOutput: 66e3,
22524
+ capabilities: {
22525
+ toolUse: false,
22526
+ streaming: true,
22527
+ structuredOutput: false,
22528
+ vision: true,
22529
+ audio: false,
22530
+ video: false,
22531
+ imageGeneration: true,
22532
+ audioGeneration: false,
22533
+ videoGeneration: false
22534
+ },
22535
+ reasoning: {
22536
+ supported: true,
22537
+ automatic: false,
22538
+ effortControl: false,
22539
+ encryptedContent: false,
22540
+ summaryAvailable: false
22541
+ },
22542
+ type: "image",
22543
+ inputModalities: [
22544
+ "text",
22545
+ "image"
22546
+ ],
22547
+ outputModalities: [
22548
+ "image"
22549
+ ],
22550
+ family: "gemini-image",
22551
+ version: "3.1",
22552
+ status: "stable",
22553
+ active: true,
22554
+ mediaParams: {
22555
+ aspectRatio: {
22556
+ values: [
22557
+ "1:1",
22558
+ "2:3",
22559
+ "3:2",
22560
+ "3:4",
22561
+ "4:3",
22562
+ "4:5",
22563
+ "5:4",
22564
+ "9:16",
22565
+ "16:9",
22566
+ "21:9"
22567
+ ]
22568
+ },
22569
+ imageSize: {
22570
+ values: [
22571
+ "0.5K",
22572
+ "1K",
22573
+ "2K",
22574
+ "4K"
22575
+ ],
22576
+ default: "1K"
21664
22577
  }
22578
+ }
22579
+ },
22580
+ "openrouter/grok-4.5": {
22581
+ providerModelName: "x-ai/grok-4.5",
22582
+ aliases: [
22583
+ "x-ai/grok-4.5"
22584
+ ],
22585
+ pricing: {
22586
+ inputPerMTok: 2,
22587
+ outputPerMTok: 6,
22588
+ cacheReadPerMTok: 0.5
21665
22589
  },
21666
- preferredApi: "responses",
22590
+ preferredApi: "completions",
21667
22591
  supportedApis: [
21668
- "responses"
22592
+ "completions"
21669
22593
  ],
21670
- contextWindow: 2e6,
22594
+ contextWindow: 5e5,
21671
22595
  capabilities: {
21672
22596
  toolUse: true,
21673
22597
  streaming: true,
@@ -21680,7 +22604,7 @@ var catalog_default5 = {
21680
22604
  videoGeneration: false
21681
22605
  },
21682
22606
  reasoning: {
21683
- supported: false,
22607
+ supported: true,
21684
22608
  automatic: false,
21685
22609
  effortControl: false,
21686
22610
  encryptedContent: false,
@@ -21695,34 +22619,1030 @@ var catalog_default5 = {
21695
22619
  "text"
21696
22620
  ],
21697
22621
  family: "grok",
21698
- version: "4.20",
22622
+ version: "4.5",
21699
22623
  status: "stable",
21700
22624
  active: true
21701
22625
  },
21702
- "xai/grok-4.3": {
21703
- providerModelName: "grok-4.3",
22626
+ "openrouter/glm-5.2": {
22627
+ providerModelName: "z-ai/glm-5.2",
21704
22628
  aliases: [
21705
- "grok-4.3"
22629
+ "z-ai/glm-5.2"
21706
22630
  ],
21707
22631
  pricing: {
21708
- inputPerMTok: 1.25,
21709
- outputPerMTok: 2.5,
21710
- cacheReadPerMTok: 0.2,
21711
- tiers: {
21712
- "long-context": {
21713
- inputPerMTok: 2.5,
21714
- outputPerMTok: 5,
21715
- cacheReadPerMTok: 0.4
21716
- }
21717
- }
22632
+ inputPerMTok: 0.35,
22633
+ outputPerMTok: 1.1,
22634
+ cacheReadPerMTok: 0.065
21718
22635
  },
21719
- preferredApi: "responses",
22636
+ preferredApi: "completions",
21720
22637
  supportedApis: [
21721
- "responses",
21722
22638
  "completions"
21723
22639
  ],
21724
- contextWindow: 1e6,
21725
- maxOutput: 1e6,
22640
+ contextWindow: 1048576,
22641
+ maxOutput: 128e3,
22642
+ capabilities: {
22643
+ toolUse: true,
22644
+ streaming: true,
22645
+ structuredOutput: true,
22646
+ vision: false,
22647
+ audio: false,
22648
+ video: false,
22649
+ imageGeneration: false,
22650
+ audioGeneration: false,
22651
+ videoGeneration: false
22652
+ },
22653
+ reasoning: {
22654
+ supported: true,
22655
+ automatic: false,
22656
+ effortControl: false,
22657
+ encryptedContent: false,
22658
+ summaryAvailable: false
22659
+ },
22660
+ type: "chat",
22661
+ inputModalities: [
22662
+ "text"
22663
+ ],
22664
+ outputModalities: [
22665
+ "text"
22666
+ ],
22667
+ family: "glm",
22668
+ version: "5.2",
22669
+ status: "stable",
22670
+ active: true
22671
+ },
22672
+ "openrouter/glm-5v-turbo": {
22673
+ providerModelName: "z-ai/glm-5v-turbo",
22674
+ aliases: [
22675
+ "z-ai/glm-5v-turbo"
22676
+ ],
22677
+ pricing: {
22678
+ inputPerMTok: 1.2,
22679
+ outputPerMTok: 4,
22680
+ cacheReadPerMTok: 0.24
22681
+ },
22682
+ preferredApi: "completions",
22683
+ supportedApis: [
22684
+ "completions"
22685
+ ],
22686
+ contextWindow: 202752,
22687
+ maxOutput: 131072,
22688
+ capabilities: {
22689
+ toolUse: true,
22690
+ streaming: true,
22691
+ structuredOutput: true,
22692
+ vision: true,
22693
+ audio: false,
22694
+ video: false,
22695
+ imageGeneration: false,
22696
+ audioGeneration: false,
22697
+ videoGeneration: false
22698
+ },
22699
+ reasoning: {
22700
+ supported: true,
22701
+ automatic: false,
22702
+ effortControl: false,
22703
+ encryptedContent: false,
22704
+ summaryAvailable: false
22705
+ },
22706
+ type: "vision",
22707
+ inputModalities: [
22708
+ "text",
22709
+ "image"
22710
+ ],
22711
+ outputModalities: [
22712
+ "text"
22713
+ ],
22714
+ family: "glm",
22715
+ version: "5",
22716
+ status: "stable",
22717
+ active: true,
22718
+ deprecation: {
22719
+ shutdownDate: "2098-12-31",
22720
+ source: "openrouter"
22721
+ }
22722
+ },
22723
+ "openrouter/aion-3.0-mini": {
22724
+ providerModelName: "aion-labs/aion-3.0-mini",
22725
+ aliases: [
22726
+ "aion-labs/aion-3.0-mini"
22727
+ ],
22728
+ pricing: {
22729
+ inputPerMTok: 0.7,
22730
+ outputPerMTok: 1.4,
22731
+ cacheReadPerMTok: 0.18
22732
+ },
22733
+ preferredApi: "completions",
22734
+ supportedApis: [
22735
+ "completions"
22736
+ ],
22737
+ contextWindow: 131072,
22738
+ maxOutput: 32768,
22739
+ capabilities: {
22740
+ toolUse: true,
22741
+ streaming: true,
22742
+ structuredOutput: true,
22743
+ vision: false,
22744
+ audio: false,
22745
+ video: false,
22746
+ imageGeneration: false,
22747
+ audioGeneration: false,
22748
+ videoGeneration: false
22749
+ },
22750
+ reasoning: {
22751
+ supported: true,
22752
+ automatic: false,
22753
+ effortControl: false,
22754
+ encryptedContent: false,
22755
+ summaryAvailable: false
22756
+ },
22757
+ type: "chat",
22758
+ inputModalities: [
22759
+ "text"
22760
+ ],
22761
+ outputModalities: [
22762
+ "text"
22763
+ ],
22764
+ family: "aion",
22765
+ version: "3.0",
22766
+ status: "stable",
22767
+ active: true
22768
+ },
22769
+ "openrouter/aion-3.0": {
22770
+ providerModelName: "aion-labs/aion-3.0",
22771
+ aliases: [
22772
+ "aion-labs/aion-3.0"
22773
+ ],
22774
+ pricing: {
22775
+ inputPerMTok: 3,
22776
+ outputPerMTok: 6,
22777
+ cacheReadPerMTok: 0.75
22778
+ },
22779
+ preferredApi: "completions",
22780
+ supportedApis: [
22781
+ "completions"
22782
+ ],
22783
+ contextWindow: 131072,
22784
+ maxOutput: 32768,
22785
+ capabilities: {
22786
+ toolUse: true,
22787
+ streaming: true,
22788
+ structuredOutput: true,
22789
+ vision: false,
22790
+ audio: false,
22791
+ video: false,
22792
+ imageGeneration: false,
22793
+ audioGeneration: false,
22794
+ videoGeneration: false
22795
+ },
22796
+ reasoning: {
22797
+ supported: true,
22798
+ automatic: false,
22799
+ effortControl: false,
22800
+ encryptedContent: false,
22801
+ summaryAvailable: false
22802
+ },
22803
+ type: "chat",
22804
+ inputModalities: [
22805
+ "text"
22806
+ ],
22807
+ outputModalities: [
22808
+ "text"
22809
+ ],
22810
+ family: "aion",
22811
+ version: "3.0",
22812
+ status: "stable",
22813
+ active: true
22814
+ },
22815
+ "openrouter/nex-n2-mini": {
22816
+ providerModelName: "nex-agi/nex-n2-mini",
22817
+ aliases: [
22818
+ "nex-agi/nex-n2-mini"
22819
+ ],
22820
+ pricing: {
22821
+ inputPerMTok: 0.025,
22822
+ outputPerMTok: 0.1,
22823
+ cacheReadPerMTok: 25e-4
22824
+ },
22825
+ preferredApi: "completions",
22826
+ supportedApis: [
22827
+ "completions"
22828
+ ],
22829
+ contextWindow: 262144,
22830
+ maxOutput: 262144,
22831
+ capabilities: {
22832
+ toolUse: true,
22833
+ streaming: true,
22834
+ structuredOutput: true,
22835
+ vision: true,
22836
+ audio: false,
22837
+ video: false,
22838
+ imageGeneration: false,
22839
+ audioGeneration: false,
22840
+ videoGeneration: false
22841
+ },
22842
+ reasoning: {
22843
+ supported: true,
22844
+ automatic: false,
22845
+ effortControl: false,
22846
+ encryptedContent: false,
22847
+ summaryAvailable: false
22848
+ },
22849
+ type: "chat",
22850
+ inputModalities: [
22851
+ "text",
22852
+ "image"
22853
+ ],
22854
+ outputModalities: [
22855
+ "text"
22856
+ ],
22857
+ family: "nex",
22858
+ version: "2",
22859
+ status: "stable",
22860
+ active: true
22861
+ },
22862
+ "openrouter/laguna-xs.2.1": {
22863
+ providerModelName: "poolside/laguna-xs-2.1",
22864
+ aliases: [
22865
+ "poolside/laguna-xs-2.1",
22866
+ "poolside/laguna-xs-2.1:free"
22867
+ ],
22868
+ pricing: {
22869
+ inputPerMTok: 0.06,
22870
+ outputPerMTok: 0.12,
22871
+ cacheReadPerMTok: 0.03
22872
+ },
22873
+ preferredApi: "completions",
22874
+ supportedApis: [
22875
+ "completions"
22876
+ ],
22877
+ contextWindow: 262144,
22878
+ maxOutput: 32768,
22879
+ capabilities: {
22880
+ toolUse: true,
22881
+ streaming: true,
22882
+ structuredOutput: true,
22883
+ vision: false,
22884
+ audio: false,
22885
+ video: false,
22886
+ imageGeneration: false,
22887
+ audioGeneration: false,
22888
+ videoGeneration: false
22889
+ },
22890
+ reasoning: {
22891
+ supported: true,
22892
+ automatic: false,
22893
+ effortControl: false,
22894
+ encryptedContent: false,
22895
+ summaryAvailable: false
22896
+ },
22897
+ type: "code",
22898
+ inputModalities: [
22899
+ "text"
22900
+ ],
22901
+ outputModalities: [
22902
+ "text"
22903
+ ],
22904
+ family: "laguna",
22905
+ version: "2.1",
22906
+ status: "preview",
22907
+ active: true
22908
+ },
22909
+ "openrouter/fugu-ultra": {
22910
+ providerModelName: "sakana/fugu-ultra",
22911
+ aliases: [
22912
+ "sakana/fugu-ultra"
22913
+ ],
22914
+ pricing: {
22915
+ inputPerMTok: 5,
22916
+ outputPerMTok: 30,
22917
+ cacheReadPerMTok: 0.5
22918
+ },
22919
+ preferredApi: "completions",
22920
+ supportedApis: [
22921
+ "completions"
22922
+ ],
22923
+ contextWindow: 1e6,
22924
+ maxOutput: 128e3,
22925
+ capabilities: {
22926
+ toolUse: true,
22927
+ streaming: true,
22928
+ structuredOutput: true,
22929
+ vision: true,
22930
+ audio: false,
22931
+ video: false,
22932
+ imageGeneration: false,
22933
+ audioGeneration: false,
22934
+ videoGeneration: false,
22935
+ webSearch: true
22936
+ },
22937
+ reasoning: {
22938
+ supported: true,
22939
+ automatic: false,
22940
+ effortControl: false,
22941
+ encryptedContent: false,
22942
+ summaryAvailable: false
22943
+ },
22944
+ type: "chat",
22945
+ inputModalities: [
22946
+ "text",
22947
+ "image"
22948
+ ],
22949
+ outputModalities: [
22950
+ "text"
22951
+ ],
22952
+ family: "fugu",
22953
+ version: "1",
22954
+ status: "stable",
22955
+ active: true
22956
+ },
22957
+ "openrouter/north-mini-code": {
22958
+ providerModelName: "cohere/north-mini-code:free",
22959
+ aliases: [
22960
+ "cohere/north-mini-code:free"
22961
+ ],
22962
+ pricing: {
22963
+ inputPerMTok: 0,
22964
+ outputPerMTok: 0
22965
+ },
22966
+ preferredApi: "completions",
22967
+ supportedApis: [
22968
+ "completions"
22969
+ ],
22970
+ contextWindow: 256e3,
22971
+ maxOutput: 64e3,
22972
+ capabilities: {
22973
+ toolUse: true,
22974
+ streaming: true,
22975
+ structuredOutput: true,
22976
+ vision: false,
22977
+ audio: false,
22978
+ video: false,
22979
+ imageGeneration: false,
22980
+ audioGeneration: false,
22981
+ videoGeneration: false
22982
+ },
22983
+ reasoning: {
22984
+ supported: true,
22985
+ automatic: false,
22986
+ effortControl: false,
22987
+ encryptedContent: false,
22988
+ summaryAvailable: false
22989
+ },
22990
+ type: "code",
22991
+ inputModalities: [
22992
+ "text"
22993
+ ],
22994
+ outputModalities: [
22995
+ "text"
22996
+ ],
22997
+ family: "north-code",
22998
+ version: "1",
22999
+ status: "stable",
23000
+ active: true
23001
+ },
23002
+ "openrouter/kimi-k2.7-code": {
23003
+ providerModelName: "moonshotai/kimi-k2.7-code",
23004
+ aliases: [
23005
+ "moonshotai/kimi-k2.7-code"
23006
+ ],
23007
+ pricing: {
23008
+ inputPerMTok: 0.72,
23009
+ outputPerMTok: 3.49,
23010
+ cacheReadPerMTok: 0.159
23011
+ },
23012
+ preferredApi: "completions",
23013
+ supportedApis: [
23014
+ "completions"
23015
+ ],
23016
+ contextWindow: 262144,
23017
+ maxOutput: 262144,
23018
+ capabilities: {
23019
+ toolUse: true,
23020
+ streaming: true,
23021
+ structuredOutput: true,
23022
+ vision: true,
23023
+ audio: false,
23024
+ video: false,
23025
+ imageGeneration: false,
23026
+ audioGeneration: false,
23027
+ videoGeneration: false
23028
+ },
23029
+ reasoning: {
23030
+ supported: true,
23031
+ automatic: false,
23032
+ effortControl: false,
23033
+ encryptedContent: false,
23034
+ summaryAvailable: false
23035
+ },
23036
+ type: "code",
23037
+ inputModalities: [
23038
+ "text",
23039
+ "image"
23040
+ ],
23041
+ outputModalities: [
23042
+ "text"
23043
+ ],
23044
+ family: "kimi-code",
23045
+ version: "2.7",
23046
+ status: "stable",
23047
+ active: true
23048
+ }
23049
+ };
23050
+
23051
+ // src/llm/providers/xai/catalog.json
23052
+ var catalog_default5 = {
23053
+ "xai/grok-4.20": {
23054
+ providerModelName: "grok-4.20-0309-reasoning",
23055
+ aliases: [
23056
+ "grok-4.20-0309-reasoning"
23057
+ ],
23058
+ pricing: {
23059
+ inputPerMTok: 1.25,
23060
+ outputPerMTok: 2.5,
23061
+ cacheReadPerMTok: 0.2,
23062
+ tiers: {
23063
+ "long-context": {
23064
+ inputPerMTok: 2.5,
23065
+ outputPerMTok: 5,
23066
+ cacheReadPerMTok: 0.4
23067
+ }
23068
+ }
23069
+ },
23070
+ preferredApi: "responses",
23071
+ supportedApis: [
23072
+ "responses",
23073
+ "completions"
23074
+ ],
23075
+ contextWindow: 2e6,
23076
+ maxOutput: 2e6,
23077
+ capabilities: {
23078
+ toolUse: true,
23079
+ streaming: true,
23080
+ structuredOutput: true,
23081
+ vision: true,
23082
+ audio: false,
23083
+ video: false,
23084
+ imageGeneration: false,
23085
+ audioGeneration: false,
23086
+ videoGeneration: false
23087
+ },
23088
+ reasoning: {
23089
+ supported: false,
23090
+ automatic: false,
23091
+ effortControl: false,
23092
+ encryptedContent: false,
23093
+ summaryAvailable: false
23094
+ },
23095
+ type: "chat",
23096
+ inputModalities: [
23097
+ "text",
23098
+ "image"
23099
+ ],
23100
+ outputModalities: [
23101
+ "text"
23102
+ ],
23103
+ family: "grok",
23104
+ version: "4.20",
23105
+ status: "stable",
23106
+ active: true
23107
+ },
23108
+ "xai/grok-4.20-non-reasoning": {
23109
+ providerModelName: "grok-4.20-0309-non-reasoning",
23110
+ aliases: [
23111
+ "grok-4.20-0309-non-reasoning"
23112
+ ],
23113
+ pricing: {
23114
+ inputPerMTok: 1.25,
23115
+ outputPerMTok: 2.5,
23116
+ cacheReadPerMTok: 0.2,
23117
+ tiers: {
23118
+ "long-context": {
23119
+ inputPerMTok: 2.5,
23120
+ outputPerMTok: 5,
23121
+ cacheReadPerMTok: 0.4
23122
+ }
23123
+ }
23124
+ },
23125
+ preferredApi: "responses",
23126
+ supportedApis: [
23127
+ "responses",
23128
+ "completions"
23129
+ ],
23130
+ capabilities: {
23131
+ toolUse: true,
23132
+ streaming: true,
23133
+ structuredOutput: true,
23134
+ vision: true,
23135
+ audio: false,
23136
+ video: false,
23137
+ imageGeneration: false,
23138
+ audioGeneration: false,
23139
+ videoGeneration: false
23140
+ },
23141
+ reasoning: {
23142
+ supported: false,
23143
+ automatic: false,
23144
+ effortControl: false,
23145
+ encryptedContent: false,
23146
+ summaryAvailable: false
23147
+ },
23148
+ type: "chat",
23149
+ inputModalities: [
23150
+ "text",
23151
+ "image"
23152
+ ],
23153
+ outputModalities: [
23154
+ "text"
23155
+ ],
23156
+ family: "grok",
23157
+ version: "4.20",
23158
+ status: "stable",
23159
+ active: true,
23160
+ contextWindow: 2e6
23161
+ },
23162
+ "xai/grok-4.20-multi-agent": {
23163
+ providerModelName: "grok-4.20-multi-agent-0309",
23164
+ aliases: [
23165
+ "grok-4.20-multi-agent-0309"
23166
+ ],
23167
+ pricing: {
23168
+ inputPerMTok: 1.25,
23169
+ outputPerMTok: 2.5,
23170
+ cacheReadPerMTok: 0.2,
23171
+ tiers: {
23172
+ "long-context": {
23173
+ inputPerMTok: 2.5,
23174
+ outputPerMTok: 5,
23175
+ cacheReadPerMTok: 0.4
23176
+ }
23177
+ }
23178
+ },
23179
+ preferredApi: "responses",
23180
+ supportedApis: [
23181
+ "responses"
23182
+ ],
23183
+ contextWindow: 2e6,
23184
+ capabilities: {
23185
+ toolUse: true,
23186
+ streaming: true,
23187
+ structuredOutput: true,
23188
+ vision: true,
23189
+ audio: false,
23190
+ video: false,
23191
+ imageGeneration: false,
23192
+ audioGeneration: false,
23193
+ videoGeneration: false
23194
+ },
23195
+ reasoning: {
23196
+ supported: false,
23197
+ automatic: false,
23198
+ effortControl: false,
23199
+ encryptedContent: false,
23200
+ summaryAvailable: false
23201
+ },
23202
+ type: "chat",
23203
+ inputModalities: [
23204
+ "text",
23205
+ "image"
23206
+ ],
23207
+ outputModalities: [
23208
+ "text"
23209
+ ],
23210
+ family: "grok",
23211
+ version: "4.20",
23212
+ status: "stable",
23213
+ active: true
23214
+ },
23215
+ "xai/grok-4.3": {
23216
+ providerModelName: "grok-4.3",
23217
+ aliases: [
23218
+ "grok-4.3"
23219
+ ],
23220
+ pricing: {
23221
+ inputPerMTok: 1.25,
23222
+ outputPerMTok: 2.5,
23223
+ cacheReadPerMTok: 0.2,
23224
+ tiers: {
23225
+ "long-context": {
23226
+ inputPerMTok: 2.5,
23227
+ outputPerMTok: 5,
23228
+ cacheReadPerMTok: 0.4
23229
+ }
23230
+ }
23231
+ },
23232
+ preferredApi: "responses",
23233
+ supportedApis: [
23234
+ "responses",
23235
+ "completions"
23236
+ ],
23237
+ contextWindow: 1e6,
23238
+ maxOutput: 1e6,
23239
+ capabilities: {
23240
+ toolUse: true,
23241
+ streaming: true,
23242
+ structuredOutput: true,
23243
+ vision: true,
23244
+ audio: false,
23245
+ video: false,
23246
+ imageGeneration: false,
23247
+ audioGeneration: false,
23248
+ videoGeneration: false
23249
+ },
23250
+ reasoning: {
23251
+ supported: false,
23252
+ automatic: false,
23253
+ effortControl: false,
23254
+ encryptedContent: false,
23255
+ summaryAvailable: false
23256
+ },
23257
+ type: "chat",
23258
+ inputModalities: [
23259
+ "text",
23260
+ "image"
23261
+ ],
23262
+ outputModalities: [
23263
+ "text"
23264
+ ],
23265
+ family: "grok",
23266
+ version: "4.3",
23267
+ status: "stable",
23268
+ active: true
23269
+ },
23270
+ "xai/grok-build-0.1": {
23271
+ providerModelName: "grok-build-0.1",
23272
+ aliases: [
23273
+ "grok-build-0.1"
23274
+ ],
23275
+ pricing: {
23276
+ inputPerMTok: 1,
23277
+ outputPerMTok: 2,
23278
+ cacheReadPerMTok: 0.2,
23279
+ tiers: {
23280
+ "long-context": {
23281
+ inputPerMTok: 2,
23282
+ outputPerMTok: 4,
23283
+ cacheReadPerMTok: 0.4
23284
+ }
23285
+ }
23286
+ },
23287
+ preferredApi: "responses",
23288
+ supportedApis: [
23289
+ "responses",
23290
+ "completions"
23291
+ ],
23292
+ contextWindow: 256e3,
23293
+ capabilities: {
23294
+ toolUse: true,
23295
+ streaming: true,
23296
+ structuredOutput: true,
23297
+ vision: true,
23298
+ audio: false,
23299
+ video: false,
23300
+ imageGeneration: false,
23301
+ audioGeneration: false,
23302
+ videoGeneration: false
23303
+ },
23304
+ reasoning: {
23305
+ supported: false,
23306
+ automatic: false,
23307
+ effortControl: false,
23308
+ encryptedContent: false,
23309
+ summaryAvailable: false
23310
+ },
23311
+ type: "code",
23312
+ inputModalities: [
23313
+ "text",
23314
+ "image"
23315
+ ],
23316
+ outputModalities: [
23317
+ "text"
23318
+ ],
23319
+ family: "grok",
23320
+ version: "0.1",
23321
+ status: "preview",
23322
+ active: true
23323
+ },
23324
+ "xai/grok-imagine-image": {
23325
+ providerModelName: "grok-imagine-image",
23326
+ aliases: [
23327
+ "grok-imagine-image"
23328
+ ],
23329
+ pricing: {
23330
+ perUnit: {
23331
+ "1k": 0.02,
23332
+ "2k": 0.02
23333
+ },
23334
+ perImage: 0.02
23335
+ },
23336
+ preferredApi: "responses",
23337
+ supportedApis: [
23338
+ "responses",
23339
+ "completions"
23340
+ ],
23341
+ capabilities: {
23342
+ toolUse: false,
23343
+ streaming: true,
23344
+ structuredOutput: false,
23345
+ vision: true,
23346
+ audio: false,
23347
+ video: false,
23348
+ imageGeneration: true,
23349
+ audioGeneration: false,
23350
+ videoGeneration: false
23351
+ },
23352
+ reasoning: {
23353
+ supported: false,
23354
+ automatic: false,
23355
+ effortControl: false,
23356
+ encryptedContent: false,
23357
+ summaryAvailable: false
23358
+ },
23359
+ type: "image",
23360
+ inputModalities: [
23361
+ "text",
23362
+ "image"
23363
+ ],
23364
+ outputModalities: [
23365
+ "image"
23366
+ ],
23367
+ family: "grok-imagine-image",
23368
+ version: "1",
23369
+ status: "stable",
23370
+ active: true,
23371
+ mediaParams: {
23372
+ aspectRatio: {
23373
+ values: [
23374
+ "1:1",
23375
+ "3:4",
23376
+ "4:3",
23377
+ "9:16",
23378
+ "16:9",
23379
+ "2:3",
23380
+ "3:2",
23381
+ "9:19.5",
23382
+ "19.5:9",
23383
+ "9:20",
23384
+ "20:9",
23385
+ "1:2",
23386
+ "2:1",
23387
+ "auto"
23388
+ ]
23389
+ },
23390
+ resolution: {
23391
+ values: [
23392
+ "1k",
23393
+ "2k"
23394
+ ]
23395
+ }
23396
+ }
23397
+ },
23398
+ "xai/grok-imagine-image-quality": {
23399
+ providerModelName: "grok-imagine-image-quality",
23400
+ aliases: [
23401
+ "grok-imagine-image-quality"
23402
+ ],
23403
+ pricing: {
23404
+ perUnit: {
23405
+ "1k": 0.05,
23406
+ "2k": 0.07
23407
+ },
23408
+ perImage: 0.05
23409
+ },
23410
+ preferredApi: "responses",
23411
+ supportedApis: [
23412
+ "responses",
23413
+ "completions"
23414
+ ],
23415
+ capabilities: {
23416
+ toolUse: false,
23417
+ streaming: true,
23418
+ structuredOutput: false,
23419
+ vision: true,
23420
+ audio: false,
23421
+ video: false,
23422
+ imageGeneration: true,
23423
+ audioGeneration: false,
23424
+ videoGeneration: false
23425
+ },
23426
+ reasoning: {
23427
+ supported: false,
23428
+ automatic: false,
23429
+ effortControl: false,
23430
+ encryptedContent: false,
23431
+ summaryAvailable: false
23432
+ },
23433
+ type: "image",
23434
+ inputModalities: [
23435
+ "text",
23436
+ "image"
23437
+ ],
23438
+ outputModalities: [
23439
+ "image"
23440
+ ],
23441
+ family: "grok-imagine-image",
23442
+ version: "1",
23443
+ status: "stable",
23444
+ active: true,
23445
+ mediaParams: {
23446
+ aspectRatio: {
23447
+ values: [
23448
+ "1:1",
23449
+ "3:4",
23450
+ "4:3",
23451
+ "9:16",
23452
+ "16:9",
23453
+ "2:3",
23454
+ "3:2",
23455
+ "9:19.5",
23456
+ "19.5:9",
23457
+ "9:20",
23458
+ "20:9",
23459
+ "1:2",
23460
+ "2:1",
23461
+ "auto"
23462
+ ]
23463
+ },
23464
+ resolution: {
23465
+ values: [
23466
+ "1k",
23467
+ "2k"
23468
+ ]
23469
+ }
23470
+ }
23471
+ },
23472
+ "xai/grok-imagine-video": {
23473
+ providerModelName: "grok-imagine-video",
23474
+ aliases: [
23475
+ "grok-imagine-video"
23476
+ ],
23477
+ pricing: {
23478
+ perSecond: 0.01,
23479
+ perUnit: {
23480
+ "480p": 0.05,
23481
+ "720p": 0.07
23482
+ },
23483
+ perImage: 2e-3
23484
+ },
23485
+ preferredApi: "responses",
23486
+ supportedApis: [
23487
+ "responses",
23488
+ "completions"
23489
+ ],
23490
+ capabilities: {
23491
+ toolUse: false,
23492
+ streaming: true,
23493
+ structuredOutput: false,
23494
+ vision: true,
23495
+ audio: false,
23496
+ video: false,
23497
+ imageGeneration: false,
23498
+ audioGeneration: false,
23499
+ videoGeneration: true
23500
+ },
23501
+ reasoning: {
23502
+ supported: false,
23503
+ automatic: false,
23504
+ effortControl: false,
23505
+ encryptedContent: false,
23506
+ summaryAvailable: false
23507
+ },
23508
+ type: "video",
23509
+ inputModalities: [
23510
+ "text",
23511
+ "image"
23512
+ ],
23513
+ outputModalities: [
23514
+ "video"
23515
+ ],
23516
+ family: "grok-imagine-video",
23517
+ version: "1",
23518
+ status: "stable",
23519
+ active: true,
23520
+ mediaParams: {
23521
+ duration: {
23522
+ min: 1,
23523
+ max: 15,
23524
+ default: 8
23525
+ },
23526
+ aspectRatio: {
23527
+ values: [
23528
+ "1:1",
23529
+ "16:9",
23530
+ "9:16",
23531
+ "4:3",
23532
+ "3:4",
23533
+ "3:2",
23534
+ "2:3"
23535
+ ]
23536
+ },
23537
+ resolution: {
23538
+ values: [
23539
+ "480p",
23540
+ "720p",
23541
+ "1080p"
23542
+ ]
23543
+ }
23544
+ }
23545
+ },
23546
+ "xai/grok-imagine-video-1.5": {
23547
+ providerModelName: "grok-imagine-video-1.5-preview",
23548
+ aliases: [
23549
+ "grok-imagine-video-1.5-preview",
23550
+ "grok-imagine-video-1.5"
23551
+ ],
23552
+ pricing: {
23553
+ perSecond: 0.01,
23554
+ perUnit: {
23555
+ "480p": 0.08,
23556
+ "720p": 0.14,
23557
+ "1080p": 0.25
23558
+ },
23559
+ perImage: 0.01
23560
+ },
23561
+ preferredApi: "responses",
23562
+ supportedApis: [
23563
+ "responses",
23564
+ "completions"
23565
+ ],
23566
+ capabilities: {
23567
+ toolUse: false,
23568
+ streaming: true,
23569
+ structuredOutput: false,
23570
+ vision: true,
23571
+ audio: false,
23572
+ video: false,
23573
+ imageGeneration: false,
23574
+ audioGeneration: false,
23575
+ videoGeneration: true
23576
+ },
23577
+ reasoning: {
23578
+ supported: false,
23579
+ automatic: false,
23580
+ effortControl: false,
23581
+ encryptedContent: false,
23582
+ summaryAvailable: false
23583
+ },
23584
+ type: "video",
23585
+ inputModalities: [
23586
+ "text",
23587
+ "image"
23588
+ ],
23589
+ outputModalities: [
23590
+ "video"
23591
+ ],
23592
+ family: "grok-imagine-video",
23593
+ version: "1.5",
23594
+ status: "preview",
23595
+ active: true,
23596
+ mediaParams: {
23597
+ duration: {
23598
+ min: 1,
23599
+ max: 15,
23600
+ default: 8
23601
+ },
23602
+ aspectRatio: {
23603
+ values: [
23604
+ "1:1",
23605
+ "16:9",
23606
+ "9:16",
23607
+ "4:3",
23608
+ "3:4",
23609
+ "3:2",
23610
+ "2:3"
23611
+ ]
23612
+ },
23613
+ resolution: {
23614
+ values: [
23615
+ "480p",
23616
+ "720p",
23617
+ "1080p"
23618
+ ]
23619
+ }
23620
+ }
23621
+ },
23622
+ "xai/grok-4.5": {
23623
+ providerModelName: "grok-4.5",
23624
+ aliases: [
23625
+ "grok-4.5"
23626
+ ],
23627
+ pricing: {
23628
+ inputPerMTok: 2,
23629
+ outputPerMTok: 6,
23630
+ cacheReadPerMTok: 0.5,
23631
+ tiers: {
23632
+ "long-context": {
23633
+ inputPerMTok: 4,
23634
+ outputPerMTok: 12,
23635
+ cacheReadPerMTok: 1
23636
+ }
23637
+ }
23638
+ },
23639
+ preferredApi: "responses",
23640
+ supportedApis: [
23641
+ "responses",
23642
+ "completions"
23643
+ ],
23644
+ contextWindow: 5e5,
23645
+ maxOutput: 5e5,
21726
23646
  capabilities: {
21727
23647
  toolUse: true,
21728
23648
  streaming: true,
@@ -21750,366 +23670,17 @@ var catalog_default5 = {
21750
23670
  "text"
21751
23671
  ],
21752
23672
  family: "grok",
21753
- version: "4.3",
23673
+ version: "4.5",
21754
23674
  status: "stable",
21755
23675
  active: true
21756
- },
21757
- "xai/grok-build-0.1": {
21758
- providerModelName: "grok-build-0.1",
21759
- aliases: [
21760
- "grok-build-0.1"
21761
- ],
21762
- pricing: {
21763
- inputPerMTok: 1,
21764
- outputPerMTok: 2,
21765
- cacheReadPerMTok: 0.2,
21766
- tiers: {
21767
- "long-context": {
21768
- inputPerMTok: 2,
21769
- outputPerMTok: 4,
21770
- cacheReadPerMTok: 0.4
21771
- }
21772
- }
21773
- },
21774
- preferredApi: "responses",
21775
- supportedApis: [
21776
- "responses",
21777
- "completions"
21778
- ],
21779
- contextWindow: 256e3,
21780
- capabilities: {
21781
- toolUse: true,
21782
- streaming: true,
21783
- structuredOutput: true,
21784
- vision: true,
21785
- audio: false,
21786
- video: false,
21787
- imageGeneration: false,
21788
- audioGeneration: false,
21789
- videoGeneration: false
21790
- },
21791
- reasoning: {
21792
- supported: false,
21793
- automatic: false,
21794
- effortControl: false,
21795
- encryptedContent: false,
21796
- summaryAvailable: false
21797
- },
21798
- type: "code",
21799
- inputModalities: [
21800
- "text",
21801
- "image"
21802
- ],
21803
- outputModalities: [
21804
- "text"
21805
- ],
21806
- family: "grok",
21807
- version: "0.1",
21808
- status: "preview",
21809
- active: true
21810
- },
21811
- "xai/grok-imagine-image": {
21812
- providerModelName: "grok-imagine-image",
21813
- aliases: [
21814
- "grok-imagine-image"
21815
- ],
21816
- pricing: {
21817
- perUnit: {
21818
- "1k": 2e-3,
21819
- "2k": 0.02
21820
- },
21821
- perImage: 0.02
21822
- },
21823
- preferredApi: "responses",
21824
- supportedApis: [
21825
- "responses",
21826
- "completions"
21827
- ],
21828
- capabilities: {
21829
- toolUse: false,
21830
- streaming: true,
21831
- structuredOutput: false,
21832
- vision: true,
21833
- audio: false,
21834
- video: false,
21835
- imageGeneration: true,
21836
- audioGeneration: false,
21837
- videoGeneration: false
21838
- },
21839
- reasoning: {
21840
- supported: false,
21841
- automatic: false,
21842
- effortControl: false,
21843
- encryptedContent: false,
21844
- summaryAvailable: false
21845
- },
21846
- type: "image",
21847
- inputModalities: [
21848
- "text",
21849
- "image"
21850
- ],
21851
- outputModalities: [
21852
- "image"
21853
- ],
21854
- family: "grok-imagine-image",
21855
- version: "1",
21856
- status: "stable",
21857
- active: true,
21858
- mediaParams: {
21859
- aspectRatio: {
21860
- values: [
21861
- "1:1",
21862
- "3:4",
21863
- "4:3",
21864
- "9:16",
21865
- "16:9",
21866
- "2:3",
21867
- "3:2",
21868
- "9:19.5",
21869
- "19.5:9",
21870
- "9:20",
21871
- "20:9",
21872
- "1:2",
21873
- "2:1",
21874
- "auto"
21875
- ]
21876
- },
21877
- resolution: {
21878
- values: [
21879
- "1k",
21880
- "2k"
21881
- ]
21882
- }
21883
- }
21884
- },
21885
- "xai/grok-imagine-image-quality": {
21886
- providerModelName: "grok-imagine-image-quality",
21887
- aliases: [
21888
- "grok-imagine-image-quality"
21889
- ],
21890
- pricing: {
21891
- perUnit: {
21892
- "1k": 0.01,
21893
- "2k": 0.05
21894
- },
21895
- perImage: 0.04
21896
- },
21897
- preferredApi: "responses",
21898
- supportedApis: [
21899
- "responses",
21900
- "completions"
21901
- ],
21902
- capabilities: {
21903
- toolUse: false,
21904
- streaming: true,
21905
- structuredOutput: false,
21906
- vision: true,
21907
- audio: false,
21908
- video: false,
21909
- imageGeneration: true,
21910
- audioGeneration: false,
21911
- videoGeneration: false
21912
- },
21913
- reasoning: {
21914
- supported: false,
21915
- automatic: false,
21916
- effortControl: false,
21917
- encryptedContent: false,
21918
- summaryAvailable: false
21919
- },
21920
- type: "image",
21921
- inputModalities: [
21922
- "text",
21923
- "image"
21924
- ],
21925
- outputModalities: [
21926
- "image"
21927
- ],
21928
- family: "grok-imagine-image",
21929
- version: "1",
21930
- status: "stable",
21931
- active: true,
21932
- mediaParams: {
21933
- aspectRatio: {
21934
- values: [
21935
- "1:1",
21936
- "3:4",
21937
- "4:3",
21938
- "9:16",
21939
- "16:9",
21940
- "2:3",
21941
- "3:2",
21942
- "9:19.5",
21943
- "19.5:9",
21944
- "9:20",
21945
- "20:9",
21946
- "1:2",
21947
- "2:1",
21948
- "auto"
21949
- ]
21950
- },
21951
- resolution: {
21952
- values: [
21953
- "1k",
21954
- "2k"
21955
- ]
21956
- }
21957
- }
21958
- },
21959
- "xai/grok-imagine-video": {
21960
- providerModelName: "grok-imagine-video",
21961
- aliases: [
21962
- "grok-imagine-video"
21963
- ],
21964
- pricing: {
21965
- perSecond: 0.01,
21966
- perUnit: {
21967
- "480p": 2e-3,
21968
- "720p": 0.05,
21969
- "1080p": 0.07
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",
22005
- status: "stable",
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
- },
22033
- "xai/grok-imagine-video-1.5": {
22034
- providerModelName: "grok-imagine-video-1.5-preview",
22035
- aliases: [
22036
- "grok-imagine-video-1.5-preview"
22037
- ],
22038
- pricing: {
22039
- perSecond: 0.01,
22040
- perUnit: {
22041
- "480p": 0.08,
22042
- "720p": 0.14
22043
- }
22044
- },
22045
- preferredApi: "responses",
22046
- supportedApis: [
22047
- "responses",
22048
- "completions"
22049
- ],
22050
- capabilities: {
22051
- toolUse: false,
22052
- streaming: true,
22053
- structuredOutput: false,
22054
- vision: true,
22055
- audio: false,
22056
- video: false,
22057
- imageGeneration: false,
22058
- audioGeneration: false,
22059
- videoGeneration: true
22060
- },
22061
- reasoning: {
22062
- supported: false,
22063
- automatic: false,
22064
- effortControl: false,
22065
- encryptedContent: false,
22066
- summaryAvailable: false
22067
- },
22068
- type: "video",
22069
- inputModalities: [
22070
- "text",
22071
- "image"
22072
- ],
22073
- outputModalities: [
22074
- "video"
22075
- ],
22076
- family: "grok-imagine-video",
22077
- version: "1.5",
22078
- status: "preview",
22079
- active: true,
22080
- mediaParams: {
22081
- duration: {
22082
- min: 1,
22083
- max: 15,
22084
- default: 8
22085
- },
22086
- aspectRatio: {
22087
- values: [
22088
- "1:1",
22089
- "16:9",
22090
- "9:16",
22091
- "4:3",
22092
- "3:4",
22093
- "3:2",
22094
- "2:3"
22095
- ]
22096
- },
22097
- resolution: {
22098
- values: [
22099
- "480p",
22100
- "720p",
22101
- "1080p"
22102
- ]
22103
- }
22104
- }
22105
23676
  }
22106
23677
  };
22107
23678
 
22108
23679
  // src/llm/providers/builtin-tools.ts
22109
23680
  var PROVIDER_BUILTIN_TOOLS = {
22110
- anthropic: ["web_search", "code_interpreter"],
23681
+ anthropic: ["web_search", "web_fetch", "code_interpreter"],
22111
23682
  openai: ["web_search", "code_interpreter"],
22112
- google: ["web_search", "code_interpreter"],
23683
+ google: ["web_search", "web_fetch", "code_interpreter"],
22113
23684
  xai: ["web_search", "code_interpreter"],
22114
23685
  openrouter: ["web_search"]
22115
23686
  };
@@ -22471,7 +24042,11 @@ function contentRequest(ctx, file) {
22471
24042
  "x-api-key": ctx.apiKey,
22472
24043
  "anthropic-version": "2023-06-01",
22473
24044
  "anthropic-beta": "files-api-2025-04-14",
22474
- accept: "application/binary"
24045
+ accept: "application/binary",
24046
+ // Enable CORS for direct browser requests (same header the completion
24047
+ // adapter sets); harmless on Node/Bun. Without it the browser blocks the
24048
+ // file download by CORS.
24049
+ ...isBrowser() ? { "anthropic-dangerous-direct-browser-access": "true" } : {}
22475
24050
  }
22476
24051
  };
22477
24052
  }
@@ -22492,7 +24067,11 @@ function providerAuth(ctx, url) {
22492
24067
  const base = ctx.baseURL ?? DEFAULT_BASE[ctx.provider];
22493
24068
  if (!url.startsWith(base)) return {};
22494
24069
  if (ctx.provider === "anthropic") {
22495
- return { "x-api-key": ctx.apiKey, "anthropic-version": "2023-06-01" };
24070
+ return {
24071
+ "x-api-key": ctx.apiKey,
24072
+ "anthropic-version": "2023-06-01",
24073
+ ...isBrowser() ? { "anthropic-dangerous-direct-browser-access": "true" } : {}
24074
+ };
22496
24075
  }
22497
24076
  if (ctx.provider === "google") return { "x-goog-api-key": ctx.apiKey };
22498
24077
  return { authorization: `Bearer ${ctx.apiKey}` };
@@ -22656,6 +24235,20 @@ function resolveServerState(args) {
22656
24235
  // src/llm/client-internal.ts
22657
24236
  var PRIORITY_INTERACTIVE = 1;
22658
24237
  var PRIORITY_BACKGROUND = 2;
24238
+ function buildAssistantMessage(response, origin) {
24239
+ const stateful = origin.api === "responses" || origin.api === "interactions";
24240
+ return {
24241
+ role: "assistant",
24242
+ content: response.content,
24243
+ id: response.id || crypto.randomUUID(),
24244
+ createdAt: Date.now(),
24245
+ origin: {
24246
+ provider: origin.provider,
24247
+ model: origin.model,
24248
+ ...stateful && response.id ? { serverStateId: response.id } : {}
24249
+ }
24250
+ };
24251
+ }
22659
24252
  function normalizeInput(input) {
22660
24253
  if (typeof input === "string") {
22661
24254
  return [{ role: "user", content: input }];
@@ -22686,7 +24279,11 @@ function contentToText(content) {
22686
24279
  }
22687
24280
  function parseStructured(text) {
22688
24281
  const stripped = text.trim().replace(/^```(?:json)?\s*/i, "").replace(/```\s*$/i, "").trim();
22689
- return JSON.parse(stripped);
24282
+ try {
24283
+ return JSON.parse(stripped);
24284
+ } catch (cause) {
24285
+ throw new InvalidFinalOutputError(text, { cause });
24286
+ }
22690
24287
  }
22691
24288
  function buildContext(client, options) {
22692
24289
  const provided = options.ctx ?? {};
@@ -22807,18 +24404,11 @@ var LLMClient = class {
22807
24404
  * const r2 = await llm.complete(messages); // sends id + only the new turn
22808
24405
  */
22809
24406
  assistantMessage(response) {
22810
- const stateful = this.api === "responses" || this.api === "interactions";
22811
- return {
22812
- role: "assistant",
22813
- content: response.content,
22814
- id: response.id || crypto.randomUUID(),
22815
- createdAt: Date.now(),
22816
- origin: {
22817
- provider: this.provider,
22818
- model: this.model,
22819
- ...stateful && response.id ? { serverStateId: response.id } : {}
22820
- }
22821
- };
24407
+ return buildAssistantMessage(response, {
24408
+ provider: this.provider,
24409
+ model: this.model,
24410
+ api: this.api
24411
+ });
22822
24412
  }
22823
24413
  // ─── Moderation helpers ───────────────────────────────────────────────
22824
24414
  /** Resolve the OpenAI key the emulated moderation path needs. Reuses the
@@ -22883,6 +24473,8 @@ var LLMClient = class {
22883
24473
  maxTokens: options.maxTokens,
22884
24474
  temperature: options.temperature,
22885
24475
  topP: options.topP,
24476
+ presencePenalty: options.presencePenalty,
24477
+ frequencyPenalty: options.frequencyPenalty,
22886
24478
  stop: options.stop,
22887
24479
  tools: options.tools,
22888
24480
  toolChoice: options.toolChoice,
@@ -23009,11 +24601,24 @@ var LLMClient = class {
23009
24601
  * leading/trailing markdown fences from the model reply, then JSON.parses
23010
24602
  * to T. Throws if the parse fails — callers should catch + retry. */
23011
24603
  async structuredComplete(input, schema, options = {}) {
23012
- const res = await this.complete(input, {
23013
- ...options,
23014
- structured: { ...options.structured ?? {}, schema }
23015
- });
23016
- return parseStructured(res.text);
24604
+ const structured = { ...options.structured ?? {}, schema };
24605
+ const repairAttempts = Math.max(0, structured.repairAttempts ?? 0);
24606
+ const messages = normalizeInput(input);
24607
+ for (let attempt = 0; ; attempt++) {
24608
+ const res = await this.complete(messages, { ...options, structured });
24609
+ try {
24610
+ return parseStructured(res.text);
24611
+ } catch (err) {
24612
+ if (!(err instanceof InvalidFinalOutputError) || attempt >= repairAttempts) throw err;
24613
+ messages.push(
24614
+ { role: "assistant", content: res.text },
24615
+ {
24616
+ role: "user",
24617
+ 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.`
24618
+ }
24619
+ );
24620
+ }
24621
+ }
23017
24622
  }
23018
24623
  async *stream(input, options = {}) {
23019
24624
  if (!this.fetchStreamFn) {
@@ -23030,6 +24635,8 @@ var LLMClient = class {
23030
24635
  maxTokens: options.maxTokens,
23031
24636
  temperature: options.temperature,
23032
24637
  topP: options.topP,
24638
+ presencePenalty: options.presencePenalty,
24639
+ frequencyPenalty: options.frequencyPenalty,
23033
24640
  stop: options.stop,
23034
24641
  tools: options.tools,
23035
24642
  toolChoice: options.toolChoice,
@@ -23134,8 +24741,15 @@ var LLMClient = class {
23134
24741
  case "file":
23135
24742
  files.push(event.file);
23136
24743
  break;
23137
- case "builtin_tool_start":
23138
- builtinToolCalls.push({ tool: event.tool, ...event.id ? { id: event.id } : {} });
24744
+ case "builtin_tool_end":
24745
+ builtinToolCalls.push({
24746
+ tool: event.tool,
24747
+ ...event.id ? { id: event.id } : {},
24748
+ ...event.code ? { code: event.code } : {},
24749
+ ...event.output ? { output: event.output } : {},
24750
+ ...event.query ? { query: event.query } : {},
24751
+ ...event.url ? { url: event.url } : {}
24752
+ });
23139
24753
  break;
23140
24754
  case "moderation":
23141
24755
  moderationReport = this.mergeModeration(
@@ -23401,10 +25015,12 @@ var NATIVE_TO_UNIFIED = {
23401
25015
  code_interpreter_call: "code_interpreter",
23402
25016
  // Anthropic server_tool_use names
23403
25017
  web_search: "web_search",
25018
+ web_fetch: "web_fetch",
23404
25019
  code_execution: "code_interpreter",
23405
25020
  bash_code_execution: "code_interpreter",
23406
25021
  // Anthropic *_tool_result block types
23407
25022
  web_search_tool_result: "web_search",
25023
+ web_fetch_tool_result: "web_fetch",
23408
25024
  code_execution_tool_result: "code_interpreter",
23409
25025
  bash_code_execution_tool_result: "code_interpreter"
23410
25026
  };
@@ -23455,6 +25071,24 @@ function filesFromCodeExecBlock(block) {
23455
25071
  }
23456
25072
  return files;
23457
25073
  }
25074
+ function builtinInputPayload(tool, input) {
25075
+ if (!input) return {};
25076
+ if (tool === "code_interpreter") {
25077
+ const code = input.code ?? input.command;
25078
+ return typeof code === "string" ? { code } : {};
25079
+ }
25080
+ if (tool === "web_search") {
25081
+ return typeof input.query === "string" ? { query: input.query } : {};
25082
+ }
25083
+ if (tool === "web_fetch") {
25084
+ return typeof input.url === "string" ? { url: input.url } : {};
25085
+ }
25086
+ return {};
25087
+ }
25088
+ function resultStdout(content) {
25089
+ const c = content;
25090
+ return c && typeof c.stdout === "string" ? c.stdout : void 0;
25091
+ }
23458
25092
  var AnthropicAdapter = class {
23459
25093
  name = "anthropic";
23460
25094
  apiKey;
@@ -23502,7 +25136,21 @@ var AnthropicAdapter = class {
23502
25136
  body.tools = req.tools.map((t, i) => {
23503
25137
  if (!isFunctionTool(t)) {
23504
25138
  if (t.type === "web_search") {
23505
- return { type: "web_search_20250305", name: "web_search", max_uses: 5 };
25139
+ return {
25140
+ type: "web_search_20260318",
25141
+ name: "web_search",
25142
+ max_uses: 5,
25143
+ allowed_callers: ["direct"],
25144
+ ...t.params
25145
+ };
25146
+ }
25147
+ if (t.type === "web_fetch") {
25148
+ return {
25149
+ type: "web_fetch_20260318",
25150
+ name: "web_fetch",
25151
+ allowed_callers: ["direct"],
25152
+ ...t.params
25153
+ };
23506
25154
  }
23507
25155
  if (t.type === "code_interpreter") {
23508
25156
  return { type: "code_execution_20260521", name: "code_execution" };
@@ -23550,6 +25198,10 @@ var AnthropicAdapter = class {
23550
25198
  });
23551
25199
  const headers = {};
23552
25200
  if (hasFileRef) headers["anthropic-beta"] = "files-api-2025-04-14";
25201
+ const userProfileId = req.providerOptions?.userProfileId;
25202
+ if (typeof userProfileId === "string" && userProfileId) {
25203
+ headers["anthropic-user-profile-id"] = userProfileId;
25204
+ }
23553
25205
  const usesCodeExec = req.tools?.some(
23554
25206
  (t) => !isFunctionTool(t) && t.type === "code_interpreter"
23555
25207
  );
@@ -23637,11 +25289,20 @@ var AnthropicAdapter = class {
23637
25289
  content.push(tc);
23638
25290
  toolCalls.push(tc);
23639
25291
  } else if (block.type === "server_tool_use") {
25292
+ const tool = unifiedBuiltinTool(block.name);
23640
25293
  builtinToolCalls.push({
23641
- tool: unifiedBuiltinTool(block.name),
23642
- ...typeof block.id === "string" ? { id: block.id } : {}
25294
+ tool,
25295
+ ...typeof block.id === "string" ? { id: block.id } : {},
25296
+ ...builtinInputPayload(tool, block.input)
23643
25297
  });
23644
25298
  } else {
25299
+ if (typeof block.type === "string" && block.type.endsWith("_tool_result")) {
25300
+ const output = resultStdout(block.content);
25301
+ if (output) {
25302
+ const call = builtinToolCalls.find((c) => c.id === block.tool_use_id);
25303
+ if (call) call.output = output;
25304
+ }
25305
+ }
23645
25306
  files.push(...filesFromCodeExecBlock(block));
23646
25307
  }
23647
25308
  }
@@ -23665,6 +25326,17 @@ var AnthropicAdapter = class {
23665
25326
  };
23666
25327
  }
23667
25328
  parseStreamEvent(event) {
25329
+ return this.streamEvents(event, { pending: /* @__PURE__ */ new Map() });
25330
+ }
25331
+ /** Stateful — Anthropic streams `server_tool_use` input via `input_json_delta`
25332
+ * (empty at block start) and returns the result in a separate `*_tool_result`
25333
+ * block. The closure accumulates each call's input (code / query) and attaches it
25334
+ * to the matching `builtin_tool_end`. */
25335
+ createStreamParser() {
25336
+ const state = { pending: /* @__PURE__ */ new Map() };
25337
+ return (event) => this.streamEvents(event, state);
25338
+ }
25339
+ streamEvents(event, state) {
23668
25340
  if (event.event === "ping") return [];
23669
25341
  const data = JSON.parse(event.data);
23670
25342
  const type = data.type;
@@ -23674,33 +25346,58 @@ var AnthropicAdapter = class {
23674
25346
  if (delta.type === "thinking_delta")
23675
25347
  return [{ type: "thinking", text: delta.thinking }];
23676
25348
  if (delta.type === "input_json_delta") {
25349
+ if (state.current) {
25350
+ state.current.json += delta.partial_json ?? "";
25351
+ return [];
25352
+ }
23677
25353
  return [{ type: "tool_call_delta", id: "", arguments: delta.partial_json }];
23678
25354
  }
23679
25355
  }
23680
25356
  if (type === "content_block_start") {
23681
25357
  const block = data.content_block;
23682
25358
  if (block.type === "tool_use") {
25359
+ state.current = void 0;
23683
25360
  return [{ type: "tool_call_start", id: block.id, name: block.name }];
23684
25361
  }
23685
25362
  const events = [];
23686
25363
  const blockType = block.type;
23687
25364
  if (blockType === "server_tool_use") {
25365
+ const tool = unifiedBuiltinTool(block.name);
25366
+ state.current = { id: block.id ?? "", tool, json: "" };
23688
25367
  events.push({
23689
25368
  type: "builtin_tool_start",
23690
- tool: unifiedBuiltinTool(block.name),
25369
+ tool,
23691
25370
  ...typeof block.id === "string" ? { id: block.id } : {}
23692
25371
  });
23693
25372
  } else if (blockType?.endsWith("_tool_result")) {
25373
+ const tool = unifiedBuiltinTool(blockType);
25374
+ const id = typeof block.tool_use_id === "string" ? block.tool_use_id : void 0;
25375
+ const input = id ? state.pending.get(id) : void 0;
25376
+ if (id) state.pending.delete(id);
25377
+ const output = resultStdout(block.content);
23694
25378
  events.push({
23695
25379
  type: "builtin_tool_end",
23696
- tool: unifiedBuiltinTool(blockType),
23697
- ...typeof block.tool_use_id === "string" ? { id: block.tool_use_id } : {}
25380
+ tool,
25381
+ ...id ? { id } : {},
25382
+ ...input?.code ? { code: input.code } : {},
25383
+ ...input?.query ? { query: input.query } : {},
25384
+ ...input?.url ? { url: input.url } : {},
25385
+ ...output ? { output } : {}
23698
25386
  });
23699
25387
  }
23700
25388
  for (const file of filesFromCodeExecBlock(block)) events.push({ type: "file", file });
23701
25389
  return events;
23702
25390
  }
23703
25391
  if (type === "content_block_stop") {
25392
+ if (state.current) {
25393
+ let input = {};
25394
+ try {
25395
+ input = JSON.parse(state.current.json || "{}");
25396
+ } catch {
25397
+ }
25398
+ state.pending.set(state.current.id, builtinInputPayload(state.current.tool, input));
25399
+ state.current = void 0;
25400
+ }
23704
25401
  }
23705
25402
  if (type === "message_delta") {
23706
25403
  const delta = data.delta;
@@ -23722,11 +25419,6 @@ var AnthropicAdapter = class {
23722
25419
  }
23723
25420
  return [];
23724
25421
  }
23725
- /** Stateless — every event is self-contained (code-execution result blocks
23726
- * arrive complete in a single content_block_start). */
23727
- createStreamParser() {
23728
- return (event) => this.parseStreamEvent(event);
23729
- }
23730
25422
  parseUsage(u) {
23731
25423
  if (!u) return emptyUsage();
23732
25424
  const inputTokens = u.input_tokens ?? 0;
@@ -24037,6 +25729,8 @@ var GoogleAdapter = class {
24037
25729
  if (req.maxTokens) config.maxOutputTokens = req.maxTokens;
24038
25730
  if (req.temperature !== void 0) config.temperature = req.temperature;
24039
25731
  if (req.topP !== void 0) config.topP = req.topP;
25732
+ if (req.presencePenalty !== void 0) config.presencePenalty = req.presencePenalty;
25733
+ if (req.frequencyPenalty !== void 0) config.frequencyPenalty = req.frequencyPenalty;
24040
25734
  if (req.stop) config.stopSequences = req.stop;
24041
25735
  if (req.outputModalities?.includes("audio")) {
24042
25736
  config.responseModalities = ["AUDIO"];
@@ -24072,6 +25766,9 @@ var GoogleAdapter = class {
24072
25766
  if (req.tools.some((t) => !isFunctionTool(t) && t.type === "code_interpreter")) {
24073
25767
  tools.push({ codeExecution: {} });
24074
25768
  }
25769
+ if (req.tools.some((t) => !isFunctionTool(t) && t.type === "web_fetch")) {
25770
+ tools.push({ urlContext: {} });
25771
+ }
24075
25772
  if (tools.length) body.tools = tools;
24076
25773
  }
24077
25774
  if (req.toolChoice) {
@@ -24235,8 +25932,32 @@ var GoogleAdapter = class {
24235
25932
  { MAX_TOKENS: "length", SAFETY: "content_filter" }
24236
25933
  );
24237
25934
  const builtinToolCalls = [];
24238
- if (hasCodeExec) builtinToolCalls.push({ tool: "code_interpreter" });
24239
- if (candidate.groundingMetadata) builtinToolCalls.push({ tool: "web_search" });
25935
+ const codes = parts.filter((p) => p.executableCode?.code).map((p) => p.executableCode.code);
25936
+ const outputs = parts.filter((p) => p.codeExecutionResult).map((p) => String(p.codeExecutionResult.output ?? ""));
25937
+ if (codes.length) {
25938
+ codes.forEach((code, i) => {
25939
+ builtinToolCalls.push({
25940
+ tool: "code_interpreter",
25941
+ code,
25942
+ ...outputs[i] ? { output: outputs[i] } : {}
25943
+ });
25944
+ });
25945
+ } else if (hasCodeExec) {
25946
+ builtinToolCalls.push({ tool: "code_interpreter", ...outputs[0] ? { output: outputs[0] } : {} });
25947
+ }
25948
+ const grounding = candidate.groundingMetadata;
25949
+ if (grounding) {
25950
+ const q = grounding.webSearchQueries?.[0];
25951
+ builtinToolCalls.push({ tool: "web_search", ...typeof q === "string" ? { query: q } : {} });
25952
+ }
25953
+ const urlCtx = candidate.urlContextMetadata;
25954
+ const urlMeta = urlCtx?.urlMetadata;
25955
+ if (Array.isArray(urlMeta)) {
25956
+ for (const m of urlMeta) {
25957
+ const url = m.retrievedUrl;
25958
+ builtinToolCalls.push({ tool: "web_fetch", ...typeof url === "string" ? { url } : {} });
25959
+ }
25960
+ }
24240
25961
  return {
24241
25962
  id: crypto.randomUUID(),
24242
25963
  // Google doesn't return a response ID in generateContent
@@ -24287,8 +26008,21 @@ var GoogleAdapter = class {
24287
26008
  if (part.text !== void 0 && !part.thought)
24288
26009
  events.push({ type: "text", text: part.text });
24289
26010
  if (part.thought && part.text) events.push({ type: "thinking", text: part.text });
24290
- if (part.executableCode) events.push({ type: "builtin_tool_start", tool: "code_interpreter" });
24291
- if (part.codeExecutionResult) events.push({ type: "builtin_tool_end", tool: "code_interpreter" });
26011
+ if (part.executableCode) {
26012
+ const code = part.executableCode.code;
26013
+ state.pendingCode = typeof code === "string" ? code : void 0;
26014
+ events.push({ type: "builtin_tool_start", tool: "code_interpreter" });
26015
+ }
26016
+ if (part.codeExecutionResult) {
26017
+ const output = part.codeExecutionResult.output;
26018
+ events.push({
26019
+ type: "builtin_tool_end",
26020
+ tool: "code_interpreter",
26021
+ ...state.pendingCode ? { code: state.pendingCode } : {},
26022
+ ...typeof output === "string" && output ? { output } : {}
26023
+ });
26024
+ state.pendingCode = void 0;
26025
+ }
24292
26026
  if (part.inlineData) {
24293
26027
  const inline = part.inlineData;
24294
26028
  const mime = inline.mimeType;
@@ -24321,8 +26055,26 @@ var GoogleAdapter = class {
24321
26055
  }
24322
26056
  if (candidate.groundingMetadata && !state.webSearchEmitted) {
24323
26057
  state.webSearchEmitted = true;
26058
+ const q = candidate.groundingMetadata.webSearchQueries?.[0];
24324
26059
  events.push({ type: "builtin_tool_start", tool: "web_search" });
24325
- events.push({ type: "builtin_tool_end", tool: "web_search" });
26060
+ events.push({
26061
+ type: "builtin_tool_end",
26062
+ tool: "web_search",
26063
+ ...typeof q === "string" ? { query: q } : {}
26064
+ });
26065
+ }
26066
+ const streamUrlMeta = candidate.urlContextMetadata?.urlMetadata;
26067
+ if (Array.isArray(streamUrlMeta) && !state.urlFetchEmitted) {
26068
+ state.urlFetchEmitted = true;
26069
+ for (const m of streamUrlMeta) {
26070
+ const url = m.retrievedUrl;
26071
+ events.push({ type: "builtin_tool_start", tool: "web_fetch" });
26072
+ events.push({
26073
+ type: "builtin_tool_end",
26074
+ tool: "web_fetch",
26075
+ ...typeof url === "string" ? { url } : {}
26076
+ });
26077
+ }
24326
26078
  }
24327
26079
  const fr = candidate.finishReason;
24328
26080
  if (fr)
@@ -24392,6 +26144,8 @@ var GoogleInteractionsAdapter = class {
24392
26144
  if (req.maxTokens) genConfig.max_output_tokens = req.maxTokens;
24393
26145
  if (req.temperature !== void 0) genConfig.temperature = req.temperature;
24394
26146
  if (req.topP !== void 0) genConfig.top_p = req.topP;
26147
+ if (req.presencePenalty !== void 0) genConfig.presence_penalty = req.presencePenalty;
26148
+ if (req.frequencyPenalty !== void 0) genConfig.frequency_penalty = req.frequencyPenalty;
24395
26149
  if (req.stop) genConfig.stop_sequences = req.stop;
24396
26150
  if (req.tools?.length) {
24397
26151
  body.tools = req.tools.filter(isFunctionTool).map((t) => ({
@@ -24407,6 +26161,8 @@ var GoogleInteractionsAdapter = class {
24407
26161
  };
24408
26162
  }
24409
26163
  if (Object.keys(genConfig).length > 0) body.generation_config = genConfig;
26164
+ const cachedContent = req.providerOptions?.cachedContent;
26165
+ if (typeof cachedContent === "string" && cachedContent) body.cached_content = cachedContent;
24410
26166
  if (req.structured) {
24411
26167
  body.response_format = {
24412
26168
  type: "text",
@@ -24564,47 +26320,77 @@ var GoogleInteractionsAdapter = class {
24564
26320
  raw
24565
26321
  };
24566
26322
  }
24567
- parseStreamEvent(event) {
26323
+ /** Translate one Interactions SSE event to unified events. The 2.10 wire is a
26324
+ * step machine (verified live): `step.start` opens a typed step (`model_output`,
26325
+ * `function_call`, `thought`…), `step.delta` streams its payload (`{type:'text'}`,
26326
+ * `{type:'arguments_delta'}`, `{type:'thought_summary'}`, internal
26327
+ * `thought_signature`), `step.stop` closes it, and `interaction.completed` /
26328
+ * `interaction.failed` finish the turn (usage under `interaction.usage`). A
26329
+ * function call's `arguments_delta` carries no id, so we correlate it to the
26330
+ * currently-open call id held in `state`. */
26331
+ streamEvents(event, state) {
24568
26332
  const data = JSON.parse(event.data);
24569
26333
  const type = data.event_type ?? data.type;
24570
26334
  const events = [];
24571
- if (type === "content.delta") {
24572
- const delta = data.delta;
24573
- if (delta?.type === "text") {
24574
- events.push({ type: "text", text: delta.text });
24575
- }
24576
- if (delta?.type === "function_call") {
24577
- events.push({
24578
- type: "tool_call_start",
24579
- id: delta.id ?? "",
24580
- name: delta.name ?? ""
24581
- });
24582
- if (delta.arguments) {
24583
- events.push({
24584
- type: "tool_call_delta",
24585
- id: delta.id ?? "",
24586
- arguments: JSON.stringify(delta.arguments)
24587
- });
26335
+ if (type === "step.start") {
26336
+ const step = data.step ?? {};
26337
+ if (step.type === "function_call") {
26338
+ const id = step.id ?? "";
26339
+ state.callId = id;
26340
+ state.sawToolCall = true;
26341
+ events.push({ type: "tool_call_start", id, name: step.name ?? "" });
26342
+ const args = step.arguments;
26343
+ if (args && Object.keys(args).length > 0) {
26344
+ events.push({ type: "tool_call_delta", id, arguments: JSON.stringify(args) });
24588
26345
  }
24589
- events.push({ type: "tool_call_end", id: delta.id ?? "" });
24590
26346
  }
26347
+ return events;
26348
+ }
26349
+ if (type === "step.delta") {
26350
+ const delta = data.delta ?? {};
26351
+ const dtype = delta.type;
26352
+ if (dtype === "text") {
26353
+ events.push({ type: "text", text: delta.text ?? "" });
26354
+ } else if (dtype === "thought_summary") {
26355
+ events.push({ type: "thinking", text: delta.text ?? "" });
26356
+ } else if (dtype === "arguments_delta") {
26357
+ events.push({ type: "tool_call_delta", id: state.callId ?? "", arguments: delta.arguments ?? "" });
26358
+ }
26359
+ return events;
24591
26360
  }
24592
- if (type === "interaction.complete") {
26361
+ if (type === "step.stop") {
26362
+ if (state.callId) {
26363
+ events.push({ type: "tool_call_end", id: state.callId });
26364
+ state.callId = void 0;
26365
+ }
26366
+ return events;
26367
+ }
26368
+ if (type === "interaction.completed" || type === "interaction.failed") {
26369
+ if (state.callId) {
26370
+ events.push({ type: "tool_call_end", id: state.callId });
26371
+ state.callId = void 0;
26372
+ }
24593
26373
  const interaction = data.interaction ?? {};
24594
- const usage = interaction.usage;
26374
+ const usage = interaction.usage ?? data.metadata?.total_usage;
24595
26375
  if (usage) events.push({ type: "usage", usage: this.parseUsage(usage) });
24596
26376
  events.push({
24597
26377
  type: "done",
24598
- finishReason: extractFinishReason(false, interaction.status, {
26378
+ finishReason: extractFinishReason(state.sawToolCall, interaction.status, {
24599
26379
  failed: "error"
24600
26380
  })
24601
26381
  });
26382
+ return events;
24602
26383
  }
24603
26384
  return events;
24604
26385
  }
24605
- /** Stateless — the Interactions adapter surfaces no code-execution file outputs. */
26386
+ parseStreamEvent(event) {
26387
+ return this.streamEvents(event, { sawToolCall: false });
26388
+ }
26389
+ /** Per-stream stateful parser — correlates a function call's streamed arguments
26390
+ * and end to the call opened by its `step.start`. */
24606
26391
  createStreamParser() {
24607
- return (event) => this.parseStreamEvent(event);
26392
+ const state = { sawToolCall: false };
26393
+ return (event) => this.streamEvents(event, state);
24608
26394
  }
24609
26395
  parseUsage(u) {
24610
26396
  if (!u) return emptyUsage();
@@ -25335,6 +27121,8 @@ var OpenAIAdapter = class {
25335
27121
  };
25336
27122
  if (req.temperature !== void 0) body.temperature = req.temperature;
25337
27123
  if (req.topP !== void 0) body.top_p = req.topP;
27124
+ if (req.presencePenalty !== void 0) body.presence_penalty = req.presencePenalty;
27125
+ if (req.frequencyPenalty !== void 0) body.frequency_penalty = req.frequencyPenalty;
25338
27126
  if (req.stop) body.stop = req.stop;
25339
27127
  const tier = openaiRequestTier(req.serviceTier);
25340
27128
  if (tier) body.service_tier = tier;
@@ -26090,32 +27878,98 @@ function filenameForMime(mimeType) {
26090
27878
  if (mimeType.startsWith("image/")) return `file.${mimeType.slice("image/".length)}`;
26091
27879
  return "file.bin";
26092
27880
  }
27881
+ function codeOutputFromResponsesItem(item) {
27882
+ const parts = [];
27883
+ for (const out of item.outputs ?? []) {
27884
+ if (out.type !== "logs" || typeof out.logs !== "string") continue;
27885
+ try {
27886
+ const j = JSON.parse(out.logs);
27887
+ if (typeof j.stdout === "string") {
27888
+ parts.push(j.stdout);
27889
+ continue;
27890
+ }
27891
+ } catch {
27892
+ }
27893
+ parts.push(out.logs);
27894
+ }
27895
+ return parts.length ? parts.join("") : void 0;
27896
+ }
27897
+ function searchActionPayload(item) {
27898
+ const action = item.action;
27899
+ if (!action) return {};
27900
+ const out = {};
27901
+ if (Array.isArray(action.queries) && typeof action.queries[0] === "string")
27902
+ out.query = action.queries[0];
27903
+ else if (typeof action.query === "string") out.query = action.query;
27904
+ if (typeof action.url === "string") out.url = action.url;
27905
+ return out;
27906
+ }
26093
27907
  var RESPONSES_BUILTIN_ITEMS = /* @__PURE__ */ new Set(["web_search_call", "code_interpreter_call"]);
26094
27908
  function builtinCallFromResponsesItem(item) {
26095
27909
  const type = item.type;
26096
27910
  if (!RESPONSES_BUILTIN_ITEMS.has(type)) return null;
27911
+ const call = { tool: unifiedBuiltinTool(type) };
27912
+ if (typeof item.id === "string") call.id = item.id;
27913
+ if (type === "code_interpreter_call") {
27914
+ if (typeof item.code === "string") call.code = item.code;
27915
+ const output = codeOutputFromResponsesItem(item);
27916
+ if (output) call.output = output;
27917
+ } else if (type === "web_search_call") {
27918
+ const { query, url } = searchActionPayload(item);
27919
+ if (query) call.query = query;
27920
+ if (url) call.url = url;
27921
+ }
27922
+ return call;
27923
+ }
27924
+ function builtinEndPayload(call) {
26097
27925
  return {
26098
- tool: unifiedBuiltinTool(type),
26099
- ...typeof item.id === "string" ? { id: item.id } : {}
27926
+ ...call.id ? { id: call.id } : {},
27927
+ ...call.code ? { code: call.code } : {},
27928
+ ...call.output ? { output: call.output } : {},
27929
+ ...call.query ? { query: call.query } : {},
27930
+ ...call.url ? { url: call.url } : {}
26100
27931
  };
26101
27932
  }
27933
+ var IMAGE_EXTS = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "gif", "webp", "svg", "bmp"]);
27934
+ function fileExt(name) {
27935
+ const i = name.lastIndexOf(".");
27936
+ return i >= 0 ? name.slice(i + 1).toLowerCase() : "";
27937
+ }
27938
+ function isDisplayArtifact(c) {
27939
+ if (!c.filename) return false;
27940
+ const ext = fileExt(c.filename);
27941
+ return c.filename === `${c.fileId}.${ext}` && IMAGE_EXTS.has(ext) && c.span[0] === c.span[1];
27942
+ }
26102
27943
  function filesFromResponsesOutputItem(item) {
26103
27944
  const files = [];
26104
27945
  const type = item.type;
26105
27946
  if (type === "message") {
27947
+ const citations = [];
26106
27948
  for (const c of item.content ?? []) {
26107
27949
  if (c.type !== "output_text") continue;
26108
27950
  for (const a of c.annotations ?? []) {
26109
27951
  if (a.type === "container_file_citation" && typeof a.file_id === "string") {
26110
- files.push({
26111
- id: a.file_id,
26112
- ...typeof a.filename === "string" ? { name: a.filename } : {},
26113
- ...typeof a.container_id === "string" ? { ref: { containerId: a.container_id } } : {},
26114
- source: "code_execution"
27952
+ citations.push({
27953
+ fileId: a.file_id,
27954
+ filename: typeof a.filename === "string" ? a.filename : void 0,
27955
+ containerId: typeof a.container_id === "string" ? a.container_id : void 0,
27956
+ span: [Number(a.start_index) || 0, Number(a.end_index) || 0]
26115
27957
  });
26116
27958
  }
26117
27959
  }
26118
27960
  }
27961
+ const hasSavedImage = citations.some(
27962
+ (c) => !isDisplayArtifact(c) && IMAGE_EXTS.has(fileExt(c.filename ?? ""))
27963
+ );
27964
+ for (const c of citations) {
27965
+ if (hasSavedImage && isDisplayArtifact(c)) continue;
27966
+ files.push({
27967
+ id: c.fileId,
27968
+ ...c.filename ? { name: c.filename } : {},
27969
+ ...c.containerId ? { ref: { containerId: c.containerId } } : {},
27970
+ source: "code_execution"
27971
+ });
27972
+ }
26119
27973
  }
26120
27974
  if (type === "code_interpreter_call") {
26121
27975
  for (const out of item.outputs ?? []) {
@@ -26419,7 +28273,7 @@ var OpenAIResponsesAdapter = class {
26419
28273
  for (const file of this.filesFromOutputItem(item)) events.push({ type: "file", file });
26420
28274
  const builtin = builtinCallFromResponsesItem(item ?? {});
26421
28275
  if (builtin) {
26422
- events.push({ type: "builtin_tool_end", tool: builtin.tool, ...builtin.id ? { id: builtin.id } : {} });
28276
+ events.push({ type: "builtin_tool_end", tool: builtin.tool, ...builtinEndPayload(builtin) });
26423
28277
  }
26424
28278
  if (item?.type === "function_call") {
26425
28279
  events.push({ type: "tool_call_end", id: item.call_id ?? "" });
@@ -27057,6 +28911,14 @@ var XAIMediaAdapter = class {
27057
28911
  }
27058
28912
  };
27059
28913
 
28914
+ // src/llm/providers/xai/tiers.ts
28915
+ function xaiRequestTier(t) {
28916
+ if (!t) return void 0;
28917
+ if (t === "priority") return "priority";
28918
+ if (t === "standard" || t === "default") return "default";
28919
+ return void 0;
28920
+ }
28921
+
27060
28922
  // src/llm/providers/xai/responses.ts
27061
28923
  function xaiCodeExecFiles(item) {
27062
28924
  if (item.type !== "code_interpreter_call") return [];
@@ -27100,6 +28962,9 @@ var XAIResponsesAdapter = class extends OpenAIResponsesAdapter {
27100
28962
  if (!req.model.includes("multi-agent")) {
27101
28963
  delete body.reasoning;
27102
28964
  }
28965
+ const xaiTier = xaiRequestTier(req.serviceTier);
28966
+ if (xaiTier) body.service_tier = xaiTier;
28967
+ else delete body.service_tier;
27103
28968
  const usesCodeInterpreter = req.tools?.some(
27104
28969
  (t) => !isFunctionTool(t) && t.type === "code_interpreter"
27105
28970
  );
@@ -28318,6 +30183,7 @@ var AgentLoop = class _AgentLoop {
28318
30183
  let lastResponse = null;
28319
30184
  let reason = "done";
28320
30185
  let errorMsg;
30186
+ let caughtError;
28321
30187
  let guardrailTripReason;
28322
30188
  try {
28323
30189
  while (true) {
@@ -28366,7 +30232,11 @@ var AgentLoop = class _AgentLoop {
28366
30232
  totalLlmTimeMs += stepLatency;
28367
30233
  addUsage(totalUsage, lastResponse.usage);
28368
30234
  this._history.append(
28369
- { role: "assistant", content: lastResponse.content },
30235
+ buildAssistantMessage(lastResponse, {
30236
+ provider: this.client.provider,
30237
+ model: this.client.model,
30238
+ api: this.client.api
30239
+ }),
28370
30240
  { model: this.client.model, usage: lastResponse.usage, latencyMs: stepLatency }
28371
30241
  );
28372
30242
  const hasToolCalls = lastResponse.finishReason === "tool_use" && lastResponse.toolCalls.length > 0;
@@ -28420,6 +30290,7 @@ var AgentLoop = class _AgentLoop {
28420
30290
  } catch (e) {
28421
30291
  reason = "error";
28422
30292
  errorMsg = e instanceof Error ? e.message : String(e);
30293
+ caughtError = e;
28423
30294
  await this.hooks.emit("onRunError", {
28424
30295
  runId,
28425
30296
  agentId: this.id,
@@ -28470,6 +30341,7 @@ var AgentLoop = class _AgentLoop {
28470
30341
  totalToolTimeMs,
28471
30342
  runTrace
28472
30343
  });
30344
+ if (reason === "error") throw caughtError ?? new Error(errorMsg ?? "agent run failed");
28473
30345
  return finalResponse;
28474
30346
  }
28475
30347
  /** Run `complete` with a JSON Schema enforced via `structured`, then
@@ -28496,6 +30368,7 @@ var AgentLoop = class _AgentLoop {
28496
30368
  let lastResponse = null;
28497
30369
  let reason = "done";
28498
30370
  let errorMsg;
30371
+ let caughtError;
28499
30372
  let guardrailTripReason;
28500
30373
  try {
28501
30374
  while (true) {
@@ -28557,7 +30430,14 @@ var AgentLoop = class _AgentLoop {
28557
30430
  finalText = state.stepText;
28558
30431
  lastResponse = stepResponse;
28559
30432
  this._history.append(
28560
- { role: "assistant", content },
30433
+ {
30434
+ ...buildAssistantMessage(lastResponse, {
30435
+ provider: this.client.provider,
30436
+ model: this.client.model,
30437
+ api: this.client.api
30438
+ }),
30439
+ content
30440
+ },
28561
30441
  { model: this.client.model, usage: state.stepUsage, latencyMs: stepLatency }
28562
30442
  );
28563
30443
  const hasToolCalls = state.stepToolCalls.length > 0;
@@ -28619,6 +30499,7 @@ var AgentLoop = class _AgentLoop {
28619
30499
  } catch (e) {
28620
30500
  reason = "error";
28621
30501
  errorMsg = e instanceof Error ? e.message : String(e);
30502
+ caughtError = e;
28622
30503
  await this.hooks.emit("onRunError", {
28623
30504
  runId,
28624
30505
  agentId: this.id,
@@ -28667,6 +30548,7 @@ var AgentLoop = class _AgentLoop {
28667
30548
  totalToolTimeMs,
28668
30549
  runTrace
28669
30550
  });
30551
+ if (reason === "error") throw caughtError ?? new Error(errorMsg ?? "agent run failed");
28670
30552
  yield { type: "done", response: finalResponse };
28671
30553
  }
28672
30554
  /** Yield tool_call_start events for all tool calls in this step. */
@@ -37048,6 +38930,7 @@ var CAP_KEYS = {
37048
38930
  var BUILTIN_TOOL_KEYS = {
37049
38931
  search: "web_search",
37050
38932
  web_search: "web_search",
38933
+ web_fetch: "web_fetch",
37051
38934
  code_interpreter: "code_interpreter"
37052
38935
  };
37053
38936
  var KNOWN_KEYS = /* @__PURE__ */ new Set([
@@ -38597,6 +40480,7 @@ function createRetrieval(backend, config) {
38597
40480
  export {
38598
40481
  AgentBus,
38599
40482
  AgentLoop,
40483
+ AgentRunError,
38600
40484
  AnthropicAdapter,
38601
40485
  AnthropicBatchAdapter,
38602
40486
  AnthropicCountApi,
@@ -38652,6 +40536,7 @@ export {
38652
40536
  INPUT_SIZE_BUCKET_LABELS,
38653
40537
  InMemoryVectorStore,
38654
40538
  InternalToolRunner,
40539
+ InvalidFinalOutputError,
38655
40540
  JSON_API_SYSTEM_PROMPT,
38656
40541
  LAYER_AGENTLOOP_CONTEXT,
38657
40542
  LAYER_AGENTLOOP_SYSTEM,