@openrouter/sdk 1.4.23 → 1.4.25
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/operations/createkeys.d.ts +4 -0
- package/esm/models/operations/createkeys.js +2 -0
- package/esm/models/operations/getkey.d.ts +4 -0
- package/esm/models/operations/getkey.js +2 -0
- package/esm/models/operations/list.d.ts +4 -0
- package/esm/models/operations/list.js +2 -0
- package/esm/models/operations/updatekeys.d.ts +4 -0
- package/esm/models/operations/updatekeys.js +2 -0
- package/esm/models/switchyardrouterplugin.d.ts +5 -0
- package/esm/models/switchyardrouterplugin.js +6 -0
- package/jsr.json +1 -1
- package/package.json +7 -7
package/esm/lib/config.d.ts
CHANGED
|
@@ -50,8 +50,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
50
50
|
export declare const SDK_METADATA: {
|
|
51
51
|
readonly language: "typescript";
|
|
52
52
|
readonly openapiDocVersion: "1.0.0";
|
|
53
|
-
readonly sdkVersion: "1.4.
|
|
53
|
+
readonly sdkVersion: "1.4.25";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.4.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.4.25 2.914.0 1.0.0 @openrouter/sdk";
|
|
56
56
|
};
|
|
57
57
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -29,8 +29,8 @@ export function serverURLFromOptions(options) {
|
|
|
29
29
|
export const SDK_METADATA = {
|
|
30
30
|
language: "typescript",
|
|
31
31
|
openapiDocVersion: "1.0.0",
|
|
32
|
-
sdkVersion: "1.4.
|
|
32
|
+
sdkVersion: "1.4.25",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.4.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.4.25 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -156,6 +156,10 @@ export type CreateKeysData = {
|
|
|
156
156
|
* Human-readable label for the API key
|
|
157
157
|
*/
|
|
158
158
|
label: string;
|
|
159
|
+
/**
|
|
160
|
+
* ISO 8601 UTC timestamp of the most recent usage recorded for the API key, or null if no usage has been recorded since the end of 2025
|
|
161
|
+
*/
|
|
162
|
+
lastUsedAt: Date | null;
|
|
159
163
|
/**
|
|
160
164
|
* Spending limit for the API key in USD
|
|
161
165
|
*/
|
|
@@ -80,6 +80,7 @@ export const CreateKeysData$inboundSchema = z.object({
|
|
|
80
80
|
hash: z.string(),
|
|
81
81
|
include_byok_in_limit: z.boolean(),
|
|
82
82
|
label: z.string(),
|
|
83
|
+
last_used_at: z.nullable(z.iso.datetime({ offset: true }).transform(v => new Date(v))),
|
|
83
84
|
limit: z.nullable(z.number()),
|
|
84
85
|
limit_remaining: z.nullable(z.number()),
|
|
85
86
|
limit_reset: z.nullable(z.string()),
|
|
@@ -101,6 +102,7 @@ export const CreateKeysData$inboundSchema = z.object({
|
|
|
101
102
|
"expires_at": "expiresAt",
|
|
102
103
|
"external_user": "externalUser",
|
|
103
104
|
"include_byok_in_limit": "includeByokInLimit",
|
|
105
|
+
"last_used_at": "lastUsedAt",
|
|
104
106
|
"limit_remaining": "limitRemaining",
|
|
105
107
|
"limit_reset": "limitReset",
|
|
106
108
|
"updated_at": "updatedAt",
|
|
@@ -99,6 +99,10 @@ export type GetKeyData = {
|
|
|
99
99
|
* Human-readable label for the API key
|
|
100
100
|
*/
|
|
101
101
|
label: string;
|
|
102
|
+
/**
|
|
103
|
+
* ISO 8601 UTC timestamp of the most recent usage recorded for the API key, or null if no usage has been recorded since the end of 2025
|
|
104
|
+
*/
|
|
105
|
+
lastUsedAt: Date | null;
|
|
102
106
|
/**
|
|
103
107
|
* Spending limit for the API key in USD
|
|
104
108
|
*/
|
|
@@ -34,6 +34,7 @@ export const GetKeyData$inboundSchema = z
|
|
|
34
34
|
hash: z.string(),
|
|
35
35
|
include_byok_in_limit: z.boolean(),
|
|
36
36
|
label: z.string(),
|
|
37
|
+
last_used_at: z.nullable(z.iso.datetime({ offset: true }).transform(v => new Date(v))),
|
|
37
38
|
limit: z.nullable(z.number()),
|
|
38
39
|
limit_remaining: z.nullable(z.number()),
|
|
39
40
|
limit_reset: z.nullable(z.string()),
|
|
@@ -55,6 +56,7 @@ export const GetKeyData$inboundSchema = z
|
|
|
55
56
|
"expires_at": "expiresAt",
|
|
56
57
|
"external_user": "externalUser",
|
|
57
58
|
"include_byok_in_limit": "includeByokInLimit",
|
|
59
|
+
"last_used_at": "lastUsedAt",
|
|
58
60
|
"limit_remaining": "limitRemaining",
|
|
59
61
|
"limit_reset": "limitReset",
|
|
60
62
|
"updated_at": "updatedAt",
|
|
@@ -104,6 +104,10 @@ export type ListData = {
|
|
|
104
104
|
* Human-readable label for the API key
|
|
105
105
|
*/
|
|
106
106
|
label: string;
|
|
107
|
+
/**
|
|
108
|
+
* ISO 8601 UTC timestamp of the most recent usage recorded for the API key, or null if no usage has been recorded since the end of 2025
|
|
109
|
+
*/
|
|
110
|
+
lastUsedAt: Date | null;
|
|
107
111
|
/**
|
|
108
112
|
* Spending limit for the API key in USD
|
|
109
113
|
*/
|
|
@@ -37,6 +37,7 @@ export const ListData$inboundSchema = z.object({
|
|
|
37
37
|
hash: z.string(),
|
|
38
38
|
include_byok_in_limit: z.boolean(),
|
|
39
39
|
label: z.string(),
|
|
40
|
+
last_used_at: z.nullable(z.iso.datetime({ offset: true }).transform(v => new Date(v))),
|
|
40
41
|
limit: z.nullable(z.number()),
|
|
41
42
|
limit_remaining: z.nullable(z.number()),
|
|
42
43
|
limit_reset: z.nullable(z.string()),
|
|
@@ -58,6 +59,7 @@ export const ListData$inboundSchema = z.object({
|
|
|
58
59
|
"expires_at": "expiresAt",
|
|
59
60
|
"external_user": "externalUser",
|
|
60
61
|
"include_byok_in_limit": "includeByokInLimit",
|
|
62
|
+
"last_used_at": "lastUsedAt",
|
|
61
63
|
"limit_remaining": "limitRemaining",
|
|
62
64
|
"limit_reset": "limitReset",
|
|
63
65
|
"updated_at": "updatedAt",
|
|
@@ -135,6 +135,10 @@ export type UpdateKeysData = {
|
|
|
135
135
|
* Human-readable label for the API key
|
|
136
136
|
*/
|
|
137
137
|
label: string;
|
|
138
|
+
/**
|
|
139
|
+
* ISO 8601 UTC timestamp of the most recent usage recorded for the API key, or null if no usage has been recorded since the end of 2025
|
|
140
|
+
*/
|
|
141
|
+
lastUsedAt: Date | null;
|
|
138
142
|
/**
|
|
139
143
|
* Spending limit for the API key in USD
|
|
140
144
|
*/
|
|
@@ -62,6 +62,7 @@ export const UpdateKeysData$inboundSchema = z.object({
|
|
|
62
62
|
hash: z.string(),
|
|
63
63
|
include_byok_in_limit: z.boolean(),
|
|
64
64
|
label: z.string(),
|
|
65
|
+
last_used_at: z.nullable(z.iso.datetime({ offset: true }).transform(v => new Date(v))),
|
|
65
66
|
limit: z.nullable(z.number()),
|
|
66
67
|
limit_remaining: z.nullable(z.number()),
|
|
67
68
|
limit_reset: z.nullable(z.string()),
|
|
@@ -83,6 +84,7 @@ export const UpdateKeysData$inboundSchema = z.object({
|
|
|
83
84
|
"expires_at": "expiresAt",
|
|
84
85
|
"external_user": "externalUser",
|
|
85
86
|
"include_byok_in_limit": "includeByokInLimit",
|
|
87
|
+
"last_used_at": "lastUsedAt",
|
|
86
88
|
"limit_remaining": "limitRemaining",
|
|
87
89
|
"limit_reset": "limitReset",
|
|
88
90
|
"updated_at": "updatedAt",
|
|
@@ -21,6 +21,10 @@ export type SwitchyardRouterPlugin = {
|
|
|
21
21
|
*/
|
|
22
22
|
algorithm?: Algorithm | undefined;
|
|
23
23
|
id: "switchyard-router";
|
|
24
|
+
/**
|
|
25
|
+
* The model that runs the judge call for the judge-backed algorithms ("capability", "stage", and "composite"). The model must support structured outputs and have a provider that your account and request settings allow. Otherwise, the request uses the platform default judge, google/gemini-2.5-flash-lite, and reports the reason in the routing metadata. The judge call is billed to you like any other request.
|
|
26
|
+
*/
|
|
27
|
+
judgeModel?: string | undefined;
|
|
24
28
|
};
|
|
25
29
|
/** @internal */
|
|
26
30
|
export declare const Algorithm$outboundSchema: z.ZodType<string, Algorithm>;
|
|
@@ -28,6 +32,7 @@ export declare const Algorithm$outboundSchema: z.ZodType<string, Algorithm>;
|
|
|
28
32
|
export type SwitchyardRouterPlugin$Outbound = {
|
|
29
33
|
algorithm?: string | undefined;
|
|
30
34
|
id: "switchyard-router";
|
|
35
|
+
judge_model?: string | undefined;
|
|
31
36
|
};
|
|
32
37
|
/** @internal */
|
|
33
38
|
export declare const SwitchyardRouterPlugin$outboundSchema: z.ZodType<SwitchyardRouterPlugin$Outbound, SwitchyardRouterPlugin>;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @generated-id: 90395eb02944
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
7
|
import * as openEnums from "../types/enums.js";
|
|
7
8
|
/**
|
|
8
9
|
* Routing algorithm for this request. "capability" calls a small judge model to rate how demanding the task is, then picks the efficient or capable candidate. "stage" reads the tool-result history (errors, repeated failures, edits landing) and calls the judge only when those signals are undecided. "auto" is "stage" without the judge call. "random" picks one candidate at random. "composite" keeps the tier chosen on the last human turn and re-evaluates tool turns with the stage signals. "passthrough" serves the eligible candidates in the order OpenRouter already ranked them, with no routing decision and no judge call. Omit this field to use the platform default, stage.
|
|
@@ -22,6 +23,11 @@ export const Algorithm$outboundSchema = openEnums
|
|
|
22
23
|
export const SwitchyardRouterPlugin$outboundSchema = z.object({
|
|
23
24
|
algorithm: Algorithm$outboundSchema.optional(),
|
|
24
25
|
id: z.literal("switchyard-router"),
|
|
26
|
+
judgeModel: z.string().optional(),
|
|
27
|
+
}).transform((v) => {
|
|
28
|
+
return remap$(v, {
|
|
29
|
+
judgeModel: "judge_model",
|
|
30
|
+
});
|
|
25
31
|
});
|
|
26
32
|
export function switchyardRouterPluginToJSON(switchyardRouterPlugin) {
|
|
27
33
|
return JSON.stringify(SwitchyardRouterPlugin$outboundSchema.parse(switchyardRouterPlugin));
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.25",
|
|
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": "tsc && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"
|
|
77
|
-
"typecheck:transit": "exit 0",
|
|
78
|
-
"postinstall": "node scripts/check-types.js || true",
|
|
76
|
+
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
79
77
|
"test": "vitest --run --project unit",
|
|
80
|
-
"test:transit": "exit 0",
|
|
81
78
|
"test:watch": "vitest --watch --project unit",
|
|
82
79
|
"typecheck": "tsc --noEmit",
|
|
83
|
-
"
|
|
84
|
-
"
|
|
80
|
+
"typecheck:transit": "exit 0",
|
|
81
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
82
|
+
"prepare": "npm run build",
|
|
83
|
+
"test:e2e": "vitest --run --project e2e",
|
|
84
|
+
"test:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
|