@openrouter/sdk 0.12.2 → 0.12.3

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.12.2";
52
+ readonly sdkVersion: "0.12.3";
53
53
  readonly genVersion: "2.879.1";
54
- readonly userAgent: "speakeasy-sdk/typescript 0.12.2 2.879.1 1.0.0 @openrouter/sdk";
54
+ readonly userAgent: "speakeasy-sdk/typescript 0.12.3 2.879.1 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.12.2",
29
+ sdkVersion: "0.12.3",
30
30
  genVersion: "2.879.1",
31
- userAgent: "speakeasy-sdk/typescript 0.12.2 2.879.1 1.0.0 @openrouter/sdk",
31
+ userAgent: "speakeasy-sdk/typescript 0.12.3 2.879.1 1.0.0 @openrouter/sdk",
32
32
  };
33
33
  //# sourceMappingURL=config.js.map
@@ -1,6 +1,7 @@
1
1
  import * as z from "zod/v4";
2
2
  import { ClosedEnum } from "../types/enums.js";
3
3
  import { ChatContentCacheControl, ChatContentCacheControl$Outbound } from "./chatcontentcachecontrol.js";
4
+ import { ChatSearchModelsServerTool, ChatSearchModelsServerTool$Outbound } from "./chatsearchmodelsservertool.js";
4
5
  import { ChatWebSearchShorthand, ChatWebSearchShorthand$Outbound } from "./chatwebsearchshorthand.js";
5
6
  import { DatetimeServerTool, DatetimeServerTool$Outbound } from "./datetimeservertool.js";
6
7
  import { OpenRouterWebSearchServerTool, OpenRouterWebSearchServerTool$Outbound } from "./openrouterwebsearchservertool.js";
@@ -45,7 +46,7 @@ export type ChatFunctionToolFunction = {
45
46
  /**
46
47
  * Tool definition for function calling (regular function or OpenRouter built-in server tool)
47
48
  */
48
- export type ChatFunctionTool = ChatFunctionToolFunction | DatetimeServerTool | OpenRouterWebSearchServerTool | ChatWebSearchShorthand;
49
+ export type ChatFunctionTool = ChatFunctionToolFunction | DatetimeServerTool | ChatSearchModelsServerTool | OpenRouterWebSearchServerTool | ChatWebSearchShorthand;
49
50
  /** @internal */
50
51
  export type ChatFunctionToolFunctionFunction$Outbound = {
51
52
  description?: string | undefined;
@@ -70,7 +71,7 @@ export type ChatFunctionToolFunction$Outbound = {
70
71
  export declare const ChatFunctionToolFunction$outboundSchema: z.ZodType<ChatFunctionToolFunction$Outbound, ChatFunctionToolFunction>;
71
72
  export declare function chatFunctionToolFunctionToJSON(chatFunctionToolFunction: ChatFunctionToolFunction): string;
72
73
  /** @internal */
73
- export type ChatFunctionTool$Outbound = ChatFunctionToolFunction$Outbound | DatetimeServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | ChatWebSearchShorthand$Outbound;
74
+ export type ChatFunctionTool$Outbound = ChatFunctionToolFunction$Outbound | DatetimeServerTool$Outbound | ChatSearchModelsServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | ChatWebSearchShorthand$Outbound;
74
75
  /** @internal */
75
76
  export declare const ChatFunctionTool$outboundSchema: z.ZodType<ChatFunctionTool$Outbound, ChatFunctionTool>;
76
77
  export declare function chatFunctionToolToJSON(chatFunctionTool: ChatFunctionTool): string;
@@ -5,6 +5,7 @@
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { ChatContentCacheControl$outboundSchema, } from "./chatcontentcachecontrol.js";
8
+ import { ChatSearchModelsServerTool$outboundSchema, } from "./chatsearchmodelsservertool.js";
8
9
  import { ChatWebSearchShorthand$outboundSchema, } from "./chatwebsearchshorthand.js";
9
10
  import { DatetimeServerTool$outboundSchema, } from "./datetimeservertool.js";
10
11
  import { OpenRouterWebSearchServerTool$outboundSchema, } from "./openrouterwebsearchservertool.js";
@@ -40,6 +41,7 @@ export function chatFunctionToolFunctionToJSON(chatFunctionToolFunction) {
40
41
  export const ChatFunctionTool$outboundSchema = z.union([
41
42
  z.lazy(() => ChatFunctionToolFunction$outboundSchema),
42
43
  DatetimeServerTool$outboundSchema,
44
+ ChatSearchModelsServerTool$outboundSchema,
43
45
  OpenRouterWebSearchServerTool$outboundSchema,
44
46
  ChatWebSearchShorthand$outboundSchema,
45
47
  ]);
@@ -0,0 +1,28 @@
1
+ import * as z from "zod/v4";
2
+ import { ClosedEnum } from "../types/enums.js";
3
+ import { SearchModelsServerToolConfig, SearchModelsServerToolConfig$Outbound } from "./searchmodelsservertoolconfig.js";
4
+ export declare const ChatSearchModelsServerToolType: {
5
+ readonly OpenrouterExperimentalSearchModels: "openrouter:experimental__search_models";
6
+ };
7
+ export type ChatSearchModelsServerToolType = ClosedEnum<typeof ChatSearchModelsServerToolType>;
8
+ /**
9
+ * OpenRouter built-in server tool: searches and filters AI models available on OpenRouter
10
+ */
11
+ export type ChatSearchModelsServerTool = {
12
+ /**
13
+ * Configuration for the openrouter:experimental__search_models server tool
14
+ */
15
+ parameters?: SearchModelsServerToolConfig | undefined;
16
+ type: ChatSearchModelsServerToolType;
17
+ };
18
+ /** @internal */
19
+ export declare const ChatSearchModelsServerToolType$outboundSchema: z.ZodEnum<typeof ChatSearchModelsServerToolType>;
20
+ /** @internal */
21
+ export type ChatSearchModelsServerTool$Outbound = {
22
+ parameters?: SearchModelsServerToolConfig$Outbound | undefined;
23
+ type: string;
24
+ };
25
+ /** @internal */
26
+ export declare const ChatSearchModelsServerTool$outboundSchema: z.ZodType<ChatSearchModelsServerTool$Outbound, ChatSearchModelsServerTool>;
27
+ export declare function chatSearchModelsServerToolToJSON(chatSearchModelsServerTool: ChatSearchModelsServerTool): string;
28
+ //# sourceMappingURL=chatsearchmodelsservertool.d.ts.map
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: bb9f1922b007
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { SearchModelsServerToolConfig$outboundSchema, } from "./searchmodelsservertoolconfig.js";
7
+ export const ChatSearchModelsServerToolType = {
8
+ OpenrouterExperimentalSearchModels: "openrouter:experimental__search_models",
9
+ };
10
+ /** @internal */
11
+ export const ChatSearchModelsServerToolType$outboundSchema = z.enum(ChatSearchModelsServerToolType);
12
+ /** @internal */
13
+ export const ChatSearchModelsServerTool$outboundSchema = z.object({
14
+ parameters: SearchModelsServerToolConfig$outboundSchema.optional(),
15
+ type: ChatSearchModelsServerToolType$outboundSchema,
16
+ });
17
+ export function chatSearchModelsServerToolToJSON(chatSearchModelsServerTool) {
18
+ return JSON.stringify(ChatSearchModelsServerTool$outboundSchema.parse(chatSearchModelsServerTool));
19
+ }
20
+ //# sourceMappingURL=chatsearchmodelsservertool.js.map
@@ -43,6 +43,7 @@ export * from "./chatnamedtoolchoice.js";
43
43
  export * from "./chatreasoningsummaryverbosityenum.js";
44
44
  export * from "./chatrequest.js";
45
45
  export * from "./chatresult.js";
46
+ export * from "./chatsearchmodelsservertool.js";
46
47
  export * from "./chatstreamchoice.js";
47
48
  export * from "./chatstreamchunk.js";
48
49
  export * from "./chatstreamdelta.js";
@@ -216,6 +217,7 @@ export * from "./responseoutputtext.js";
216
217
  export * from "./responseserrorfield.js";
217
218
  export * from "./responsesrequest.js";
218
219
  export * from "./searchcontextsizeenum.js";
220
+ export * from "./searchmodelsservertoolconfig.js";
219
221
  export * from "./searchqualitylevel.js";
220
222
  export * from "./security.js";
221
223
  export * from "./serviceunavailableresponseerrordata.js";
@@ -47,6 +47,7 @@ export * from "./chatnamedtoolchoice.js";
47
47
  export * from "./chatreasoningsummaryverbosityenum.js";
48
48
  export * from "./chatrequest.js";
49
49
  export * from "./chatresult.js";
50
+ export * from "./chatsearchmodelsservertool.js";
50
51
  export * from "./chatstreamchoice.js";
51
52
  export * from "./chatstreamchunk.js";
52
53
  export * from "./chatstreamdelta.js";
@@ -220,6 +221,7 @@ export * from "./responseoutputtext.js";
220
221
  export * from "./responseserrorfield.js";
221
222
  export * from "./responsesrequest.js";
222
223
  export * from "./searchcontextsizeenum.js";
224
+ export * from "./searchmodelsservertoolconfig.js";
223
225
  export * from "./searchqualitylevel.js";
224
226
  export * from "./security.js";
225
227
  export * from "./serviceunavailableresponseerrordata.js";
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
2
2
  import { OpenEnum } from "../types/enums.js";
3
3
  import { ApplyPatchServerTool, ApplyPatchServerTool$Outbound } from "./applypatchservertool.js";
4
4
  import { AutoRouterPlugin, AutoRouterPlugin$Outbound } from "./autorouterplugin.js";
5
+ import { ChatSearchModelsServerTool, ChatSearchModelsServerTool$Outbound } from "./chatsearchmodelsservertool.js";
5
6
  import { CodeInterpreterServerTool, CodeInterpreterServerTool$Outbound } from "./codeinterpreterservertool.js";
6
7
  import { CodexLocalShellTool, CodexLocalShellTool$Outbound } from "./codexlocalshelltool.js";
7
8
  import { ComputerUseServerTool, ComputerUseServerTool$Outbound } from "./computeruseservertool.js";
@@ -55,6 +56,8 @@ export type ResponsesRequestToolFunction = {
55
56
  };
56
57
  export type ResponsesRequestToolUnion = ResponsesRequestToolFunction | PreviewWebSearchServerTool | Preview20250311WebSearchServerTool | LegacyWebSearchServerTool | WebSearchServerTool | FileSearchServerTool | ComputerUseServerTool | CodeInterpreterServerTool | McpServerTool | ImageGenerationServerTool | CodexLocalShellTool | ShellServerTool | ApplyPatchServerTool | CustomTool | (DatetimeServerTool & {
57
58
  type: "openrouter:datetime";
59
+ }) | (ChatSearchModelsServerTool & {
60
+ type: "openrouter:experimental__search_models";
58
61
  }) | WebSearchServerToolOpenRouter;
59
62
  /**
60
63
  * Request schema for Responses endpoint
@@ -121,6 +124,8 @@ export type ResponsesRequest = {
121
124
  toolChoice?: OpenAIResponsesToolChoiceUnion | undefined;
122
125
  tools?: Array<ResponsesRequestToolFunction | PreviewWebSearchServerTool | Preview20250311WebSearchServerTool | LegacyWebSearchServerTool | WebSearchServerTool | FileSearchServerTool | ComputerUseServerTool | CodeInterpreterServerTool | McpServerTool | ImageGenerationServerTool | CodexLocalShellTool | ShellServerTool | ApplyPatchServerTool | CustomTool | (DatetimeServerTool & {
123
126
  type: "openrouter:datetime";
127
+ }) | (ChatSearchModelsServerTool & {
128
+ type: "openrouter:experimental__search_models";
124
129
  }) | WebSearchServerToolOpenRouter> | undefined;
125
130
  topK?: number | undefined;
126
131
  topLogprobs?: number | undefined;
@@ -163,6 +168,8 @@ export declare function responsesRequestToolFunctionToJSON(responsesRequestToolF
163
168
  /** @internal */
164
169
  export type ResponsesRequestToolUnion$Outbound = ResponsesRequestToolFunction$Outbound | PreviewWebSearchServerTool$Outbound | Preview20250311WebSearchServerTool$Outbound | LegacyWebSearchServerTool$Outbound | WebSearchServerTool$Outbound | FileSearchServerTool$Outbound | ComputerUseServerTool$Outbound | CodeInterpreterServerTool$Outbound | McpServerTool$Outbound | ImageGenerationServerTool$Outbound | CodexLocalShellTool$Outbound | ShellServerTool$Outbound | ApplyPatchServerTool$Outbound | CustomTool$Outbound | (DatetimeServerTool$Outbound & {
165
170
  type: "openrouter:datetime";
171
+ }) | (ChatSearchModelsServerTool$Outbound & {
172
+ type: "openrouter:experimental__search_models";
166
173
  }) | WebSearchServerToolOpenRouter$Outbound;
167
174
  /** @internal */
168
175
  export declare const ResponsesRequestToolUnion$outboundSchema: z.ZodType<ResponsesRequestToolUnion$Outbound, ResponsesRequestToolUnion>;
@@ -203,6 +210,8 @@ export type ResponsesRequest$Outbound = {
203
210
  tool_choice?: OpenAIResponsesToolChoiceUnion$Outbound | undefined;
204
211
  tools?: Array<ResponsesRequestToolFunction$Outbound | PreviewWebSearchServerTool$Outbound | Preview20250311WebSearchServerTool$Outbound | LegacyWebSearchServerTool$Outbound | WebSearchServerTool$Outbound | FileSearchServerTool$Outbound | ComputerUseServerTool$Outbound | CodeInterpreterServerTool$Outbound | McpServerTool$Outbound | ImageGenerationServerTool$Outbound | CodexLocalShellTool$Outbound | ShellServerTool$Outbound | ApplyPatchServerTool$Outbound | CustomTool$Outbound | (DatetimeServerTool$Outbound & {
205
212
  type: "openrouter:datetime";
213
+ }) | (ChatSearchModelsServerTool$Outbound & {
214
+ type: "openrouter:experimental__search_models";
206
215
  }) | WebSearchServerToolOpenRouter$Outbound> | undefined;
207
216
  top_k?: number | undefined;
208
217
  top_logprobs?: number | undefined;
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../lib/primitives.js";
7
7
  import * as openEnums from "../types/enums.js";
8
8
  import { ApplyPatchServerTool$outboundSchema, } from "./applypatchservertool.js";
9
9
  import { AutoRouterPlugin$outboundSchema, } from "./autorouterplugin.js";
10
+ import { ChatSearchModelsServerTool$outboundSchema, } from "./chatsearchmodelsservertool.js";
10
11
  import { CodeInterpreterServerTool$outboundSchema, } from "./codeinterpreterservertool.js";
11
12
  import { CodexLocalShellTool$outboundSchema, } from "./codexlocalshelltool.js";
12
13
  import { ComputerUseServerTool$outboundSchema, } from "./computeruseservertool.js";
@@ -90,6 +91,7 @@ export const ResponsesRequestToolUnion$outboundSchema = z.union([
90
91
  ApplyPatchServerTool$outboundSchema,
91
92
  CustomTool$outboundSchema,
92
93
  DatetimeServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:datetime") })),
94
+ ChatSearchModelsServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:experimental__search_models") })),
93
95
  WebSearchServerToolOpenRouter$outboundSchema,
94
96
  ]);
95
97
  export function responsesRequestToolUnionToJSON(responsesRequestToolUnion) {
@@ -149,6 +151,7 @@ export const ResponsesRequest$outboundSchema = z.object({
149
151
  ApplyPatchServerTool$outboundSchema,
150
152
  CustomTool$outboundSchema,
151
153
  DatetimeServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:datetime") })),
154
+ ChatSearchModelsServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:experimental__search_models") })),
152
155
  WebSearchServerToolOpenRouter$outboundSchema,
153
156
  ])).optional(),
154
157
  topK: z.int().optional(),
@@ -0,0 +1,18 @@
1
+ import * as z from "zod/v4";
2
+ /**
3
+ * Configuration for the openrouter:experimental__search_models server tool
4
+ */
5
+ export type SearchModelsServerToolConfig = {
6
+ /**
7
+ * Maximum number of models to return. Defaults to 5, max 20.
8
+ */
9
+ maxResults?: number | undefined;
10
+ };
11
+ /** @internal */
12
+ export type SearchModelsServerToolConfig$Outbound = {
13
+ max_results?: number | undefined;
14
+ };
15
+ /** @internal */
16
+ export declare const SearchModelsServerToolConfig$outboundSchema: z.ZodType<SearchModelsServerToolConfig$Outbound, SearchModelsServerToolConfig>;
17
+ export declare function searchModelsServerToolConfigToJSON(searchModelsServerToolConfig: SearchModelsServerToolConfig): string;
18
+ //# sourceMappingURL=searchmodelsservertoolconfig.d.ts.map
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: f15358a543a6
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ /** @internal */
8
+ export const SearchModelsServerToolConfig$outboundSchema = z.object({
9
+ maxResults: z.int().optional(),
10
+ }).transform((v) => {
11
+ return remap$(v, {
12
+ maxResults: "max_results",
13
+ });
14
+ });
15
+ export function searchModelsServerToolConfigToJSON(searchModelsServerToolConfig) {
16
+ return JSON.stringify(SearchModelsServerToolConfig$outboundSchema.parse(searchModelsServerToolConfig));
17
+ }
18
+ //# sourceMappingURL=searchmodelsservertoolconfig.js.map
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "0.12.2",
5
+ "version": "0.12.3",
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.12.2",
3
+ "version": "0.12.3",
4
4
  "author": "OpenRouter",
5
5
  "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.",
6
6
  "keywords": [
@@ -69,15 +69,15 @@
69
69
  "lint": "eslint --cache --max-warnings=0 src",
70
70
  "build": "tsc",
71
71
  "prepublishOnly": "npm run build",
72
- "compile": "tsc",
72
+ "prepare": "npm run build",
73
73
  "test": "vitest --run --project unit",
74
74
  "test:e2e": "vitest --run --project e2e",
75
75
  "test:transit": "exit 0",
76
- "typecheck": "tsc --noEmit",
77
76
  "typecheck:transit": "exit 0",
78
- "postinstall": "node scripts/check-types.js || true",
79
- "prepare": "npm run build",
80
- "test:watch": "vitest --watch --project unit"
77
+ "test:watch": "vitest --watch --project unit",
78
+ "typecheck": "tsc --noEmit",
79
+ "compile": "tsc",
80
+ "postinstall": "node scripts/check-types.js || true"
81
81
  },
82
82
  "peerDependencies": {},
83
83
  "devDependencies": {