@openrouter/sdk 1.2.43 → 1.2.45
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/advisorservertoolconfig.d.ts +1 -12
- package/esm/models/advisorservertoolconfig.js +0 -4
- package/esm/models/advisorservertoolopenrouter.d.ts +1 -1
- package/esm/models/index.d.ts +0 -1
- package/esm/models/index.js +0 -1
- package/esm/models/videogenerationrequest.d.ts +10 -0
- package/esm/models/videogenerationrequest.js +3 -0
- package/esm/models/videomodel.d.ts +18 -0
- package/esm/models/videomodel.js +12 -0
- package/jsr.json +1 -1
- package/package.json +6 -6
- package/esm/models/advisornestedtool.d.ts +0 -25
- package/esm/models/advisornestedtool.js +0 -23
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.2.
|
|
53
|
+
readonly sdkVersion: "1.2.45";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.45 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.2.
|
|
32
|
+
sdkVersion: "1.2.45",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.2.45 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import { AdvisorNestedTool, AdvisorNestedTool$Outbound } from "./advisornestedtool.js";
|
|
3
2
|
import { AdvisorReasoning, AdvisorReasoning$Outbound } from "./advisorreasoning.js";
|
|
4
3
|
/**
|
|
5
4
|
* Configuration for one openrouter:advisor server tool entry.
|
|
@@ -18,11 +17,7 @@ export type AdvisorServerToolConfig = {
|
|
|
18
17
|
*/
|
|
19
18
|
maxCompletionTokens?: number | undefined;
|
|
20
19
|
/**
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
maxToolCalls?: number | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* Slug of the advisor model to consult (any OpenRouter model). When omitted, the executor can choose it via the tool call's `model` argument; if neither is set, the model from the outer API request is used. The advisor tool itself cannot be the advisor model.
|
|
20
|
+
* Slug of the advisor model to consult (any OpenRouter model). When omitted, the executor can choose it via the tool call's `model` argument; if neither is set, the model from the outer API request is used.
|
|
26
21
|
*/
|
|
27
22
|
model?: string | undefined;
|
|
28
23
|
/**
|
|
@@ -41,23 +36,17 @@ export type AdvisorServerToolConfig = {
|
|
|
41
36
|
* Sampling temperature forwarded to the advisor call. When omitted, the provider's default applies.
|
|
42
37
|
*/
|
|
43
38
|
temperature?: number | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Tools the advisor sub-agent may use while forming its advice. The advisor runs as an agentic sub-agent over these tools, then returns its text. Only OpenRouter server tools are supported — function tools are rejected — and the list must not include the advisor tool itself.
|
|
46
|
-
*/
|
|
47
|
-
tools?: Array<AdvisorNestedTool> | undefined;
|
|
48
39
|
};
|
|
49
40
|
/** @internal */
|
|
50
41
|
export type AdvisorServerToolConfig$Outbound = {
|
|
51
42
|
forward_transcript?: boolean | undefined;
|
|
52
43
|
instructions?: string | undefined;
|
|
53
44
|
max_completion_tokens?: number | undefined;
|
|
54
|
-
max_tool_calls?: number | undefined;
|
|
55
45
|
model?: string | undefined;
|
|
56
46
|
name?: string | undefined;
|
|
57
47
|
reasoning?: AdvisorReasoning$Outbound | undefined;
|
|
58
48
|
stream?: boolean | undefined;
|
|
59
49
|
temperature?: number | undefined;
|
|
60
|
-
tools?: Array<AdvisorNestedTool$Outbound> | undefined;
|
|
61
50
|
};
|
|
62
51
|
/** @internal */
|
|
63
52
|
export declare const AdvisorServerToolConfig$outboundSchema: z.ZodType<AdvisorServerToolConfig$Outbound, AdvisorServerToolConfig>;
|
|
@@ -4,25 +4,21 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
-
import { AdvisorNestedTool$outboundSchema, } from "./advisornestedtool.js";
|
|
8
7
|
import { AdvisorReasoning$outboundSchema, } from "./advisorreasoning.js";
|
|
9
8
|
/** @internal */
|
|
10
9
|
export const AdvisorServerToolConfig$outboundSchema = z.object({
|
|
11
10
|
forwardTranscript: z.boolean().optional(),
|
|
12
11
|
instructions: z.string().optional(),
|
|
13
12
|
maxCompletionTokens: z.int().optional(),
|
|
14
|
-
maxToolCalls: z.int().optional(),
|
|
15
13
|
model: z.string().optional(),
|
|
16
14
|
name: z.string().optional(),
|
|
17
15
|
reasoning: AdvisorReasoning$outboundSchema.optional(),
|
|
18
16
|
stream: z.boolean().optional(),
|
|
19
17
|
temperature: z.number().optional(),
|
|
20
|
-
tools: z.array(AdvisorNestedTool$outboundSchema).optional(),
|
|
21
18
|
}).transform((v) => {
|
|
22
19
|
return remap$(v, {
|
|
23
20
|
forwardTranscript: "forward_transcript",
|
|
24
21
|
maxCompletionTokens: "max_completion_tokens",
|
|
25
|
-
maxToolCalls: "max_tool_calls",
|
|
26
22
|
});
|
|
27
23
|
});
|
|
28
24
|
export function advisorServerToolConfigToJSON(advisorServerToolConfig) {
|
|
@@ -6,7 +6,7 @@ export declare const AdvisorServerToolOpenRouterType: {
|
|
|
6
6
|
};
|
|
7
7
|
export type AdvisorServerToolOpenRouterType = ClosedEnum<typeof AdvisorServerToolOpenRouterType>;
|
|
8
8
|
/**
|
|
9
|
-
* OpenRouter built-in server tool: consults a higher-intelligence advisor model (any OpenRouter model) for guidance mid-generation and returns its response.
|
|
9
|
+
* OpenRouter built-in server tool: consults a higher-intelligence advisor model (any OpenRouter model) for guidance mid-generation and returns its response. Include multiple entries to offer several named advisors; at most one entry may omit `name` to act as the default advisor.
|
|
10
10
|
*/
|
|
11
11
|
export type AdvisorServerToolOpenRouter = {
|
|
12
12
|
/**
|
package/esm/models/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export * from "./aabenchmarkentry.js";
|
|
|
2
2
|
export * from "./activityitem.js";
|
|
3
3
|
export * from "./activityresponse.js";
|
|
4
4
|
export * from "./additionaltoolsitem.js";
|
|
5
|
-
export * from "./advisornestedtool.js";
|
|
6
5
|
export * from "./advisorreasoning.js";
|
|
7
6
|
export * from "./advisorservertoolconfig.js";
|
|
8
7
|
export * from "./advisorservertoolopenrouter.js";
|
package/esm/models/index.js
CHANGED
|
@@ -6,7 +6,6 @@ export * from "./aabenchmarkentry.js";
|
|
|
6
6
|
export * from "./activityitem.js";
|
|
7
7
|
export * from "./activityresponse.js";
|
|
8
8
|
export * from "./additionaltoolsitem.js";
|
|
9
|
-
export * from "./advisornestedtool.js";
|
|
10
9
|
export * from "./advisorreasoning.js";
|
|
11
10
|
export * from "./advisorservertoolconfig.js";
|
|
12
11
|
export * from "./advisorservertoolopenrouter.js";
|
|
@@ -461,6 +461,10 @@ export type VideoGenerationRequest = {
|
|
|
461
461
|
* URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS.
|
|
462
462
|
*/
|
|
463
463
|
callbackUrl?: string | undefined;
|
|
464
|
+
/**
|
|
465
|
+
* Creativity level for video upscaling models only. This parameter is not supported by video generation models.
|
|
466
|
+
*/
|
|
467
|
+
creativity?: number | undefined;
|
|
464
468
|
/**
|
|
465
469
|
* Duration of the generated video in seconds
|
|
466
470
|
*/
|
|
@@ -498,6 +502,10 @@ export type VideoGenerationRequest = {
|
|
|
498
502
|
* Exact pixel dimensions of the generated video in "WIDTHxHEIGHT" format (e.g. "1280x720"). Interchangeable with resolution + aspect_ratio.
|
|
499
503
|
*/
|
|
500
504
|
size?: string | undefined;
|
|
505
|
+
/**
|
|
506
|
+
* Upscale factor for video upscaling models only. This parameter is not supported by video generation models.
|
|
507
|
+
*/
|
|
508
|
+
upscaleFactor?: number | undefined;
|
|
501
509
|
};
|
|
502
510
|
/** @internal */
|
|
503
511
|
export declare const VideoGenerationRequestAspectRatio$outboundSchema: z.ZodType<string, VideoGenerationRequestAspectRatio>;
|
|
@@ -925,6 +933,7 @@ export declare const VideoGenerationRequestResolution$outboundSchema: z.ZodType<
|
|
|
925
933
|
export type VideoGenerationRequest$Outbound = {
|
|
926
934
|
aspect_ratio?: string | undefined;
|
|
927
935
|
callback_url?: string | undefined;
|
|
936
|
+
creativity?: number | undefined;
|
|
928
937
|
duration?: number | undefined;
|
|
929
938
|
frame_images?: Array<FrameImage$Outbound> | undefined;
|
|
930
939
|
generate_audio?: boolean | undefined;
|
|
@@ -935,6 +944,7 @@ export type VideoGenerationRequest$Outbound = {
|
|
|
935
944
|
resolution?: string | undefined;
|
|
936
945
|
seed?: number | undefined;
|
|
937
946
|
size?: string | undefined;
|
|
947
|
+
upscale_factor?: number | undefined;
|
|
938
948
|
};
|
|
939
949
|
/** @internal */
|
|
940
950
|
export declare const VideoGenerationRequest$outboundSchema: z.ZodType<VideoGenerationRequest$Outbound, VideoGenerationRequest>;
|
|
@@ -222,6 +222,7 @@ export const VideoGenerationRequestResolution$outboundSchema = openEnums.outboun
|
|
|
222
222
|
export const VideoGenerationRequest$outboundSchema = z.object({
|
|
223
223
|
aspectRatio: VideoGenerationRequestAspectRatio$outboundSchema.optional(),
|
|
224
224
|
callbackUrl: z.string().optional(),
|
|
225
|
+
creativity: z.int().optional(),
|
|
225
226
|
duration: z.int().optional(),
|
|
226
227
|
frameImages: z.array(FrameImage$outboundSchema).optional(),
|
|
227
228
|
generateAudio: z.boolean().optional(),
|
|
@@ -233,6 +234,7 @@ export const VideoGenerationRequest$outboundSchema = z.object({
|
|
|
233
234
|
resolution: VideoGenerationRequestResolution$outboundSchema.optional(),
|
|
234
235
|
seed: z.int().optional(),
|
|
235
236
|
size: z.string().optional(),
|
|
237
|
+
upscaleFactor: z.number().optional(),
|
|
236
238
|
}).transform((v) => {
|
|
237
239
|
return remap$(v, {
|
|
238
240
|
aspectRatio: "aspect_ratio",
|
|
@@ -240,6 +242,7 @@ export const VideoGenerationRequest$outboundSchema = z.object({
|
|
|
240
242
|
frameImages: "frame_images",
|
|
241
243
|
generateAudio: "generate_audio",
|
|
242
244
|
inputReferences: "input_references",
|
|
245
|
+
upscaleFactor: "upscale_factor",
|
|
243
246
|
});
|
|
244
247
|
});
|
|
245
248
|
export function videoGenerationRequestToJSON(videoGenerationRequest) {
|
|
@@ -94,6 +94,13 @@ export declare const SupportedSize: {
|
|
|
94
94
|
readonly FiveThousandAndFortyx2160: "5040x2160";
|
|
95
95
|
};
|
|
96
96
|
export type SupportedSize = OpenEnum<typeof SupportedSize>;
|
|
97
|
+
/**
|
|
98
|
+
* Supported upscale factor range for video upscaling models
|
|
99
|
+
*/
|
|
100
|
+
export type UpscaleFactor = {
|
|
101
|
+
max?: number | null | undefined;
|
|
102
|
+
min?: number | null | undefined;
|
|
103
|
+
};
|
|
97
104
|
export type VideoModel = {
|
|
98
105
|
/**
|
|
99
106
|
* List of parameters that are allowed to be passed through to the provider
|
|
@@ -107,6 +114,10 @@ export type VideoModel = {
|
|
|
107
114
|
* Unix timestamp of when the model was created
|
|
108
115
|
*/
|
|
109
116
|
created: number;
|
|
117
|
+
/**
|
|
118
|
+
* Supported creativity levels for video upscaling models
|
|
119
|
+
*/
|
|
120
|
+
creativity: Array<number> | null;
|
|
110
121
|
/**
|
|
111
122
|
* Description of the model
|
|
112
123
|
*/
|
|
@@ -157,6 +168,10 @@ export type VideoModel = {
|
|
|
157
168
|
* Supported output sizes (width x height)
|
|
158
169
|
*/
|
|
159
170
|
supportedSizes: Array<SupportedSize> | null;
|
|
171
|
+
/**
|
|
172
|
+
* Supported upscale factor range for video upscaling models
|
|
173
|
+
*/
|
|
174
|
+
upscaleFactor: UpscaleFactor | null;
|
|
160
175
|
};
|
|
161
176
|
/** @internal */
|
|
162
177
|
export declare const SupportedAspectRatio$inboundSchema: z.ZodType<SupportedAspectRatio, unknown>;
|
|
@@ -167,6 +182,9 @@ export declare const SupportedResolution$inboundSchema: z.ZodType<SupportedResol
|
|
|
167
182
|
/** @internal */
|
|
168
183
|
export declare const SupportedSize$inboundSchema: z.ZodType<SupportedSize, unknown>;
|
|
169
184
|
/** @internal */
|
|
185
|
+
export declare const UpscaleFactor$inboundSchema: z.ZodType<UpscaleFactor, unknown>;
|
|
186
|
+
export declare function upscaleFactorFromJSON(jsonString: string): SafeParseResult<UpscaleFactor, SDKValidationError>;
|
|
187
|
+
/** @internal */
|
|
170
188
|
export declare const VideoModel$inboundSchema: z.ZodType<VideoModel, unknown>;
|
|
171
189
|
export declare function videoModelFromJSON(jsonString: string): SafeParseResult<VideoModel, SDKValidationError>;
|
|
172
190
|
//# sourceMappingURL=videomodel.d.ts.map
|
package/esm/models/videomodel.js
CHANGED
|
@@ -103,11 +103,21 @@ export const SupportedResolution$inboundSchema = openEnums.inboundSchema(Support
|
|
|
103
103
|
/** @internal */
|
|
104
104
|
export const SupportedSize$inboundSchema = openEnums.inboundSchema(SupportedSize);
|
|
105
105
|
/** @internal */
|
|
106
|
+
export const UpscaleFactor$inboundSchema = z
|
|
107
|
+
.object({
|
|
108
|
+
max: z.nullable(z.number()).optional(),
|
|
109
|
+
min: z.nullable(z.number()).optional(),
|
|
110
|
+
});
|
|
111
|
+
export function upscaleFactorFromJSON(jsonString) {
|
|
112
|
+
return safeParse(jsonString, (x) => UpscaleFactor$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpscaleFactor' from JSON`);
|
|
113
|
+
}
|
|
114
|
+
/** @internal */
|
|
106
115
|
export const VideoModel$inboundSchema = z
|
|
107
116
|
.object({
|
|
108
117
|
allowed_passthrough_parameters: z.array(z.string()),
|
|
109
118
|
canonical_slug: z.string(),
|
|
110
119
|
created: z.int(),
|
|
120
|
+
creativity: z.nullable(z.array(z.int())),
|
|
111
121
|
description: z.string().optional(),
|
|
112
122
|
generate_audio: z.nullable(z.boolean()),
|
|
113
123
|
hugging_face_id: z.nullable(z.string()).optional(),
|
|
@@ -120,6 +130,7 @@ export const VideoModel$inboundSchema = z
|
|
|
120
130
|
supported_frame_images: z.nullable(z.array(SupportedFrameImage$inboundSchema)),
|
|
121
131
|
supported_resolutions: z.nullable(z.array(SupportedResolution$inboundSchema)),
|
|
122
132
|
supported_sizes: z.nullable(z.array(SupportedSize$inboundSchema)),
|
|
133
|
+
upscale_factor: z.nullable(z.lazy(() => UpscaleFactor$inboundSchema)),
|
|
123
134
|
}).transform((v) => {
|
|
124
135
|
return remap$(v, {
|
|
125
136
|
"allowed_passthrough_parameters": "allowedPassthroughParameters",
|
|
@@ -132,6 +143,7 @@ export const VideoModel$inboundSchema = z
|
|
|
132
143
|
"supported_frame_images": "supportedFrameImages",
|
|
133
144
|
"supported_resolutions": "supportedResolutions",
|
|
134
145
|
"supported_sizes": "supportedSizes",
|
|
146
|
+
"upscale_factor": "upscaleFactor",
|
|
135
147
|
});
|
|
136
148
|
});
|
|
137
149
|
export function videoModelFromJSON(jsonString) {
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.45",
|
|
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",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"
|
|
76
|
+
"compile": "tsc",
|
|
77
77
|
"prepare": "npm run build",
|
|
78
|
+
"test": "vitest --run --project unit",
|
|
78
79
|
"test:transit": "exit 0",
|
|
79
|
-
"test:watch": "vitest --watch --project unit",
|
|
80
80
|
"typecheck": "tsc --noEmit",
|
|
81
|
-
"
|
|
82
|
-
"
|
|
81
|
+
"typecheck:transit": "exit 0",
|
|
82
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
83
83
|
"test:e2e": "vitest --run --project e2e",
|
|
84
|
-
"
|
|
84
|
+
"test:watch": "vitest --watch --project unit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v4";
|
|
2
|
-
/**
|
|
3
|
-
* A tool made available to the advisor sub-agent. Only OpenRouter server tools (e.g. openrouter:web_search) are supported; function tools are rejected because the advisor has no way to execute them. The advisor tool may not list itself.
|
|
4
|
-
*/
|
|
5
|
-
export type AdvisorNestedTool = {
|
|
6
|
-
parameters?: {
|
|
7
|
-
[k: string]: any;
|
|
8
|
-
} | undefined;
|
|
9
|
-
type: string;
|
|
10
|
-
additionalProperties?: {
|
|
11
|
-
[k: string]: any;
|
|
12
|
-
} | undefined;
|
|
13
|
-
};
|
|
14
|
-
/** @internal */
|
|
15
|
-
export type AdvisorNestedTool$Outbound = {
|
|
16
|
-
parameters?: {
|
|
17
|
-
[k: string]: any;
|
|
18
|
-
} | undefined;
|
|
19
|
-
type: string;
|
|
20
|
-
[additionalProperties: string]: unknown;
|
|
21
|
-
};
|
|
22
|
-
/** @internal */
|
|
23
|
-
export declare const AdvisorNestedTool$outboundSchema: z.ZodType<AdvisorNestedTool$Outbound, AdvisorNestedTool>;
|
|
24
|
-
export declare function advisorNestedToolToJSON(advisorNestedTool: AdvisorNestedTool): string;
|
|
25
|
-
//# sourceMappingURL=advisornestedtool.d.ts.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: 5dc7e04c01b7
|
|
4
|
-
*/
|
|
5
|
-
import * as z from "zod/v4";
|
|
6
|
-
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
-
/** @internal */
|
|
8
|
-
export const AdvisorNestedTool$outboundSchema = z.object({
|
|
9
|
-
parameters: z.record(z.string(), z.any()).optional(),
|
|
10
|
-
type: z.string(),
|
|
11
|
-
additionalProperties: z.record(z.string(), z.any()).optional(),
|
|
12
|
-
}).transform((v) => {
|
|
13
|
-
return {
|
|
14
|
-
...v.additionalProperties,
|
|
15
|
-
...remap$(v, {
|
|
16
|
-
additionalProperties: null,
|
|
17
|
-
}),
|
|
18
|
-
};
|
|
19
|
-
});
|
|
20
|
-
export function advisorNestedToolToJSON(advisorNestedTool) {
|
|
21
|
-
return JSON.stringify(AdvisorNestedTool$outboundSchema.parse(advisorNestedTool));
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=advisornestedtool.js.map
|