@cloudflare/workers-types 4.20250913.0 → 4.20250918.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.
@@ -289,7 +289,6 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
289
289
  FixedLengthStream: typeof FixedLengthStream;
290
290
  IdentityTransformStream: typeof IdentityTransformStream;
291
291
  HTMLRewriter: typeof HTMLRewriter;
292
- Performance: typeof Performance;
293
292
  }
294
293
  export declare function addEventListener<
295
294
  Type extends keyof WorkerGlobalScopeEventMap,
@@ -467,6 +466,18 @@ export declare abstract class Navigator {
467
466
  readonly userAgent: string;
468
467
  readonly hardwareConcurrency: number;
469
468
  }
469
+ /**
470
+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
471
+ * as well as timing of subrequests and other operations.
472
+ *
473
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
474
+ */
475
+ export interface Performance {
476
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
477
+ readonly timeOrigin: number;
478
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
479
+ now(): number;
480
+ }
470
481
  export interface AlarmInvocationInfo {
471
482
  readonly isRetry: boolean;
472
483
  readonly retryCount: number;
@@ -3159,18 +3170,6 @@ export interface WorkerLoaderWorkerCode {
3159
3170
  tails?: Fetcher[];
3160
3171
  streamingTails?: Fetcher[];
3161
3172
  }
3162
- /**
3163
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3164
- * as well as timing of subrequests and other operations.
3165
- *
3166
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3167
- */
3168
- export declare abstract class Performance {
3169
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3170
- get timeOrigin(): number;
3171
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3172
- now(): number;
3173
- }
3174
3173
  export type AiImageClassificationInput = {
3175
3174
  image: number[];
3176
3175
  };
@@ -3225,6 +3224,18 @@ export declare abstract class BaseAiImageTextToText {
3225
3224
  inputs: AiImageTextToTextInput;
3226
3225
  postProcessedOutputs: AiImageTextToTextOutput;
3227
3226
  }
3227
+ export type AiMultimodalEmbeddingsInput = {
3228
+ image: string;
3229
+ text: string[];
3230
+ };
3231
+ export type AiIMultimodalEmbeddingsOutput = {
3232
+ data: number[][];
3233
+ shape: number[];
3234
+ };
3235
+ export declare abstract class BaseAiMultimodalEmbeddings {
3236
+ inputs: AiImageTextToTextInput;
3237
+ postProcessedOutputs: AiImageTextToTextOutput;
3238
+ }
3228
3239
  export type AiObjectDetectionInput = {
3229
3240
  image: number[];
3230
3241
  };
@@ -3363,12 +3374,28 @@ export type AiTextGenerationInput = {
3363
3374
  | (object & NonNullable<unknown>);
3364
3375
  functions?: AiTextGenerationFunctionsInput[];
3365
3376
  };
3377
+ export type AiTextGenerationToolLegacyOutput = {
3378
+ name: string;
3379
+ arguments: unknown;
3380
+ };
3381
+ export type AiTextGenerationToolOutput = {
3382
+ id: string;
3383
+ type: "function";
3384
+ function: {
3385
+ name: string;
3386
+ arguments: string;
3387
+ };
3388
+ };
3389
+ export type UsageTags = {
3390
+ prompt_tokens: number;
3391
+ completion_tokens: number;
3392
+ total_tokens: number;
3393
+ };
3366
3394
  export type AiTextGenerationOutput = {
3367
3395
  response?: string;
3368
- tool_calls?: {
3369
- name: string;
3370
- arguments: unknown;
3371
- }[];
3396
+ tool_calls?: AiTextGenerationToolLegacyOutput[] &
3397
+ AiTextGenerationToolOutput[];
3398
+ usage?: UsageTags;
3372
3399
  };
3373
3400
  export declare abstract class BaseAiTextGeneration {
3374
3401
  inputs: AiTextGenerationInput;
@@ -4457,6 +4484,7 @@ export type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output =
4457
4484
  name?: string;
4458
4485
  }[];
4459
4486
  }
4487
+ | string
4460
4488
  | AsyncResponse;
4461
4489
  export declare abstract class Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast {
4462
4490
  inputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input;
@@ -4533,7 +4561,6 @@ export interface Ai_Cf_Baai_Bge_Reranker_Base_Input {
4533
4561
  /**
4534
4562
  * A query you wish to perform against the provided contexts.
4535
4563
  */
4536
- query: string;
4537
4564
  /**
4538
4565
  * Number of returned results starting with the best score.
4539
4566
  */
@@ -5628,7 +5655,8 @@ export declare abstract class Base_Ai_Cf_Google_Gemma_3_12B_It {
5628
5655
  }
5629
5656
  export type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input =
5630
5657
  | Ai_Cf_Meta_Llama_4_Prompt
5631
- | Ai_Cf_Meta_Llama_4_Messages;
5658
+ | Ai_Cf_Meta_Llama_4_Messages
5659
+ | Ai_Cf_Meta_Llama_4_Async_Batch;
5632
5660
  export interface Ai_Cf_Meta_Llama_4_Prompt {
5633
5661
  /**
5634
5662
  * The input text prompt for the model to generate a response.
@@ -5862,6 +5890,245 @@ export interface Ai_Cf_Meta_Llama_4_Messages {
5862
5890
  */
5863
5891
  presence_penalty?: number;
5864
5892
  }
5893
+ export interface Ai_Cf_Meta_Llama_4_Async_Batch {
5894
+ requests: (
5895
+ | Ai_Cf_Meta_Llama_4_Prompt_Inner
5896
+ | Ai_Cf_Meta_Llama_4_Messages_Inner
5897
+ )[];
5898
+ }
5899
+ export interface Ai_Cf_Meta_Llama_4_Prompt_Inner {
5900
+ /**
5901
+ * The input text prompt for the model to generate a response.
5902
+ */
5903
+ prompt: string;
5904
+ /**
5905
+ * JSON schema that should be fulfilled for the response.
5906
+ */
5907
+ guided_json?: object;
5908
+ response_format?: JSONMode;
5909
+ /**
5910
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
5911
+ */
5912
+ raw?: boolean;
5913
+ /**
5914
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
5915
+ */
5916
+ stream?: boolean;
5917
+ /**
5918
+ * The maximum number of tokens to generate in the response.
5919
+ */
5920
+ max_tokens?: number;
5921
+ /**
5922
+ * Controls the randomness of the output; higher values produce more random results.
5923
+ */
5924
+ temperature?: number;
5925
+ /**
5926
+ * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
5927
+ */
5928
+ top_p?: number;
5929
+ /**
5930
+ * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
5931
+ */
5932
+ top_k?: number;
5933
+ /**
5934
+ * Random seed for reproducibility of the generation.
5935
+ */
5936
+ seed?: number;
5937
+ /**
5938
+ * Penalty for repeated tokens; higher values discourage repetition.
5939
+ */
5940
+ repetition_penalty?: number;
5941
+ /**
5942
+ * Decreases the likelihood of the model repeating the same lines verbatim.
5943
+ */
5944
+ frequency_penalty?: number;
5945
+ /**
5946
+ * Increases the likelihood of the model introducing new topics.
5947
+ */
5948
+ presence_penalty?: number;
5949
+ }
5950
+ export interface Ai_Cf_Meta_Llama_4_Messages_Inner {
5951
+ /**
5952
+ * An array of message objects representing the conversation history.
5953
+ */
5954
+ messages: {
5955
+ /**
5956
+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
5957
+ */
5958
+ role?: string;
5959
+ /**
5960
+ * The tool call id. If you don't know what to put here you can fall back to 000000001
5961
+ */
5962
+ tool_call_id?: string;
5963
+ content?:
5964
+ | string
5965
+ | {
5966
+ /**
5967
+ * Type of the content provided
5968
+ */
5969
+ type?: string;
5970
+ text?: string;
5971
+ image_url?: {
5972
+ /**
5973
+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
5974
+ */
5975
+ url?: string;
5976
+ };
5977
+ }[]
5978
+ | {
5979
+ /**
5980
+ * Type of the content provided
5981
+ */
5982
+ type?: string;
5983
+ text?: string;
5984
+ image_url?: {
5985
+ /**
5986
+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
5987
+ */
5988
+ url?: string;
5989
+ };
5990
+ };
5991
+ }[];
5992
+ functions?: {
5993
+ name: string;
5994
+ code: string;
5995
+ }[];
5996
+ /**
5997
+ * A list of tools available for the assistant to use.
5998
+ */
5999
+ tools?: (
6000
+ | {
6001
+ /**
6002
+ * The name of the tool. More descriptive the better.
6003
+ */
6004
+ name: string;
6005
+ /**
6006
+ * A brief description of what the tool does.
6007
+ */
6008
+ description: string;
6009
+ /**
6010
+ * Schema defining the parameters accepted by the tool.
6011
+ */
6012
+ parameters: {
6013
+ /**
6014
+ * The type of the parameters object (usually 'object').
6015
+ */
6016
+ type: string;
6017
+ /**
6018
+ * List of required parameter names.
6019
+ */
6020
+ required?: string[];
6021
+ /**
6022
+ * Definitions of each parameter.
6023
+ */
6024
+ properties: {
6025
+ [k: string]: {
6026
+ /**
6027
+ * The data type of the parameter.
6028
+ */
6029
+ type: string;
6030
+ /**
6031
+ * A description of the expected parameter.
6032
+ */
6033
+ description: string;
6034
+ };
6035
+ };
6036
+ };
6037
+ }
6038
+ | {
6039
+ /**
6040
+ * Specifies the type of tool (e.g., 'function').
6041
+ */
6042
+ type: string;
6043
+ /**
6044
+ * Details of the function tool.
6045
+ */
6046
+ function: {
6047
+ /**
6048
+ * The name of the function.
6049
+ */
6050
+ name: string;
6051
+ /**
6052
+ * A brief description of what the function does.
6053
+ */
6054
+ description: string;
6055
+ /**
6056
+ * Schema defining the parameters accepted by the function.
6057
+ */
6058
+ parameters: {
6059
+ /**
6060
+ * The type of the parameters object (usually 'object').
6061
+ */
6062
+ type: string;
6063
+ /**
6064
+ * List of required parameter names.
6065
+ */
6066
+ required?: string[];
6067
+ /**
6068
+ * Definitions of each parameter.
6069
+ */
6070
+ properties: {
6071
+ [k: string]: {
6072
+ /**
6073
+ * The data type of the parameter.
6074
+ */
6075
+ type: string;
6076
+ /**
6077
+ * A description of the expected parameter.
6078
+ */
6079
+ description: string;
6080
+ };
6081
+ };
6082
+ };
6083
+ };
6084
+ }
6085
+ )[];
6086
+ response_format?: JSONMode;
6087
+ /**
6088
+ * JSON schema that should be fufilled for the response.
6089
+ */
6090
+ guided_json?: object;
6091
+ /**
6092
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
6093
+ */
6094
+ raw?: boolean;
6095
+ /**
6096
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
6097
+ */
6098
+ stream?: boolean;
6099
+ /**
6100
+ * The maximum number of tokens to generate in the response.
6101
+ */
6102
+ max_tokens?: number;
6103
+ /**
6104
+ * Controls the randomness of the output; higher values produce more random results.
6105
+ */
6106
+ temperature?: number;
6107
+ /**
6108
+ * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
6109
+ */
6110
+ top_p?: number;
6111
+ /**
6112
+ * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
6113
+ */
6114
+ top_k?: number;
6115
+ /**
6116
+ * Random seed for reproducibility of the generation.
6117
+ */
6118
+ seed?: number;
6119
+ /**
6120
+ * Penalty for repeated tokens; higher values discourage repetition.
6121
+ */
6122
+ repetition_penalty?: number;
6123
+ /**
6124
+ * Decreases the likelihood of the model repeating the same lines verbatim.
6125
+ */
6126
+ frequency_penalty?: number;
6127
+ /**
6128
+ * Increases the likelihood of the model introducing new topics.
6129
+ */
6130
+ presence_penalty?: number;
6131
+ }
5865
6132
  export type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output = {
5866
6133
  /**
5867
6134
  * The generated text response from the model
@@ -5915,6 +6182,447 @@ export declare abstract class Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct {
5915
6182
  inputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input;
5916
6183
  postProcessedOutputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output;
5917
6184
  }
6185
+ export interface Ai_Cf_Deepgram_Nova_3_Input {
6186
+ audio: {
6187
+ body: object;
6188
+ contentType: string;
6189
+ };
6190
+ /**
6191
+ * Sets how the model will interpret strings submitted to the custom_topic param. When strict, the model will only return topics submitted using the custom_topic param. When extended, the model will return its own detected topics in addition to those submitted using the custom_topic param.
6192
+ */
6193
+ custom_topic_mode?: "extended" | "strict";
6194
+ /**
6195
+ * Custom topics you want the model to detect within your input audio or text if present Submit up to 100
6196
+ */
6197
+ custom_topic?: string;
6198
+ /**
6199
+ * Sets how the model will interpret intents submitted to the custom_intent param. When strict, the model will only return intents submitted using the custom_intent param. When extended, the model will return its own detected intents in addition those submitted using the custom_intents param
6200
+ */
6201
+ custom_intent_mode?: "extended" | "strict";
6202
+ /**
6203
+ * Custom intents you want the model to detect within your input audio if present
6204
+ */
6205
+ custom_intent?: string;
6206
+ /**
6207
+ * Identifies and extracts key entities from content in submitted audio
6208
+ */
6209
+ detect_entities?: boolean;
6210
+ /**
6211
+ * Identifies the dominant language spoken in submitted audio
6212
+ */
6213
+ detect_language?: boolean;
6214
+ /**
6215
+ * Recognize speaker changes. Each word in the transcript will be assigned a speaker number starting at 0
6216
+ */
6217
+ diarize?: boolean;
6218
+ /**
6219
+ * Identify and extract key entities from content in submitted audio
6220
+ */
6221
+ dictation?: boolean;
6222
+ /**
6223
+ * Specify the expected encoding of your submitted audio
6224
+ */
6225
+ encoding?:
6226
+ | "linear16"
6227
+ | "flac"
6228
+ | "mulaw"
6229
+ | "amr-nb"
6230
+ | "amr-wb"
6231
+ | "opus"
6232
+ | "speex"
6233
+ | "g729";
6234
+ /**
6235
+ * Arbitrary key-value pairs that are attached to the API response for usage in downstream processing
6236
+ */
6237
+ extra?: string;
6238
+ /**
6239
+ * Filler Words can help transcribe interruptions in your audio, like 'uh' and 'um'
6240
+ */
6241
+ filler_words?: boolean;
6242
+ /**
6243
+ * Key term prompting can boost or suppress specialized terminology and brands.
6244
+ */
6245
+ keyterm?: string;
6246
+ /**
6247
+ * Keywords can boost or suppress specialized terminology and brands.
6248
+ */
6249
+ keywords?: string;
6250
+ /**
6251
+ * The BCP-47 language tag that hints at the primary spoken language. Depending on the Model and API endpoint you choose only certain languages are available.
6252
+ */
6253
+ language?: string;
6254
+ /**
6255
+ * Spoken measurements will be converted to their corresponding abbreviations.
6256
+ */
6257
+ measurements?: boolean;
6258
+ /**
6259
+ * Opts out requests from the Deepgram Model Improvement Program. Refer to our Docs for pricing impacts before setting this to true. https://dpgr.am/deepgram-mip.
6260
+ */
6261
+ mip_opt_out?: boolean;
6262
+ /**
6263
+ * Mode of operation for the model representing broad area of topic that will be talked about in the supplied audio
6264
+ */
6265
+ mode?: "general" | "medical" | "finance";
6266
+ /**
6267
+ * Transcribe each audio channel independently.
6268
+ */
6269
+ multichannel?: boolean;
6270
+ /**
6271
+ * Numerals converts numbers from written format to numerical format.
6272
+ */
6273
+ numerals?: boolean;
6274
+ /**
6275
+ * Splits audio into paragraphs to improve transcript readability.
6276
+ */
6277
+ paragraphs?: boolean;
6278
+ /**
6279
+ * Profanity Filter looks for recognized profanity and converts it to the nearest recognized non-profane word or removes it from the transcript completely.
6280
+ */
6281
+ profanity_filter?: boolean;
6282
+ /**
6283
+ * Add punctuation and capitalization to the transcript.
6284
+ */
6285
+ punctuate?: boolean;
6286
+ /**
6287
+ * Redaction removes sensitive information from your transcripts.
6288
+ */
6289
+ redact?: string;
6290
+ /**
6291
+ * Search for terms or phrases in submitted audio and replaces them.
6292
+ */
6293
+ replace?: string;
6294
+ /**
6295
+ * Search for terms or phrases in submitted audio.
6296
+ */
6297
+ search?: string;
6298
+ /**
6299
+ * Recognizes the sentiment throughout a transcript or text.
6300
+ */
6301
+ sentiment?: boolean;
6302
+ /**
6303
+ * Apply formatting to transcript output. When set to true, additional formatting will be applied to transcripts to improve readability.
6304
+ */
6305
+ smart_format?: boolean;
6306
+ /**
6307
+ * Detect topics throughout a transcript or text.
6308
+ */
6309
+ topics?: boolean;
6310
+ /**
6311
+ * Segments speech into meaningful semantic units.
6312
+ */
6313
+ utterances?: boolean;
6314
+ /**
6315
+ * Seconds to wait before detecting a pause between words in submitted audio.
6316
+ */
6317
+ utt_split?: number;
6318
+ /**
6319
+ * The number of channels in the submitted audio
6320
+ */
6321
+ channels?: number;
6322
+ /**
6323
+ * Specifies whether the streaming endpoint should provide ongoing transcription updates as more audio is received. When set to true, the endpoint sends continuous updates, meaning transcription results may evolve over time. Note: Supported only for webosockets.
6324
+ */
6325
+ interim_results?: boolean;
6326
+ /**
6327
+ * Indicates how long model will wait to detect whether a speaker has finished speaking or pauses for a significant period of time. When set to a value, the streaming endpoint immediately finalizes the transcription for the processed time range and returns the transcript with a speech_final parameter set to true. Can also be set to false to disable endpointing
6328
+ */
6329
+ endpointing?: string;
6330
+ /**
6331
+ * Indicates that speech has started. You'll begin receiving Speech Started messages upon speech starting. Note: Supported only for webosockets.
6332
+ */
6333
+ vad_events?: boolean;
6334
+ /**
6335
+ * Indicates how long model will wait to send an UtteranceEnd message after a word has been transcribed. Use with interim_results. Note: Supported only for webosockets.
6336
+ */
6337
+ utterance_end_ms?: boolean;
6338
+ }
6339
+ export interface Ai_Cf_Deepgram_Nova_3_Output {
6340
+ results?: {
6341
+ channels?: {
6342
+ alternatives?: {
6343
+ confidence?: number;
6344
+ transcript?: string;
6345
+ words?: {
6346
+ confidence?: number;
6347
+ end?: number;
6348
+ start?: number;
6349
+ word?: string;
6350
+ }[];
6351
+ }[];
6352
+ }[];
6353
+ summary?: {
6354
+ result?: string;
6355
+ short?: string;
6356
+ };
6357
+ sentiments?: {
6358
+ segments?: {
6359
+ text?: string;
6360
+ start_word?: number;
6361
+ end_word?: number;
6362
+ sentiment?: string;
6363
+ sentiment_score?: number;
6364
+ }[];
6365
+ average?: {
6366
+ sentiment?: string;
6367
+ sentiment_score?: number;
6368
+ };
6369
+ };
6370
+ };
6371
+ }
6372
+ export declare abstract class Base_Ai_Cf_Deepgram_Nova_3 {
6373
+ inputs: Ai_Cf_Deepgram_Nova_3_Input;
6374
+ postProcessedOutputs: Ai_Cf_Deepgram_Nova_3_Output;
6375
+ }
6376
+ export type Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input =
6377
+ | {
6378
+ /**
6379
+ * readable stream with audio data and content-type specified for that data
6380
+ */
6381
+ audio: {
6382
+ body: object;
6383
+ contentType: string;
6384
+ };
6385
+ /**
6386
+ * type of data PCM data that's sent to the inference server as raw array
6387
+ */
6388
+ dtype?: "uint8" | "float32" | "float64";
6389
+ }
6390
+ | {
6391
+ /**
6392
+ * base64 encoded audio data
6393
+ */
6394
+ audio: string;
6395
+ /**
6396
+ * type of data PCM data that's sent to the inference server as raw array
6397
+ */
6398
+ dtype?: "uint8" | "float32" | "float64";
6399
+ };
6400
+ export interface Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output {
6401
+ /**
6402
+ * if true, end-of-turn was detected
6403
+ */
6404
+ is_complete?: boolean;
6405
+ /**
6406
+ * probability of the end-of-turn detection
6407
+ */
6408
+ probability?: number;
6409
+ }
6410
+ export declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
6411
+ inputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input;
6412
+ postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
6413
+ }
6414
+ export type Ai_Cf_Openai_Gpt_Oss_120B_Input =
6415
+ | GPT_OSS_120B_Responses
6416
+ | GPT_OSS_120B_Responses_Async;
6417
+ export interface GPT_OSS_120B_Responses {
6418
+ /**
6419
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6420
+ */
6421
+ input: string | unknown[];
6422
+ reasoning?: {
6423
+ /**
6424
+ * Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
6425
+ */
6426
+ effort?: "low" | "medium" | "high";
6427
+ /**
6428
+ * A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of auto, concise, or detailed.
6429
+ */
6430
+ summary?: "auto" | "concise" | "detailed";
6431
+ };
6432
+ }
6433
+ export interface GPT_OSS_120B_Responses_Async {
6434
+ requests: {
6435
+ /**
6436
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6437
+ */
6438
+ input: string | unknown[];
6439
+ reasoning?: {
6440
+ /**
6441
+ * Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
6442
+ */
6443
+ effort?: "low" | "medium" | "high";
6444
+ /**
6445
+ * A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of auto, concise, or detailed.
6446
+ */
6447
+ summary?: "auto" | "concise" | "detailed";
6448
+ };
6449
+ }[];
6450
+ }
6451
+ export type Ai_Cf_Openai_Gpt_Oss_120B_Output =
6452
+ | {}
6453
+ | (string & NonNullable<unknown>);
6454
+ export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
6455
+ inputs: Ai_Cf_Openai_Gpt_Oss_120B_Input;
6456
+ postProcessedOutputs: Ai_Cf_Openai_Gpt_Oss_120B_Output;
6457
+ }
6458
+ export type Ai_Cf_Openai_Gpt_Oss_20B_Input =
6459
+ | GPT_OSS_20B_Responses
6460
+ | GPT_OSS_20B_Responses_Async;
6461
+ export interface GPT_OSS_20B_Responses {
6462
+ /**
6463
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6464
+ */
6465
+ input: string | unknown[];
6466
+ reasoning?: {
6467
+ /**
6468
+ * Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
6469
+ */
6470
+ effort?: "low" | "medium" | "high";
6471
+ /**
6472
+ * A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of auto, concise, or detailed.
6473
+ */
6474
+ summary?: "auto" | "concise" | "detailed";
6475
+ };
6476
+ }
6477
+ export interface GPT_OSS_20B_Responses_Async {
6478
+ requests: {
6479
+ /**
6480
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6481
+ */
6482
+ input: string | unknown[];
6483
+ reasoning?: {
6484
+ /**
6485
+ * Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
6486
+ */
6487
+ effort?: "low" | "medium" | "high";
6488
+ /**
6489
+ * A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of auto, concise, or detailed.
6490
+ */
6491
+ summary?: "auto" | "concise" | "detailed";
6492
+ };
6493
+ }[];
6494
+ }
6495
+ export type Ai_Cf_Openai_Gpt_Oss_20B_Output =
6496
+ | {}
6497
+ | (string & NonNullable<unknown>);
6498
+ export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
6499
+ inputs: Ai_Cf_Openai_Gpt_Oss_20B_Input;
6500
+ postProcessedOutputs: Ai_Cf_Openai_Gpt_Oss_20B_Output;
6501
+ }
6502
+ export interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
6503
+ /**
6504
+ * A text description of the image you want to generate.
6505
+ */
6506
+ prompt: string;
6507
+ /**
6508
+ * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
6509
+ */
6510
+ guidance?: number;
6511
+ /**
6512
+ * Random seed for reproducibility of the image generation
6513
+ */
6514
+ seed?: number;
6515
+ /**
6516
+ * The height of the generated image in pixels
6517
+ */
6518
+ height?: number;
6519
+ /**
6520
+ * The width of the generated image in pixels
6521
+ */
6522
+ width?: number;
6523
+ /**
6524
+ * The number of diffusion steps; higher values can improve quality but take longer
6525
+ */
6526
+ num_steps?: number;
6527
+ /**
6528
+ * Specify what to exclude from the generated images
6529
+ */
6530
+ negative_prompt?: string;
6531
+ }
6532
+ /**
6533
+ * The generated image in JPEG format
6534
+ */
6535
+ export type Ai_Cf_Leonardo_Phoenix_1_0_Output = string;
6536
+ export declare abstract class Base_Ai_Cf_Leonardo_Phoenix_1_0 {
6537
+ inputs: Ai_Cf_Leonardo_Phoenix_1_0_Input;
6538
+ postProcessedOutputs: Ai_Cf_Leonardo_Phoenix_1_0_Output;
6539
+ }
6540
+ export interface Ai_Cf_Leonardo_Lucid_Origin_Input {
6541
+ /**
6542
+ * A text description of the image you want to generate.
6543
+ */
6544
+ prompt: string;
6545
+ /**
6546
+ * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
6547
+ */
6548
+ guidance?: number;
6549
+ /**
6550
+ * Random seed for reproducibility of the image generation
6551
+ */
6552
+ seed?: number;
6553
+ /**
6554
+ * The height of the generated image in pixels
6555
+ */
6556
+ height?: number;
6557
+ /**
6558
+ * The width of the generated image in pixels
6559
+ */
6560
+ width?: number;
6561
+ /**
6562
+ * The number of diffusion steps; higher values can improve quality but take longer
6563
+ */
6564
+ num_steps?: number;
6565
+ /**
6566
+ * The number of diffusion steps; higher values can improve quality but take longer
6567
+ */
6568
+ steps?: number;
6569
+ }
6570
+ export interface Ai_Cf_Leonardo_Lucid_Origin_Output {
6571
+ /**
6572
+ * The generated image in Base64 format.
6573
+ */
6574
+ image?: string;
6575
+ }
6576
+ export declare abstract class Base_Ai_Cf_Leonardo_Lucid_Origin {
6577
+ inputs: Ai_Cf_Leonardo_Lucid_Origin_Input;
6578
+ postProcessedOutputs: Ai_Cf_Leonardo_Lucid_Origin_Output;
6579
+ }
6580
+ export interface Ai_Cf_Deepgram_Aura_1_Input {
6581
+ /**
6582
+ * Speaker used to produce the audio.
6583
+ */
6584
+ speaker?:
6585
+ | "angus"
6586
+ | "asteria"
6587
+ | "arcas"
6588
+ | "orion"
6589
+ | "orpheus"
6590
+ | "athena"
6591
+ | "luna"
6592
+ | "zeus"
6593
+ | "perseus"
6594
+ | "helios"
6595
+ | "hera"
6596
+ | "stella";
6597
+ /**
6598
+ * Encoding of the output audio.
6599
+ */
6600
+ encoding?: "linear16" | "flac" | "mulaw" | "alaw" | "mp3" | "opus" | "aac";
6601
+ /**
6602
+ * Container specifies the file format wrapper for the output audio. The available options depend on the encoding type..
6603
+ */
6604
+ container?: "none" | "wav" | "ogg";
6605
+ /**
6606
+ * The text content to be converted to speech
6607
+ */
6608
+ text: string;
6609
+ /**
6610
+ * Sample Rate specifies the sample rate for the output audio. Based on the encoding, different sample rates are supported. For some encodings, the sample rate is not configurable
6611
+ */
6612
+ sample_rate?: number;
6613
+ /**
6614
+ * The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type.
6615
+ */
6616
+ bit_rate?: number;
6617
+ }
6618
+ /**
6619
+ * The generated audio in MP3 format
6620
+ */
6621
+ export type Ai_Cf_Deepgram_Aura_1_Output = string;
6622
+ export declare abstract class Base_Ai_Cf_Deepgram_Aura_1 {
6623
+ inputs: Ai_Cf_Deepgram_Aura_1_Input;
6624
+ postProcessedOutputs: Ai_Cf_Deepgram_Aura_1_Output;
6625
+ }
5918
6626
  export interface AiModels {
5919
6627
  "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
5920
6628
  "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
@@ -5923,8 +6631,8 @@ export interface AiModels {
5923
6631
  "@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage;
5924
6632
  "@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage;
5925
6633
  "@cf/myshell-ai/melotts": BaseAiTextToSpeech;
6634
+ "@cf/google/embeddinggemma-300m": BaseAiTextEmbeddings;
5926
6635
  "@cf/microsoft/resnet-50": BaseAiImageClassification;
5927
- "@cf/facebook/detr-resnet-50": BaseAiObjectDetection;
5928
6636
  "@cf/meta/llama-2-7b-chat-int8": BaseAiTextGeneration;
5929
6637
  "@cf/mistral/mistral-7b-instruct-v0.1": BaseAiTextGeneration;
5930
6638
  "@cf/meta/llama-2-7b-chat-fp16": BaseAiTextGeneration;
@@ -5959,7 +6667,6 @@ export interface AiModels {
5959
6667
  "@cf/fblgit/una-cybertron-7b-v2-bf16": BaseAiTextGeneration;
5960
6668
  "@cf/meta/llama-3-8b-instruct-awq": BaseAiTextGeneration;
5961
6669
  "@hf/meta-llama/meta-llama-3-8b-instruct": BaseAiTextGeneration;
5962
- "@cf/meta/llama-3.1-8b-instruct": BaseAiTextGeneration;
5963
6670
  "@cf/meta/llama-3.1-8b-instruct-fp8": BaseAiTextGeneration;
5964
6671
  "@cf/meta/llama-3.1-8b-instruct-awq": BaseAiTextGeneration;
5965
6672
  "@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
@@ -5986,6 +6693,13 @@ export interface AiModels {
5986
6693
  "@cf/mistralai/mistral-small-3.1-24b-instruct": Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct;
5987
6694
  "@cf/google/gemma-3-12b-it": Base_Ai_Cf_Google_Gemma_3_12B_It;
5988
6695
  "@cf/meta/llama-4-scout-17b-16e-instruct": Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct;
6696
+ "@cf/deepgram/nova-3": Base_Ai_Cf_Deepgram_Nova_3;
6697
+ "@cf/pipecat-ai/smart-turn-v2": Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2;
6698
+ "@cf/openai/gpt-oss-120b": Base_Ai_Cf_Openai_Gpt_Oss_120B;
6699
+ "@cf/openai/gpt-oss-20b": Base_Ai_Cf_Openai_Gpt_Oss_20B;
6700
+ "@cf/leonardo/phoenix-1.0": Base_Ai_Cf_Leonardo_Phoenix_1_0;
6701
+ "@cf/leonardo/lucid-origin": Base_Ai_Cf_Leonardo_Lucid_Origin;
6702
+ "@cf/deepgram/aura-1": Base_Ai_Cf_Deepgram_Aura_1;
5989
6703
  }
5990
6704
  export type AiOptions = {
5991
6705
  /**
@@ -5993,6 +6707,10 @@ export type AiOptions = {
5993
6707
  * https://developers.cloudflare.com/workers-ai/features/batch-api
5994
6708
  */
5995
6709
  queueRequest?: boolean;
6710
+ /**
6711
+ * Establish websocket connections, only works for supported models
6712
+ */
6713
+ websocket?: boolean;
5996
6714
  gateway?: GatewayOptions;
5997
6715
  returnRawResponse?: boolean;
5998
6716
  prefix?: string;
@@ -6038,7 +6756,7 @@ export declare abstract class Ai<
6038
6756
  > {
6039
6757
  aiGatewayLogId: string | null;
6040
6758
  gateway(gatewayId: string): AiGateway;
6041
- autorag(autoragId?: string): AutoRAG;
6759
+ autorag(autoragId: string): AutoRAG;
6042
6760
  run<
6043
6761
  Name extends keyof AiModelList,
6044
6762
  Options extends AiOptions,
@@ -6048,9 +6766,13 @@ export declare abstract class Ai<
6048
6766
  inputs: InputOptions,
6049
6767
  options?: Options,
6050
6768
  ): Promise<
6051
- Options extends {
6052
- returnRawResponse: true;
6053
- }
6769
+ Options extends
6770
+ | {
6771
+ returnRawResponse: true;
6772
+ }
6773
+ | {
6774
+ websocket: true;
6775
+ }
6054
6776
  ? Response
6055
6777
  : InputOptions extends {
6056
6778
  stream: true;