@orq-ai/node 4.16.3 → 4.16.4

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.
Files changed (71) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +2 -2
  3. package/lib/config.js +2 -2
  4. package/models/components/reasoningpart.js +1 -1
  5. package/models/operations/createtool.js +4 -4
  6. package/models/operations/getalltools.js +4 -4
  7. package/models/operations/getv2humanevalsets.js +2 -2
  8. package/models/operations/getv2humanevalsetsid.js +2 -2
  9. package/models/operations/patchv2humanevalsetsid.js +2 -2
  10. package/models/operations/postv2feedbackevaluation.js +4 -4
  11. package/models/operations/postv2humanevalsets.js +2 -2
  12. package/models/operations/retrievetool.js +4 -4
  13. package/models/operations/runagent.js +1 -1
  14. package/models/operations/streamrunagent.js +1 -1
  15. package/models/operations/updatetool.js +4 -4
  16. package/package.json +7 -7
  17. package/packages/orq-rc/src/funcs/routerAudioTranscriptionsCreate.ts +3 -0
  18. package/packages/orq-rc/src/funcs/routerAudioTranslationsCreate.ts +3 -0
  19. package/packages/orq-rc/src/funcs/routerImagesEditsCreate.ts +3 -0
  20. package/packages/orq-rc/src/funcs/routerImagesVariationsCreate.ts +3 -0
  21. package/packages/orq-rc/src/lib/config.ts +2 -2
  22. package/packages/orq-rc/src/models/components/modelsconfig.ts +13 -0
  23. package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
  24. package/packages/orq-rc/src/models/components/routingrulemodelsconfig.ts +16 -0
  25. package/packages/orq-rc/src/models/operations/createagentrequest.ts +26 -0
  26. package/packages/orq-rc/src/models/operations/createchatcompletion.ts +14 -0
  27. package/packages/orq-rc/src/models/operations/createclassify.ts +11 -0
  28. package/packages/orq-rc/src/models/operations/createcompletion.ts +14 -0
  29. package/packages/orq-rc/src/models/operations/createdecisions.ts +11 -0
  30. package/packages/orq-rc/src/models/operations/createembedding.ts +7 -0
  31. package/packages/orq-rc/src/models/operations/createimage.ts +14 -0
  32. package/packages/orq-rc/src/models/operations/createimageedit.ts +14 -0
  33. package/packages/orq-rc/src/models/operations/createimagevariation.ts +14 -0
  34. package/packages/orq-rc/src/models/operations/createprompt.ts +13 -0
  35. package/packages/orq-rc/src/models/operations/creatererank.ts +14 -0
  36. package/packages/orq-rc/src/models/operations/createrouterresponse.ts +7 -0
  37. package/packages/orq-rc/src/models/operations/createspeech.ts +14 -0
  38. package/packages/orq-rc/src/models/operations/createtool.ts +4 -4
  39. package/packages/orq-rc/src/models/operations/createtranscription.ts +14 -0
  40. package/packages/orq-rc/src/models/operations/createtranslation.ts +14 -0
  41. package/packages/orq-rc/src/models/operations/getallprompts.ts +6 -0
  42. package/packages/orq-rc/src/models/operations/getalltools.ts +4 -4
  43. package/packages/orq-rc/src/models/operations/getoneprompt.ts +6 -0
  44. package/packages/orq-rc/src/models/operations/getpromptversion.ts +6 -0
  45. package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +2 -2
  46. package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +2 -2
  47. package/packages/orq-rc/src/models/operations/listagents.ts +12 -0
  48. package/packages/orq-rc/src/models/operations/listpromptversions.ts +6 -0
  49. package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  50. package/packages/orq-rc/src/models/operations/postv2feedbackevaluation.ts +4 -4
  51. package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +2 -2
  52. package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +12 -0
  53. package/packages/orq-rc/src/models/operations/retrievetool.ts +4 -4
  54. package/packages/orq-rc/src/models/operations/runagent.ts +15 -1
  55. package/packages/orq-rc/src/models/operations/streamrunagent.ts +15 -1
  56. package/packages/orq-rc/src/models/operations/updateagent.ts +26 -0
  57. package/packages/orq-rc/src/models/operations/updateprompt.ts +13 -0
  58. package/packages/orq-rc/src/models/operations/updatetool.ts +4 -4
  59. package/src/lib/config.ts +2 -2
  60. package/src/models/components/reasoningpart.ts +1 -1
  61. package/src/models/operations/createtool.ts +4 -4
  62. package/src/models/operations/getalltools.ts +4 -4
  63. package/src/models/operations/getv2humanevalsets.ts +2 -2
  64. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  65. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  66. package/src/models/operations/postv2feedbackevaluation.ts +4 -4
  67. package/src/models/operations/postv2humanevalsets.ts +2 -2
  68. package/src/models/operations/retrievetool.ts +4 -4
  69. package/src/models/operations/runagent.ts +1 -1
  70. package/src/models/operations/streamrunagent.ts +1 -1
  71. package/src/models/operations/updatetool.ts +4 -4
@@ -1408,6 +1408,10 @@ export type Orq = {
1408
1408
  * Retry configuration for the request
1409
1409
  */
1410
1410
  retry?: CreateChatCompletionRouterChatCompletionsRetry | undefined;
1411
+ /**
1412
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
1413
+ */
1414
+ fallbackOnCodes?: Array<number> | undefined;
1411
1415
  /**
1412
1416
  * Array of fallback models to use if primary model fails
1413
1417
  */
@@ -1601,6 +1605,10 @@ export type CreateChatCompletionRequestBody = {
1601
1605
  | components.TraceScrubbingPlugin
1602
1606
  >
1603
1607
  | undefined;
1608
+ /**
1609
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
1610
+ */
1611
+ fallbackOnCodes?: Array<number> | undefined;
1604
1612
  /**
1605
1613
  * Array of fallback models to use if primary model fails
1606
1614
  */
@@ -5304,6 +5312,7 @@ export function createChatCompletionRouterChatCompletionsTimeoutToJSON(
5304
5312
  export type Orq$Outbound = {
5305
5313
  name?: string | undefined;
5306
5314
  retry?: CreateChatCompletionRouterChatCompletionsRetry$Outbound | undefined;
5315
+ fallback_on_codes?: Array<number> | undefined;
5307
5316
  fallbacks?:
5308
5317
  | Array<CreateChatCompletionRouterChatCompletionsFallbacks$Outbound>
5309
5318
  | undefined;
@@ -5331,6 +5340,7 @@ export const Orq$outboundSchema: z.ZodType<Orq$Outbound, z.ZodTypeDef, Orq> = z
5331
5340
  retry: z.lazy(() =>
5332
5341
  CreateChatCompletionRouterChatCompletionsRetry$outboundSchema
5333
5342
  ).optional(),
5343
+ fallbackOnCodes: z.array(z.number().int()).optional(),
5334
5344
  fallbacks: z.array(
5335
5345
  z.lazy(() =>
5336
5346
  CreateChatCompletionRouterChatCompletionsFallbacks$outboundSchema
@@ -5358,6 +5368,7 @@ export const Orq$outboundSchema: z.ZodType<Orq$Outbound, z.ZodTypeDef, Orq> = z
5358
5368
  ).optional(),
5359
5369
  }).transform((v) => {
5360
5370
  return remap$(v, {
5371
+ fallbackOnCodes: "fallback_on_codes",
5361
5372
  knowledgeBases: "knowledge_bases",
5362
5373
  loadBalancer: "load_balancer",
5363
5374
  });
@@ -5420,6 +5431,7 @@ export type CreateChatCompletionRequestBody$Outbound = {
5420
5431
  | components.TraceScrubbingPlugin$Outbound
5421
5432
  >
5422
5433
  | undefined;
5434
+ fallback_on_codes?: Array<number> | undefined;
5423
5435
  fallbacks?: Array<CreateChatCompletionFallbacks$Outbound> | undefined;
5424
5436
  retry?: CreateChatCompletionRetry$Outbound | undefined;
5425
5437
  cache?: CreateChatCompletionCache$Outbound | undefined;
@@ -5503,6 +5515,7 @@ export const CreateChatCompletionRequestBody$outboundSchema: z.ZodType<
5503
5515
  components.TraceScrubbingPlugin$outboundSchema,
5504
5516
  ]),
5505
5517
  ).optional(),
5518
+ fallbackOnCodes: z.array(z.number().int()).optional(),
5506
5519
  fallbacks: z.array(z.lazy(() => CreateChatCompletionFallbacks$outboundSchema))
5507
5520
  .optional(),
5508
5521
  retry: z.lazy(() => CreateChatCompletionRetry$outboundSchema).optional(),
@@ -5530,6 +5543,7 @@ export const CreateChatCompletionRequestBody$outboundSchema: z.ZodType<
5530
5543
  topK: "top_k",
5531
5544
  toolChoice: "tool_choice",
5532
5545
  parallelToolCalls: "parallel_tool_calls",
5546
+ fallbackOnCodes: "fallback_on_codes",
5533
5547
  loadBalancer: "load_balancer",
5534
5548
  cacheControl: "cache_control",
5535
5549
  promptCacheKey: "prompt_cache_key",
@@ -3,6 +3,7 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
6
7
  import { safeParse } from "../../lib/schemas.js";
7
8
  import { Result as SafeParseResult } from "../../types/fp.js";
8
9
  import * as components from "../components/index.js";
@@ -88,6 +89,10 @@ export type State = string | { [k: string]: any } | Array<any>;
88
89
 
89
90
  export type CreateClassifyRequestBody = {
90
91
  cache?: components.ClassifyCacheConfig | undefined;
92
+ /**
93
+ * HTTP status codes that trigger fallback. Defaults to [408,429,500,502,503,504,529]. Each code must be unique and between 400 and 599.
94
+ */
95
+ fallbackOnCodes?: Array<number> | null | undefined;
91
96
  /**
92
97
  * Up to 10 fallback models in order. The gateway retries a model for matching error codes before trying the next model. Every model must support classification and satisfy access checks. Image requests require native OpenAI image-capable fallbacks.
93
98
  */
@@ -314,6 +319,7 @@ export function stateToJSON(state: State): string {
314
319
  /** @internal */
315
320
  export type CreateClassifyRequestBody$Outbound = {
316
321
  cache?: components.ClassifyCacheConfig$Outbound | undefined;
322
+ fallback_on_codes?: Array<number> | null | undefined;
317
323
  fallbacks?: Array<components.FallbackConfig$Outbound> | null | undefined;
318
324
  identity?: components.ResponseIdentity$Outbound | undefined;
319
325
  metadata?: { [k: string]: string } | undefined;
@@ -337,6 +343,7 @@ export const CreateClassifyRequestBody$outboundSchema: z.ZodType<
337
343
  CreateClassifyRequestBody
338
344
  > = z.object({
339
345
  cache: components.ClassifyCacheConfig$outboundSchema.optional(),
346
+ fallbackOnCodes: z.nullable(z.array(z.number().int())).optional(),
340
347
  fallbacks: z.nullable(z.array(components.FallbackConfig$outboundSchema))
341
348
  .optional(),
342
349
  identity: components.ResponseIdentity$outboundSchema.optional(),
@@ -353,6 +360,10 @@ export const CreateClassifyRequestBody$outboundSchema: z.ZodType<
353
360
  retry: components.ClassifyRetryConfig$outboundSchema.optional(),
354
361
  state: z.union([z.string(), z.record(z.any()), z.array(z.any())]),
355
362
  timeout: components.ClassifyTimeoutConfig$outboundSchema.optional(),
363
+ }).transform((v) => {
364
+ return remap$(v, {
365
+ fallbackOnCodes: "fallback_on_codes",
366
+ });
356
367
  });
357
368
 
358
369
  export function createClassifyRequestBodyToJSON(
@@ -635,6 +635,10 @@ export type CreateCompletionOrq = {
635
635
  * Retry configuration for the request
636
636
  */
637
637
  retry?: CreateCompletionRouterCompletionsRetry | undefined;
638
+ /**
639
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
640
+ */
641
+ fallbackOnCodes?: Array<number> | undefined;
638
642
  /**
639
643
  * Array of fallback models to use if primary model fails
640
644
  */
@@ -731,6 +735,10 @@ export type CreateCompletionRequestBody = {
731
735
  * The name to display on the trace. If not specified, the default system name will be used.
732
736
  */
733
737
  name?: string | undefined;
738
+ /**
739
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
740
+ */
741
+ fallbackOnCodes?: Array<number> | undefined;
734
742
  /**
735
743
  * Array of fallback models to use if primary model fails
736
744
  */
@@ -2787,6 +2795,7 @@ export function createCompletionRouterCompletionsTimeoutToJSON(
2787
2795
  export type CreateCompletionOrq$Outbound = {
2788
2796
  name?: string | undefined;
2789
2797
  retry?: CreateCompletionRouterCompletionsRetry$Outbound | undefined;
2798
+ fallback_on_codes?: Array<number> | undefined;
2790
2799
  fallbacks?:
2791
2800
  | Array<CreateCompletionRouterCompletionsFallbacks$Outbound>
2792
2801
  | undefined;
@@ -2815,6 +2824,7 @@ export const CreateCompletionOrq$outboundSchema: z.ZodType<
2815
2824
  name: z.string().optional(),
2816
2825
  retry: z.lazy(() => CreateCompletionRouterCompletionsRetry$outboundSchema)
2817
2826
  .optional(),
2827
+ fallbackOnCodes: z.array(z.number().int()).optional(),
2818
2828
  fallbacks: z.array(
2819
2829
  z.lazy(() => CreateCompletionRouterCompletionsFallbacks$outboundSchema),
2820
2830
  ).optional(),
@@ -2838,6 +2848,7 @@ export const CreateCompletionOrq$outboundSchema: z.ZodType<
2838
2848
  .optional(),
2839
2849
  }).transform((v) => {
2840
2850
  return remap$(v, {
2851
+ fallbackOnCodes: "fallback_on_codes",
2841
2852
  knowledgeBases: "knowledge_bases",
2842
2853
  loadBalancer: "load_balancer",
2843
2854
  });
@@ -2866,6 +2877,7 @@ export type CreateCompletionRequestBody$Outbound = {
2866
2877
  n: number | null;
2867
2878
  user?: string | undefined;
2868
2879
  name?: string | undefined;
2880
+ fallback_on_codes?: Array<number> | undefined;
2869
2881
  fallbacks?: Array<CreateCompletionFallbacks$Outbound> | undefined;
2870
2882
  retry?: CreateCompletionRetry$Outbound | undefined;
2871
2883
  cache?: CreateCompletionCache$Outbound | undefined;
@@ -2901,6 +2913,7 @@ export const CreateCompletionRequestBody$outboundSchema: z.ZodType<
2901
2913
  n: z.nullable(z.number().int().default(1)),
2902
2914
  user: z.string().optional(),
2903
2915
  name: z.string().optional(),
2916
+ fallbackOnCodes: z.array(z.number().int()).optional(),
2904
2917
  fallbacks: z.array(z.lazy(() => CreateCompletionFallbacks$outboundSchema))
2905
2918
  .optional(),
2906
2919
  retry: z.lazy(() => CreateCompletionRetry$outboundSchema).optional(),
@@ -2924,6 +2937,7 @@ export const CreateCompletionRequestBody$outboundSchema: z.ZodType<
2924
2937
  maxTokens: "max_tokens",
2925
2938
  presencePenalty: "presence_penalty",
2926
2939
  topP: "top_p",
2940
+ fallbackOnCodes: "fallback_on_codes",
2927
2941
  loadBalancer: "load_balancer",
2928
2942
  });
2929
2943
  });
@@ -3,6 +3,7 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
6
7
  import { safeParse } from "../../lib/schemas.js";
7
8
  import { Result as SafeParseResult } from "../../types/fp.js";
8
9
  import * as components from "../components/index.js";
@@ -96,6 +97,10 @@ export type CreateDecisionsState = string | { [k: string]: any } | Array<any>;
96
97
 
97
98
  export type CreateDecisionsRequestBody = {
98
99
  cache?: components.ClassifyCacheConfig | undefined;
100
+ /**
101
+ * HTTP status codes that trigger fallback. Defaults to [408,429,500,502,503,504,529]. Each code must be unique and between 400 and 599.
102
+ */
103
+ fallbackOnCodes?: Array<number> | null | undefined;
99
104
  /**
100
105
  * Up to 10 fallback models in order. The gateway retries a model for matching error codes before trying the next model. Every model must support classification and satisfy access checks. Image requests require native OpenAI image-capable fallbacks.
101
106
  */
@@ -368,6 +373,7 @@ export function createDecisionsStateToJSON(
368
373
  /** @internal */
369
374
  export type CreateDecisionsRequestBody$Outbound = {
370
375
  cache?: components.ClassifyCacheConfig$Outbound | undefined;
376
+ fallback_on_codes?: Array<number> | null | undefined;
371
377
  fallbacks?: Array<components.FallbackConfig$Outbound> | null | undefined;
372
378
  identity?: components.ResponseIdentity$Outbound | undefined;
373
379
  metadata?: { [k: string]: string } | undefined;
@@ -391,6 +397,7 @@ export const CreateDecisionsRequestBody$outboundSchema: z.ZodType<
391
397
  CreateDecisionsRequestBody
392
398
  > = z.object({
393
399
  cache: components.ClassifyCacheConfig$outboundSchema.optional(),
400
+ fallbackOnCodes: z.nullable(z.array(z.number().int())).optional(),
394
401
  fallbacks: z.nullable(z.array(components.FallbackConfig$outboundSchema))
395
402
  .optional(),
396
403
  identity: components.ResponseIdentity$outboundSchema.optional(),
@@ -407,6 +414,10 @@ export const CreateDecisionsRequestBody$outboundSchema: z.ZodType<
407
414
  retry: components.ClassifyRetryConfig$outboundSchema.optional(),
408
415
  state: z.union([z.string(), z.record(z.any()), z.array(z.any())]),
409
416
  timeout: components.ClassifyTimeoutConfig$outboundSchema.optional(),
417
+ }).transform((v) => {
418
+ return remap$(v, {
419
+ fallbackOnCodes: "fallback_on_codes",
420
+ });
410
421
  });
411
422
 
412
423
  export function createDecisionsRequestBodyToJSON(
@@ -39,6 +39,10 @@ export type CreateEmbeddingRequestBody = {
39
39
  * The format to return the embeddings in. Can be either float or base64.
40
40
  */
41
41
  encodingFormat?: EncodingFormat | undefined;
42
+ /**
43
+ * HTTP status codes that trigger fallback. Defaults to [408,429,500,502,503,504,529]. Each code must be unique and between 400 and 599.
44
+ */
45
+ fallbackOnCodes?: Array<number> | null | undefined;
42
46
  /**
43
47
  * Array of fallback models to use if primary model fails.
44
48
  */
@@ -146,6 +150,7 @@ export type CreateEmbeddingRequestBody$Outbound = {
146
150
  cache?: components.EmbeddingCacheConfig$Outbound | undefined;
147
151
  dimensions?: number | undefined;
148
152
  encoding_format?: string | undefined;
153
+ fallback_on_codes?: Array<number> | null | undefined;
149
154
  fallbacks?: Array<components.FallbackConfig$Outbound> | null | undefined;
150
155
  input: string | Array<string | Array<number>>;
151
156
  load_balancer?: components.EmbeddingLoadBalancerConfig$Outbound | undefined;
@@ -166,6 +171,7 @@ export const CreateEmbeddingRequestBody$outboundSchema: z.ZodType<
166
171
  cache: components.EmbeddingCacheConfig$outboundSchema.optional(),
167
172
  dimensions: z.number().int().optional(),
168
173
  encodingFormat: EncodingFormat$outboundSchema.optional(),
174
+ fallbackOnCodes: z.nullable(z.array(z.number().int())).optional(),
169
175
  fallbacks: z.nullable(z.array(components.FallbackConfig$outboundSchema))
170
176
  .optional(),
171
177
  input: z.union([
@@ -183,6 +189,7 @@ export const CreateEmbeddingRequestBody$outboundSchema: z.ZodType<
183
189
  }).transform((v) => {
184
190
  return remap$(v, {
185
191
  encodingFormat: "encoding_format",
192
+ fallbackOnCodes: "fallback_on_codes",
186
193
  loadBalancer: "load_balancer",
187
194
  });
188
195
  });
@@ -252,6 +252,10 @@ export type CreateImageOrq = {
252
252
  * Retry configuration for the request
253
253
  */
254
254
  retry?: CreateImageRouterImagesGenerationsRetry | undefined;
255
+ /**
256
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
257
+ */
258
+ fallbackOnCodes?: Array<number> | undefined;
255
259
  /**
256
260
  * Array of fallback models to use if primary model fails
257
261
  */
@@ -336,6 +340,10 @@ export type CreateImageRequestBody = {
336
340
  * The name to display on the trace. If not specified, the default system name will be used.
337
341
  */
338
342
  name?: string | undefined;
343
+ /**
344
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
345
+ */
346
+ fallbackOnCodes?: Array<number> | undefined;
339
347
  /**
340
348
  * Array of fallback models to use if primary model fails
341
349
  */
@@ -824,6 +832,7 @@ export function createImageRouterImagesGenerationsTimeoutToJSON(
824
832
  export type CreateImageOrq$Outbound = {
825
833
  name?: string | undefined;
826
834
  retry?: CreateImageRouterImagesGenerationsRetry$Outbound | undefined;
835
+ fallback_on_codes?: Array<number> | undefined;
827
836
  fallbacks?:
828
837
  | Array<CreateImageRouterImagesGenerationsFallbacks$Outbound>
829
838
  | undefined;
@@ -845,6 +854,7 @@ export const CreateImageOrq$outboundSchema: z.ZodType<
845
854
  name: z.string().optional(),
846
855
  retry: z.lazy(() => CreateImageRouterImagesGenerationsRetry$outboundSchema)
847
856
  .optional(),
857
+ fallbackOnCodes: z.array(z.number().int()).optional(),
848
858
  fallbacks: z.array(
849
859
  z.lazy(() => CreateImageRouterImagesGenerationsFallbacks$outboundSchema),
850
860
  ).optional(),
@@ -860,6 +870,7 @@ export const CreateImageOrq$outboundSchema: z.ZodType<
860
870
  ).optional(),
861
871
  }).transform((v) => {
862
872
  return remap$(v, {
873
+ fallbackOnCodes: "fallback_on_codes",
863
874
  loadBalancer: "load_balancer",
864
875
  });
865
876
  });
@@ -883,6 +894,7 @@ export type CreateImageRequestBody$Outbound = {
883
894
  style?: string | null | undefined;
884
895
  metadata?: { [k: string]: string } | undefined;
885
896
  name?: string | undefined;
897
+ fallback_on_codes?: Array<number> | undefined;
886
898
  fallbacks?: Array<CreateImageFallbacks$Outbound> | undefined;
887
899
  retry?: CreateImageRetry$Outbound | undefined;
888
900
  cache?: CreateImageCache$Outbound | undefined;
@@ -912,6 +924,7 @@ export const CreateImageRequestBody$outboundSchema: z.ZodType<
912
924
  style: z.nullable(Style$outboundSchema).optional(),
913
925
  metadata: z.record(z.string()).optional(),
914
926
  name: z.string().optional(),
927
+ fallbackOnCodes: z.array(z.number().int()).optional(),
915
928
  fallbacks: z.array(z.lazy(() => CreateImageFallbacks$outboundSchema))
916
929
  .optional(),
917
930
  retry: z.lazy(() => CreateImageRetry$outboundSchema).optional(),
@@ -926,6 +939,7 @@ export const CreateImageRequestBody$outboundSchema: z.ZodType<
926
939
  outputCompression: "output_compression",
927
940
  outputFormat: "output_format",
928
941
  responseFormat: "response_format",
942
+ fallbackOnCodes: "fallback_on_codes",
929
943
  loadBalancer: "load_balancer",
930
944
  });
931
945
  });
@@ -232,6 +232,10 @@ export type CreateImageEditOrq = {
232
232
  * Retry configuration for the request
233
233
  */
234
234
  retry?: CreateImageEditRouterImagesEditsRetry | undefined;
235
+ /**
236
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
237
+ */
238
+ fallbackOnCodes?: Array<number> | undefined;
235
239
  /**
236
240
  * Array of fallback models to use if primary model fails
237
241
  */
@@ -301,6 +305,10 @@ export type CreateImageEditRequestBody = {
301
305
  * The name to display on the trace. If not specified, the default system name will be used.
302
306
  */
303
307
  name?: string | undefined;
308
+ /**
309
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
310
+ */
311
+ fallbackOnCodes?: Array<number> | undefined;
304
312
  /**
305
313
  * Array of fallback models to use if primary model fails
306
314
  */
@@ -861,6 +869,7 @@ export function createImageEditRouterImagesEditsTimeoutToJSON(
861
869
  export type CreateImageEditOrq$Outbound = {
862
870
  name?: string | undefined;
863
871
  retry?: CreateImageEditRouterImagesEditsRetry$Outbound | undefined;
872
+ fallback_on_codes?: Array<number> | undefined;
864
873
  fallbacks?:
865
874
  | Array<CreateImageEditRouterImagesEditsFallbacks$Outbound>
866
875
  | undefined;
@@ -883,6 +892,7 @@ export const CreateImageEditOrq$outboundSchema: z.ZodType<
883
892
  name: z.string().optional(),
884
893
  retry: z.lazy(() => CreateImageEditRouterImagesEditsRetry$outboundSchema)
885
894
  .optional(),
895
+ fallbackOnCodes: z.array(z.number().int()).optional(),
886
896
  fallbacks: z.array(
887
897
  z.lazy(() => CreateImageEditRouterImagesEditsFallbacks$outboundSchema),
888
898
  ).optional(),
@@ -898,6 +908,7 @@ export const CreateImageEditOrq$outboundSchema: z.ZodType<
898
908
  .optional(),
899
909
  }).transform((v) => {
900
910
  return remap$(v, {
911
+ fallbackOnCodes: "fallback_on_codes",
901
912
  loadBalancer: "load_balancer",
902
913
  });
903
914
  });
@@ -921,6 +932,7 @@ export type CreateImageEditRequestBody$Outbound = {
921
932
  response_format?: string | undefined;
922
933
  user?: string | undefined;
923
934
  name?: string | undefined;
935
+ fallback_on_codes?: Array<number> | undefined;
924
936
  fallbacks?: Array<CreateImageEditFallbacks$Outbound> | undefined;
925
937
  retry?: CreateImageEditRetry$Outbound | undefined;
926
938
  cache?: CreateImageEditCache$Outbound | undefined;
@@ -944,6 +956,7 @@ export const CreateImageEditRequestBody$outboundSchema: z.ZodType<
944
956
  responseFormat: CreateImageEditResponseFormat$outboundSchema.optional(),
945
957
  user: z.string().optional(),
946
958
  name: z.string().optional(),
959
+ fallbackOnCodes: z.array(z.number().int()).optional(),
947
960
  fallbacks: z.array(z.lazy(() => CreateImageEditFallbacks$outboundSchema))
948
961
  .optional(),
949
962
  retry: z.lazy(() => CreateImageEditRetry$outboundSchema).optional(),
@@ -955,6 +968,7 @@ export const CreateImageEditRequestBody$outboundSchema: z.ZodType<
955
968
  }).transform((v) => {
956
969
  return remap$(v, {
957
970
  responseFormat: "response_format",
971
+ fallbackOnCodes: "fallback_on_codes",
958
972
  loadBalancer: "load_balancer",
959
973
  });
960
974
  });
@@ -234,6 +234,10 @@ export type CreateImageVariationOrq = {
234
234
  * Retry configuration for the request
235
235
  */
236
236
  retry?: CreateImageVariationRouterImagesVariationsRetry | undefined;
237
+ /**
238
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
239
+ */
240
+ fallbackOnCodes?: Array<number> | undefined;
237
241
  /**
238
242
  * Array of fallback models to use if primary model fails
239
243
  */
@@ -302,6 +306,10 @@ export type CreateImageVariationRequestBody = {
302
306
  * The name to display on the trace. If not specified, the default system name will be used.
303
307
  */
304
308
  name?: string | undefined;
309
+ /**
310
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
311
+ */
312
+ fallbackOnCodes?: Array<number> | undefined;
305
313
  /**
306
314
  * Array of fallback models to use if primary model fails
307
315
  */
@@ -879,6 +887,7 @@ export function createImageVariationRouterImagesVariationsTimeoutToJSON(
879
887
  export type CreateImageVariationOrq$Outbound = {
880
888
  name?: string | undefined;
881
889
  retry?: CreateImageVariationRouterImagesVariationsRetry$Outbound | undefined;
890
+ fallback_on_codes?: Array<number> | undefined;
882
891
  fallbacks?:
883
892
  | Array<CreateImageVariationRouterImagesVariationsFallbacks$Outbound>
884
893
  | undefined;
@@ -904,6 +913,7 @@ export const CreateImageVariationOrq$outboundSchema: z.ZodType<
904
913
  retry: z.lazy(() =>
905
914
  CreateImageVariationRouterImagesVariationsRetry$outboundSchema
906
915
  ).optional(),
916
+ fallbackOnCodes: z.array(z.number().int()).optional(),
907
917
  fallbacks: z.array(
908
918
  z.lazy(() =>
909
919
  CreateImageVariationRouterImagesVariationsFallbacks$outboundSchema
@@ -923,6 +933,7 @@ export const CreateImageVariationOrq$outboundSchema: z.ZodType<
923
933
  ).optional(),
924
934
  }).transform((v) => {
925
935
  return remap$(v, {
936
+ fallbackOnCodes: "fallback_on_codes",
926
937
  loadBalancer: "load_balancer",
927
938
  });
928
939
  });
@@ -944,6 +955,7 @@ export type CreateImageVariationRequestBody$Outbound = {
944
955
  size: string;
945
956
  user?: string | undefined;
946
957
  name?: string | undefined;
958
+ fallback_on_codes?: Array<number> | undefined;
947
959
  fallbacks?: Array<CreateImageVariationFallbacks$Outbound> | undefined;
948
960
  retry?: CreateImageVariationRetry$Outbound | undefined;
949
961
  cache?: CreateImageVariationCache$Outbound | undefined;
@@ -969,6 +981,7 @@ export const CreateImageVariationRequestBody$outboundSchema: z.ZodType<
969
981
  size: Size$outboundSchema.default("1024x1024"),
970
982
  user: z.string().optional(),
971
983
  name: z.string().optional(),
984
+ fallbackOnCodes: z.array(z.number().int()).optional(),
972
985
  fallbacks: z.array(z.lazy(() => CreateImageVariationFallbacks$outboundSchema))
973
986
  .optional(),
974
987
  retry: z.lazy(() => CreateImageVariationRetry$outboundSchema).optional(),
@@ -980,6 +993,7 @@ export const CreateImageVariationRequestBody$outboundSchema: z.ZodType<
980
993
  }).transform((v) => {
981
994
  return remap$(v, {
982
995
  responseFormat: "response_format",
996
+ fallbackOnCodes: "fallback_on_codes",
983
997
  loadBalancer: "load_balancer",
984
998
  });
985
999
  });
@@ -933,6 +933,10 @@ export type PromptInput = {
933
933
  | components.TraceScrubbingPlugin
934
934
  >
935
935
  | undefined;
936
+ /**
937
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
938
+ */
939
+ fallbackOnCodes?: Array<number> | undefined;
936
940
  /**
937
941
  * Array of fallback models to use if primary model fails
938
942
  */
@@ -2454,6 +2458,10 @@ export type PromptField = {
2454
2458
  | components.TraceScrubbingPlugin
2455
2459
  >
2456
2460
  | undefined;
2461
+ /**
2462
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
2463
+ */
2464
+ fallbackOnCodes?: Array<number> | undefined;
2457
2465
  /**
2458
2466
  * Array of fallback models to use if primary model fails
2459
2467
  */
@@ -3950,6 +3958,7 @@ export type PromptInput$Outbound = {
3950
3958
  | components.TraceScrubbingPlugin$Outbound
3951
3959
  >
3952
3960
  | undefined;
3961
+ fallback_on_codes?: Array<number> | undefined;
3953
3962
  fallbacks?: Array<CreatePromptFallbacks$Outbound> | undefined;
3954
3963
  retry?: CreatePromptRetry$Outbound | undefined;
3955
3964
  cache?: CreatePromptCache$Outbound | undefined;
@@ -4020,6 +4029,7 @@ export const PromptInput$outboundSchema: z.ZodType<
4020
4029
  components.TraceScrubbingPlugin$outboundSchema,
4021
4030
  ]),
4022
4031
  ).optional(),
4032
+ fallbackOnCodes: z.array(z.number().int()).optional(),
4023
4033
  fallbacks: z.array(z.lazy(() => CreatePromptFallbacks$outboundSchema))
4024
4034
  .optional(),
4025
4035
  retry: z.lazy(() => CreatePromptRetry$outboundSchema).optional(),
@@ -4044,6 +4054,7 @@ export const PromptInput$outboundSchema: z.ZodType<
4044
4054
  topK: "top_k",
4045
4055
  toolChoice: "tool_choice",
4046
4056
  parallelToolCalls: "parallel_tool_calls",
4057
+ fallbackOnCodes: "fallback_on_codes",
4047
4058
  loadBalancer: "load_balancer",
4048
4059
  cacheControl: "cache_control",
4049
4060
  promptCacheKey: "prompt_cache_key",
@@ -5891,6 +5902,7 @@ export const PromptField$inboundSchema: z.ZodType<
5891
5902
  components.TraceScrubbingPlugin$inboundSchema,
5892
5903
  ]),
5893
5904
  ).optional(),
5905
+ fallback_on_codes: z.array(z.number().int()).optional(),
5894
5906
  fallbacks: z.array(z.lazy(() => CreatePromptPromptsFallbacks$inboundSchema))
5895
5907
  .optional(),
5896
5908
  retry: z.lazy(() => CreatePromptPromptsRetry$inboundSchema).optional(),
@@ -5925,6 +5937,7 @@ export const PromptField$inboundSchema: z.ZodType<
5925
5937
  "top_k": "topK",
5926
5938
  "tool_choice": "toolChoice",
5927
5939
  "parallel_tool_calls": "parallelToolCalls",
5940
+ "fallback_on_codes": "fallbackOnCodes",
5928
5941
  "load_balancer": "loadBalancer",
5929
5942
  "cache_control": "cacheControl",
5930
5943
  "prompt_cache_key": "promptCacheKey",
@@ -172,6 +172,10 @@ export type CreateRerankOrq = {
172
172
  * Array of fallback models to use if primary model fails
173
173
  */
174
174
  fallbacks?: Array<CreateRerankRouterRerankFallbacks> | undefined;
175
+ /**
176
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
177
+ */
178
+ fallbackOnCodes?: Array<number> | undefined;
175
179
  /**
176
180
  * Cache configuration for the request.
177
181
  */
@@ -232,6 +236,10 @@ export type CreateRerankRequestBody = {
232
236
  * The name to display on the trace. If not specified, the default system name will be used.
233
237
  */
234
238
  name?: string | undefined;
239
+ /**
240
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
241
+ */
242
+ fallbackOnCodes?: Array<number> | undefined;
235
243
  /**
236
244
  * Array of fallback models to use if primary model fails
237
245
  */
@@ -707,6 +715,7 @@ export function createRerankRouterRerankTimeoutToJSON(
707
715
  export type CreateRerankOrq$Outbound = {
708
716
  name?: string | undefined;
709
717
  fallbacks?: Array<CreateRerankRouterRerankFallbacks$Outbound> | undefined;
718
+ fallback_on_codes?: Array<number> | undefined;
710
719
  cache?: CreateRerankRouterRerankCache$Outbound | undefined;
711
720
  retry?: CreateRerankRouterRerankRetry$Outbound | undefined;
712
721
  identity?: components.PublicIdentity$Outbound | undefined;
@@ -725,6 +734,7 @@ export const CreateRerankOrq$outboundSchema: z.ZodType<
725
734
  fallbacks: z.array(
726
735
  z.lazy(() => CreateRerankRouterRerankFallbacks$outboundSchema),
727
736
  ).optional(),
737
+ fallbackOnCodes: z.array(z.number().int()).optional(),
728
738
  cache: z.lazy(() => CreateRerankRouterRerankCache$outboundSchema).optional(),
729
739
  retry: z.lazy(() => CreateRerankRouterRerankRetry$outboundSchema).optional(),
730
740
  identity: components.PublicIdentity$outboundSchema.optional(),
@@ -736,6 +746,7 @@ export const CreateRerankOrq$outboundSchema: z.ZodType<
736
746
  .optional(),
737
747
  }).transform((v) => {
738
748
  return remap$(v, {
749
+ fallbackOnCodes: "fallback_on_codes",
739
750
  loadBalancer: "load_balancer",
740
751
  });
741
752
  });
@@ -755,6 +766,7 @@ export type CreateRerankRequestBody$Outbound = {
755
766
  return_documents?: boolean | undefined;
756
767
  filename?: string | null | undefined;
757
768
  name?: string | undefined;
769
+ fallback_on_codes?: Array<number> | undefined;
758
770
  fallbacks?: Array<CreateRerankFallbacks$Outbound> | undefined;
759
771
  retry?: CreateRerankRetry$Outbound | undefined;
760
772
  cache?: CreateRerankCache$Outbound | undefined;
@@ -777,6 +789,7 @@ export const CreateRerankRequestBody$outboundSchema: z.ZodType<
777
789
  returnDocuments: z.boolean().optional(),
778
790
  filename: z.nullable(z.string()).optional(),
779
791
  name: z.string().optional(),
792
+ fallbackOnCodes: z.array(z.number().int()).optional(),
780
793
  fallbacks: z.array(z.lazy(() => CreateRerankFallbacks$outboundSchema))
781
794
  .optional(),
782
795
  retry: z.lazy(() => CreateRerankRetry$outboundSchema).optional(),
@@ -790,6 +803,7 @@ export const CreateRerankRequestBody$outboundSchema: z.ZodType<
790
803
  return remap$(v, {
791
804
  topN: "top_n",
792
805
  returnDocuments: "return_documents",
806
+ fallbackOnCodes: "fallback_on_codes",
793
807
  loadBalancer: "load_balancer",
794
808
  });
795
809
  });
@@ -883,6 +883,10 @@ export type CreateRouterResponseRequestBody = {
883
883
  */
884
884
  cacheControl?: CreateRouterResponseCacheControl | undefined;
885
885
  conversation?: components.ConversationParam | undefined;
886
+ /**
887
+ * HTTP status codes that trigger fallback. Defaults to [408,429,500,502,503,504,529]. Each code must be unique and between 400 and 599.
888
+ */
889
+ fallbackOnCodes?: Array<number> | null | undefined;
886
890
  /**
887
891
  * Fallback models to try if the primary model fails. Each entry specifies a model in provider/model format.
888
892
  */
@@ -2097,6 +2101,7 @@ export type CreateRouterResponseRequestBody$Outbound = {
2097
2101
  cache?: components.CacheConfig$Outbound | undefined;
2098
2102
  cache_control?: CreateRouterResponseCacheControl$Outbound | undefined;
2099
2103
  conversation?: components.ConversationParam$Outbound | undefined;
2104
+ fallback_on_codes?: Array<number> | null | undefined;
2100
2105
  fallbacks?: Array<components.FallbackConfig$Outbound> | null | undefined;
2101
2106
  frequency_penalty?: number | undefined;
2102
2107
  guardrails?: Array<components.EvaluatorRef$Outbound> | undefined;
@@ -2179,6 +2184,7 @@ export const CreateRouterResponseRequestBody$outboundSchema: z.ZodType<
2179
2184
  cacheControl: z.lazy(() => CreateRouterResponseCacheControl$outboundSchema)
2180
2185
  .optional(),
2181
2186
  conversation: components.ConversationParam$outboundSchema.optional(),
2187
+ fallbackOnCodes: z.nullable(z.array(z.number().int())).optional(),
2182
2188
  fallbacks: z.nullable(z.array(components.FallbackConfig$outboundSchema))
2183
2189
  .optional(),
2184
2190
  frequencyPenalty: z.number().optional(),
@@ -2298,6 +2304,7 @@ export const CreateRouterResponseRequestBody$outboundSchema: z.ZodType<
2298
2304
  }).transform((v) => {
2299
2305
  return remap$(v, {
2300
2306
  cacheControl: "cache_control",
2307
+ fallbackOnCodes: "fallback_on_codes",
2301
2308
  frequencyPenalty: "frequency_penalty",
2302
2309
  integrationId: "integration_id",
2303
2310
  loadBalancer: "load_balancer",