@cloudflare/workers-types 4.20260525.1 → 4.20260526.1

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.
@@ -5368,9 +5368,6 @@ type ChatCompletionChoice = {
5368
5368
  | "function_call";
5369
5369
  logprobs: ChatCompletionLogprobs | null;
5370
5370
  };
5371
- type ChatCompletionsPromptInput = {
5372
- prompt: string;
5373
- } & ChatCompletionsCommonOptions;
5374
5371
  type ChatCompletionsMessagesInput = {
5375
5372
  messages: Array<ChatCompletionMessageParam>;
5376
5373
  } & ChatCompletionsCommonOptions;
@@ -9495,11 +9492,11 @@ declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
9495
9492
  postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
9496
9493
  }
9497
9494
  declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
9498
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9495
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9499
9496
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9500
9497
  }
9501
9498
  declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
9502
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9499
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9503
9500
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9504
9501
  }
9505
9502
  interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
@@ -10594,7 +10591,7 @@ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
10594
10591
  postProcessedOutputs: ChatCompletionsOutput;
10595
10592
  }
10596
10593
  declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
10597
- inputs: ChatCompletionsBase;
10594
+ inputs: ChatCompletionsInput;
10598
10595
  postProcessedOutputs: ChatCompletionsOutput;
10599
10596
  }
10600
10597
  declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
@@ -10602,7 +10599,7 @@ declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
10602
10599
  postProcessedOutputs: ChatCompletionsOutput;
10603
10600
  }
10604
10601
  declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
10605
- inputs: ChatCompletionsBase;
10602
+ inputs: ChatCompletionsInput;
10606
10603
  postProcessedOutputs: ChatCompletionsOutput;
10607
10604
  }
10608
10605
  interface AiModels {
@@ -10749,16 +10746,8 @@ type AiModelsSearchObject = {
10749
10746
  value: string;
10750
10747
  }[];
10751
10748
  };
10752
- type ChatCompletionsBase = XOR<
10753
- ChatCompletionsPromptInput,
10754
- ChatCompletionsMessagesInput
10755
- >;
10756
- type ChatCompletionsInput = XOR<
10757
- ChatCompletionsBase,
10758
- {
10759
- requests: ChatCompletionsBase[];
10760
- }
10761
- >;
10749
+ type ChatCompletionsBase = ChatCompletionsMessagesInput;
10750
+ type ChatCompletionsInput = ChatCompletionsMessagesInput;
10762
10751
  interface InferenceUpstreamError extends Error {}
10763
10752
  interface AiInternalError extends Error {}
10764
10753
  type AiModelListType = Record<string, any>;
@@ -10821,9 +10810,16 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
10821
10810
  inputs: AiModelList[Name]["inputs"],
10822
10811
  options?: AiOptions,
10823
10812
  ): Promise<AiModelList[Name]["postProcessedOutputs"]>;
10824
- // Unknown model (gateway fallback)
10825
- run(
10826
- model: string & {},
10813
+ // Unknown model (fallback).
10814
+ //
10815
+ // The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
10816
+ // route any model name that is a literal key of `AiModelList` to one of
10817
+ // the known-model overloads above (so input/output mismatches surface as
10818
+ // type errors rather than silently falling back to `Record<string, unknown>`).
10819
+ // Names that aren't in `AiModelList` — e.g. third-party gateway models
10820
+ // like `"google/nano-banana"` — still hit this overload.
10821
+ run<Model extends string>(
10822
+ model: Model extends keyof AiModelList ? never : Model,
10827
10823
  inputs: Record<string, unknown>,
10828
10824
  options?: AiOptions,
10829
10825
  ): Promise<Record<string, unknown>>;
@@ -5377,9 +5377,6 @@ export type ChatCompletionChoice = {
5377
5377
  | "function_call";
5378
5378
  logprobs: ChatCompletionLogprobs | null;
5379
5379
  };
5380
- export type ChatCompletionsPromptInput = {
5381
- prompt: string;
5382
- } & ChatCompletionsCommonOptions;
5383
5380
  export type ChatCompletionsMessagesInput = {
5384
5381
  messages: Array<ChatCompletionMessageParam>;
5385
5382
  } & ChatCompletionsCommonOptions;
@@ -9505,11 +9502,11 @@ export declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
9505
9502
  postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
9506
9503
  }
9507
9504
  export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
9508
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9505
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9509
9506
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9510
9507
  }
9511
9508
  export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
9512
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9509
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9513
9510
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9514
9511
  }
9515
9512
  export interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
@@ -10604,7 +10601,7 @@ export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
10604
10601
  postProcessedOutputs: ChatCompletionsOutput;
10605
10602
  }
10606
10603
  export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
10607
- inputs: ChatCompletionsBase;
10604
+ inputs: ChatCompletionsInput;
10608
10605
  postProcessedOutputs: ChatCompletionsOutput;
10609
10606
  }
10610
10607
  export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
@@ -10612,7 +10609,7 @@ export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
10612
10609
  postProcessedOutputs: ChatCompletionsOutput;
10613
10610
  }
10614
10611
  export declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
10615
- inputs: ChatCompletionsBase;
10612
+ inputs: ChatCompletionsInput;
10616
10613
  postProcessedOutputs: ChatCompletionsOutput;
10617
10614
  }
10618
10615
  export interface AiModels {
@@ -10759,16 +10756,8 @@ export type AiModelsSearchObject = {
10759
10756
  value: string;
10760
10757
  }[];
10761
10758
  };
10762
- export type ChatCompletionsBase = XOR<
10763
- ChatCompletionsPromptInput,
10764
- ChatCompletionsMessagesInput
10765
- >;
10766
- export type ChatCompletionsInput = XOR<
10767
- ChatCompletionsBase,
10768
- {
10769
- requests: ChatCompletionsBase[];
10770
- }
10771
- >;
10759
+ export type ChatCompletionsBase = ChatCompletionsMessagesInput;
10760
+ export type ChatCompletionsInput = ChatCompletionsMessagesInput;
10772
10761
  export interface InferenceUpstreamError extends Error {}
10773
10762
  export interface AiInternalError extends Error {}
10774
10763
  export type AiModelListType = Record<string, any>;
@@ -10833,9 +10822,16 @@ export declare abstract class Ai<
10833
10822
  inputs: AiModelList[Name]["inputs"],
10834
10823
  options?: AiOptions,
10835
10824
  ): Promise<AiModelList[Name]["postProcessedOutputs"]>;
10836
- // Unknown model (gateway fallback)
10837
- run(
10838
- model: string & {},
10825
+ // Unknown model (fallback).
10826
+ //
10827
+ // The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
10828
+ // route any model name that is a literal key of `AiModelList` to one of
10829
+ // the known-model overloads above (so input/output mismatches surface as
10830
+ // type errors rather than silently falling back to `Record<string, unknown>`).
10831
+ // Names that aren't in `AiModelList` — e.g. third-party gateway models
10832
+ // like `"google/nano-banana"` — still hit this overload.
10833
+ run<Model extends string>(
10834
+ model: Model extends keyof AiModelList ? never : Model,
10839
10835
  inputs: Record<string, unknown>,
10840
10836
  options?: AiOptions,
10841
10837
  ): Promise<Record<string, unknown>>;
@@ -5435,9 +5435,6 @@ type ChatCompletionChoice = {
5435
5435
  | "function_call";
5436
5436
  logprobs: ChatCompletionLogprobs | null;
5437
5437
  };
5438
- type ChatCompletionsPromptInput = {
5439
- prompt: string;
5440
- } & ChatCompletionsCommonOptions;
5441
5438
  type ChatCompletionsMessagesInput = {
5442
5439
  messages: Array<ChatCompletionMessageParam>;
5443
5440
  } & ChatCompletionsCommonOptions;
@@ -9562,11 +9559,11 @@ declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
9562
9559
  postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
9563
9560
  }
9564
9561
  declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
9565
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9562
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9566
9563
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9567
9564
  }
9568
9565
  declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
9569
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9566
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9570
9567
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9571
9568
  }
9572
9569
  interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
@@ -10661,7 +10658,7 @@ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
10661
10658
  postProcessedOutputs: ChatCompletionsOutput;
10662
10659
  }
10663
10660
  declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
10664
- inputs: ChatCompletionsBase;
10661
+ inputs: ChatCompletionsInput;
10665
10662
  postProcessedOutputs: ChatCompletionsOutput;
10666
10663
  }
10667
10664
  declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
@@ -10669,7 +10666,7 @@ declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
10669
10666
  postProcessedOutputs: ChatCompletionsOutput;
10670
10667
  }
10671
10668
  declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
10672
- inputs: ChatCompletionsBase;
10669
+ inputs: ChatCompletionsInput;
10673
10670
  postProcessedOutputs: ChatCompletionsOutput;
10674
10671
  }
10675
10672
  interface AiModels {
@@ -10816,16 +10813,8 @@ type AiModelsSearchObject = {
10816
10813
  value: string;
10817
10814
  }[];
10818
10815
  };
10819
- type ChatCompletionsBase = XOR<
10820
- ChatCompletionsPromptInput,
10821
- ChatCompletionsMessagesInput
10822
- >;
10823
- type ChatCompletionsInput = XOR<
10824
- ChatCompletionsBase,
10825
- {
10826
- requests: ChatCompletionsBase[];
10827
- }
10828
- >;
10816
+ type ChatCompletionsBase = ChatCompletionsMessagesInput;
10817
+ type ChatCompletionsInput = ChatCompletionsMessagesInput;
10829
10818
  interface InferenceUpstreamError extends Error {}
10830
10819
  interface AiInternalError extends Error {}
10831
10820
  type AiModelListType = Record<string, any>;
@@ -10888,9 +10877,16 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
10888
10877
  inputs: AiModelList[Name]["inputs"],
10889
10878
  options?: AiOptions,
10890
10879
  ): Promise<AiModelList[Name]["postProcessedOutputs"]>;
10891
- // Unknown model (gateway fallback)
10892
- run(
10893
- model: string & {},
10880
+ // Unknown model (fallback).
10881
+ //
10882
+ // The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
10883
+ // route any model name that is a literal key of `AiModelList` to one of
10884
+ // the known-model overloads above (so input/output mismatches surface as
10885
+ // type errors rather than silently falling back to `Record<string, unknown>`).
10886
+ // Names that aren't in `AiModelList` — e.g. third-party gateway models
10887
+ // like `"google/nano-banana"` — still hit this overload.
10888
+ run<Model extends string>(
10889
+ model: Model extends keyof AiModelList ? never : Model,
10894
10890
  inputs: Record<string, unknown>,
10895
10891
  options?: AiOptions,
10896
10892
  ): Promise<Record<string, unknown>>;
@@ -5444,9 +5444,6 @@ export type ChatCompletionChoice = {
5444
5444
  | "function_call";
5445
5445
  logprobs: ChatCompletionLogprobs | null;
5446
5446
  };
5447
- export type ChatCompletionsPromptInput = {
5448
- prompt: string;
5449
- } & ChatCompletionsCommonOptions;
5450
5447
  export type ChatCompletionsMessagesInput = {
5451
5448
  messages: Array<ChatCompletionMessageParam>;
5452
5449
  } & ChatCompletionsCommonOptions;
@@ -9572,11 +9569,11 @@ export declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
9572
9569
  postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
9573
9570
  }
9574
9571
  export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
9575
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9572
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9576
9573
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9577
9574
  }
9578
9575
  export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
9579
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9576
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9580
9577
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9581
9578
  }
9582
9579
  export interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
@@ -10671,7 +10668,7 @@ export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
10671
10668
  postProcessedOutputs: ChatCompletionsOutput;
10672
10669
  }
10673
10670
  export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
10674
- inputs: ChatCompletionsBase;
10671
+ inputs: ChatCompletionsInput;
10675
10672
  postProcessedOutputs: ChatCompletionsOutput;
10676
10673
  }
10677
10674
  export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
@@ -10679,7 +10676,7 @@ export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
10679
10676
  postProcessedOutputs: ChatCompletionsOutput;
10680
10677
  }
10681
10678
  export declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
10682
- inputs: ChatCompletionsBase;
10679
+ inputs: ChatCompletionsInput;
10683
10680
  postProcessedOutputs: ChatCompletionsOutput;
10684
10681
  }
10685
10682
  export interface AiModels {
@@ -10826,16 +10823,8 @@ export type AiModelsSearchObject = {
10826
10823
  value: string;
10827
10824
  }[];
10828
10825
  };
10829
- export type ChatCompletionsBase = XOR<
10830
- ChatCompletionsPromptInput,
10831
- ChatCompletionsMessagesInput
10832
- >;
10833
- export type ChatCompletionsInput = XOR<
10834
- ChatCompletionsBase,
10835
- {
10836
- requests: ChatCompletionsBase[];
10837
- }
10838
- >;
10826
+ export type ChatCompletionsBase = ChatCompletionsMessagesInput;
10827
+ export type ChatCompletionsInput = ChatCompletionsMessagesInput;
10839
10828
  export interface InferenceUpstreamError extends Error {}
10840
10829
  export interface AiInternalError extends Error {}
10841
10830
  export type AiModelListType = Record<string, any>;
@@ -10900,9 +10889,16 @@ export declare abstract class Ai<
10900
10889
  inputs: AiModelList[Name]["inputs"],
10901
10890
  options?: AiOptions,
10902
10891
  ): Promise<AiModelList[Name]["postProcessedOutputs"]>;
10903
- // Unknown model (gateway fallback)
10904
- run(
10905
- model: string & {},
10892
+ // Unknown model (fallback).
10893
+ //
10894
+ // The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
10895
+ // route any model name that is a literal key of `AiModelList` to one of
10896
+ // the known-model overloads above (so input/output mismatches surface as
10897
+ // type errors rather than silently falling back to `Record<string, unknown>`).
10898
+ // Names that aren't in `AiModelList` — e.g. third-party gateway models
10899
+ // like `"google/nano-banana"` — still hit this overload.
10900
+ run<Model extends string>(
10901
+ model: Model extends keyof AiModelList ? never : Model,
10906
10902
  inputs: Record<string, unknown>,
10907
10903
  options?: AiOptions,
10908
10904
  ): Promise<Record<string, unknown>>;
@@ -5444,9 +5444,6 @@ type ChatCompletionChoice = {
5444
5444
  | "function_call";
5445
5445
  logprobs: ChatCompletionLogprobs | null;
5446
5446
  };
5447
- type ChatCompletionsPromptInput = {
5448
- prompt: string;
5449
- } & ChatCompletionsCommonOptions;
5450
5447
  type ChatCompletionsMessagesInput = {
5451
5448
  messages: Array<ChatCompletionMessageParam>;
5452
5449
  } & ChatCompletionsCommonOptions;
@@ -9571,11 +9568,11 @@ declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
9571
9568
  postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
9572
9569
  }
9573
9570
  declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
9574
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9571
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9575
9572
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9576
9573
  }
9577
9574
  declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
9578
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9575
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9579
9576
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9580
9577
  }
9581
9578
  interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
@@ -10670,7 +10667,7 @@ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
10670
10667
  postProcessedOutputs: ChatCompletionsOutput;
10671
10668
  }
10672
10669
  declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
10673
- inputs: ChatCompletionsBase;
10670
+ inputs: ChatCompletionsInput;
10674
10671
  postProcessedOutputs: ChatCompletionsOutput;
10675
10672
  }
10676
10673
  declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
@@ -10678,7 +10675,7 @@ declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
10678
10675
  postProcessedOutputs: ChatCompletionsOutput;
10679
10676
  }
10680
10677
  declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
10681
- inputs: ChatCompletionsBase;
10678
+ inputs: ChatCompletionsInput;
10682
10679
  postProcessedOutputs: ChatCompletionsOutput;
10683
10680
  }
10684
10681
  interface AiModels {
@@ -10825,16 +10822,8 @@ type AiModelsSearchObject = {
10825
10822
  value: string;
10826
10823
  }[];
10827
10824
  };
10828
- type ChatCompletionsBase = XOR<
10829
- ChatCompletionsPromptInput,
10830
- ChatCompletionsMessagesInput
10831
- >;
10832
- type ChatCompletionsInput = XOR<
10833
- ChatCompletionsBase,
10834
- {
10835
- requests: ChatCompletionsBase[];
10836
- }
10837
- >;
10825
+ type ChatCompletionsBase = ChatCompletionsMessagesInput;
10826
+ type ChatCompletionsInput = ChatCompletionsMessagesInput;
10838
10827
  interface InferenceUpstreamError extends Error {}
10839
10828
  interface AiInternalError extends Error {}
10840
10829
  type AiModelListType = Record<string, any>;
@@ -10897,9 +10886,16 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
10897
10886
  inputs: AiModelList[Name]["inputs"],
10898
10887
  options?: AiOptions,
10899
10888
  ): Promise<AiModelList[Name]["postProcessedOutputs"]>;
10900
- // Unknown model (gateway fallback)
10901
- run(
10902
- model: string & {},
10889
+ // Unknown model (fallback).
10890
+ //
10891
+ // The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
10892
+ // route any model name that is a literal key of `AiModelList` to one of
10893
+ // the known-model overloads above (so input/output mismatches surface as
10894
+ // type errors rather than silently falling back to `Record<string, unknown>`).
10895
+ // Names that aren't in `AiModelList` — e.g. third-party gateway models
10896
+ // like `"google/nano-banana"` — still hit this overload.
10897
+ run<Model extends string>(
10898
+ model: Model extends keyof AiModelList ? never : Model,
10903
10899
  inputs: Record<string, unknown>,
10904
10900
  options?: AiOptions,
10905
10901
  ): Promise<Record<string, unknown>>;
@@ -5453,9 +5453,6 @@ export type ChatCompletionChoice = {
5453
5453
  | "function_call";
5454
5454
  logprobs: ChatCompletionLogprobs | null;
5455
5455
  };
5456
- export type ChatCompletionsPromptInput = {
5457
- prompt: string;
5458
- } & ChatCompletionsCommonOptions;
5459
5456
  export type ChatCompletionsMessagesInput = {
5460
5457
  messages: Array<ChatCompletionMessageParam>;
5461
5458
  } & ChatCompletionsCommonOptions;
@@ -9581,11 +9578,11 @@ export declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
9581
9578
  postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
9582
9579
  }
9583
9580
  export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
9584
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9581
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9585
9582
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9586
9583
  }
9587
9584
  export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
9588
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9585
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9589
9586
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9590
9587
  }
9591
9588
  export interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
@@ -10680,7 +10677,7 @@ export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
10680
10677
  postProcessedOutputs: ChatCompletionsOutput;
10681
10678
  }
10682
10679
  export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
10683
- inputs: ChatCompletionsBase;
10680
+ inputs: ChatCompletionsInput;
10684
10681
  postProcessedOutputs: ChatCompletionsOutput;
10685
10682
  }
10686
10683
  export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
@@ -10688,7 +10685,7 @@ export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
10688
10685
  postProcessedOutputs: ChatCompletionsOutput;
10689
10686
  }
10690
10687
  export declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
10691
- inputs: ChatCompletionsBase;
10688
+ inputs: ChatCompletionsInput;
10692
10689
  postProcessedOutputs: ChatCompletionsOutput;
10693
10690
  }
10694
10691
  export interface AiModels {
@@ -10835,16 +10832,8 @@ export type AiModelsSearchObject = {
10835
10832
  value: string;
10836
10833
  }[];
10837
10834
  };
10838
- export type ChatCompletionsBase = XOR<
10839
- ChatCompletionsPromptInput,
10840
- ChatCompletionsMessagesInput
10841
- >;
10842
- export type ChatCompletionsInput = XOR<
10843
- ChatCompletionsBase,
10844
- {
10845
- requests: ChatCompletionsBase[];
10846
- }
10847
- >;
10835
+ export type ChatCompletionsBase = ChatCompletionsMessagesInput;
10836
+ export type ChatCompletionsInput = ChatCompletionsMessagesInput;
10848
10837
  export interface InferenceUpstreamError extends Error {}
10849
10838
  export interface AiInternalError extends Error {}
10850
10839
  export type AiModelListType = Record<string, any>;
@@ -10909,9 +10898,16 @@ export declare abstract class Ai<
10909
10898
  inputs: AiModelList[Name]["inputs"],
10910
10899
  options?: AiOptions,
10911
10900
  ): Promise<AiModelList[Name]["postProcessedOutputs"]>;
10912
- // Unknown model (gateway fallback)
10913
- run(
10914
- model: string & {},
10901
+ // Unknown model (fallback).
10902
+ //
10903
+ // The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
10904
+ // route any model name that is a literal key of `AiModelList` to one of
10905
+ // the known-model overloads above (so input/output mismatches surface as
10906
+ // type errors rather than silently falling back to `Record<string, unknown>`).
10907
+ // Names that aren't in `AiModelList` — e.g. third-party gateway models
10908
+ // like `"google/nano-banana"` — still hit this overload.
10909
+ run<Model extends string>(
10910
+ model: Model extends keyof AiModelList ? never : Model,
10915
10911
  inputs: Record<string, unknown>,
10916
10912
  options?: AiOptions,
10917
10913
  ): Promise<Record<string, unknown>>;
@@ -5445,9 +5445,6 @@ type ChatCompletionChoice = {
5445
5445
  | "function_call";
5446
5446
  logprobs: ChatCompletionLogprobs | null;
5447
5447
  };
5448
- type ChatCompletionsPromptInput = {
5449
- prompt: string;
5450
- } & ChatCompletionsCommonOptions;
5451
5448
  type ChatCompletionsMessagesInput = {
5452
5449
  messages: Array<ChatCompletionMessageParam>;
5453
5450
  } & ChatCompletionsCommonOptions;
@@ -9572,11 +9569,11 @@ declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
9572
9569
  postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
9573
9570
  }
9574
9571
  declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
9575
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9572
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9576
9573
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9577
9574
  }
9578
9575
  declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
9579
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9576
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9580
9577
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9581
9578
  }
9582
9579
  interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
@@ -10671,7 +10668,7 @@ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
10671
10668
  postProcessedOutputs: ChatCompletionsOutput;
10672
10669
  }
10673
10670
  declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
10674
- inputs: ChatCompletionsBase;
10671
+ inputs: ChatCompletionsInput;
10675
10672
  postProcessedOutputs: ChatCompletionsOutput;
10676
10673
  }
10677
10674
  declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
@@ -10679,7 +10676,7 @@ declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
10679
10676
  postProcessedOutputs: ChatCompletionsOutput;
10680
10677
  }
10681
10678
  declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
10682
- inputs: ChatCompletionsBase;
10679
+ inputs: ChatCompletionsInput;
10683
10680
  postProcessedOutputs: ChatCompletionsOutput;
10684
10681
  }
10685
10682
  interface AiModels {
@@ -10826,16 +10823,8 @@ type AiModelsSearchObject = {
10826
10823
  value: string;
10827
10824
  }[];
10828
10825
  };
10829
- type ChatCompletionsBase = XOR<
10830
- ChatCompletionsPromptInput,
10831
- ChatCompletionsMessagesInput
10832
- >;
10833
- type ChatCompletionsInput = XOR<
10834
- ChatCompletionsBase,
10835
- {
10836
- requests: ChatCompletionsBase[];
10837
- }
10838
- >;
10826
+ type ChatCompletionsBase = ChatCompletionsMessagesInput;
10827
+ type ChatCompletionsInput = ChatCompletionsMessagesInput;
10839
10828
  interface InferenceUpstreamError extends Error {}
10840
10829
  interface AiInternalError extends Error {}
10841
10830
  type AiModelListType = Record<string, any>;
@@ -10898,9 +10887,16 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
10898
10887
  inputs: AiModelList[Name]["inputs"],
10899
10888
  options?: AiOptions,
10900
10889
  ): Promise<AiModelList[Name]["postProcessedOutputs"]>;
10901
- // Unknown model (gateway fallback)
10902
- run(
10903
- model: string & {},
10890
+ // Unknown model (fallback).
10891
+ //
10892
+ // The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
10893
+ // route any model name that is a literal key of `AiModelList` to one of
10894
+ // the known-model overloads above (so input/output mismatches surface as
10895
+ // type errors rather than silently falling back to `Record<string, unknown>`).
10896
+ // Names that aren't in `AiModelList` — e.g. third-party gateway models
10897
+ // like `"google/nano-banana"` — still hit this overload.
10898
+ run<Model extends string>(
10899
+ model: Model extends keyof AiModelList ? never : Model,
10904
10900
  inputs: Record<string, unknown>,
10905
10901
  options?: AiOptions,
10906
10902
  ): Promise<Record<string, unknown>>;
@@ -5454,9 +5454,6 @@ export type ChatCompletionChoice = {
5454
5454
  | "function_call";
5455
5455
  logprobs: ChatCompletionLogprobs | null;
5456
5456
  };
5457
- export type ChatCompletionsPromptInput = {
5458
- prompt: string;
5459
- } & ChatCompletionsCommonOptions;
5460
5457
  export type ChatCompletionsMessagesInput = {
5461
5458
  messages: Array<ChatCompletionMessageParam>;
5462
5459
  } & ChatCompletionsCommonOptions;
@@ -9582,11 +9579,11 @@ export declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
9582
9579
  postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
9583
9580
  }
9584
9581
  export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
9585
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9582
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9586
9583
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9587
9584
  }
9588
9585
  export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
9589
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9586
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9590
9587
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9591
9588
  }
9592
9589
  export interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
@@ -10681,7 +10678,7 @@ export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
10681
10678
  postProcessedOutputs: ChatCompletionsOutput;
10682
10679
  }
10683
10680
  export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
10684
- inputs: ChatCompletionsBase;
10681
+ inputs: ChatCompletionsInput;
10685
10682
  postProcessedOutputs: ChatCompletionsOutput;
10686
10683
  }
10687
10684
  export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
@@ -10689,7 +10686,7 @@ export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
10689
10686
  postProcessedOutputs: ChatCompletionsOutput;
10690
10687
  }
10691
10688
  export declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
10692
- inputs: ChatCompletionsBase;
10689
+ inputs: ChatCompletionsInput;
10693
10690
  postProcessedOutputs: ChatCompletionsOutput;
10694
10691
  }
10695
10692
  export interface AiModels {
@@ -10836,16 +10833,8 @@ export type AiModelsSearchObject = {
10836
10833
  value: string;
10837
10834
  }[];
10838
10835
  };
10839
- export type ChatCompletionsBase = XOR<
10840
- ChatCompletionsPromptInput,
10841
- ChatCompletionsMessagesInput
10842
- >;
10843
- export type ChatCompletionsInput = XOR<
10844
- ChatCompletionsBase,
10845
- {
10846
- requests: ChatCompletionsBase[];
10847
- }
10848
- >;
10836
+ export type ChatCompletionsBase = ChatCompletionsMessagesInput;
10837
+ export type ChatCompletionsInput = ChatCompletionsMessagesInput;
10849
10838
  export interface InferenceUpstreamError extends Error {}
10850
10839
  export interface AiInternalError extends Error {}
10851
10840
  export type AiModelListType = Record<string, any>;
@@ -10910,9 +10899,16 @@ export declare abstract class Ai<
10910
10899
  inputs: AiModelList[Name]["inputs"],
10911
10900
  options?: AiOptions,
10912
10901
  ): Promise<AiModelList[Name]["postProcessedOutputs"]>;
10913
- // Unknown model (gateway fallback)
10914
- run(
10915
- model: string & {},
10902
+ // Unknown model (fallback).
10903
+ //
10904
+ // The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
10905
+ // route any model name that is a literal key of `AiModelList` to one of
10906
+ // the known-model overloads above (so input/output mismatches surface as
10907
+ // type errors rather than silently falling back to `Record<string, unknown>`).
10908
+ // Names that aren't in `AiModelList` — e.g. third-party gateway models
10909
+ // like `"google/nano-banana"` — still hit this overload.
10910
+ run<Model extends string>(
10911
+ model: Model extends keyof AiModelList ? never : Model,
10916
10912
  inputs: Record<string, unknown>,
10917
10913
  options?: AiOptions,
10918
10914
  ): Promise<Record<string, unknown>>;