@openrouter/sdk 0.13.21 → 0.13.22

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.
@@ -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.21";
52
+ readonly sdkVersion: "0.13.22";
53
53
  readonly genVersion: "2.884.4";
54
- readonly userAgent: "speakeasy-sdk/typescript 0.13.21 2.884.4 1.0.0 @openrouter/sdk";
54
+ readonly userAgent: "speakeasy-sdk/typescript 0.13.22 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.21",
29
+ sdkVersion: "0.13.22",
30
30
  genVersion: "2.884.4",
31
- userAgent: "speakeasy-sdk/typescript 0.13.21 2.884.4 1.0.0 @openrouter/sdk",
31
+ userAgent: "speakeasy-sdk/typescript 0.13.22 2.884.4 1.0.0 @openrouter/sdk",
32
32
  };
33
33
  //# sourceMappingURL=config.js.map
@@ -6,6 +6,7 @@ import { ChatContentCacheControl, ChatContentCacheControl$Outbound } from "./cha
6
6
  import { ChatSearchModelsServerTool, ChatSearchModelsServerTool$Outbound } from "./chatsearchmodelsservertool.js";
7
7
  import { ChatWebSearchShorthand, ChatWebSearchShorthand$Outbound } from "./chatwebsearchshorthand.js";
8
8
  import { DatetimeServerTool, DatetimeServerTool$Outbound } from "./datetimeservertool.js";
9
+ import { FilesServerTool, FilesServerTool$Outbound } from "./filesservertool.js";
9
10
  import { ImageGenerationServerToolOpenRouter, ImageGenerationServerToolOpenRouter$Outbound } from "./imagegenerationservertoolopenrouter.js";
10
11
  import { OpenRouterWebSearchServerTool, OpenRouterWebSearchServerTool$Outbound } from "./openrouterwebsearchservertool.js";
11
12
  import { SubagentServerToolOpenRouter, SubagentServerToolOpenRouter$Outbound } from "./subagentservertoolopenrouter.js";
@@ -51,7 +52,7 @@ export type ChatFunctionToolFunction = {
51
52
  /**
52
53
  * Tool definition for function calling (regular function or OpenRouter built-in server tool)
53
54
  */
54
- export type ChatFunctionTool = ChatFunctionToolFunction | AdvisorServerToolOpenRouter | BashServerTool | DatetimeServerTool | ImageGenerationServerToolOpenRouter | ChatSearchModelsServerTool | SubagentServerToolOpenRouter | WebFetchServerTool | OpenRouterWebSearchServerTool | ChatWebSearchShorthand;
55
+ export type ChatFunctionTool = ChatFunctionToolFunction | AdvisorServerToolOpenRouter | BashServerTool | DatetimeServerTool | FilesServerTool | ImageGenerationServerToolOpenRouter | ChatSearchModelsServerTool | SubagentServerToolOpenRouter | WebFetchServerTool | OpenRouterWebSearchServerTool | ChatWebSearchShorthand;
55
56
  /** @internal */
56
57
  export type ChatFunctionToolFunctionFunction$Outbound = {
57
58
  description?: string | undefined;
@@ -76,7 +77,7 @@ export type ChatFunctionToolFunction$Outbound = {
76
77
  export declare const ChatFunctionToolFunction$outboundSchema: z.ZodType<ChatFunctionToolFunction$Outbound, ChatFunctionToolFunction>;
77
78
  export declare function chatFunctionToolFunctionToJSON(chatFunctionToolFunction: ChatFunctionToolFunction): string;
78
79
  /** @internal */
79
- export type ChatFunctionTool$Outbound = ChatFunctionToolFunction$Outbound | AdvisorServerToolOpenRouter$Outbound | BashServerTool$Outbound | DatetimeServerTool$Outbound | ImageGenerationServerToolOpenRouter$Outbound | ChatSearchModelsServerTool$Outbound | SubagentServerToolOpenRouter$Outbound | WebFetchServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | ChatWebSearchShorthand$Outbound;
80
+ export type ChatFunctionTool$Outbound = ChatFunctionToolFunction$Outbound | AdvisorServerToolOpenRouter$Outbound | BashServerTool$Outbound | DatetimeServerTool$Outbound | FilesServerTool$Outbound | ImageGenerationServerToolOpenRouter$Outbound | ChatSearchModelsServerTool$Outbound | SubagentServerToolOpenRouter$Outbound | WebFetchServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | ChatWebSearchShorthand$Outbound;
80
81
  /** @internal */
81
82
  export declare const ChatFunctionTool$outboundSchema: z.ZodType<ChatFunctionTool$Outbound, ChatFunctionTool>;
82
83
  export declare function chatFunctionToolToJSON(chatFunctionTool: ChatFunctionTool): string;
@@ -10,6 +10,7 @@ import { ChatContentCacheControl$outboundSchema, } from "./chatcontentcachecontr
10
10
  import { ChatSearchModelsServerTool$outboundSchema, } from "./chatsearchmodelsservertool.js";
11
11
  import { ChatWebSearchShorthand$outboundSchema, } from "./chatwebsearchshorthand.js";
12
12
  import { DatetimeServerTool$outboundSchema, } from "./datetimeservertool.js";
13
+ import { FilesServerTool$outboundSchema, } from "./filesservertool.js";
13
14
  import { ImageGenerationServerToolOpenRouter$outboundSchema, } from "./imagegenerationservertoolopenrouter.js";
14
15
  import { OpenRouterWebSearchServerTool$outboundSchema, } from "./openrouterwebsearchservertool.js";
15
16
  import { SubagentServerToolOpenRouter$outboundSchema, } from "./subagentservertoolopenrouter.js";
@@ -48,6 +49,7 @@ export const ChatFunctionTool$outboundSchema = z.union([
48
49
  AdvisorServerToolOpenRouter$outboundSchema,
49
50
  BashServerTool$outboundSchema,
50
51
  DatetimeServerTool$outboundSchema,
52
+ FilesServerTool$outboundSchema,
51
53
  ImageGenerationServerToolOpenRouter$outboundSchema,
52
54
  ChatSearchModelsServerTool$outboundSchema,
53
55
  SubagentServerToolOpenRouter$outboundSchema,
@@ -0,0 +1,28 @@
1
+ import * as z from "zod/v4";
2
+ import { ClosedEnum } from "../types/enums.js";
3
+ import { FilesServerToolConfig, FilesServerToolConfig$Outbound } from "./filesservertoolconfig.js";
4
+ export declare const FilesServerToolType: {
5
+ readonly OpenrouterFiles: "openrouter:files";
6
+ };
7
+ export type FilesServerToolType = ClosedEnum<typeof FilesServerToolType>;
8
+ /**
9
+ * OpenRouter built-in server tool: read, write, edit, and list workspace files via the Files API. Requires the `x-openrouter-file-ids: openrouter` request header.
10
+ */
11
+ export type FilesServerTool = {
12
+ /**
13
+ * Configuration for the openrouter:files server tool
14
+ */
15
+ parameters?: FilesServerToolConfig | undefined;
16
+ type: FilesServerToolType;
17
+ };
18
+ /** @internal */
19
+ export declare const FilesServerToolType$outboundSchema: z.ZodEnum<typeof FilesServerToolType>;
20
+ /** @internal */
21
+ export type FilesServerTool$Outbound = {
22
+ parameters?: FilesServerToolConfig$Outbound | undefined;
23
+ type: string;
24
+ };
25
+ /** @internal */
26
+ export declare const FilesServerTool$outboundSchema: z.ZodType<FilesServerTool$Outbound, FilesServerTool>;
27
+ export declare function filesServerToolToJSON(filesServerTool: FilesServerTool): string;
28
+ //# sourceMappingURL=filesservertool.d.ts.map
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 3e85b948793d
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { FilesServerToolConfig$outboundSchema, } from "./filesservertoolconfig.js";
7
+ export const FilesServerToolType = {
8
+ OpenrouterFiles: "openrouter:files",
9
+ };
10
+ /** @internal */
11
+ export const FilesServerToolType$outboundSchema = z.enum(FilesServerToolType);
12
+ /** @internal */
13
+ export const FilesServerTool$outboundSchema = z.object({
14
+ parameters: FilesServerToolConfig$outboundSchema.optional(),
15
+ type: FilesServerToolType$outboundSchema,
16
+ });
17
+ export function filesServerToolToJSON(filesServerTool) {
18
+ return JSON.stringify(FilesServerTool$outboundSchema.parse(filesServerTool));
19
+ }
20
+ //# sourceMappingURL=filesservertool.js.map
@@ -0,0 +1,11 @@
1
+ import * as z from "zod/v4";
2
+ /**
3
+ * Configuration for the openrouter:files server tool
4
+ */
5
+ export type FilesServerToolConfig = {};
6
+ /** @internal */
7
+ export type FilesServerToolConfig$Outbound = {};
8
+ /** @internal */
9
+ export declare const FilesServerToolConfig$outboundSchema: z.ZodType<FilesServerToolConfig$Outbound, FilesServerToolConfig>;
10
+ export declare function filesServerToolConfigToJSON(filesServerToolConfig: FilesServerToolConfig): string;
11
+ //# sourceMappingURL=filesservertoolconfig.d.ts.map
@@ -0,0 +1,11 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 9e169d1b0b62
4
+ */
5
+ import * as z from "zod/v4";
6
+ /** @internal */
7
+ export const FilesServerToolConfig$outboundSchema = z.object({});
8
+ export function filesServerToolConfigToJSON(filesServerToolConfig) {
9
+ return JSON.stringify(FilesServerToolConfig$outboundSchema.parse(filesServerToolConfig));
10
+ }
11
+ //# sourceMappingURL=filesservertoolconfig.js.map
@@ -187,6 +187,8 @@ export * from "./filemetadata.js";
187
187
  export * from "./fileparserplugin.js";
188
188
  export * from "./filepath.js";
189
189
  export * from "./filesearchservertool.js";
190
+ export * from "./filesservertool.js";
191
+ export * from "./filesservertoolconfig.js";
190
192
  export * from "./forbiddenresponseerrordata.js";
191
193
  export * from "./formatjsonobjectconfig.js";
192
194
  export * from "./formatjsonschemaconfig.js";
@@ -191,6 +191,8 @@ export * from "./filemetadata.js";
191
191
  export * from "./fileparserplugin.js";
192
192
  export * from "./filepath.js";
193
193
  export * from "./filesearchservertool.js";
194
+ export * from "./filesservertool.js";
195
+ export * from "./filesservertoolconfig.js";
194
196
  export * from "./forbiddenresponseerrordata.js";
195
197
  export * from "./formatjsonobjectconfig.js";
196
198
  export * from "./formatjsonschemaconfig.js";
@@ -16,6 +16,7 @@ import { CustomTool, CustomTool$Outbound } from "./customtool.js";
16
16
  import { DatetimeServerTool, DatetimeServerTool$Outbound } from "./datetimeservertool.js";
17
17
  import { FileParserPlugin, FileParserPlugin$Outbound } from "./fileparserplugin.js";
18
18
  import { FileSearchServerTool, FileSearchServerTool$Outbound } from "./filesearchservertool.js";
19
+ import { FilesServerTool, FilesServerTool$Outbound } from "./filesservertool.js";
19
20
  import { FusionPlugin, FusionPlugin$Outbound } from "./fusionplugin.js";
20
21
  import { FusionServerToolOpenRouter, FusionServerToolOpenRouter$Outbound } from "./fusionservertoolopenrouter.js";
21
22
  import { ImageConfig, ImageConfig$Outbound } from "./imageconfig.js";
@@ -74,6 +75,8 @@ export type ResponsesRequestToolUnion = ResponsesRequestToolFunction | PreviewWe
74
75
  type: "openrouter:subagent";
75
76
  }) | (DatetimeServerTool & {
76
77
  type: "openrouter:datetime";
78
+ }) | (FilesServerTool & {
79
+ type: "openrouter:files";
77
80
  }) | FusionServerToolOpenRouter | (ImageGenerationServerToolOpenRouter & {
78
81
  type: "openrouter:image_generation";
79
82
  }) | (ChatSearchModelsServerTool & {
@@ -164,6 +167,8 @@ export type ResponsesRequest = {
164
167
  type: "openrouter:subagent";
165
168
  }) | (DatetimeServerTool & {
166
169
  type: "openrouter:datetime";
170
+ }) | (FilesServerTool & {
171
+ type: "openrouter:files";
167
172
  }) | FusionServerToolOpenRouter | (ImageGenerationServerToolOpenRouter & {
168
173
  type: "openrouter:image_generation";
169
174
  }) | (ChatSearchModelsServerTool & {
@@ -213,6 +218,8 @@ export type ResponsesRequestToolUnion$Outbound = ResponsesRequestToolFunction$Ou
213
218
  type: "openrouter:subagent";
214
219
  }) | (DatetimeServerTool$Outbound & {
215
220
  type: "openrouter:datetime";
221
+ }) | (FilesServerTool$Outbound & {
222
+ type: "openrouter:files";
216
223
  }) | FusionServerToolOpenRouter$Outbound | (ImageGenerationServerToolOpenRouter$Outbound & {
217
224
  type: "openrouter:image_generation";
218
225
  }) | (ChatSearchModelsServerTool$Outbound & {
@@ -268,6 +275,8 @@ export type ResponsesRequest$Outbound = {
268
275
  type: "openrouter:subagent";
269
276
  }) | (DatetimeServerTool$Outbound & {
270
277
  type: "openrouter:datetime";
278
+ }) | (FilesServerTool$Outbound & {
279
+ type: "openrouter:files";
271
280
  }) | FusionServerToolOpenRouter$Outbound | (ImageGenerationServerToolOpenRouter$Outbound & {
272
281
  type: "openrouter:image_generation";
273
282
  }) | (ChatSearchModelsServerTool$Outbound & {
@@ -21,6 +21,7 @@ import { CustomTool$outboundSchema, } from "./customtool.js";
21
21
  import { DatetimeServerTool$outboundSchema, } from "./datetimeservertool.js";
22
22
  import { FileParserPlugin$outboundSchema, } from "./fileparserplugin.js";
23
23
  import { FileSearchServerTool$outboundSchema, } from "./filesearchservertool.js";
24
+ import { FilesServerTool$outboundSchema, } from "./filesservertool.js";
24
25
  import { FusionPlugin$outboundSchema, } from "./fusionplugin.js";
25
26
  import { FusionServerToolOpenRouter$outboundSchema, } from "./fusionservertoolopenrouter.js";
26
27
  import { ImageConfig$outboundSchema, } from "./imageconfig.js";
@@ -106,6 +107,7 @@ export const ResponsesRequestToolUnion$outboundSchema = z.union([
106
107
  AdvisorServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:advisor") })),
107
108
  SubagentServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:subagent") })),
108
109
  DatetimeServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:datetime") })),
110
+ FilesServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:files") })),
109
111
  FusionServerToolOpenRouter$outboundSchema,
110
112
  ImageGenerationServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:image_generation") })),
111
113
  ChatSearchModelsServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:experimental__search_models") })),
@@ -180,6 +182,7 @@ export const ResponsesRequest$outboundSchema = z.object({
180
182
  AdvisorServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:advisor") })),
181
183
  SubagentServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:subagent") })),
182
184
  DatetimeServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:datetime") })),
185
+ FilesServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:files") })),
183
186
  FusionServerToolOpenRouter$outboundSchema,
184
187
  ImageGenerationServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:image_generation") })),
185
188
  ChatSearchModelsServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:experimental__search_models") })),
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "0.13.21",
5
+ "version": "0.13.22",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openrouter/sdk",
3
- "version": "0.13.21",
3
+ "version": "0.13.22",
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": [
@@ -21,8 +21,8 @@
21
21
  "license": "Apache-2.0",
22
22
  "packageManager": "pnpm@10.22.0",
23
23
  "publishConfig": {
24
- "access": "public",
25
- "provenance": true
24
+ "provenance": true,
25
+ "access": "public"
26
26
  },
27
27
  "type": "module",
28
28
  "main": "./esm/index.js",
@@ -74,14 +74,14 @@
74
74
  "build": "tsc",
75
75
  "prepublishOnly": "npm run build",
76
76
  "postinstall": "node scripts/check-types.js || true",
77
+ "prepare": "npm run build",
78
+ "test:watch": "vitest --watch --project unit",
79
+ "typecheck:transit": "exit 0",
80
+ "compile": "tsc",
77
81
  "test": "vitest --run --project unit",
78
82
  "test:e2e": "vitest --run --project e2e",
79
83
  "test:transit": "exit 0",
80
- "test:watch": "vitest --watch --project unit",
81
- "typecheck": "tsc --noEmit",
82
- "prepare": "npm run build",
83
- "typecheck:transit": "exit 0",
84
- "compile": "tsc"
84
+ "typecheck": "tsc --noEmit"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {