@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.
@@ -6177,9 +6177,6 @@ type ChatCompletionChoice = {
6177
6177
  | "function_call";
6178
6178
  logprobs: ChatCompletionLogprobs | null;
6179
6179
  };
6180
- type ChatCompletionsPromptInput = {
6181
- prompt: string;
6182
- } & ChatCompletionsCommonOptions;
6183
6180
  type ChatCompletionsMessagesInput = {
6184
6181
  messages: Array<ChatCompletionMessageParam>;
6185
6182
  } & ChatCompletionsCommonOptions;
@@ -10304,11 +10301,11 @@ declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
10304
10301
  postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
10305
10302
  }
10306
10303
  declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
10307
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
10304
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
10308
10305
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
10309
10306
  }
10310
10307
  declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
10311
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
10308
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
10312
10309
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
10313
10310
  }
10314
10311
  interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
@@ -11403,7 +11400,7 @@ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
11403
11400
  postProcessedOutputs: ChatCompletionsOutput;
11404
11401
  }
11405
11402
  declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
11406
- inputs: ChatCompletionsBase;
11403
+ inputs: ChatCompletionsInput;
11407
11404
  postProcessedOutputs: ChatCompletionsOutput;
11408
11405
  }
11409
11406
  declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
@@ -11411,7 +11408,7 @@ declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
11411
11408
  postProcessedOutputs: ChatCompletionsOutput;
11412
11409
  }
11413
11410
  declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
11414
- inputs: ChatCompletionsBase;
11411
+ inputs: ChatCompletionsInput;
11415
11412
  postProcessedOutputs: ChatCompletionsOutput;
11416
11413
  }
11417
11414
  interface AiModels {
@@ -11558,16 +11555,8 @@ type AiModelsSearchObject = {
11558
11555
  value: string;
11559
11556
  }[];
11560
11557
  };
11561
- type ChatCompletionsBase = XOR<
11562
- ChatCompletionsPromptInput,
11563
- ChatCompletionsMessagesInput
11564
- >;
11565
- type ChatCompletionsInput = XOR<
11566
- ChatCompletionsBase,
11567
- {
11568
- requests: ChatCompletionsBase[];
11569
- }
11570
- >;
11558
+ type ChatCompletionsBase = ChatCompletionsMessagesInput;
11559
+ type ChatCompletionsInput = ChatCompletionsMessagesInput;
11571
11560
  interface InferenceUpstreamError extends Error {}
11572
11561
  interface AiInternalError extends Error {}
11573
11562
  type AiModelListType = Record<string, any>;
@@ -11630,9 +11619,16 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
11630
11619
  inputs: AiModelList[Name]["inputs"],
11631
11620
  options?: AiOptions,
11632
11621
  ): Promise<AiModelList[Name]["postProcessedOutputs"]>;
11633
- // Unknown model (gateway fallback)
11634
- run(
11635
- model: string & {},
11622
+ // Unknown model (fallback).
11623
+ //
11624
+ // The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
11625
+ // route any model name that is a literal key of `AiModelList` to one of
11626
+ // the known-model overloads above (so input/output mismatches surface as
11627
+ // type errors rather than silently falling back to `Record<string, unknown>`).
11628
+ // Names that aren't in `AiModelList` — e.g. third-party gateway models
11629
+ // like `"google/nano-banana"` — still hit this overload.
11630
+ run<Model extends string>(
11631
+ model: Model extends keyof AiModelList ? never : Model,
11636
11632
  inputs: Record<string, unknown>,
11637
11633
  options?: AiOptions,
11638
11634
  ): Promise<Record<string, unknown>>;
@@ -6186,9 +6186,6 @@ export type ChatCompletionChoice = {
6186
6186
  | "function_call";
6187
6187
  logprobs: ChatCompletionLogprobs | null;
6188
6188
  };
6189
- export type ChatCompletionsPromptInput = {
6190
- prompt: string;
6191
- } & ChatCompletionsCommonOptions;
6192
6189
  export type ChatCompletionsMessagesInput = {
6193
6190
  messages: Array<ChatCompletionMessageParam>;
6194
6191
  } & ChatCompletionsCommonOptions;
@@ -10314,11 +10311,11 @@ export declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
10314
10311
  postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
10315
10312
  }
10316
10313
  export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
10317
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
10314
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
10318
10315
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
10319
10316
  }
10320
10317
  export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
10321
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
10318
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
10322
10319
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
10323
10320
  }
10324
10321
  export interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
@@ -11413,7 +11410,7 @@ export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
11413
11410
  postProcessedOutputs: ChatCompletionsOutput;
11414
11411
  }
11415
11412
  export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
11416
- inputs: ChatCompletionsBase;
11413
+ inputs: ChatCompletionsInput;
11417
11414
  postProcessedOutputs: ChatCompletionsOutput;
11418
11415
  }
11419
11416
  export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
@@ -11421,7 +11418,7 @@ export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
11421
11418
  postProcessedOutputs: ChatCompletionsOutput;
11422
11419
  }
11423
11420
  export declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
11424
- inputs: ChatCompletionsBase;
11421
+ inputs: ChatCompletionsInput;
11425
11422
  postProcessedOutputs: ChatCompletionsOutput;
11426
11423
  }
11427
11424
  export interface AiModels {
@@ -11568,16 +11565,8 @@ export type AiModelsSearchObject = {
11568
11565
  value: string;
11569
11566
  }[];
11570
11567
  };
11571
- export type ChatCompletionsBase = XOR<
11572
- ChatCompletionsPromptInput,
11573
- ChatCompletionsMessagesInput
11574
- >;
11575
- export type ChatCompletionsInput = XOR<
11576
- ChatCompletionsBase,
11577
- {
11578
- requests: ChatCompletionsBase[];
11579
- }
11580
- >;
11568
+ export type ChatCompletionsBase = ChatCompletionsMessagesInput;
11569
+ export type ChatCompletionsInput = ChatCompletionsMessagesInput;
11581
11570
  export interface InferenceUpstreamError extends Error {}
11582
11571
  export interface AiInternalError extends Error {}
11583
11572
  export type AiModelListType = Record<string, any>;
@@ -11642,9 +11631,16 @@ export declare abstract class Ai<
11642
11631
  inputs: AiModelList[Name]["inputs"],
11643
11632
  options?: AiOptions,
11644
11633
  ): Promise<AiModelList[Name]["postProcessedOutputs"]>;
11645
- // Unknown model (gateway fallback)
11646
- run(
11647
- model: string & {},
11634
+ // Unknown model (fallback).
11635
+ //
11636
+ // The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
11637
+ // route any model name that is a literal key of `AiModelList` to one of
11638
+ // the known-model overloads above (so input/output mismatches surface as
11639
+ // type errors rather than silently falling back to `Record<string, unknown>`).
11640
+ // Names that aren't in `AiModelList` — e.g. third-party gateway models
11641
+ // like `"google/nano-banana"` — still hit this overload.
11642
+ run<Model extends string>(
11643
+ model: Model extends keyof AiModelList ? never : Model,
11648
11644
  inputs: Record<string, unknown>,
11649
11645
  options?: AiOptions,
11650
11646
  ): Promise<Record<string, unknown>>;
package/index.d.ts CHANGED
@@ -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>>;
package/index.ts CHANGED
@@ -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>>;
package/latest/index.d.ts CHANGED
@@ -5509,9 +5509,6 @@ type ChatCompletionChoice = {
5509
5509
  | "function_call";
5510
5510
  logprobs: ChatCompletionLogprobs | null;
5511
5511
  };
5512
- type ChatCompletionsPromptInput = {
5513
- prompt: string;
5514
- } & ChatCompletionsCommonOptions;
5515
5512
  type ChatCompletionsMessagesInput = {
5516
5513
  messages: Array<ChatCompletionMessageParam>;
5517
5514
  } & ChatCompletionsCommonOptions;
@@ -9636,11 +9633,11 @@ declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
9636
9633
  postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
9637
9634
  }
9638
9635
  declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
9639
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9636
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9640
9637
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9641
9638
  }
9642
9639
  declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
9643
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9640
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9644
9641
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9645
9642
  }
9646
9643
  interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
@@ -10735,7 +10732,7 @@ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
10735
10732
  postProcessedOutputs: ChatCompletionsOutput;
10736
10733
  }
10737
10734
  declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
10738
- inputs: ChatCompletionsBase;
10735
+ inputs: ChatCompletionsInput;
10739
10736
  postProcessedOutputs: ChatCompletionsOutput;
10740
10737
  }
10741
10738
  declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
@@ -10743,7 +10740,7 @@ declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
10743
10740
  postProcessedOutputs: ChatCompletionsOutput;
10744
10741
  }
10745
10742
  declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
10746
- inputs: ChatCompletionsBase;
10743
+ inputs: ChatCompletionsInput;
10747
10744
  postProcessedOutputs: ChatCompletionsOutput;
10748
10745
  }
10749
10746
  interface AiModels {
@@ -10890,16 +10887,8 @@ type AiModelsSearchObject = {
10890
10887
  value: string;
10891
10888
  }[];
10892
10889
  };
10893
- type ChatCompletionsBase = XOR<
10894
- ChatCompletionsPromptInput,
10895
- ChatCompletionsMessagesInput
10896
- >;
10897
- type ChatCompletionsInput = XOR<
10898
- ChatCompletionsBase,
10899
- {
10900
- requests: ChatCompletionsBase[];
10901
- }
10902
- >;
10890
+ type ChatCompletionsBase = ChatCompletionsMessagesInput;
10891
+ type ChatCompletionsInput = ChatCompletionsMessagesInput;
10903
10892
  interface InferenceUpstreamError extends Error {}
10904
10893
  interface AiInternalError extends Error {}
10905
10894
  type AiModelListType = Record<string, any>;
@@ -10962,9 +10951,16 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
10962
10951
  inputs: AiModelList[Name]["inputs"],
10963
10952
  options?: AiOptions,
10964
10953
  ): Promise<AiModelList[Name]["postProcessedOutputs"]>;
10965
- // Unknown model (gateway fallback)
10966
- run(
10967
- model: string & {},
10954
+ // Unknown model (fallback).
10955
+ //
10956
+ // The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
10957
+ // route any model name that is a literal key of `AiModelList` to one of
10958
+ // the known-model overloads above (so input/output mismatches surface as
10959
+ // type errors rather than silently falling back to `Record<string, unknown>`).
10960
+ // Names that aren't in `AiModelList` — e.g. third-party gateway models
10961
+ // like `"google/nano-banana"` — still hit this overload.
10962
+ run<Model extends string>(
10963
+ model: Model extends keyof AiModelList ? never : Model,
10968
10964
  inputs: Record<string, unknown>,
10969
10965
  options?: AiOptions,
10970
10966
  ): Promise<Record<string, unknown>>;
package/latest/index.ts CHANGED
@@ -5518,9 +5518,6 @@ export type ChatCompletionChoice = {
5518
5518
  | "function_call";
5519
5519
  logprobs: ChatCompletionLogprobs | null;
5520
5520
  };
5521
- export type ChatCompletionsPromptInput = {
5522
- prompt: string;
5523
- } & ChatCompletionsCommonOptions;
5524
5521
  export type ChatCompletionsMessagesInput = {
5525
5522
  messages: Array<ChatCompletionMessageParam>;
5526
5523
  } & ChatCompletionsCommonOptions;
@@ -9646,11 +9643,11 @@ export declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
9646
9643
  postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
9647
9644
  }
9648
9645
  export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
9649
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9646
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9650
9647
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9651
9648
  }
9652
9649
  export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
9653
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9650
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
9654
9651
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
9655
9652
  }
9656
9653
  export interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
@@ -10745,7 +10742,7 @@ export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
10745
10742
  postProcessedOutputs: ChatCompletionsOutput;
10746
10743
  }
10747
10744
  export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
10748
- inputs: ChatCompletionsBase;
10745
+ inputs: ChatCompletionsInput;
10749
10746
  postProcessedOutputs: ChatCompletionsOutput;
10750
10747
  }
10751
10748
  export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
@@ -10753,7 +10750,7 @@ export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
10753
10750
  postProcessedOutputs: ChatCompletionsOutput;
10754
10751
  }
10755
10752
  export declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
10756
- inputs: ChatCompletionsBase;
10753
+ inputs: ChatCompletionsInput;
10757
10754
  postProcessedOutputs: ChatCompletionsOutput;
10758
10755
  }
10759
10756
  export interface AiModels {
@@ -10900,16 +10897,8 @@ export type AiModelsSearchObject = {
10900
10897
  value: string;
10901
10898
  }[];
10902
10899
  };
10903
- export type ChatCompletionsBase = XOR<
10904
- ChatCompletionsPromptInput,
10905
- ChatCompletionsMessagesInput
10906
- >;
10907
- export type ChatCompletionsInput = XOR<
10908
- ChatCompletionsBase,
10909
- {
10910
- requests: ChatCompletionsBase[];
10911
- }
10912
- >;
10900
+ export type ChatCompletionsBase = ChatCompletionsMessagesInput;
10901
+ export type ChatCompletionsInput = ChatCompletionsMessagesInput;
10913
10902
  export interface InferenceUpstreamError extends Error {}
10914
10903
  export interface AiInternalError extends Error {}
10915
10904
  export type AiModelListType = Record<string, any>;
@@ -10974,9 +10963,16 @@ export declare abstract class Ai<
10974
10963
  inputs: AiModelList[Name]["inputs"],
10975
10964
  options?: AiOptions,
10976
10965
  ): Promise<AiModelList[Name]["postProcessedOutputs"]>;
10977
- // Unknown model (gateway fallback)
10978
- run(
10979
- model: string & {},
10966
+ // Unknown model (fallback).
10967
+ //
10968
+ // The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
10969
+ // route any model name that is a literal key of `AiModelList` to one of
10970
+ // the known-model overloads above (so input/output mismatches surface as
10971
+ // type errors rather than silently falling back to `Record<string, unknown>`).
10972
+ // Names that aren't in `AiModelList` — e.g. third-party gateway models
10973
+ // like `"google/nano-banana"` — still hit this overload.
10974
+ run<Model extends string>(
10975
+ model: Model extends keyof AiModelList ? never : Model,
10980
10976
  inputs: Record<string, unknown>,
10981
10977
  options?: AiOptions,
10982
10978
  ): Promise<Record<string, unknown>>;
package/oldest/index.d.ts CHANGED
@@ -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>>;
package/oldest/index.ts CHANGED
@@ -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>>;
package/package.json CHANGED
@@ -7,5 +7,5 @@
7
7
  },
8
8
  "author": "Cloudflare Workers DevProd Team <workers-devprod@cloudflare.com> (https://workers.cloudflare.com)",
9
9
  "license": "MIT OR Apache-2.0",
10
- "version": "4.20260525.1"
10
+ "version": "4.20260526.1"
11
11
  }