@effect/ai-openrouter 0.7.1 → 0.8.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.
package/src/Generated.ts CHANGED
@@ -16,9 +16,7 @@ export class CacheControlEphemeral extends S.Class<CacheControlEphemeral>("Cache
16
16
 
17
17
  export class ReasoningDetailSummaryType extends S.Literal("reasoning.summary") {}
18
18
 
19
- export class ReasoningDetailSummaryFormat
20
- extends S.Literal("unknown", "openai-responses-v1", "anthropic-claude-v1", "google-gemini-v1")
21
- {}
19
+ export class ReasoningDetailSummaryFormat extends S.Literal("unknown", "openai-responses-v1", "anthropic-claude-v1") {}
22
20
 
23
21
  /**
24
22
  * Reasoning summary detail
@@ -37,7 +35,7 @@ export class ReasoningDetailSummary extends S.Class<ReasoningDetailSummary>("Rea
37
35
  export class ReasoningDetailEncryptedType extends S.Literal("reasoning.encrypted") {}
38
36
 
39
37
  export class ReasoningDetailEncryptedFormat
40
- extends S.Literal("unknown", "openai-responses-v1", "anthropic-claude-v1", "google-gemini-v1")
38
+ extends S.Literal("unknown", "openai-responses-v1", "anthropic-claude-v1")
41
39
  {}
42
40
 
43
41
  /**
@@ -56,9 +54,7 @@ export class ReasoningDetailEncrypted extends S.Class<ReasoningDetailEncrypted>(
56
54
 
57
55
  export class ReasoningDetailTextType extends S.Literal("reasoning.text") {}
58
56
 
59
- export class ReasoningDetailTextFormat
60
- extends S.Literal("unknown", "openai-responses-v1", "anthropic-claude-v1", "google-gemini-v1")
61
- {}
57
+ export class ReasoningDetailTextFormat extends S.Literal("unknown", "openai-responses-v1", "anthropic-claude-v1") {}
62
58
 
63
59
  /**
64
60
  * Text reasoning detail
@@ -616,7 +612,7 @@ export class OpenResponsesResponseText extends S.Class<OpenResponsesResponseText
616
612
  "verbosity": S.optionalWith(OpenResponsesResponseTextVerbosity, { nullable: true })
617
613
  }) {}
618
614
 
619
- export class OpenAIResponsesReasoningEffort extends S.Literal("high", "medium", "low", "minimal", "none") {}
615
+ export class OpenAIResponsesReasoningEffort extends S.Literal("xhigh", "high", "medium", "low", "minimal", "none") {}
620
616
 
621
617
  export class ReasoningSummaryVerbosity extends S.Literal("auto", "concise", "detailed") {}
622
618
 
@@ -642,9 +638,7 @@ export class OpenAIResponsesIncludable extends S.Literal(
642
638
  "code_interpreter_call.outputs"
643
639
  ) {}
644
640
 
645
- export class OpenResponsesRequestServiceTierEnum extends S.Literal("auto", "default", "flex", "scale", "priority") {}
646
-
647
- export class OpenResponsesRequestServiceTier extends OpenResponsesRequestServiceTierEnum {}
641
+ export class OpenResponsesRequestServiceTier extends S.Literal("auto") {}
648
642
 
649
643
  export class OpenResponsesRequestTruncationEnum extends S.Literal("auto", "disabled") {}
650
644
 
@@ -663,12 +657,14 @@ export class ProviderName extends S.Literal(
663
657
  "AionLabs",
664
658
  "Alibaba",
665
659
  "Amazon Bedrock",
660
+ "Amazon Nova",
666
661
  "Anthropic",
667
- "Arcee",
662
+ "Arcee AI",
668
663
  "AtlasCloud",
669
664
  "Avian",
670
665
  "Azure",
671
666
  "BaseTen",
667
+ "BytePlus",
672
668
  "Black Forest Labs",
673
669
  "Cerebras",
674
670
  "Chutes",
@@ -683,6 +679,7 @@ export class ProviderName extends S.Literal(
683
679
  "Fireworks",
684
680
  "Friendli",
685
681
  "GMICloud",
682
+ "GoPomelo",
686
683
  "Google",
687
684
  "Google AI Studio",
688
685
  "Groq",
@@ -692,6 +689,7 @@ export class ProviderName extends S.Literal(
692
689
  "Infermatic",
693
690
  "Inflection",
694
691
  "Liquid",
692
+ "Mara",
695
693
  "Mancer 2",
696
694
  "Minimax",
697
695
  "ModelRun",
@@ -712,12 +710,15 @@ export class ProviderName extends S.Literal(
712
710
  "Relace",
713
711
  "SambaNova",
714
712
  "SiliconFlow",
713
+ "Sourceful",
715
714
  "Stealth",
715
+ "StreamLake",
716
716
  "Switchpoint",
717
717
  "Targon",
718
718
  "Together",
719
719
  "Venice",
720
720
  "WandB",
721
+ "Xiaomi",
721
722
  "xAI",
722
723
  "Z.AI",
723
724
  "FakeProvider"
@@ -725,15 +726,41 @@ export class ProviderName extends S.Literal(
725
726
 
726
727
  export class Quantization extends S.Literal("int4", "int8", "fp4", "fp6", "fp8", "fp16", "bf16", "fp32", "unknown") {}
727
728
 
729
+ export class ProviderSort extends S.Literal("price", "throughput", "latency") {}
730
+
731
+ export class ProviderSortConfigPartitionEnum extends S.Literal("model", "none") {}
732
+
733
+ export class ProviderSortConfig extends S.Class<ProviderSortConfig>("ProviderSortConfig")({
734
+ "by": S.optionalWith(ProviderSort, { nullable: true }),
735
+ "partition": S.optionalWith(ProviderSortConfigPartitionEnum, { nullable: true })
736
+ }) {}
737
+
728
738
  /**
729
- * The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
739
+ * A value in string format that is a large number
730
740
  */
731
- export class ProviderSort extends S.Literal("price", "throughput", "latency") {}
741
+ export class BigNumberUnion extends S.String {}
742
+
743
+ /**
744
+ * The search engine to use for web search.
745
+ */
746
+ export class WebSearchEngine extends S.Literal("native", "exa") {}
747
+
748
+ /**
749
+ * The engine to use for parsing PDF files.
750
+ */
751
+ export class PDFParserEngine extends S.Literal("mistral-ocr", "pdf-text", "native") {}
752
+
753
+ /**
754
+ * Options for PDF parsing.
755
+ */
756
+ export class PDFParserOptions extends S.Class<PDFParserOptions>("PDFParserOptions")({
757
+ "engine": S.optionalWith(PDFParserEngine, { nullable: true })
758
+ }) {}
732
759
 
733
760
  /**
734
- * A value in string or number format that is a large number
761
+ * **DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for providers.sort.partition. Accepts legacy values: "fallback" (maps to "model"), "sort" (maps to "none").
735
762
  */
736
- export class BigNumberUnion extends S.Union(S.Number, S.String, S.Number) {}
763
+ export class OpenResponsesRequestRoute extends S.Literal("fallback", "sort") {}
737
764
 
738
765
  /**
739
766
  * Request schema for Responses endpoint
@@ -771,8 +798,8 @@ export class OpenResponsesRequest extends S.Class<OpenResponsesRequest>("OpenRes
771
798
  "include": S.optionalWith(S.Array(OpenAIResponsesIncludable), { nullable: true }),
772
799
  "background": S.optionalWith(S.Boolean, { nullable: true }),
773
800
  "safety_identifier": S.optionalWith(S.String, { nullable: true }),
774
- "store": S.optionalWith(S.Boolean, { nullable: true }),
775
- "service_tier": S.optionalWith(OpenResponsesRequestServiceTier, { nullable: true }),
801
+ "store": S.optionalWith(S.Literal(false), { nullable: true, default: () => false as const }),
802
+ "service_tier": S.optionalWith(OpenResponsesRequestServiceTier, { nullable: true, default: () => "auto" as const }),
776
803
  "truncation": S.optionalWith(OpenResponsesRequestTruncation, { nullable: true }),
777
804
  "stream": S.optionalWith(S.Boolean, { nullable: true, default: () => false as const }),
778
805
  /**
@@ -815,7 +842,10 @@ export class OpenResponsesRequest extends S.Class<OpenResponsesRequest>("OpenRes
815
842
  * A list of quantization levels to filter the provider by.
816
843
  */
817
844
  "quantizations": S.optionalWith(S.Array(Quantization), { nullable: true }),
818
- "sort": S.optionalWith(ProviderSort, { nullable: true }),
845
+ /**
846
+ * The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
847
+ */
848
+ "sort": S.optionalWith(S.Union(ProviderSort, ProviderSortConfig), { nullable: true }),
819
849
  /**
820
850
  * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
821
851
  */
@@ -828,7 +858,23 @@ export class OpenResponsesRequest extends S.Class<OpenResponsesRequest>("OpenRes
828
858
  "request": S.optionalWith(BigNumberUnion, { nullable: true })
829
859
  }),
830
860
  { nullable: true }
831
- )
861
+ ),
862
+ /**
863
+ * Preferred minimum throughput (in tokens per second). Endpoints below this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
864
+ */
865
+ "preferred_min_throughput": S.optionalWith(S.Number, { nullable: true }),
866
+ /**
867
+ * Preferred maximum latency (in seconds). Endpoints above this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
868
+ */
869
+ "preferred_max_latency": S.optionalWith(S.Number, { nullable: true }),
870
+ /**
871
+ * **DEPRECATED** Use preferred_min_throughput instead. Backwards-compatible alias for preferred_min_throughput.
872
+ */
873
+ "min_throughput": S.optionalWith(S.Number, { nullable: true }),
874
+ /**
875
+ * **DEPRECATED** Use preferred_max_latency instead. Backwards-compatible alias for preferred_max_latency.
876
+ */
877
+ "max_latency": S.optionalWith(S.Number, { nullable: true })
832
878
  }),
833
879
  { nullable: true }
834
880
  ),
@@ -842,27 +888,44 @@ export class OpenResponsesRequest extends S.Class<OpenResponsesRequest>("OpenRes
842
888
  }),
843
889
  S.Struct({
844
890
  "id": S.Literal("web"),
891
+ /**
892
+ * Set to false to disable the web-search plugin for this request. Defaults to true.
893
+ */
894
+ "enabled": S.optionalWith(S.Boolean, { nullable: true }),
845
895
  "max_results": S.optionalWith(S.Number, { nullable: true }),
846
896
  "search_prompt": S.optionalWith(S.String, { nullable: true }),
847
- "engine": S.optionalWith(S.Literal("native", "exa"), { nullable: true })
897
+ "engine": S.optionalWith(WebSearchEngine, { nullable: true })
848
898
  }),
849
899
  S.Struct({
850
900
  "id": S.Literal("file-parser"),
851
- "max_files": S.optionalWith(S.Number, { nullable: true }),
852
- "pdf": S.optionalWith(
853
- S.Struct({
854
- "engine": S.optionalWith(S.Literal("mistral-ocr", "pdf-text", "native"), { nullable: true })
855
- }),
856
- { nullable: true }
857
- )
901
+ /**
902
+ * Set to false to disable the file-parser plugin for this request. Defaults to true.
903
+ */
904
+ "enabled": S.optionalWith(S.Boolean, { nullable: true }),
905
+ "pdf": S.optionalWith(PDFParserOptions, { nullable: true })
906
+ }),
907
+ S.Struct({
908
+ "id": S.Literal("response-healing"),
909
+ /**
910
+ * Set to false to disable the response-healing plugin for this request. Defaults to true.
911
+ */
912
+ "enabled": S.optionalWith(S.Boolean, { nullable: true })
858
913
  })
859
914
  )),
860
915
  { nullable: true }
861
916
  ),
917
+ /**
918
+ * **DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for providers.sort.partition. Accepts legacy values: "fallback" (maps to "model"), "sort" (maps to "none").
919
+ */
920
+ "route": S.optionalWith(OpenResponsesRequestRoute, { nullable: true }),
862
921
  /**
863
922
  * A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters.
864
923
  */
865
- "user": S.optionalWith(S.String.pipe(S.maxLength(128)), { nullable: true })
924
+ "user": S.optionalWith(S.String.pipe(S.maxLength(128)), { nullable: true }),
925
+ /**
926
+ * A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters.
927
+ */
928
+ "session_id": S.optionalWith(S.String.pipe(S.maxLength(128)), { nullable: true })
866
929
  }) {}
867
930
 
868
931
  export class OutputMessageRole extends S.Literal("assistant") {}
@@ -1430,7 +1493,18 @@ export class ForbiddenResponse extends S.Class<ForbiddenResponse>("ForbiddenResp
1430
1493
  /**
1431
1494
  * Total credits purchased and used
1432
1495
  */
1433
- export class GetCredits200 extends S.Record({ key: S.String, value: S.Unknown }) {}
1496
+ export class GetCredits200 extends S.Struct({
1497
+ "data": S.Struct({
1498
+ /**
1499
+ * Total credits purchased
1500
+ */
1501
+ "total_credits": S.Number,
1502
+ /**
1503
+ * Total credits used
1504
+ */
1505
+ "total_usage": S.Number
1506
+ })
1507
+ }) {}
1434
1508
 
1435
1509
  export class CreateChargeRequestChainId extends S.Literal(1, 137, 8453) {}
1436
1510
 
@@ -1474,6 +1548,82 @@ export class CreateCoinbaseCharge200 extends S.Struct({
1474
1548
 
1475
1549
  export class CreateEmbeddingsRequestEncodingFormat extends S.Literal("float", "base64") {}
1476
1550
 
1551
+ /**
1552
+ * The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
1553
+ */
1554
+ export class ProviderPreferencesSort extends S.Literal("price", "throughput", "latency") {}
1555
+
1556
+ /**
1557
+ * Provider routing preferences for the request.
1558
+ */
1559
+ export class ProviderPreferences extends S.Class<ProviderPreferences>("ProviderPreferences")({
1560
+ /**
1561
+ * Whether to allow backup providers to serve requests
1562
+ * - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
1563
+ * - false: use only the primary/custom provider, and return the upstream error if it's unavailable.
1564
+ */
1565
+ "allow_fallbacks": S.optionalWith(S.Boolean, { nullable: true }),
1566
+ /**
1567
+ * Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest.
1568
+ */
1569
+ "require_parameters": S.optionalWith(S.Boolean, { nullable: true }),
1570
+ "data_collection": S.optionalWith(DataCollection, { nullable: true }),
1571
+ /**
1572
+ * Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used.
1573
+ */
1574
+ "zdr": S.optionalWith(S.Boolean, { nullable: true }),
1575
+ /**
1576
+ * Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used.
1577
+ */
1578
+ "enforce_distillable_text": S.optionalWith(S.Boolean, { nullable: true }),
1579
+ /**
1580
+ * An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.
1581
+ */
1582
+ "order": S.optionalWith(S.Array(S.Union(ProviderName, S.String)), { nullable: true }),
1583
+ /**
1584
+ * List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.
1585
+ */
1586
+ "only": S.optionalWith(S.Array(S.Union(ProviderName, S.String)), { nullable: true }),
1587
+ /**
1588
+ * List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.
1589
+ */
1590
+ "ignore": S.optionalWith(S.Array(S.Union(ProviderName, S.String)), { nullable: true }),
1591
+ /**
1592
+ * A list of quantization levels to filter the provider by.
1593
+ */
1594
+ "quantizations": S.optionalWith(S.Array(Quantization), { nullable: true }),
1595
+ "sort": S.optionalWith(ProviderPreferencesSort, { nullable: true }),
1596
+ /**
1597
+ * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
1598
+ */
1599
+ "max_price": S.optionalWith(
1600
+ S.Struct({
1601
+ "prompt": S.optionalWith(BigNumberUnion, { nullable: true }),
1602
+ "completion": S.optionalWith(BigNumberUnion, { nullable: true }),
1603
+ "image": S.optionalWith(BigNumberUnion, { nullable: true }),
1604
+ "audio": S.optionalWith(BigNumberUnion, { nullable: true }),
1605
+ "request": S.optionalWith(BigNumberUnion, { nullable: true })
1606
+ }),
1607
+ { nullable: true }
1608
+ ),
1609
+ /**
1610
+ * Preferred minimum throughput (in tokens per second). Endpoints below this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
1611
+ */
1612
+ "preferred_min_throughput": S.optionalWith(S.Number, { nullable: true }),
1613
+ /**
1614
+ * Preferred maximum latency (in seconds). Endpoints above this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
1615
+ */
1616
+ "preferred_max_latency": S.optionalWith(S.Number, { nullable: true }),
1617
+ /**
1618
+ * **DEPRECATED** Use preferred_min_throughput instead. Backwards-compatible alias for preferred_min_throughput.
1619
+ */
1620
+ "min_throughput": S.optionalWith(S.Number, { nullable: true }),
1621
+ /**
1622
+ * **DEPRECATED** Use preferred_max_latency instead. Backwards-compatible alias for preferred_max_latency.
1623
+ */
1624
+ "max_latency": S.optionalWith(S.Number, { nullable: true })
1625
+ }) {}
1626
+
1477
1627
  export class CreateEmbeddingsRequest extends S.Class<CreateEmbeddingsRequest>("CreateEmbeddingsRequest")({
1478
1628
  "input": S.Union(
1479
1629
  S.String,
@@ -1499,60 +1649,7 @@ export class CreateEmbeddingsRequest extends S.Class<CreateEmbeddingsRequest>("C
1499
1649
  "encoding_format": S.optionalWith(CreateEmbeddingsRequestEncodingFormat, { nullable: true }),
1500
1650
  "dimensions": S.optionalWith(S.Int.pipe(S.greaterThan(0)), { nullable: true }),
1501
1651
  "user": S.optionalWith(S.String, { nullable: true }),
1502
- "provider": S.optionalWith(
1503
- S.Struct({
1504
- /**
1505
- * Whether to allow backup providers to serve requests
1506
- * - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
1507
- * - false: use only the primary/custom provider, and return the upstream error if it's unavailable.
1508
- */
1509
- "allow_fallbacks": S.optionalWith(S.Boolean, { nullable: true }),
1510
- /**
1511
- * Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest.
1512
- */
1513
- "require_parameters": S.optionalWith(S.Boolean, { nullable: true }),
1514
- "data_collection": S.optionalWith(DataCollection, { nullable: true }),
1515
- /**
1516
- * Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used.
1517
- */
1518
- "zdr": S.optionalWith(S.Boolean, { nullable: true }),
1519
- /**
1520
- * Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used.
1521
- */
1522
- "enforce_distillable_text": S.optionalWith(S.Boolean, { nullable: true }),
1523
- /**
1524
- * An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.
1525
- */
1526
- "order": S.optionalWith(S.Array(S.Union(ProviderName, S.String)), { nullable: true }),
1527
- /**
1528
- * List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.
1529
- */
1530
- "only": S.optionalWith(S.Array(S.Union(ProviderName, S.String)), { nullable: true }),
1531
- /**
1532
- * List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.
1533
- */
1534
- "ignore": S.optionalWith(S.Array(S.Union(ProviderName, S.String)), { nullable: true }),
1535
- /**
1536
- * A list of quantization levels to filter the provider by.
1537
- */
1538
- "quantizations": S.optionalWith(S.Array(Quantization), { nullable: true }),
1539
- "sort": S.optionalWith(ProviderSort, { nullable: true }),
1540
- /**
1541
- * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
1542
- */
1543
- "max_price": S.optionalWith(
1544
- S.Struct({
1545
- "prompt": S.optionalWith(BigNumberUnion, { nullable: true }),
1546
- "completion": S.optionalWith(BigNumberUnion, { nullable: true }),
1547
- "image": S.optionalWith(BigNumberUnion, { nullable: true }),
1548
- "audio": S.optionalWith(BigNumberUnion, { nullable: true }),
1549
- "request": S.optionalWith(BigNumberUnion, { nullable: true })
1550
- }),
1551
- { nullable: true }
1552
- )
1553
- }),
1554
- { nullable: true }
1555
- ),
1652
+ "provider": S.optionalWith(ProviderPreferences, { nullable: true }),
1556
1653
  "input_type": S.optionalWith(S.String, { nullable: true })
1557
1654
  }) {}
1558
1655
 
@@ -1730,6 +1827,7 @@ export class Parameter extends S.Literal(
1730
1827
  "parallel_tool_calls",
1731
1828
  "include_reasoning",
1732
1829
  "reasoning",
1830
+ "reasoning_effort",
1733
1831
  "web_search_options",
1734
1832
  "verbosity"
1735
1833
  ) {}
@@ -2120,73 +2218,8 @@ export class ListEndpointsZdr200 extends S.Struct({
2120
2218
  "data": S.Array(PublicEndpoint)
2121
2219
  }) {}
2122
2220
 
2123
- export class GetParametersParamsProvider extends S.Literal(
2124
- "AI21",
2125
- "AionLabs",
2126
- "Alibaba",
2127
- "Amazon Bedrock",
2128
- "Anthropic",
2129
- "Arcee",
2130
- "AtlasCloud",
2131
- "Avian",
2132
- "Azure",
2133
- "BaseTen",
2134
- "Black Forest Labs",
2135
- "Cerebras",
2136
- "Chutes",
2137
- "Cirrascale",
2138
- "Clarifai",
2139
- "Cloudflare",
2140
- "Cohere",
2141
- "Crusoe",
2142
- "DeepInfra",
2143
- "DeepSeek",
2144
- "Featherless",
2145
- "Fireworks",
2146
- "Friendli",
2147
- "GMICloud",
2148
- "Google",
2149
- "Google AI Studio",
2150
- "Groq",
2151
- "Hyperbolic",
2152
- "Inception",
2153
- "InferenceNet",
2154
- "Infermatic",
2155
- "Inflection",
2156
- "Liquid",
2157
- "Mancer 2",
2158
- "Minimax",
2159
- "ModelRun",
2160
- "Mistral",
2161
- "Modular",
2162
- "Moonshot AI",
2163
- "Morph",
2164
- "NCompass",
2165
- "Nebius",
2166
- "NextBit",
2167
- "Novita",
2168
- "Nvidia",
2169
- "OpenAI",
2170
- "OpenInference",
2171
- "Parasail",
2172
- "Perplexity",
2173
- "Phala",
2174
- "Relace",
2175
- "SambaNova",
2176
- "SiliconFlow",
2177
- "Stealth",
2178
- "Switchpoint",
2179
- "Targon",
2180
- "Together",
2181
- "Venice",
2182
- "WandB",
2183
- "xAI",
2184
- "Z.AI",
2185
- "FakeProvider"
2186
- ) {}
2187
-
2188
2221
  export class GetParametersParams extends S.Struct({
2189
- "provider": S.optionalWith(GetParametersParamsProvider, { nullable: true })
2222
+ "provider": S.optionalWith(ProviderName, { nullable: true })
2190
2223
  }) {}
2191
2224
 
2192
2225
  export class GetParameters200 extends S.Struct({
@@ -2224,6 +2257,7 @@ export class GetParameters200 extends S.Struct({
2224
2257
  "parallel_tool_calls",
2225
2258
  "include_reasoning",
2226
2259
  "reasoning",
2260
+ "reasoning_effort",
2227
2261
  "web_search_options",
2228
2262
  "verbosity"
2229
2263
  )
@@ -2840,9 +2874,104 @@ export class CreateAuthKeysCode200 extends S.Struct({
2840
2874
  })
2841
2875
  }) {}
2842
2876
 
2877
+ export class ChatGenerationParamsProviderEnumDataCollectionEnum extends S.Literal("deny", "allow") {}
2878
+
2879
+ export class Schema0 extends S.Array(
2880
+ S.Union(
2881
+ S.Literal(
2882
+ "AI21",
2883
+ "AionLabs",
2884
+ "Alibaba",
2885
+ "Amazon Bedrock",
2886
+ "Amazon Nova",
2887
+ "Anthropic",
2888
+ "Arcee AI",
2889
+ "AtlasCloud",
2890
+ "Avian",
2891
+ "Azure",
2892
+ "BaseTen",
2893
+ "BytePlus",
2894
+ "Black Forest Labs",
2895
+ "Cerebras",
2896
+ "Chutes",
2897
+ "Cirrascale",
2898
+ "Clarifai",
2899
+ "Cloudflare",
2900
+ "Cohere",
2901
+ "Crusoe",
2902
+ "DeepInfra",
2903
+ "DeepSeek",
2904
+ "Featherless",
2905
+ "Fireworks",
2906
+ "Friendli",
2907
+ "GMICloud",
2908
+ "GoPomelo",
2909
+ "Google",
2910
+ "Google AI Studio",
2911
+ "Groq",
2912
+ "Hyperbolic",
2913
+ "Inception",
2914
+ "InferenceNet",
2915
+ "Infermatic",
2916
+ "Inflection",
2917
+ "Liquid",
2918
+ "Mara",
2919
+ "Mancer 2",
2920
+ "Minimax",
2921
+ "ModelRun",
2922
+ "Mistral",
2923
+ "Modular",
2924
+ "Moonshot AI",
2925
+ "Morph",
2926
+ "NCompass",
2927
+ "Nebius",
2928
+ "NextBit",
2929
+ "Novita",
2930
+ "Nvidia",
2931
+ "OpenAI",
2932
+ "OpenInference",
2933
+ "Parasail",
2934
+ "Perplexity",
2935
+ "Phala",
2936
+ "Relace",
2937
+ "SambaNova",
2938
+ "SiliconFlow",
2939
+ "Sourceful",
2940
+ "Stealth",
2941
+ "StreamLake",
2942
+ "Switchpoint",
2943
+ "Targon",
2944
+ "Together",
2945
+ "Venice",
2946
+ "WandB",
2947
+ "Xiaomi",
2948
+ "xAI",
2949
+ "Z.AI",
2950
+ "FakeProvider"
2951
+ ),
2952
+ S.String
2953
+ )
2954
+ ) {}
2955
+
2956
+ export class ProviderSortUnion extends S.Union(ProviderSort, ProviderSortConfig) {}
2957
+
2958
+ export class Schema1 extends S.Union(S.Number, S.String, S.Number) {}
2959
+
2960
+ export class ChatGenerationParamsRouteEnum extends S.Literal("fallback", "sort") {}
2961
+
2962
+ export class ChatMessageContentItemCacheControlTtl extends S.Literal("5m", "1h") {}
2963
+
2964
+ export class ChatMessageContentItemCacheControl
2965
+ extends S.Class<ChatMessageContentItemCacheControl>("ChatMessageContentItemCacheControl")({
2966
+ "type": S.Literal("ephemeral"),
2967
+ "ttl": S.optionalWith(ChatMessageContentItemCacheControlTtl, { nullable: true })
2968
+ })
2969
+ {}
2970
+
2843
2971
  export class ChatMessageContentItemText extends S.Class<ChatMessageContentItemText>("ChatMessageContentItemText")({
2844
2972
  "type": S.Literal("text"),
2845
- "text": S.String
2973
+ "text": S.String,
2974
+ "cache_control": S.optionalWith(ChatMessageContentItemCacheControl, { nullable: true })
2846
2975
  }) {}
2847
2976
 
2848
2977
  export class SystemMessage extends S.Class<SystemMessage>("SystemMessage")({
@@ -2861,33 +2990,16 @@ export class ChatMessageContentItemImage extends S.Class<ChatMessageContentItemI
2861
2990
  })
2862
2991
  }) {}
2863
2992
 
2864
- export class ChatMessageContentItemAudioInputAudioFormat
2865
- extends S.Literal("wav", "mp3", "flac", "m4a", "ogg", "pcm16", "pcm24")
2866
- {}
2867
-
2868
2993
  export class ChatMessageContentItemAudio extends S.Class<ChatMessageContentItemAudio>("ChatMessageContentItemAudio")({
2869
2994
  "type": S.Literal("input_audio"),
2870
2995
  "input_audio": S.Struct({
2871
2996
  "data": S.String,
2872
- "format": ChatMessageContentItemAudioInputAudioFormat
2997
+ "format": S.String
2873
2998
  })
2874
2999
  }) {}
2875
3000
 
2876
- export class VideoURL extends S.Class<VideoURL>("VideoURL")({
2877
- "url": S.String
2878
- }) {}
2879
-
2880
3001
  export class ChatMessageContentItemVideo extends S.Record({ key: S.String, value: S.Unknown }) {}
2881
3002
 
2882
- export class ChatMessageContentItemFile extends S.Class<ChatMessageContentItemFile>("ChatMessageContentItemFile")({
2883
- "type": S.Literal("file"),
2884
- "file": S.Struct({
2885
- "file_data": S.String,
2886
- "file_id": S.optionalWith(S.String, { nullable: true }),
2887
- "filename": S.optionalWith(S.String, { nullable: true })
2888
- })
2889
- }) {}
2890
-
2891
3003
  export class ChatMessageContentItem extends S.Record({ key: S.String, value: S.Unknown }) {}
2892
3004
 
2893
3005
  export class UserMessage extends S.Class<UserMessage>("UserMessage")({
@@ -2927,7 +3039,9 @@ export class Message extends S.Record({ key: S.String, value: S.Unknown }) {}
2927
3039
 
2928
3040
  export class ModelName extends S.String {}
2929
3041
 
2930
- export class ChatGenerationParamsReasoningEffortEnum extends S.Literal("none", "minimal", "low", "medium", "high") {}
3042
+ export class ChatGenerationParamsReasoningEffortEnum
3043
+ extends S.Literal("xhigh", "high", "medium", "low", "minimal", "none")
3044
+ {}
2931
3045
 
2932
3046
  export class JSONSchemaConfig extends S.Class<JSONSchemaConfig>("JSONSchemaConfig")({
2933
3047
  "name": S.String.pipe(S.maxLength(64)),
@@ -2972,6 +3086,83 @@ export class ToolDefinitionJson extends S.Class<ToolDefinitionJson>("ToolDefinit
2972
3086
  }) {}
2973
3087
 
2974
3088
  export class ChatGenerationParams extends S.Class<ChatGenerationParams>("ChatGenerationParams")({
3089
+ /**
3090
+ * When multiple model providers are available, optionally indicate your routing preference.
3091
+ */
3092
+ "provider": S.optionalWith(
3093
+ S.Struct({
3094
+ /**
3095
+ * Whether to allow backup providers to serve requests
3096
+ * - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
3097
+ * - false: use only the primary/custom provider, and return the upstream error if it's unavailable.
3098
+ */
3099
+ "allow_fallbacks": S.optionalWith(S.Boolean, { nullable: true }),
3100
+ /**
3101
+ * Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest.
3102
+ */
3103
+ "require_parameters": S.optionalWith(S.Boolean, { nullable: true }),
3104
+ /**
3105
+ * Data collection setting. If no available model provider meets the requirement, your request will return an error.
3106
+ * - allow: (default) allow providers which store user data non-transiently and may train on it
3107
+ *
3108
+ * - deny: use only providers which do not collect user data.
3109
+ */
3110
+ "data_collection": S.optionalWith(S.Literal("deny", "allow"), { nullable: true }),
3111
+ "zdr": S.optionalWith(S.Boolean, { nullable: true }),
3112
+ "enforce_distillable_text": S.optionalWith(S.Boolean, { nullable: true }),
3113
+ /**
3114
+ * An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.
3115
+ */
3116
+ "order": S.optionalWith(Schema0, { nullable: true }),
3117
+ /**
3118
+ * List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.
3119
+ */
3120
+ "only": S.optionalWith(Schema0, { nullable: true }),
3121
+ /**
3122
+ * List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.
3123
+ */
3124
+ "ignore": S.optionalWith(Schema0, { nullable: true }),
3125
+ /**
3126
+ * A list of quantization levels to filter the provider by.
3127
+ */
3128
+ "quantizations": S.optionalWith(
3129
+ S.Array(S.Literal("int4", "int8", "fp4", "fp6", "fp8", "fp16", "bf16", "fp32", "unknown")),
3130
+ { nullable: true }
3131
+ ),
3132
+ /**
3133
+ * The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
3134
+ */
3135
+ "sort": S.optionalWith(ProviderSortUnion, { nullable: true }),
3136
+ /**
3137
+ * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
3138
+ */
3139
+ "max_price": S.optionalWith(
3140
+ S.Struct({
3141
+ "prompt": S.optionalWith(Schema1, { nullable: true }),
3142
+ "completion": S.optionalWith(Schema1, { nullable: true }),
3143
+ "image": S.optionalWith(Schema1, { nullable: true }),
3144
+ "audio": S.optionalWith(Schema1, { nullable: true }),
3145
+ "request": S.optionalWith(Schema1, { nullable: true })
3146
+ }),
3147
+ { nullable: true }
3148
+ ),
3149
+ "preferred_min_throughput": S.optionalWith(S.Number, { nullable: true }),
3150
+ "preferred_max_latency": S.optionalWith(S.Number, { nullable: true }),
3151
+ "min_throughput": S.optionalWith(S.Number, { nullable: true }),
3152
+ "max_latency": S.optionalWith(S.Number, { nullable: true })
3153
+ }),
3154
+ { nullable: true }
3155
+ ),
3156
+ /**
3157
+ * Plugins you want to enable for this request, including their settings.
3158
+ */
3159
+ "plugins": S.optionalWith(S.Array(S.Record({ key: S.String, value: S.Unknown })), { nullable: true }),
3160
+ "route": S.optionalWith(ChatGenerationParamsRouteEnum, { nullable: true }),
3161
+ "user": S.optionalWith(S.String, { nullable: true }),
3162
+ /**
3163
+ * A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters.
3164
+ */
3165
+ "session_id": S.optionalWith(S.String.pipe(S.maxLength(128)), { nullable: true }),
2975
3166
  "messages": S.NonEmptyArray(Message).pipe(S.minItems(1)),
2976
3167
  "model": S.optionalWith(ModelName, { nullable: true }),
2977
3168
  "models": S.optionalWith(S.Array(ModelName), { nullable: true }),
@@ -3011,14 +3202,29 @@ export class ChatGenerationParams extends S.Class<ChatGenerationParams>("ChatGen
3011
3202
  nullable: true,
3012
3203
  default: () => 1 as const
3013
3204
  }),
3014
- "user": S.optionalWith(S.String, { nullable: true })
3205
+ "debug": S.optionalWith(
3206
+ S.Struct({
3207
+ "echo_upstream_body": S.optionalWith(S.Boolean, { nullable: true })
3208
+ }),
3209
+ { nullable: true }
3210
+ )
3015
3211
  }) {}
3016
3212
 
3017
- export class ChatCompletionFinishReasonEnum
3018
- extends S.Literal("tool_calls", "stop", "length", "content_filter", "error")
3213
+ export class ChatCompletionFinishReason extends S.Literal("tool_calls", "stop", "length", "content_filter", "error") {}
3214
+
3215
+ export class Schema2 extends S.Union(ChatCompletionFinishReason, S.Null) {}
3216
+
3217
+ export class Schema4 extends S.Union(S.String, S.Null) {}
3218
+
3219
+ export class Schema5Enum
3220
+ extends S.Literal("unknown", "openai-responses-v1", "xai-responses-v1", "anthropic-claude-v1", "google-gemini-v1")
3019
3221
  {}
3020
3222
 
3021
- export class ChatCompletionFinishReason extends S.Union(ChatCompletionFinishReasonEnum, S.Null) {}
3223
+ export class Schema5 extends S.Union(Schema5Enum, S.Null) {}
3224
+
3225
+ export class Schema6 extends S.Number {}
3226
+
3227
+ export class Schema3 extends S.Record({ key: S.String, value: S.Unknown }) {}
3022
3228
 
3023
3229
  export class ChatMessageTokenLogprob extends S.Class<ChatMessageTokenLogprob>("ChatMessageTokenLogprob")({
3024
3230
  "token": S.String,
@@ -3037,9 +3243,10 @@ export class ChatMessageTokenLogprobs extends S.Class<ChatMessageTokenLogprobs>(
3037
3243
  }) {}
3038
3244
 
3039
3245
  export class ChatResponseChoice extends S.Class<ChatResponseChoice>("ChatResponseChoice")({
3040
- "finish_reason": S.NullOr(S.Literal("tool_calls", "stop", "length", "content_filter", "error")),
3246
+ "finish_reason": S.NullOr(ChatCompletionFinishReason),
3041
3247
  "index": S.Number,
3042
3248
  "message": AssistantMessage,
3249
+ "reasoning_details": S.optionalWith(S.Array(Schema3), { nullable: true }),
3043
3250
  "logprobs": S.optionalWith(ChatMessageTokenLogprobs, { nullable: true })
3044
3251
  }) {}
3045
3252
 
@@ -3145,7 +3352,9 @@ export class CompletionChoice extends S.Class<CompletionChoice>("CompletionChoic
3145
3352
  "text": S.String,
3146
3353
  "index": S.Number,
3147
3354
  "logprobs": S.NullOr(CompletionLogprobs),
3148
- "finish_reason": S.NullOr(S.Literal("stop", "length", "content_filter"))
3355
+ "finish_reason": S.NullOr(S.Literal("stop", "length", "content_filter")),
3356
+ "native_finish_reason": S.optionalWith(S.String, { nullable: true }),
3357
+ "reasoning": S.optionalWith(S.String, { nullable: true })
3149
3358
  }) {}
3150
3359
 
3151
3360
  export class CompletionUsage extends S.Class<CompletionUsage>("CompletionUsage")({
@@ -3159,6 +3368,7 @@ export class CompletionResponse extends S.Class<CompletionResponse>("CompletionR
3159
3368
  "object": S.Literal("text_completion"),
3160
3369
  "created": S.Number,
3161
3370
  "model": S.String,
3371
+ "provider": S.optionalWith(S.String, { nullable: true }),
3162
3372
  "system_fingerprint": S.optionalWith(S.String, { nullable: true }),
3163
3373
  "choices": S.Array(CompletionChoice),
3164
3374
  "usage": S.optionalWith(CompletionUsage, { nullable: true })