@openrouter/sdk 1.3.18 → 1.3.20
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/chatrequest.d.ts +5 -4
- package/esm/models/chatrequest.js +3 -0
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/esm/models/messagesrequest.d.ts +7 -4
- package/esm/models/messagesrequest.js +4 -0
- package/esm/models/responsesrequest.d.ts +5 -4
- package/esm/models/responsesrequest.js +3 -0
- package/esm/models/switchyardrouterplugin.d.ts +35 -0
- package/esm/models/switchyardrouterplugin.js +29 -0
- package/jsr.json +1 -1
- package/package.json +6 -6
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.3.
|
|
53
|
+
readonly sdkVersion: "1.3.20";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.3.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.3.20 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.3.
|
|
32
|
+
sdkVersion: "1.3.20",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.3.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.3.20 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -25,6 +25,7 @@ import { PromptCacheOptions, PromptCacheOptions$Outbound } from "./promptcacheop
|
|
|
25
25
|
import { ProviderPreferences, ProviderPreferences$Outbound } from "./providerpreferences.js";
|
|
26
26
|
import { ResponseHealingPlugin, ResponseHealingPlugin$Outbound } from "./responsehealingplugin.js";
|
|
27
27
|
import { StopServerToolsWhenCondition, StopServerToolsWhenCondition$Outbound } from "./stopservertoolswhencondition.js";
|
|
28
|
+
import { SwitchyardRouterPlugin, SwitchyardRouterPlugin$Outbound } from "./switchyardrouterplugin.js";
|
|
28
29
|
import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js";
|
|
29
30
|
import { WebFetchPlugin, WebFetchPlugin$Outbound } from "./webfetchplugin.js";
|
|
30
31
|
import { WebSearchPlugin, WebSearchPlugin$Outbound } from "./websearchplugin.js";
|
|
@@ -34,7 +35,7 @@ export declare const Modality: {
|
|
|
34
35
|
readonly Audio: "audio";
|
|
35
36
|
};
|
|
36
37
|
export type Modality = OpenEnum<typeof Modality>;
|
|
37
|
-
export type ChatRequestPlugin = AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | WebSearchPlugin | WebFetchPlugin;
|
|
38
|
+
export type ChatRequestPlugin = AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | SwitchyardRouterPlugin | WebSearchPlugin | WebFetchPlugin;
|
|
38
39
|
/**
|
|
39
40
|
* Constrains effort on reasoning for reasoning models
|
|
40
41
|
*/
|
|
@@ -173,7 +174,7 @@ export type ChatRequest = {
|
|
|
173
174
|
/**
|
|
174
175
|
* Plugins you want to enable for this request, including their settings.
|
|
175
176
|
*/
|
|
176
|
-
plugins?: Array<AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | WebSearchPlugin | WebFetchPlugin> | undefined;
|
|
177
|
+
plugins?: Array<AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | SwitchyardRouterPlugin | WebSearchPlugin | WebFetchPlugin> | undefined;
|
|
177
178
|
/**
|
|
178
179
|
* Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance.
|
|
179
180
|
*/
|
|
@@ -275,7 +276,7 @@ export type ChatRequest = {
|
|
|
275
276
|
/** @internal */
|
|
276
277
|
export declare const Modality$outboundSchema: z.ZodType<string, Modality>;
|
|
277
278
|
/** @internal */
|
|
278
|
-
export type ChatRequestPlugin$Outbound = AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound;
|
|
279
|
+
export type ChatRequestPlugin$Outbound = AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | SwitchyardRouterPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound;
|
|
279
280
|
/** @internal */
|
|
280
281
|
export declare const ChatRequestPlugin$outboundSchema: z.ZodType<ChatRequestPlugin$Outbound, ChatRequestPlugin>;
|
|
281
282
|
export declare function chatRequestPluginToJSON(chatRequestPlugin: ChatRequestPlugin): string;
|
|
@@ -326,7 +327,7 @@ export type ChatRequest$Outbound = {
|
|
|
326
327
|
model?: string | undefined;
|
|
327
328
|
models?: Array<string> | undefined;
|
|
328
329
|
parallel_tool_calls?: boolean | null | undefined;
|
|
329
|
-
plugins?: Array<AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound> | undefined;
|
|
330
|
+
plugins?: Array<AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | SwitchyardRouterPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound> | undefined;
|
|
330
331
|
prediction?: Prediction$Outbound | null | undefined;
|
|
331
332
|
presence_penalty?: number | null | undefined;
|
|
332
333
|
prompt_cache_key?: string | null | undefined;
|
|
@@ -30,6 +30,7 @@ import { PromptCacheOptions$outboundSchema, } from "./promptcacheoptions.js";
|
|
|
30
30
|
import { ProviderPreferences$outboundSchema, } from "./providerpreferences.js";
|
|
31
31
|
import { ResponseHealingPlugin$outboundSchema, } from "./responsehealingplugin.js";
|
|
32
32
|
import { StopServerToolsWhenCondition$outboundSchema, } from "./stopservertoolswhencondition.js";
|
|
33
|
+
import { SwitchyardRouterPlugin$outboundSchema, } from "./switchyardrouterplugin.js";
|
|
33
34
|
import { TraceConfig$outboundSchema, } from "./traceconfig.js";
|
|
34
35
|
import { WebFetchPlugin$outboundSchema, } from "./webfetchplugin.js";
|
|
35
36
|
import { WebSearchPlugin$outboundSchema, } from "./websearchplugin.js";
|
|
@@ -86,6 +87,7 @@ export const ChatRequestPlugin$outboundSchema = z.union([
|
|
|
86
87
|
ModerationPlugin$outboundSchema,
|
|
87
88
|
ParetoRouterPlugin$outboundSchema,
|
|
88
89
|
ResponseHealingPlugin$outboundSchema,
|
|
90
|
+
SwitchyardRouterPlugin$outboundSchema,
|
|
89
91
|
WebSearchPlugin$outboundSchema,
|
|
90
92
|
WebFetchPlugin$outboundSchema,
|
|
91
93
|
]);
|
|
@@ -152,6 +154,7 @@ export const ChatRequest$outboundSchema = z.object({
|
|
|
152
154
|
ModerationPlugin$outboundSchema,
|
|
153
155
|
ParetoRouterPlugin$outboundSchema,
|
|
154
156
|
ResponseHealingPlugin$outboundSchema,
|
|
157
|
+
SwitchyardRouterPlugin$outboundSchema,
|
|
155
158
|
WebSearchPlugin$outboundSchema,
|
|
156
159
|
WebFetchPlugin$outboundSchema,
|
|
157
160
|
])).optional(),
|
package/esm/models/index.d.ts
CHANGED
|
@@ -611,6 +611,7 @@ export * from "./subagentservertoolopenrouter.js";
|
|
|
611
611
|
export * from "./submitgenerationfeedbackrequest.js";
|
|
612
612
|
export * from "./submitgenerationfeedbackresponse.js";
|
|
613
613
|
export * from "./suspendinternresponse.js";
|
|
614
|
+
export * from "./switchyardrouterplugin.js";
|
|
614
615
|
export * from "./taskclassificationitem.js";
|
|
615
616
|
export * from "./taskclassificationmacrocategory.js";
|
|
616
617
|
export * from "./taskclassificationmodel.js";
|
package/esm/models/index.js
CHANGED
|
@@ -615,6 +615,7 @@ export * from "./subagentservertoolopenrouter.js";
|
|
|
615
615
|
export * from "./submitgenerationfeedbackrequest.js";
|
|
616
616
|
export * from "./submitgenerationfeedbackresponse.js";
|
|
617
617
|
export * from "./suspendinternresponse.js";
|
|
618
|
+
export * from "./switchyardrouterplugin.js";
|
|
618
619
|
export * from "./taskclassificationitem.js";
|
|
619
620
|
export * from "./taskclassificationmacrocategory.js";
|
|
620
621
|
export * from "./taskclassificationmodel.js";
|
|
@@ -33,6 +33,7 @@ import { ProviderPreferences, ProviderPreferences$Outbound } from "./providerpre
|
|
|
33
33
|
import { ResponseHealingPlugin, ResponseHealingPlugin$Outbound } from "./responsehealingplugin.js";
|
|
34
34
|
import { ShellServerToolOpenRouter, ShellServerToolOpenRouter$Outbound } from "./shellservertoolopenrouter.js";
|
|
35
35
|
import { StopServerToolsWhenCondition, StopServerToolsWhenCondition$Outbound } from "./stopservertoolswhencondition.js";
|
|
36
|
+
import { SwitchyardRouterPlugin, SwitchyardRouterPlugin$Outbound } from "./switchyardrouterplugin.js";
|
|
36
37
|
import { ToolSearchServerTool, ToolSearchServerTool$Outbound } from "./toolsearchservertool.js";
|
|
37
38
|
import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js";
|
|
38
39
|
import { WebFetchPlugin, WebFetchPlugin$Outbound } from "./webfetchplugin.js";
|
|
@@ -85,7 +86,7 @@ export type ContextManagement = {
|
|
|
85
86
|
export type MessagesRequestMetadata = {
|
|
86
87
|
userId?: string | null | undefined;
|
|
87
88
|
};
|
|
88
|
-
export type MessagesRequestPlugin = AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | WebSearchPlugin | WebFetchPlugin;
|
|
89
|
+
export type MessagesRequestPlugin = AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | SwitchyardRouterPlugin | WebSearchPlugin | WebFetchPlugin;
|
|
89
90
|
/**
|
|
90
91
|
* Controls output generation speed. When set to `fast`, uses a higher-speed inference configuration at premium pricing. Defaults to `standard` when omitted.
|
|
91
92
|
*/
|
|
@@ -251,6 +252,7 @@ export type ToolCustom = {
|
|
|
251
252
|
description?: string | undefined;
|
|
252
253
|
inputSchema: InputSchema;
|
|
253
254
|
name: string;
|
|
255
|
+
strict?: boolean | undefined;
|
|
254
256
|
type?: ToolTypeCustom | undefined;
|
|
255
257
|
};
|
|
256
258
|
export type MessagesRequestToolUnion = ToolAdvisor20260301 | ToolCustom | ToolBash20250124 | ToolTextEditor20250124 | ToolWebSearch20250305 | ToolWebSearch20260209 | AnthropicToolSearchToolBm25 | AnthropicToolSearchToolRegex | BashServerTool | DatetimeServerTool | ImageGenerationServerToolOpenRouter | MessagesSearchModelsServerTool | WebFetchServerTool | OpenRouterWebSearchServerTool | MessagesRequestTool | ShellServerToolOpenRouter | ToolSearchServerTool;
|
|
@@ -279,7 +281,7 @@ export type MessagesRequest = {
|
|
|
279
281
|
/**
|
|
280
282
|
* Plugins you want to enable for this request, including their settings.
|
|
281
283
|
*/
|
|
282
|
-
plugins?: Array<AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | WebSearchPlugin | WebFetchPlugin> | undefined;
|
|
284
|
+
plugins?: Array<AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | SwitchyardRouterPlugin | WebSearchPlugin | WebFetchPlugin> | undefined;
|
|
283
285
|
/**
|
|
284
286
|
* When multiple model providers are available, optionally indicate your routing preference.
|
|
285
287
|
*/
|
|
@@ -399,7 +401,7 @@ export type MessagesRequestMetadata$Outbound = {
|
|
|
399
401
|
export declare const MessagesRequestMetadata$outboundSchema: z.ZodType<MessagesRequestMetadata$Outbound, MessagesRequestMetadata>;
|
|
400
402
|
export declare function messagesRequestMetadataToJSON(messagesRequestMetadata: MessagesRequestMetadata): string;
|
|
401
403
|
/** @internal */
|
|
402
|
-
export type MessagesRequestPlugin$Outbound = AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound;
|
|
404
|
+
export type MessagesRequestPlugin$Outbound = AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | SwitchyardRouterPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound;
|
|
403
405
|
/** @internal */
|
|
404
406
|
export declare const MessagesRequestPlugin$outboundSchema: z.ZodType<MessagesRequestPlugin$Outbound, MessagesRequestPlugin>;
|
|
405
407
|
export declare function messagesRequestPluginToJSON(messagesRequestPlugin: MessagesRequestPlugin): string;
|
|
@@ -584,6 +586,7 @@ export type ToolCustom$Outbound = {
|
|
|
584
586
|
description?: string | undefined;
|
|
585
587
|
input_schema: InputSchema$Outbound;
|
|
586
588
|
name: string;
|
|
589
|
+
strict?: boolean | undefined;
|
|
587
590
|
type?: string | undefined;
|
|
588
591
|
};
|
|
589
592
|
/** @internal */
|
|
@@ -605,7 +608,7 @@ export type MessagesRequest$Outbound = {
|
|
|
605
608
|
model: string;
|
|
606
609
|
models?: Array<string> | undefined;
|
|
607
610
|
output_config?: MessagesOutputConfig$Outbound | undefined;
|
|
608
|
-
plugins?: Array<AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound> | undefined;
|
|
611
|
+
plugins?: Array<AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | SwitchyardRouterPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound> | undefined;
|
|
609
612
|
provider?: ProviderPreferences$Outbound | null | undefined;
|
|
610
613
|
safeguards?: Array<AnthropicSafeguard$Outbound> | null | undefined;
|
|
611
614
|
service_tier?: string | undefined;
|
|
@@ -38,6 +38,7 @@ import { ProviderPreferences$outboundSchema, } from "./providerpreferences.js";
|
|
|
38
38
|
import { ResponseHealingPlugin$outboundSchema, } from "./responsehealingplugin.js";
|
|
39
39
|
import { ShellServerToolOpenRouter$outboundSchema, } from "./shellservertoolopenrouter.js";
|
|
40
40
|
import { StopServerToolsWhenCondition$outboundSchema, } from "./stopservertoolswhencondition.js";
|
|
41
|
+
import { SwitchyardRouterPlugin$outboundSchema, } from "./switchyardrouterplugin.js";
|
|
41
42
|
import { ToolSearchServerTool$outboundSchema, } from "./toolsearchservertool.js";
|
|
42
43
|
import { TraceConfig$outboundSchema, } from "./traceconfig.js";
|
|
43
44
|
import { WebFetchPlugin$outboundSchema, } from "./webfetchplugin.js";
|
|
@@ -228,6 +229,7 @@ export const MessagesRequestPlugin$outboundSchema = z.union([
|
|
|
228
229
|
ModerationPlugin$outboundSchema,
|
|
229
230
|
ParetoRouterPlugin$outboundSchema,
|
|
230
231
|
ResponseHealingPlugin$outboundSchema,
|
|
232
|
+
SwitchyardRouterPlugin$outboundSchema,
|
|
231
233
|
WebSearchPlugin$outboundSchema,
|
|
232
234
|
WebFetchPlugin$outboundSchema,
|
|
233
235
|
]);
|
|
@@ -501,6 +503,7 @@ export const ToolCustom$outboundSchema = z.object({
|
|
|
501
503
|
description: z.string().optional(),
|
|
502
504
|
inputSchema: z.lazy(() => InputSchema$outboundSchema),
|
|
503
505
|
name: z.string(),
|
|
506
|
+
strict: z.boolean().optional(),
|
|
504
507
|
type: ToolTypeCustom$outboundSchema.optional(),
|
|
505
508
|
}).transform((v) => {
|
|
506
509
|
return remap$(v, {
|
|
@@ -557,6 +560,7 @@ export const MessagesRequest$outboundSchema = z.object({
|
|
|
557
560
|
ModerationPlugin$outboundSchema,
|
|
558
561
|
ParetoRouterPlugin$outboundSchema,
|
|
559
562
|
ResponseHealingPlugin$outboundSchema,
|
|
563
|
+
SwitchyardRouterPlugin$outboundSchema,
|
|
560
564
|
WebSearchPlugin$outboundSchema,
|
|
561
565
|
WebFetchPlugin$outboundSchema,
|
|
562
566
|
])).optional(),
|
|
@@ -47,6 +47,7 @@ import { ShellServerToolOpenRouter, ShellServerToolOpenRouter$Outbound } from ".
|
|
|
47
47
|
import { StopServerToolsWhenCondition, StopServerToolsWhenCondition$Outbound } from "./stopservertoolswhencondition.js";
|
|
48
48
|
import { StoredPromptTemplate, StoredPromptTemplate$Outbound } from "./storedprompttemplate.js";
|
|
49
49
|
import { SubagentServerToolOpenRouter, SubagentServerToolOpenRouter$Outbound } from "./subagentservertoolopenrouter.js";
|
|
50
|
+
import { SwitchyardRouterPlugin, SwitchyardRouterPlugin$Outbound } from "./switchyardrouterplugin.js";
|
|
50
51
|
import { TextExtendedConfig, TextExtendedConfig$Outbound } from "./textextendedconfig.js";
|
|
51
52
|
import { ToolSearchServerTool, ToolSearchServerTool$Outbound } from "./toolsearchservertool.js";
|
|
52
53
|
import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js";
|
|
@@ -55,7 +56,7 @@ import { WebFetchServerTool, WebFetchServerTool$Outbound } from "./webfetchserve
|
|
|
55
56
|
import { WebSearchPlugin, WebSearchPlugin$Outbound } from "./websearchplugin.js";
|
|
56
57
|
import { WebSearchServerTool, WebSearchServerTool$Outbound } from "./websearchservertool.js";
|
|
57
58
|
import { WebSearchServerToolOpenRouter, WebSearchServerToolOpenRouter$Outbound } from "./websearchservertoolopenrouter.js";
|
|
58
|
-
export type ResponsesRequestPlugin = AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | WebSearchPlugin | WebFetchPlugin;
|
|
59
|
+
export type ResponsesRequestPlugin = AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | SwitchyardRouterPlugin | WebSearchPlugin | WebFetchPlugin;
|
|
59
60
|
export type ReasoningConfig = {
|
|
60
61
|
/**
|
|
61
62
|
* Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer.
|
|
@@ -207,7 +208,7 @@ export type ResponsesRequest = {
|
|
|
207
208
|
/**
|
|
208
209
|
* Plugins you want to enable for this request, including their settings.
|
|
209
210
|
*/
|
|
210
|
-
plugins?: Array<AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | WebSearchPlugin | WebFetchPlugin> | undefined;
|
|
211
|
+
plugins?: Array<AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | SwitchyardRouterPlugin | WebSearchPlugin | WebFetchPlugin> | undefined;
|
|
211
212
|
presencePenalty?: number | null | undefined;
|
|
212
213
|
/**
|
|
213
214
|
* Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead.
|
|
@@ -320,7 +321,7 @@ export type ResponsesRequest = {
|
|
|
320
321
|
user?: string | undefined;
|
|
321
322
|
};
|
|
322
323
|
/** @internal */
|
|
323
|
-
export type ResponsesRequestPlugin$Outbound = AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound;
|
|
324
|
+
export type ResponsesRequestPlugin$Outbound = AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | SwitchyardRouterPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound;
|
|
324
325
|
/** @internal */
|
|
325
326
|
export declare const ResponsesRequestPlugin$outboundSchema: z.ZodType<ResponsesRequestPlugin$Outbound, ResponsesRequestPlugin>;
|
|
326
327
|
export declare function responsesRequestPluginToJSON(responsesRequestPlugin: ResponsesRequestPlugin): string;
|
|
@@ -433,7 +434,7 @@ export type ResponsesRequest$Outbound = {
|
|
|
433
434
|
model?: string | undefined;
|
|
434
435
|
models?: Array<string> | undefined;
|
|
435
436
|
parallel_tool_calls?: boolean | null | undefined;
|
|
436
|
-
plugins?: Array<AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound> | undefined;
|
|
437
|
+
plugins?: Array<AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | SwitchyardRouterPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound> | undefined;
|
|
437
438
|
presence_penalty?: number | null | undefined;
|
|
438
439
|
previous_response_id?: any | undefined;
|
|
439
440
|
prompt?: StoredPromptTemplate$Outbound | null | undefined;
|
|
@@ -52,6 +52,7 @@ import { ShellServerToolOpenRouter$outboundSchema, } from "./shellservertoolopen
|
|
|
52
52
|
import { StopServerToolsWhenCondition$outboundSchema, } from "./stopservertoolswhencondition.js";
|
|
53
53
|
import { StoredPromptTemplate$outboundSchema, } from "./storedprompttemplate.js";
|
|
54
54
|
import { SubagentServerToolOpenRouter$outboundSchema, } from "./subagentservertoolopenrouter.js";
|
|
55
|
+
import { SwitchyardRouterPlugin$outboundSchema, } from "./switchyardrouterplugin.js";
|
|
55
56
|
import { TextExtendedConfig$outboundSchema, } from "./textextendedconfig.js";
|
|
56
57
|
import { ToolSearchServerTool$outboundSchema, } from "./toolsearchservertool.js";
|
|
57
58
|
import { TraceConfig$outboundSchema, } from "./traceconfig.js";
|
|
@@ -81,6 +82,7 @@ export const ResponsesRequestPlugin$outboundSchema = z.union([
|
|
|
81
82
|
ModerationPlugin$outboundSchema,
|
|
82
83
|
ParetoRouterPlugin$outboundSchema,
|
|
83
84
|
ResponseHealingPlugin$outboundSchema,
|
|
85
|
+
SwitchyardRouterPlugin$outboundSchema,
|
|
84
86
|
WebSearchPlugin$outboundSchema,
|
|
85
87
|
WebFetchPlugin$outboundSchema,
|
|
86
88
|
]);
|
|
@@ -182,6 +184,7 @@ export const ResponsesRequest$outboundSchema = z.object({
|
|
|
182
184
|
ModerationPlugin$outboundSchema,
|
|
183
185
|
ParetoRouterPlugin$outboundSchema,
|
|
184
186
|
ResponseHealingPlugin$outboundSchema,
|
|
187
|
+
SwitchyardRouterPlugin$outboundSchema,
|
|
185
188
|
WebSearchPlugin$outboundSchema,
|
|
186
189
|
WebFetchPlugin$outboundSchema,
|
|
187
190
|
])).optional(),
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
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.
|
|
5
|
+
*/
|
|
6
|
+
export declare const Algorithm: {
|
|
7
|
+
readonly Capability: "capability";
|
|
8
|
+
readonly Stage: "stage";
|
|
9
|
+
readonly Auto: "auto";
|
|
10
|
+
readonly Random: "random";
|
|
11
|
+
readonly Composite: "composite";
|
|
12
|
+
readonly Passthrough: "passthrough";
|
|
13
|
+
};
|
|
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.
|
|
16
|
+
*/
|
|
17
|
+
export type Algorithm = OpenEnum<typeof Algorithm>;
|
|
18
|
+
export type SwitchyardRouterPlugin = {
|
|
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.
|
|
21
|
+
*/
|
|
22
|
+
algorithm?: Algorithm | undefined;
|
|
23
|
+
id: "switchyard-router";
|
|
24
|
+
};
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare const Algorithm$outboundSchema: z.ZodType<string, Algorithm>;
|
|
27
|
+
/** @internal */
|
|
28
|
+
export type SwitchyardRouterPlugin$Outbound = {
|
|
29
|
+
algorithm?: string | undefined;
|
|
30
|
+
id: "switchyard-router";
|
|
31
|
+
};
|
|
32
|
+
/** @internal */
|
|
33
|
+
export declare const SwitchyardRouterPlugin$outboundSchema: z.ZodType<SwitchyardRouterPlugin$Outbound, SwitchyardRouterPlugin>;
|
|
34
|
+
export declare function switchyardRouterPluginToJSON(switchyardRouterPlugin: SwitchyardRouterPlugin): string;
|
|
35
|
+
//# sourceMappingURL=switchyardrouterplugin.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 90395eb02944
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import * as openEnums from "../types/enums.js";
|
|
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.
|
|
9
|
+
*/
|
|
10
|
+
export const Algorithm = {
|
|
11
|
+
Capability: "capability",
|
|
12
|
+
Stage: "stage",
|
|
13
|
+
Auto: "auto",
|
|
14
|
+
Random: "random",
|
|
15
|
+
Composite: "composite",
|
|
16
|
+
Passthrough: "passthrough",
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const Algorithm$outboundSchema = openEnums
|
|
20
|
+
.outboundSchema(Algorithm);
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const SwitchyardRouterPlugin$outboundSchema = z.object({
|
|
23
|
+
algorithm: Algorithm$outboundSchema.optional(),
|
|
24
|
+
id: z.literal("switchyard-router"),
|
|
25
|
+
});
|
|
26
|
+
export function switchyardRouterPluginToJSON(switchyardRouterPlugin) {
|
|
27
|
+
return JSON.stringify(SwitchyardRouterPlugin$outboundSchema.parse(switchyardRouterPlugin));
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=switchyardrouterplugin.js.map
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.20",
|
|
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
|
+
"compile": "tsc",
|
|
76
77
|
"postinstall": "node scripts/check-types.js || true",
|
|
78
|
+
"test:e2e": "vitest --run --project e2e",
|
|
79
|
+
"test:watch": "vitest --watch --project unit",
|
|
80
|
+
"typecheck": "tsc --noEmit",
|
|
77
81
|
"prepare": "npm run build",
|
|
78
82
|
"test": "vitest --run --project unit",
|
|
79
83
|
"test:transit": "exit 0",
|
|
80
|
-
"
|
|
81
|
-
"typecheck:transit": "exit 0",
|
|
82
|
-
"test:e2e": "vitest --run --project e2e",
|
|
83
|
-
"typecheck": "tsc --noEmit",
|
|
84
|
-
"compile": "tsc"
|
|
84
|
+
"typecheck:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|