@openrouter/sdk 1.4.12 → 1.4.14

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.
@@ -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.12";
53
+ readonly sdkVersion: "1.4.14";
54
54
  readonly genVersion: "2.914.0";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.4.12 2.914.0 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.4.14 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.12",
32
+ sdkVersion: "1.4.14",
33
33
  genVersion: "2.914.0",
34
- userAgent: "speakeasy-sdk/typescript 1.4.12 2.914.0 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.4.14 2.914.0 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -0,0 +1,21 @@
1
+ import * as z from "zod/v4";
2
+ /**
3
+ * Generic OpenRouter server-tool envelope. `type` names a registered server tool (canonical `openrouter:*` form or a registered shorthand); `parameters` carries tool-specific configuration validated against the tool definition.
4
+ */
5
+ export type ChatDynamicServerTool = {
6
+ parameters?: {
7
+ [k: string]: any;
8
+ } | undefined;
9
+ type: string;
10
+ };
11
+ /** @internal */
12
+ export type ChatDynamicServerTool$Outbound = {
13
+ parameters?: {
14
+ [k: string]: any;
15
+ } | undefined;
16
+ type: string;
17
+ };
18
+ /** @internal */
19
+ export declare const ChatDynamicServerTool$outboundSchema: z.ZodType<ChatDynamicServerTool$Outbound, ChatDynamicServerTool>;
20
+ export declare function chatDynamicServerToolToJSON(chatDynamicServerTool: ChatDynamicServerTool): string;
21
+ //# sourceMappingURL=chatdynamicservertool.d.ts.map
@@ -0,0 +1,14 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 883a1e1c541b
4
+ */
5
+ import * as z from "zod/v4";
6
+ /** @internal */
7
+ export const ChatDynamicServerTool$outboundSchema = z.object({
8
+ parameters: z.record(z.string(), z.any()).optional(),
9
+ type: z.string(),
10
+ });
11
+ export function chatDynamicServerToolToJSON(chatDynamicServerTool) {
12
+ return JSON.stringify(ChatDynamicServerTool$outboundSchema.parse(chatDynamicServerTool));
13
+ }
14
+ //# sourceMappingURL=chatdynamicservertool.js.map
@@ -3,6 +3,7 @@ import { ClosedEnum } from "../types/enums.js";
3
3
  import { AdvisorServerToolOpenRouter, AdvisorServerToolOpenRouter$Outbound } from "./advisorservertoolopenrouter.js";
4
4
  import { BashServerTool, BashServerTool$Outbound } from "./bashservertool.js";
5
5
  import { ChatContentCacheControl, ChatContentCacheControl$Outbound } from "./chatcontentcachecontrol.js";
6
+ import { ChatDynamicServerTool, ChatDynamicServerTool$Outbound } from "./chatdynamicservertool.js";
6
7
  import { ChatSearchModelsServerTool, ChatSearchModelsServerTool$Outbound } from "./chatsearchmodelsservertool.js";
7
8
  import { ChatWebSearchShorthand, ChatWebSearchShorthand$Outbound } from "./chatwebsearchshorthand.js";
8
9
  import { DatetimeServerTool, DatetimeServerTool$Outbound } from "./datetimeservertool.js";
@@ -53,7 +54,7 @@ export type ChatFunctionToolFunction = {
53
54
  /**
54
55
  * Tool definition for function calling (regular function or OpenRouter built-in server tool)
55
56
  */
56
- export type ChatFunctionTool = ChatFunctionToolFunction | AdvisorServerToolOpenRouter | BashServerTool | DatetimeServerTool | FilesServerTool | FusionServerToolOpenRouter | ImageGenerationServerToolOpenRouter | ChatSearchModelsServerTool | SubagentServerToolOpenRouter | WebFetchServerTool | OpenRouterWebSearchServerTool | ChatWebSearchShorthand;
57
+ export type ChatFunctionTool = ChatFunctionToolFunction | AdvisorServerToolOpenRouter | BashServerTool | DatetimeServerTool | FilesServerTool | FusionServerToolOpenRouter | ImageGenerationServerToolOpenRouter | ChatSearchModelsServerTool | SubagentServerToolOpenRouter | WebFetchServerTool | OpenRouterWebSearchServerTool | ChatWebSearchShorthand | ChatDynamicServerTool;
57
58
  /** @internal */
58
59
  export type ChatFunctionToolFunctionFunction$Outbound = {
59
60
  description?: string | undefined;
@@ -78,7 +79,7 @@ export type ChatFunctionToolFunction$Outbound = {
78
79
  export declare const ChatFunctionToolFunction$outboundSchema: z.ZodType<ChatFunctionToolFunction$Outbound, ChatFunctionToolFunction>;
79
80
  export declare function chatFunctionToolFunctionToJSON(chatFunctionToolFunction: ChatFunctionToolFunction): string;
80
81
  /** @internal */
81
- export type ChatFunctionTool$Outbound = ChatFunctionToolFunction$Outbound | AdvisorServerToolOpenRouter$Outbound | BashServerTool$Outbound | DatetimeServerTool$Outbound | FilesServerTool$Outbound | FusionServerToolOpenRouter$Outbound | ImageGenerationServerToolOpenRouter$Outbound | ChatSearchModelsServerTool$Outbound | SubagentServerToolOpenRouter$Outbound | WebFetchServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | ChatWebSearchShorthand$Outbound;
82
+ export type ChatFunctionTool$Outbound = ChatFunctionToolFunction$Outbound | AdvisorServerToolOpenRouter$Outbound | BashServerTool$Outbound | DatetimeServerTool$Outbound | FilesServerTool$Outbound | FusionServerToolOpenRouter$Outbound | ImageGenerationServerToolOpenRouter$Outbound | ChatSearchModelsServerTool$Outbound | SubagentServerToolOpenRouter$Outbound | WebFetchServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | ChatWebSearchShorthand$Outbound | ChatDynamicServerTool$Outbound;
82
83
  /** @internal */
83
84
  export declare const ChatFunctionTool$outboundSchema: z.ZodType<ChatFunctionTool$Outbound, ChatFunctionTool>;
84
85
  export declare function chatFunctionToolToJSON(chatFunctionTool: ChatFunctionTool): string;
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { AdvisorServerToolOpenRouter$outboundSchema, } from "./advisorservertoolopenrouter.js";
8
8
  import { BashServerTool$outboundSchema, } from "./bashservertool.js";
9
9
  import { ChatContentCacheControl$outboundSchema, } from "./chatcontentcachecontrol.js";
10
+ import { ChatDynamicServerTool$outboundSchema, } from "./chatdynamicservertool.js";
10
11
  import { ChatSearchModelsServerTool$outboundSchema, } from "./chatsearchmodelsservertool.js";
11
12
  import { ChatWebSearchShorthand$outboundSchema, } from "./chatwebsearchshorthand.js";
12
13
  import { DatetimeServerTool$outboundSchema, } from "./datetimeservertool.js";
@@ -58,6 +59,7 @@ export const ChatFunctionTool$outboundSchema = z.union([
58
59
  WebFetchServerTool$outboundSchema,
59
60
  OpenRouterWebSearchServerTool$outboundSchema,
60
61
  ChatWebSearchShorthand$outboundSchema,
62
+ ChatDynamicServerTool$outboundSchema,
61
63
  ]);
62
64
  export function chatFunctionToolToJSON(chatFunctionTool) {
63
65
  return JSON.stringify(ChatFunctionTool$outboundSchema.parse(chatFunctionTool));
@@ -189,6 +189,7 @@ export * from "./chatcontentvideo.js";
189
189
  export * from "./chatcontentvideoinput.js";
190
190
  export * from "./chatdebugoptions.js";
191
191
  export * from "./chatdevelopermessage.js";
192
+ export * from "./chatdynamicservertool.js";
192
193
  export * from "./chatfinishreasonenum.js";
193
194
  export * from "./chatformatgrammarconfig.js";
194
195
  export * from "./chatformatjsonobjectconfig.js";
@@ -193,6 +193,7 @@ export * from "./chatcontentvideo.js";
193
193
  export * from "./chatcontentvideoinput.js";
194
194
  export * from "./chatdebugoptions.js";
195
195
  export * from "./chatdevelopermessage.js";
196
+ export * from "./chatdynamicservertool.js";
196
197
  export * from "./chatfinishreasonenum.js";
197
198
  export * from "./chatformatgrammarconfig.js";
198
199
  export * from "./chatformatjsonobjectconfig.js";
@@ -1,7 +1,7 @@
1
1
  import * as z from "zod/v4";
2
2
  import { OpenEnum } from "../types/enums.js";
3
3
  /**
4
- * 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, capability.
4
+ * 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.
5
5
  */
6
6
  export declare const Algorithm: {
7
7
  readonly Capability: "capability";
@@ -12,12 +12,12 @@ export declare const Algorithm: {
12
12
  readonly Passthrough: "passthrough";
13
13
  };
14
14
  /**
15
- * 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, capability.
15
+ * 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.
16
16
  */
17
17
  export type Algorithm = OpenEnum<typeof Algorithm>;
18
18
  export type SwitchyardRouterPlugin = {
19
19
  /**
20
- * 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, capability.
20
+ * 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.
21
21
  */
22
22
  algorithm?: Algorithm | undefined;
23
23
  id: "switchyard-router";
@@ -5,7 +5,7 @@
5
5
  import * as z from "zod/v4";
6
6
  import * as openEnums from "../types/enums.js";
7
7
  /**
8
- * 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, capability.
8
+ * 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.
9
9
  */
10
10
  export const Algorithm = {
11
11
  Capability: "capability",
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.4.12",
5
+ "version": "1.4.14",
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": "1.4.12",
3
+ "version": "1.4.14",
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
- "compile": "tsc && node scripts/unbarrel-imports.js",
77
- "prepare": "npm run build",
78
- "test": "vitest --run --project unit",
79
- "typecheck:transit": "exit 0",
80
76
  "postinstall": "node scripts/check-types.js || true",
77
+ "prepare": "npm run build",
81
78
  "test:e2e": "vitest --run --project e2e",
82
79
  "test:transit": "exit 0",
83
- "test:watch": "vitest --watch --project unit",
84
- "typecheck": "tsc --noEmit"
80
+ "typecheck": "tsc --noEmit",
81
+ "typecheck:transit": "exit 0",
82
+ "compile": "tsc && node scripts/unbarrel-imports.js",
83
+ "test": "vitest --run --project unit",
84
+ "test:watch": "vitest --watch --project unit"
85
85
  },
86
86
  "peerDependencies": {
87
87