@openrouter/sdk 0.13.25 → 0.13.26
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/funcs/modelsList.js
CHANGED
|
@@ -33,8 +33,20 @@ async function $do(client, request, options) {
|
|
|
33
33
|
"context": payload?.context,
|
|
34
34
|
"distillable": payload?.distillable,
|
|
35
35
|
"input_modalities": payload?.input_modalities,
|
|
36
|
+
"max_age_days": payload?.max_age_days,
|
|
37
|
+
"max_agentic_index": payload?.max_agentic_index,
|
|
38
|
+
"max_coding_index": payload?.max_coding_index,
|
|
39
|
+
"max_intelligence_index": payload?.max_intelligence_index,
|
|
40
|
+
"max_output_price": payload?.max_output_price,
|
|
36
41
|
"max_price": payload?.max_price,
|
|
42
|
+
"max_tool_success_rate": payload?.max_tool_success_rate,
|
|
43
|
+
"min_age_days": payload?.min_age_days,
|
|
44
|
+
"min_agentic_index": payload?.min_agentic_index,
|
|
45
|
+
"min_coding_index": payload?.min_coding_index,
|
|
46
|
+
"min_intelligence_index": payload?.min_intelligence_index,
|
|
47
|
+
"min_output_price": payload?.min_output_price,
|
|
37
48
|
"min_price": payload?.min_price,
|
|
49
|
+
"min_tool_success_rate": payload?.min_tool_success_rate,
|
|
38
50
|
"model_authors": payload?.model_authors,
|
|
39
51
|
"output_modalities": payload?.output_modalities,
|
|
40
52
|
"providers": payload?.providers,
|
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: "0.13.
|
|
52
|
+
readonly sdkVersion: "0.13.26";
|
|
53
53
|
readonly genVersion: "2.884.4";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.13.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.13.26 2.884.4 1.0.0 @openrouter/sdk";
|
|
55
55
|
};
|
|
56
56
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -26,8 +26,8 @@ export function serverURLFromOptions(options) {
|
|
|
26
26
|
export const SDK_METADATA = {
|
|
27
27
|
language: "typescript",
|
|
28
28
|
openapiDocVersion: "1.0.0",
|
|
29
|
-
sdkVersion: "0.13.
|
|
29
|
+
sdkVersion: "0.13.26",
|
|
30
30
|
genVersion: "2.884.4",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 0.13.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 0.13.26 2.884.4 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -43,7 +43,7 @@ export declare const GetModelsCategory: {
|
|
|
43
43
|
*/
|
|
44
44
|
export type GetModelsCategory = OpenEnum<typeof GetModelsCategory>;
|
|
45
45
|
/**
|
|
46
|
-
* 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), intelligence-high-to-low (Artificial Analysis
|
|
46
|
+
* 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), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.
|
|
47
47
|
*/
|
|
48
48
|
export declare const GetModelsSort: {
|
|
49
49
|
readonly MostPopular: "most-popular";
|
|
@@ -55,10 +55,12 @@ export declare const GetModelsSort: {
|
|
|
55
55
|
readonly ThroughputHighToLow: "throughput-high-to-low";
|
|
56
56
|
readonly LatencyLowToHigh: "latency-low-to-high";
|
|
57
57
|
readonly IntelligenceHighToLow: "intelligence-high-to-low";
|
|
58
|
+
readonly CodingHighToLow: "coding-high-to-low";
|
|
59
|
+
readonly AgenticHighToLow: "agentic-high-to-low";
|
|
58
60
|
readonly DesignArenaEloHighToLow: "design-arena-elo-high-to-low";
|
|
59
61
|
};
|
|
60
62
|
/**
|
|
61
|
-
* 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), intelligence-high-to-low (Artificial Analysis
|
|
63
|
+
* 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), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.
|
|
62
64
|
*/
|
|
63
65
|
export type GetModelsSort = OpenEnum<typeof GetModelsSort>;
|
|
64
66
|
/**
|
|
@@ -125,7 +127,7 @@ export type GetModelsRequest = {
|
|
|
125
127
|
*/
|
|
126
128
|
outputModalities?: string | undefined;
|
|
127
129
|
/**
|
|
128
|
-
* 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), intelligence-high-to-low (Artificial Analysis
|
|
130
|
+
* 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), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.
|
|
129
131
|
*/
|
|
130
132
|
sort?: GetModelsSort | undefined;
|
|
131
133
|
/**
|
|
@@ -172,6 +174,54 @@ export type GetModelsRequest = {
|
|
|
172
174
|
* Filter to models with endpoints in the given data region. Currently only "eu" is supported.
|
|
173
175
|
*/
|
|
174
176
|
region?: Region | undefined;
|
|
177
|
+
/**
|
|
178
|
+
* Minimum completion (output) price in $/M tokens.
|
|
179
|
+
*/
|
|
180
|
+
minOutputPrice?: number | null | undefined;
|
|
181
|
+
/**
|
|
182
|
+
* Maximum completion (output) price in $/M tokens.
|
|
183
|
+
*/
|
|
184
|
+
maxOutputPrice?: number | null | undefined;
|
|
185
|
+
/**
|
|
186
|
+
* Minimum model age in days since its creation date.
|
|
187
|
+
*/
|
|
188
|
+
minAgeDays?: number | null | undefined;
|
|
189
|
+
/**
|
|
190
|
+
* Maximum model age in days since its creation date.
|
|
191
|
+
*/
|
|
192
|
+
maxAgeDays?: number | null | undefined;
|
|
193
|
+
/**
|
|
194
|
+
* Minimum Artificial Analysis intelligence index.
|
|
195
|
+
*/
|
|
196
|
+
minIntelligenceIndex?: number | null | undefined;
|
|
197
|
+
/**
|
|
198
|
+
* Maximum Artificial Analysis intelligence index.
|
|
199
|
+
*/
|
|
200
|
+
maxIntelligenceIndex?: number | null | undefined;
|
|
201
|
+
/**
|
|
202
|
+
* Minimum Artificial Analysis coding index.
|
|
203
|
+
*/
|
|
204
|
+
minCodingIndex?: number | null | undefined;
|
|
205
|
+
/**
|
|
206
|
+
* Maximum Artificial Analysis coding index.
|
|
207
|
+
*/
|
|
208
|
+
maxCodingIndex?: number | null | undefined;
|
|
209
|
+
/**
|
|
210
|
+
* Minimum Artificial Analysis agentic index.
|
|
211
|
+
*/
|
|
212
|
+
minAgenticIndex?: number | null | undefined;
|
|
213
|
+
/**
|
|
214
|
+
* Maximum Artificial Analysis agentic index.
|
|
215
|
+
*/
|
|
216
|
+
maxAgenticIndex?: number | null | undefined;
|
|
217
|
+
/**
|
|
218
|
+
* Minimum tool-calling success rate, as a fraction in [0, 1] (e.g. 0.9 = 90% of requests finishing with a tool_calls finish reason).
|
|
219
|
+
*/
|
|
220
|
+
minToolSuccessRate?: number | null | undefined;
|
|
221
|
+
/**
|
|
222
|
+
* Maximum tool-calling success rate, as a fraction in [0, 1].
|
|
223
|
+
*/
|
|
224
|
+
maxToolSuccessRate?: number | null | undefined;
|
|
175
225
|
};
|
|
176
226
|
/** @internal */
|
|
177
227
|
export declare const GetModelsCategory$outboundSchema: z.ZodType<string, GetModelsCategory>;
|
|
@@ -203,6 +253,18 @@ export type GetModelsRequest$Outbound = {
|
|
|
203
253
|
distillable?: string | undefined;
|
|
204
254
|
zdr?: string | undefined;
|
|
205
255
|
region?: string | undefined;
|
|
256
|
+
min_output_price?: number | null | undefined;
|
|
257
|
+
max_output_price?: number | null | undefined;
|
|
258
|
+
min_age_days?: number | null | undefined;
|
|
259
|
+
max_age_days?: number | null | undefined;
|
|
260
|
+
min_intelligence_index?: number | null | undefined;
|
|
261
|
+
max_intelligence_index?: number | null | undefined;
|
|
262
|
+
min_coding_index?: number | null | undefined;
|
|
263
|
+
max_coding_index?: number | null | undefined;
|
|
264
|
+
min_agentic_index?: number | null | undefined;
|
|
265
|
+
max_agentic_index?: number | null | undefined;
|
|
266
|
+
min_tool_success_rate?: number | null | undefined;
|
|
267
|
+
max_tool_success_rate?: number | null | undefined;
|
|
206
268
|
};
|
|
207
269
|
/** @internal */
|
|
208
270
|
export declare const GetModelsRequest$outboundSchema: z.ZodType<GetModelsRequest$Outbound, GetModelsRequest>;
|
|
@@ -23,7 +23,7 @@ export const GetModelsCategory = {
|
|
|
23
23
|
Academia: "academia",
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
|
-
* 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), intelligence-high-to-low (Artificial Analysis
|
|
26
|
+
* 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), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.
|
|
27
27
|
*/
|
|
28
28
|
export const GetModelsSort = {
|
|
29
29
|
MostPopular: "most-popular",
|
|
@@ -35,6 +35,8 @@ export const GetModelsSort = {
|
|
|
35
35
|
ThroughputHighToLow: "throughput-high-to-low",
|
|
36
36
|
LatencyLowToHigh: "latency-low-to-high",
|
|
37
37
|
IntelligenceHighToLow: "intelligence-high-to-low",
|
|
38
|
+
CodingHighToLow: "coding-high-to-low",
|
|
39
|
+
AgenticHighToLow: "agentic-high-to-low",
|
|
38
40
|
DesignArenaEloHighToLow: "design-arena-elo-high-to-low",
|
|
39
41
|
};
|
|
40
42
|
/**
|
|
@@ -86,6 +88,18 @@ export const GetModelsRequest$outboundSchema = z.object({
|
|
|
86
88
|
distillable: Distillable$outboundSchema.optional(),
|
|
87
89
|
zdr: Zdr$outboundSchema.optional(),
|
|
88
90
|
region: Region$outboundSchema.optional(),
|
|
91
|
+
minOutputPrice: z.nullable(z.number()).optional(),
|
|
92
|
+
maxOutputPrice: z.nullable(z.number()).optional(),
|
|
93
|
+
minAgeDays: z.nullable(z.int()).optional(),
|
|
94
|
+
maxAgeDays: z.nullable(z.int()).optional(),
|
|
95
|
+
minIntelligenceIndex: z.nullable(z.number()).optional(),
|
|
96
|
+
maxIntelligenceIndex: z.nullable(z.number()).optional(),
|
|
97
|
+
minCodingIndex: z.nullable(z.number()).optional(),
|
|
98
|
+
maxCodingIndex: z.nullable(z.number()).optional(),
|
|
99
|
+
minAgenticIndex: z.nullable(z.number()).optional(),
|
|
100
|
+
maxAgenticIndex: z.nullable(z.number()).optional(),
|
|
101
|
+
minToolSuccessRate: z.nullable(z.number()).optional(),
|
|
102
|
+
maxToolSuccessRate: z.nullable(z.number()).optional(),
|
|
89
103
|
}).transform((v) => {
|
|
90
104
|
return remap$(v, {
|
|
91
105
|
httpReferer: "HTTP-Referer",
|
|
@@ -95,6 +109,18 @@ export const GetModelsRequest$outboundSchema = z.object({
|
|
|
95
109
|
minPrice: "min_price",
|
|
96
110
|
maxPrice: "max_price",
|
|
97
111
|
modelAuthors: "model_authors",
|
|
112
|
+
minOutputPrice: "min_output_price",
|
|
113
|
+
maxOutputPrice: "max_output_price",
|
|
114
|
+
minAgeDays: "min_age_days",
|
|
115
|
+
maxAgeDays: "max_age_days",
|
|
116
|
+
minIntelligenceIndex: "min_intelligence_index",
|
|
117
|
+
maxIntelligenceIndex: "max_intelligence_index",
|
|
118
|
+
minCodingIndex: "min_coding_index",
|
|
119
|
+
maxCodingIndex: "max_coding_index",
|
|
120
|
+
minAgenticIndex: "min_agentic_index",
|
|
121
|
+
maxAgenticIndex: "max_agentic_index",
|
|
122
|
+
minToolSuccessRate: "min_tool_success_rate",
|
|
123
|
+
maxToolSuccessRate: "max_tool_success_rate",
|
|
98
124
|
});
|
|
99
125
|
});
|
|
100
126
|
export function getModelsRequestToJSON(getModelsRequest) {
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.26",
|
|
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": [
|
|
@@ -74,14 +74,14 @@
|
|
|
74
74
|
"build": "tsc",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
76
|
"prepare": "npm run build",
|
|
77
|
-
"test": "vitest --run --project unit",
|
|
78
77
|
"test:e2e": "vitest --run --project e2e",
|
|
78
|
+
"compile": "tsc",
|
|
79
|
+
"test": "vitest --run --project unit",
|
|
79
80
|
"test:transit": "exit 0",
|
|
80
81
|
"test:watch": "vitest --watch --project unit",
|
|
82
|
+
"typecheck": "tsc --noEmit",
|
|
81
83
|
"typecheck:transit": "exit 0",
|
|
82
|
-
"
|
|
83
|
-
"postinstall": "node scripts/check-types.js || true",
|
|
84
|
-
"typecheck": "tsc --noEmit"
|
|
84
|
+
"postinstall": "node scripts/check-types.js || true"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|