@openrouter/sdk 1.5.114 → 1.5.116
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/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/aabenchmarkentry.d.ts +3 -3
- package/esm/models/index.d.ts +2 -0
- package/esm/models/index.js +2 -0
- package/esm/models/modelbenchmarks.d.ts +1 -1
- package/esm/models/operations/getbenchmarks.d.ts +3 -3
- package/esm/models/operations/getbenchmarks.js +1 -1
- package/esm/models/operations/getmodels.d.ts +7 -7
- package/esm/models/operations/getmodels.js +1 -1
- package/esm/models/operations/listmodelsuser.d.ts +3 -3
- package/esm/models/operations/listmodelsuser.js +1 -1
- package/esm/models/privateendpointpromptcaching.d.ts +20 -0
- package/esm/models/privateendpointpromptcaching.js +20 -0
- package/esm/models/privateendpointsettings.d.ts +5 -0
- package/esm/models/privateendpointsettings.js +3 -0
- package/esm/models/unifiedbenchmarksaaitem.d.ts +3 -3
- package/esm/models/updateprivateendpointpromptcaching.d.ts +23 -0
- package/esm/models/updateprivateendpointpromptcaching.js +19 -0
- package/esm/models/updateprivateendpointsettingsrequest.d.ts +6 -0
- package/esm/models/updateprivateendpointsettingsrequest.js +3 -0
- package/jsr.json +1 -1
- package/package.json +7 -7
package/esm/lib/config.d.ts
CHANGED
|
@@ -49,8 +49,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
49
49
|
export declare const SDK_METADATA: {
|
|
50
50
|
readonly language: "typescript";
|
|
51
51
|
readonly openapiDocVersion: "1.0.0";
|
|
52
|
-
readonly sdkVersion: "1.5.
|
|
52
|
+
readonly sdkVersion: "1.5.116";
|
|
53
53
|
readonly genVersion: "2.960.8";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.5.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.5.116 2.960.8 1.0.0 @openrouter/sdk";
|
|
55
55
|
};
|
|
56
56
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -25,8 +25,8 @@ export function serverURLFromOptions(options) {
|
|
|
25
25
|
export const SDK_METADATA = {
|
|
26
26
|
language: "typescript",
|
|
27
27
|
openapiDocVersion: "1.0.0",
|
|
28
|
-
sdkVersion: "1.5.
|
|
28
|
+
sdkVersion: "1.5.116",
|
|
29
29
|
genVersion: "2.960.8",
|
|
30
|
-
userAgent: "speakeasy-sdk/typescript 1.5.
|
|
30
|
+
userAgent: "speakeasy-sdk/typescript 1.5.116 2.960.8 1.0.0 @openrouter/sdk",
|
|
31
31
|
};
|
|
32
32
|
//# sourceMappingURL=config.js.map
|
|
@@ -2,17 +2,17 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
4
|
/**
|
|
5
|
-
* Benchmark index scores published by Artificial Analysis (artificialanalysis.ai), one field per index. Each score is the model's best on that index across the configurations Artificial Analysis evaluated (for example reasoning levels), so two indexes of one model can come from different configurations. The deprecated Coding and Agentic Index
|
|
5
|
+
* Benchmark index scores published by Artificial Analysis (artificialanalysis.ai), one field per index. Each score is the model's best on that index across the configurations Artificial Analysis evaluated (for example reasoning levels), so two indexes of one model can come from different configurations. The deprecated Coding Index and Agentic Index fields are null for every model: Artificial Analysis has retired those indexes. Attribute Artificial Analysis when you republish them. Omitted when Artificial Analysis has scored the model on none of them.
|
|
6
6
|
*/
|
|
7
7
|
export type AABenchmarkEntry = {
|
|
8
8
|
/**
|
|
9
|
-
* Deprecated: Artificial Analysis has retired its Agentic Index and no longer publishes it.
|
|
9
|
+
* Deprecated: Artificial Analysis has retired its Agentic Index and no longer publishes it. Always null.
|
|
10
10
|
*
|
|
11
11
|
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
12
12
|
*/
|
|
13
13
|
agenticIndex: number | null;
|
|
14
14
|
/**
|
|
15
|
-
* Deprecated: Artificial Analysis has retired its Coding Index and no longer publishes it.
|
|
15
|
+
* Deprecated: Artificial Analysis has retired its Coding Index and no longer publishes it. Always null.
|
|
16
16
|
*
|
|
17
17
|
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
18
18
|
*/
|
package/esm/models/index.d.ts
CHANGED
|
@@ -723,6 +723,7 @@ export * from "./privateendpointdeclaredparameter.js";
|
|
|
723
723
|
export * from "./privateendpointdeclaredregion.js";
|
|
724
724
|
export * from "./privateendpointparametercheck.js";
|
|
725
725
|
export * from "./privateendpointpricing.js";
|
|
726
|
+
export * from "./privateendpointpromptcaching.js";
|
|
726
727
|
export * from "./privateendpointquantization.js";
|
|
727
728
|
export * from "./privateendpointreasoningreturnmechanism.js";
|
|
728
729
|
export * from "./privateendpointresponse.js";
|
|
@@ -907,6 +908,7 @@ export * from "./updatemoderationguardrailpolicyrequest.js";
|
|
|
907
908
|
export * from "./updateobservabilitydestinationrequest.js";
|
|
908
909
|
export * from "./updateobservabilitydestinationresponse.js";
|
|
909
910
|
export * from "./updateorganizationsettingsrequest.js";
|
|
911
|
+
export * from "./updateprivateendpointpromptcaching.js";
|
|
910
912
|
export * from "./updateprivateendpointrequest.js";
|
|
911
913
|
export * from "./updateprivateendpointsettingsrequest.js";
|
|
912
914
|
export * from "./updateprivateproviderrequest.js";
|
package/esm/models/index.js
CHANGED
|
@@ -726,6 +726,7 @@ export * from "./privateendpointdeclaredparameter.js";
|
|
|
726
726
|
export * from "./privateendpointdeclaredregion.js";
|
|
727
727
|
export * from "./privateendpointparametercheck.js";
|
|
728
728
|
export * from "./privateendpointpricing.js";
|
|
729
|
+
export * from "./privateendpointpromptcaching.js";
|
|
729
730
|
export * from "./privateendpointquantization.js";
|
|
730
731
|
export * from "./privateendpointreasoningreturnmechanism.js";
|
|
731
732
|
export * from "./privateendpointresponse.js";
|
|
@@ -910,6 +911,7 @@ export * from "./updatemoderationguardrailpolicyrequest.js";
|
|
|
910
911
|
export * from "./updateobservabilitydestinationrequest.js";
|
|
911
912
|
export * from "./updateobservabilitydestinationresponse.js";
|
|
912
913
|
export * from "./updateorganizationsettingsrequest.js";
|
|
914
|
+
export * from "./updateprivateendpointpromptcaching.js";
|
|
913
915
|
export * from "./updateprivateendpointrequest.js";
|
|
914
916
|
export * from "./updateprivateendpointsettingsrequest.js";
|
|
915
917
|
export * from "./updateprivateproviderrequest.js";
|
|
@@ -8,7 +8,7 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
|
8
8
|
*/
|
|
9
9
|
export type ModelBenchmarks = {
|
|
10
10
|
/**
|
|
11
|
-
* Benchmark index scores published by Artificial Analysis (artificialanalysis.ai), one field per index. Each score is the model's best on that index across the configurations Artificial Analysis evaluated (for example reasoning levels), so two indexes of one model can come from different configurations. The deprecated Coding and Agentic Index
|
|
11
|
+
* Benchmark index scores published by Artificial Analysis (artificialanalysis.ai), one field per index. Each score is the model's best on that index across the configurations Artificial Analysis evaluated (for example reasoning levels), so two indexes of one model can come from different configurations. The deprecated Coding Index and Agentic Index fields are null for every model: Artificial Analysis has retired those indexes. Attribute Artificial Analysis when you republish them. Omitted when Artificial Analysis has scored the model on none of them.
|
|
12
12
|
*/
|
|
13
13
|
artificialAnalysis?: AABenchmarkEntry | undefined;
|
|
14
14
|
/**
|
|
@@ -34,7 +34,7 @@ export declare const Source: {
|
|
|
34
34
|
*/
|
|
35
35
|
export type Source = OpenEnum<typeof Source>;
|
|
36
36
|
/**
|
|
37
|
-
* Filter results by task type. Every value except `search` names the Artificial Analysis index of the same name and returns only models scored on it, best first (`coding` and `agentic` are deprecated: Artificial Analysis has retired those indexes). Design Arena answers only `coding`, `intelligence` and `agentic`, and OpenRouter's own evals only `intelligence` and `agentic`. `search` returns OpenRouter search benchmark results only.
|
|
37
|
+
* Filter results by task type. Every value except `search` names the Artificial Analysis index of the same name and returns only models scored on it, best first (`coding` and `agentic` are deprecated: Artificial Analysis has retired those indexes and returns no item for them). Design Arena answers only `coding`, `intelligence` and `agentic`, and OpenRouter's own evals only `intelligence` and `agentic`. `search` returns OpenRouter search benchmark results only.
|
|
38
38
|
*/
|
|
39
39
|
export declare const TaskType: {
|
|
40
40
|
readonly Intelligence: "intelligence";
|
|
@@ -52,7 +52,7 @@ export declare const TaskType: {
|
|
|
52
52
|
readonly Search: "search";
|
|
53
53
|
};
|
|
54
54
|
/**
|
|
55
|
-
* Filter results by task type. Every value except `search` names the Artificial Analysis index of the same name and returns only models scored on it, best first (`coding` and `agentic` are deprecated: Artificial Analysis has retired those indexes). Design Arena answers only `coding`, `intelligence` and `agentic`, and OpenRouter's own evals only `intelligence` and `agentic`. `search` returns OpenRouter search benchmark results only.
|
|
55
|
+
* Filter results by task type. Every value except `search` names the Artificial Analysis index of the same name and returns only models scored on it, best first (`coding` and `agentic` are deprecated: Artificial Analysis has retired those indexes and returns no item for them). Design Arena answers only `coding`, `intelligence` and `agentic`, and OpenRouter's own evals only `intelligence` and `agentic`. `search` returns OpenRouter search benchmark results only.
|
|
56
56
|
*/
|
|
57
57
|
export type TaskType = OpenEnum<typeof TaskType>;
|
|
58
58
|
/**
|
|
@@ -118,7 +118,7 @@ export type GetBenchmarksRequest = {
|
|
|
118
118
|
*/
|
|
119
119
|
source?: Source | undefined;
|
|
120
120
|
/**
|
|
121
|
-
* Filter results by task type. Every value except `search` names the Artificial Analysis index of the same name and returns only models scored on it, best first (`coding` and `agentic` are deprecated: Artificial Analysis has retired those indexes). Design Arena answers only `coding`, `intelligence` and `agentic`, and OpenRouter's own evals only `intelligence` and `agentic`. `search` returns OpenRouter search benchmark results only.
|
|
121
|
+
* Filter results by task type. Every value except `search` names the Artificial Analysis index of the same name and returns only models scored on it, best first (`coding` and `agentic` are deprecated: Artificial Analysis has retired those indexes and returns no item for them). Design Arena answers only `coding`, `intelligence` and `agentic`, and OpenRouter's own evals only `intelligence` and `agentic`. `search` returns OpenRouter search benchmark results only.
|
|
122
122
|
*/
|
|
123
123
|
taskType?: TaskType | undefined;
|
|
124
124
|
/**
|
|
@@ -13,7 +13,7 @@ export const Source = {
|
|
|
13
13
|
Openrouter: "openrouter",
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
|
-
* Filter results by task type. Every value except `search` names the Artificial Analysis index of the same name and returns only models scored on it, best first (`coding` and `agentic` are deprecated: Artificial Analysis has retired those indexes). Design Arena answers only `coding`, `intelligence` and `agentic`, and OpenRouter's own evals only `intelligence` and `agentic`. `search` returns OpenRouter search benchmark results only.
|
|
16
|
+
* Filter results by task type. Every value except `search` names the Artificial Analysis index of the same name and returns only models scored on it, best first (`coding` and `agentic` are deprecated: Artificial Analysis has retired those indexes and returns no item for them). Design Arena answers only `coding`, `intelligence` and `agentic`, and OpenRouter's own evals only `intelligence` and `agentic`. `search` returns OpenRouter search benchmark results only.
|
|
17
17
|
*/
|
|
18
18
|
export const TaskType = {
|
|
19
19
|
Intelligence: "intelligence",
|
|
@@ -46,7 +46,7 @@ export declare const GetModelsCategory: {
|
|
|
46
46
|
*/
|
|
47
47
|
export type GetModelsCategory = OpenEnum<typeof GetModelsCategory>;
|
|
48
48
|
/**
|
|
49
|
-
* Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), <index>-high-to-low for each Artificial Analysis index (the coding and agentic sorts are deprecated: Artificial Analysis has retired those indexes), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. The decision sort ranks decision models, so pass output_modalities=decisions or all with it. When omitted, the existing default ordering is preserved.
|
|
49
|
+
* Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), <index>-high-to-low for each Artificial Analysis index (the coding and agentic sorts are deprecated: Artificial Analysis has retired those indexes, so they order by canonical slug and variant alone), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. The decision sort ranks decision models, so pass output_modalities=decisions or all with it. When omitted, the existing default ordering is preserved.
|
|
50
50
|
*/
|
|
51
51
|
export declare const GetModelsSort: {
|
|
52
52
|
readonly MostPopular: "most-popular";
|
|
@@ -73,7 +73,7 @@ export declare const GetModelsSort: {
|
|
|
73
73
|
readonly DesignArenaEloHighToLow: "design-arena-elo-high-to-low";
|
|
74
74
|
};
|
|
75
75
|
/**
|
|
76
|
-
* Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), <index>-high-to-low for each Artificial Analysis index (the coding and agentic sorts are deprecated: Artificial Analysis has retired those indexes), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. The decision sort ranks decision models, so pass output_modalities=decisions or all with it. When omitted, the existing default ordering is preserved.
|
|
76
|
+
* Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), <index>-high-to-low for each Artificial Analysis index (the coding and agentic sorts are deprecated: Artificial Analysis has retired those indexes, so they order by canonical slug and variant alone), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. The decision sort ranks decision models, so pass output_modalities=decisions or all with it. When omitted, the existing default ordering is preserved.
|
|
77
77
|
*/
|
|
78
78
|
export type GetModelsSort = OpenEnum<typeof GetModelsSort>;
|
|
79
79
|
/**
|
|
@@ -149,7 +149,7 @@ export type GetModelsRequest = {
|
|
|
149
149
|
*/
|
|
150
150
|
outputModalities?: string | undefined;
|
|
151
151
|
/**
|
|
152
|
-
* Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), <index>-high-to-low for each Artificial Analysis index (the coding and agentic sorts are deprecated: Artificial Analysis has retired those indexes), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. The decision sort ranks decision models, so pass output_modalities=decisions or all with it. When omitted, the existing default ordering is preserved.
|
|
152
|
+
* Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), <index>-high-to-low for each Artificial Analysis index (the coding and agentic sorts are deprecated: Artificial Analysis has retired those indexes, so they order by canonical slug and variant alone), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. The decision sort ranks decision models, so pass output_modalities=decisions or all with it. When omitted, the existing default ordering is preserved.
|
|
153
153
|
*/
|
|
154
154
|
sort?: GetModelsSort | undefined;
|
|
155
155
|
/**
|
|
@@ -225,25 +225,25 @@ export type GetModelsRequest = {
|
|
|
225
225
|
*/
|
|
226
226
|
maxIntelligenceIndex?: number | null | undefined;
|
|
227
227
|
/**
|
|
228
|
-
* Deprecated: Artificial Analysis has retired its Coding Index
|
|
228
|
+
* Deprecated: Artificial Analysis has retired its Coding Index; no model has a score, so this matches no model.
|
|
229
229
|
*
|
|
230
230
|
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
231
231
|
*/
|
|
232
232
|
minCodingIndex?: number | null | undefined;
|
|
233
233
|
/**
|
|
234
|
-
* Deprecated: Artificial Analysis has retired its Coding Index
|
|
234
|
+
* Deprecated: Artificial Analysis has retired its Coding Index; no model has a score, so this matches no model.
|
|
235
235
|
*
|
|
236
236
|
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
237
237
|
*/
|
|
238
238
|
maxCodingIndex?: number | null | undefined;
|
|
239
239
|
/**
|
|
240
|
-
* Deprecated: Artificial Analysis has retired its Agentic Index
|
|
240
|
+
* Deprecated: Artificial Analysis has retired its Agentic Index; no model has a score, so this matches no model.
|
|
241
241
|
*
|
|
242
242
|
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
243
243
|
*/
|
|
244
244
|
minAgenticIndex?: number | null | undefined;
|
|
245
245
|
/**
|
|
246
|
-
* Deprecated: Artificial Analysis has retired its Agentic Index
|
|
246
|
+
* Deprecated: Artificial Analysis has retired its Agentic Index; no model has a score, so this matches no model.
|
|
247
247
|
*
|
|
248
248
|
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
249
249
|
*/
|
|
@@ -24,7 +24,7 @@ export const GetModelsCategory = {
|
|
|
24
24
|
Academia: "academia",
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
27
|
-
* Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), <index>-high-to-low for each Artificial Analysis index (the coding and agentic sorts are deprecated: Artificial Analysis has retired those indexes), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. The decision sort ranks decision models, so pass output_modalities=decisions or all with it. When omitted, the existing default ordering is preserved.
|
|
27
|
+
* Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), <index>-high-to-low for each Artificial Analysis index (the coding and agentic sorts are deprecated: Artificial Analysis has retired those indexes, so they order by canonical slug and variant alone), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. The decision sort ranks decision models, so pass output_modalities=decisions or all with it. When omitted, the existing default ordering is preserved.
|
|
28
28
|
*/
|
|
29
29
|
export const GetModelsSort = {
|
|
30
30
|
MostPopular: "most-popular",
|
|
@@ -28,7 +28,7 @@ export type ListModelsUserSecurity = {
|
|
|
28
28
|
bearer: string;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
|
-
* Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), <index>-high-to-low for each Artificial Analysis index (the coding and agentic sorts are deprecated: Artificial Analysis has retired those indexes), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. The decision sort ranks decision models, so pass output_modalities=decisions or all with it. When omitted, the existing default ordering is preserved.
|
|
31
|
+
* Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), <index>-high-to-low for each Artificial Analysis index (the coding and agentic sorts are deprecated: Artificial Analysis has retired those indexes, so they order by canonical slug and variant alone), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. The decision sort ranks decision models, so pass output_modalities=decisions or all with it. When omitted, the existing default ordering is preserved.
|
|
32
32
|
*/
|
|
33
33
|
export declare const ListModelsUserSort: {
|
|
34
34
|
readonly MostPopular: "most-popular";
|
|
@@ -55,7 +55,7 @@ export declare const ListModelsUserSort: {
|
|
|
55
55
|
readonly DesignArenaEloHighToLow: "design-arena-elo-high-to-low";
|
|
56
56
|
};
|
|
57
57
|
/**
|
|
58
|
-
* Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), <index>-high-to-low for each Artificial Analysis index (the coding and agentic sorts are deprecated: Artificial Analysis has retired those indexes), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. The decision sort ranks decision models, so pass output_modalities=decisions or all with it. When omitted, the existing default ordering is preserved.
|
|
58
|
+
* Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), <index>-high-to-low for each Artificial Analysis index (the coding and agentic sorts are deprecated: Artificial Analysis has retired those indexes, so they order by canonical slug and variant alone), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. The decision sort ranks decision models, so pass output_modalities=decisions or all with it. When omitted, the existing default ordering is preserved.
|
|
59
59
|
*/
|
|
60
60
|
export type ListModelsUserSort = OpenEnum<typeof ListModelsUserSort>;
|
|
61
61
|
/**
|
|
@@ -103,7 +103,7 @@ export type ListModelsUserRequest = {
|
|
|
103
103
|
*/
|
|
104
104
|
outputModalities?: string | undefined;
|
|
105
105
|
/**
|
|
106
|
-
* Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), <index>-high-to-low for each Artificial Analysis index (the coding and agentic sorts are deprecated: Artificial Analysis has retired those indexes), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. The decision sort ranks decision models, so pass output_modalities=decisions or all with it. When omitted, the existing default ordering is preserved.
|
|
106
|
+
* Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), <index>-high-to-low for each Artificial Analysis index (the coding and agentic sorts are deprecated: Artificial Analysis has retired those indexes, so they order by canonical slug and variant alone), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. The decision sort ranks decision models, so pass output_modalities=decisions or all with it. When omitted, the existing default ordering is preserved.
|
|
107
107
|
*/
|
|
108
108
|
sort?: ListModelsUserSort | undefined;
|
|
109
109
|
/**
|
|
@@ -7,7 +7,7 @@ import { safeParse } from "../../lib/schemas.js";
|
|
|
7
7
|
import * as openEnums from "../../types/enums.js";
|
|
8
8
|
import { ModelsListResponse$inboundSchema as models_ModelsListResponse$inboundSchema } from "../modelslistresponse.js";
|
|
9
9
|
/**
|
|
10
|
-
* Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), <index>-high-to-low for each Artificial Analysis index (the coding and agentic sorts are deprecated: Artificial Analysis has retired those indexes), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. The decision sort ranks decision models, so pass output_modalities=decisions or all with it. When omitted, the existing default ordering is preserved.
|
|
10
|
+
* Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), <index>-high-to-low for each Artificial Analysis index (the coding and agentic sorts are deprecated: Artificial Analysis has retired those indexes, so they order by canonical slug and variant alone), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. The decision sort ranks decision models, so pass output_modalities=decisions or all with it. When omitted, the existing default ordering is preserved.
|
|
11
11
|
*/
|
|
12
12
|
export const ListModelsUserSort = {
|
|
13
13
|
MostPopular: "most-popular",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
/**
|
|
5
|
+
* Prompt-caching controls for an OpenAI-compatible private endpoint. Accepted fields default on after validation; explicit owner settings override the defaults.
|
|
6
|
+
*/
|
|
7
|
+
export type PrivateEndpointPromptCaching = {
|
|
8
|
+
/**
|
|
9
|
+
* Forward top-level, message, and tool cache_control markers. Defaults on after endpoint validation accepts these fields; otherwise off. Set false to opt out, or true to declare support explicitly.
|
|
10
|
+
*/
|
|
11
|
+
cacheControl: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Send an OpenRouter-derived, customer-isolated prompt_cache_key, not the caller-supplied key. Defaults on after endpoint validation accepts the field; otherwise off. Set false to opt out, or true to declare support explicitly. HIPAA and unknown workspace posture withhold OpenRouter caching directives and the derived key; this does not control upstream retention.
|
|
14
|
+
*/
|
|
15
|
+
promptCacheKey: boolean;
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export declare const PrivateEndpointPromptCaching$inboundSchema: z.ZodType<PrivateEndpointPromptCaching, unknown>;
|
|
19
|
+
export declare function privateEndpointPromptCachingFromJSON(jsonString: string): SafeParseResult<PrivateEndpointPromptCaching, SDKValidationError>;
|
|
20
|
+
//# sourceMappingURL=privateendpointpromptcaching.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const PrivateEndpointPromptCaching$inboundSchema = z.object({
|
|
9
|
+
cache_control: z.boolean(),
|
|
10
|
+
prompt_cache_key: z.boolean(),
|
|
11
|
+
}).transform((v) => {
|
|
12
|
+
return remap$(v, {
|
|
13
|
+
"cache_control": "cacheControl",
|
|
14
|
+
"prompt_cache_key": "promptCacheKey",
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
export function privateEndpointPromptCachingFromJSON(jsonString) {
|
|
18
|
+
return safeParse(jsonString, (x) => PrivateEndpointPromptCaching$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PrivateEndpointPromptCaching' from JSON`);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=privateendpointpromptcaching.js.map
|
|
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { PrivateEndpointPromptCaching } from "./privateendpointpromptcaching.js";
|
|
5
6
|
import { PrivateEndpointQuantization } from "./privateendpointquantization.js";
|
|
6
7
|
import { PrivateEndpointReasoningReturnMechanism } from "./privateendpointreasoningreturnmechanism.js";
|
|
7
8
|
export type PrivateEndpointSettingsCompletions = {
|
|
@@ -115,6 +116,10 @@ export type PrivateEndpointSettings = {
|
|
|
115
116
|
* Longest prompt, in tokens, or `null` for no cap below the context length. Cannot exceed `context_length`, or the model context length while `context_length` is `null`.
|
|
116
117
|
*/
|
|
117
118
|
maxPromptTokens: number | null;
|
|
119
|
+
/**
|
|
120
|
+
* Prompt-caching controls for an OpenAI-compatible private endpoint. Accepted fields default on after validation; explicit owner settings override the defaults.
|
|
121
|
+
*/
|
|
122
|
+
promptCaching?: PrivateEndpointPromptCaching | undefined;
|
|
118
123
|
/**
|
|
119
124
|
* Weight precision the deployment runs at; `unknown` when not stated.
|
|
120
125
|
*/
|
|
@@ -5,6 +5,7 @@ import * as z from "zod/v4";
|
|
|
5
5
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import * as openEnums from "../types/enums.js";
|
|
8
|
+
import { PrivateEndpointPromptCaching$inboundSchema, } from "./privateendpointpromptcaching.js";
|
|
8
9
|
import { PrivateEndpointQuantization$inboundSchema, } from "./privateendpointquantization.js";
|
|
9
10
|
import { PrivateEndpointReasoningReturnMechanism$inboundSchema, } from "./privateendpointreasoningreturnmechanism.js";
|
|
10
11
|
export const PrivateEndpointSettingsExcludedParameter = {
|
|
@@ -93,6 +94,7 @@ export const PrivateEndpointSettings$inboundSchema = z.object({
|
|
|
93
94
|
inputs: z.lazy(() => PrivateEndpointSettingsInputs$inboundSchema),
|
|
94
95
|
max_completion_tokens: z.nullable(z.int()),
|
|
95
96
|
max_prompt_tokens: z.nullable(z.int()),
|
|
97
|
+
prompt_caching: PrivateEndpointPromptCaching$inboundSchema.optional(),
|
|
96
98
|
quantization: PrivateEndpointQuantization$inboundSchema,
|
|
97
99
|
reasoning: z.lazy(() => PrivateEndpointSettingsReasoning$inboundSchema),
|
|
98
100
|
tool_choice: z.lazy(() => PrivateEndpointSettingsToolChoice$inboundSchema),
|
|
@@ -102,6 +104,7 @@ export const PrivateEndpointSettings$inboundSchema = z.object({
|
|
|
102
104
|
"excluded_parameters": "excludedParameters",
|
|
103
105
|
"max_completion_tokens": "maxCompletionTokens",
|
|
104
106
|
"max_prompt_tokens": "maxPromptTokens",
|
|
107
|
+
"prompt_caching": "promptCaching",
|
|
105
108
|
"tool_choice": "toolChoice",
|
|
106
109
|
});
|
|
107
110
|
});
|
|
@@ -14,17 +14,17 @@ export declare const UnifiedBenchmarksAAItemSource: {
|
|
|
14
14
|
*/
|
|
15
15
|
export type UnifiedBenchmarksAAItemSource = ClosedEnum<typeof UnifiedBenchmarksAAItemSource>;
|
|
16
16
|
/**
|
|
17
|
-
* One model's Artificial Analysis index scores. Each score is the model's best on that index across the configurations Artificial Analysis evaluated (for example reasoning levels), so two indexes of one model can come from different configurations. The deprecated Coding and Agentic Index
|
|
17
|
+
* One model's Artificial Analysis index scores. Each score is the model's best on that index across the configurations Artificial Analysis evaluated (for example reasoning levels), so two indexes of one model can come from different configurations. The deprecated Coding Index and Agentic Index fields are null for every model: Artificial Analysis has retired those indexes.
|
|
18
18
|
*/
|
|
19
19
|
export type UnifiedBenchmarksAAItem = {
|
|
20
20
|
/**
|
|
21
|
-
* Deprecated: Artificial Analysis has retired its Agentic Index and no longer publishes it.
|
|
21
|
+
* Deprecated: Artificial Analysis has retired its Agentic Index and no longer publishes it. Always null.
|
|
22
22
|
*
|
|
23
23
|
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
24
24
|
*/
|
|
25
25
|
agenticIndex: number | null;
|
|
26
26
|
/**
|
|
27
|
-
* Deprecated: Artificial Analysis has retired its Coding Index and no longer publishes it.
|
|
27
|
+
* Deprecated: Artificial Analysis has retired its Coding Index and no longer publishes it. Always null.
|
|
28
28
|
*
|
|
29
29
|
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
30
30
|
*/
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
/**
|
|
3
|
+
* Change only the named prompt-caching flags; omitted flags keep their stored value.
|
|
4
|
+
*/
|
|
5
|
+
export type UpdatePrivateEndpointPromptCaching = {
|
|
6
|
+
/**
|
|
7
|
+
* Forward top-level, message, and tool cache_control markers. Defaults on after endpoint validation accepts these fields; otherwise off. Set false to opt out, or true to declare support explicitly.
|
|
8
|
+
*/
|
|
9
|
+
cacheControl?: boolean | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Send an OpenRouter-derived, customer-isolated prompt_cache_key, not the caller-supplied key. Defaults on after endpoint validation accepts the field; otherwise off. Set false to opt out, or true to declare support explicitly. HIPAA and unknown workspace posture withhold OpenRouter caching directives and the derived key; this does not control upstream retention.
|
|
12
|
+
*/
|
|
13
|
+
promptCacheKey?: boolean | undefined;
|
|
14
|
+
};
|
|
15
|
+
/** @internal */
|
|
16
|
+
export type UpdatePrivateEndpointPromptCaching$Outbound = {
|
|
17
|
+
cache_control?: boolean | undefined;
|
|
18
|
+
prompt_cache_key?: boolean | undefined;
|
|
19
|
+
};
|
|
20
|
+
/** @internal */
|
|
21
|
+
export declare const UpdatePrivateEndpointPromptCaching$outboundSchema: z.ZodType<UpdatePrivateEndpointPromptCaching$Outbound, UpdatePrivateEndpointPromptCaching>;
|
|
22
|
+
export declare function updatePrivateEndpointPromptCachingToJSON(updatePrivateEndpointPromptCaching: UpdatePrivateEndpointPromptCaching): string;
|
|
23
|
+
//# sourceMappingURL=updateprivateendpointpromptcaching.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const UpdatePrivateEndpointPromptCaching$outboundSchema = z.object({
|
|
8
|
+
cacheControl: z.boolean().optional(),
|
|
9
|
+
promptCacheKey: z.boolean().optional(),
|
|
10
|
+
}).transform((v) => {
|
|
11
|
+
return remap$(v, {
|
|
12
|
+
cacheControl: "cache_control",
|
|
13
|
+
promptCacheKey: "prompt_cache_key",
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
export function updatePrivateEndpointPromptCachingToJSON(updatePrivateEndpointPromptCaching) {
|
|
17
|
+
return JSON.stringify(UpdatePrivateEndpointPromptCaching$outboundSchema.parse(updatePrivateEndpointPromptCaching));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=updateprivateendpointpromptcaching.js.map
|
|
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { PrivateEndpointQuantization } from "./privateendpointquantization.js";
|
|
4
4
|
import { PrivateEndpointReasoningReturnMechanism } from "./privateendpointreasoningreturnmechanism.js";
|
|
5
|
+
import { UpdatePrivateEndpointPromptCaching, UpdatePrivateEndpointPromptCaching$Outbound } from "./updateprivateendpointpromptcaching.js";
|
|
5
6
|
export type UpdatePrivateEndpointSettingsRequestCompletions = {
|
|
6
7
|
/**
|
|
7
8
|
* Serves `/chat/completions`; `null` uses the provider default.
|
|
@@ -113,6 +114,10 @@ export type UpdatePrivateEndpointSettingsRequest = {
|
|
|
113
114
|
* Longest prompt, in tokens, or `null` for no cap below the context length. Cannot exceed `context_length`, or the model context length while `context_length` is `null`.
|
|
114
115
|
*/
|
|
115
116
|
maxPromptTokens?: number | null | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* Change only the named prompt-caching flags; omitted flags keep their stored value.
|
|
119
|
+
*/
|
|
120
|
+
promptCaching?: UpdatePrivateEndpointPromptCaching | undefined;
|
|
116
121
|
/**
|
|
117
122
|
* Weight precision the deployment runs at; `unknown` when not stated.
|
|
118
123
|
*/
|
|
@@ -167,6 +172,7 @@ export type UpdatePrivateEndpointSettingsRequest$Outbound = {
|
|
|
167
172
|
inputs?: UpdatePrivateEndpointSettingsRequestInputs$Outbound | undefined;
|
|
168
173
|
max_completion_tokens?: number | null | undefined;
|
|
169
174
|
max_prompt_tokens?: number | null | undefined;
|
|
175
|
+
prompt_caching?: UpdatePrivateEndpointPromptCaching$Outbound | undefined;
|
|
170
176
|
quantization?: string | undefined;
|
|
171
177
|
reasoning?: UpdatePrivateEndpointSettingsRequestReasoning$Outbound | undefined;
|
|
172
178
|
tool_choice?: UpdatePrivateEndpointSettingsRequestToolChoice$Outbound | undefined;
|
|
@@ -6,6 +6,7 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
6
6
|
import * as openEnums from "../types/enums.js";
|
|
7
7
|
import { PrivateEndpointQuantization$outboundSchema, } from "./privateendpointquantization.js";
|
|
8
8
|
import { PrivateEndpointReasoningReturnMechanism$outboundSchema, } from "./privateendpointreasoningreturnmechanism.js";
|
|
9
|
+
import { UpdatePrivateEndpointPromptCaching$outboundSchema, } from "./updateprivateendpointpromptcaching.js";
|
|
9
10
|
export const UpdatePrivateEndpointSettingsRequestExcludedParameter = {
|
|
10
11
|
Temperature: "temperature",
|
|
11
12
|
TopP: "top_p",
|
|
@@ -92,6 +93,7 @@ export const UpdatePrivateEndpointSettingsRequest$outboundSchema = z.object({
|
|
|
92
93
|
inputs: z.lazy(() => UpdatePrivateEndpointSettingsRequestInputs$outboundSchema).optional(),
|
|
93
94
|
maxCompletionTokens: z.nullable(z.int()).optional(),
|
|
94
95
|
maxPromptTokens: z.nullable(z.int()).optional(),
|
|
96
|
+
promptCaching: UpdatePrivateEndpointPromptCaching$outboundSchema.optional(),
|
|
95
97
|
quantization: PrivateEndpointQuantization$outboundSchema.optional(),
|
|
96
98
|
reasoning: z.lazy(() => UpdatePrivateEndpointSettingsRequestReasoning$outboundSchema).optional(),
|
|
97
99
|
toolChoice: z.lazy(() => UpdatePrivateEndpointSettingsRequestToolChoice$outboundSchema).optional(),
|
|
@@ -101,6 +103,7 @@ export const UpdatePrivateEndpointSettingsRequest$outboundSchema = z.object({
|
|
|
101
103
|
excludedParameters: "excluded_parameters",
|
|
102
104
|
maxCompletionTokens: "max_completion_tokens",
|
|
103
105
|
maxPromptTokens: "max_prompt_tokens",
|
|
106
|
+
promptCaching: "prompt_caching",
|
|
104
107
|
toolChoice: "tool_choice",
|
|
105
108
|
});
|
|
106
109
|
});
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.116",
|
|
4
4
|
"author": "OpenRouter",
|
|
5
5
|
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.",
|
|
6
6
|
"keywords": [
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"
|
|
77
|
-
"test:e2e": "vitest --run --project e2e",
|
|
76
|
+
"test": "vitest --run --project unit",
|
|
78
77
|
"test:watch": "vitest --watch --project unit",
|
|
79
|
-
"typecheck
|
|
80
|
-
"compile": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js",
|
|
78
|
+
"typecheck": "tsc --noEmit",
|
|
81
79
|
"postinstall": "node scripts/check-types.js || true",
|
|
82
|
-
"
|
|
80
|
+
"prepare": "npm run build",
|
|
81
|
+
"test:e2e": "vitest --run --project e2e",
|
|
83
82
|
"test:transit": "exit 0",
|
|
84
|
-
"typecheck": "
|
|
83
|
+
"typecheck:transit": "exit 0",
|
|
84
|
+
"compile": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
|