@openrouter/sdk 1.0.3 → 1.0.5
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/anthropictoolsearchtoolbm25.d.ts +41 -0
- package/esm/models/anthropictoolsearchtoolbm25.js +39 -0
- package/esm/models/anthropictoolsearchtoolregex.d.ts +41 -0
- package/esm/models/anthropictoolsearchtoolregex.js +39 -0
- package/esm/models/byokproviderslug.d.ts +1 -0
- package/esm/models/byokproviderslug.js +1 -0
- package/esm/models/chatrequest.d.ts +1 -1
- package/esm/models/imagegenerationproviderpreferences.d.ts +6 -0
- package/esm/models/imagegenerationproviderpreferences.js +1 -0
- package/esm/models/index.d.ts +2 -0
- package/esm/models/index.js +2 -0
- package/esm/models/messagesrequest.d.ts +7 -5
- package/esm/models/messagesrequest.js +6 -0
- package/esm/models/operations/listbyokkeys.d.ts +1 -0
- package/esm/models/operations/listbyokkeys.js +1 -0
- package/esm/models/providername.d.ts +1 -0
- package/esm/models/providername.js +1 -0
- package/esm/models/provideroptions.d.ts +6 -0
- package/esm/models/provideroptions.js +1 -0
- package/esm/models/providerresponse.d.ts +1 -0
- package/esm/models/providerresponse.js +1 -0
- package/esm/models/responsesrequest.d.ts +1 -1
- package/esm/models/videogenerationrequest.d.ts +6 -0
- package/esm/models/videogenerationrequest.js +1 -0
- package/jsr.json +1 -1
- package/package.json +6 -6
package/esm/lib/config.d.ts
CHANGED
|
@@ -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: "1.0.
|
|
52
|
+
readonly sdkVersion: "1.0.5";
|
|
53
53
|
readonly genVersion: "2.914.0";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.0.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.0.5 2.914.0 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: "1.0.
|
|
29
|
+
sdkVersion: "1.0.5",
|
|
30
30
|
genVersion: "2.914.0",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 1.0.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 1.0.5 2.914.0 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { AnthropicAllowedCallers } from "./anthropicallowedcallers.js";
|
|
4
|
+
import { AnthropicCacheControlDirective, AnthropicCacheControlDirective$Outbound } from "./anthropiccachecontroldirective.js";
|
|
5
|
+
export declare const AnthropicToolSearchToolBm25Name: {
|
|
6
|
+
readonly ToolSearchToolBm25: "tool_search_tool_bm25";
|
|
7
|
+
};
|
|
8
|
+
export type AnthropicToolSearchToolBm25Name = ClosedEnum<typeof AnthropicToolSearchToolBm25Name>;
|
|
9
|
+
export declare const AnthropicToolSearchToolBm25Type: {
|
|
10
|
+
readonly ToolSearchToolBm2520251119: "tool_search_tool_bm25_20251119";
|
|
11
|
+
readonly ToolSearchToolBm25: "tool_search_tool_bm25";
|
|
12
|
+
};
|
|
13
|
+
export type AnthropicToolSearchToolBm25Type = OpenEnum<typeof AnthropicToolSearchToolBm25Type>;
|
|
14
|
+
export type AnthropicToolSearchToolBm25 = {
|
|
15
|
+
allowedCallers?: Array<AnthropicAllowedCallers> | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.
|
|
18
|
+
*/
|
|
19
|
+
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
20
|
+
deferLoading?: boolean | undefined;
|
|
21
|
+
name: AnthropicToolSearchToolBm25Name;
|
|
22
|
+
strict?: boolean | undefined;
|
|
23
|
+
type: AnthropicToolSearchToolBm25Type;
|
|
24
|
+
};
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare const AnthropicToolSearchToolBm25Name$outboundSchema: z.ZodEnum<typeof AnthropicToolSearchToolBm25Name>;
|
|
27
|
+
/** @internal */
|
|
28
|
+
export declare const AnthropicToolSearchToolBm25Type$outboundSchema: z.ZodType<string, AnthropicToolSearchToolBm25Type>;
|
|
29
|
+
/** @internal */
|
|
30
|
+
export type AnthropicToolSearchToolBm25$Outbound = {
|
|
31
|
+
allowed_callers?: Array<string> | undefined;
|
|
32
|
+
cache_control?: AnthropicCacheControlDirective$Outbound | undefined;
|
|
33
|
+
defer_loading?: boolean | undefined;
|
|
34
|
+
name: string;
|
|
35
|
+
strict?: boolean | undefined;
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
/** @internal */
|
|
39
|
+
export declare const AnthropicToolSearchToolBm25$outboundSchema: z.ZodType<AnthropicToolSearchToolBm25$Outbound, AnthropicToolSearchToolBm25>;
|
|
40
|
+
export declare function anthropicToolSearchToolBm25ToJSON(anthropicToolSearchToolBm25: AnthropicToolSearchToolBm25): string;
|
|
41
|
+
//# sourceMappingURL=anthropictoolsearchtoolbm25.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: d06d81d905be
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import * as openEnums from "../types/enums.js";
|
|
8
|
+
import { AnthropicAllowedCallers$outboundSchema, } from "./anthropicallowedcallers.js";
|
|
9
|
+
import { AnthropicCacheControlDirective$outboundSchema, } from "./anthropiccachecontroldirective.js";
|
|
10
|
+
export const AnthropicToolSearchToolBm25Name = {
|
|
11
|
+
ToolSearchToolBm25: "tool_search_tool_bm25",
|
|
12
|
+
};
|
|
13
|
+
export const AnthropicToolSearchToolBm25Type = {
|
|
14
|
+
ToolSearchToolBm2520251119: "tool_search_tool_bm25_20251119",
|
|
15
|
+
ToolSearchToolBm25: "tool_search_tool_bm25",
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const AnthropicToolSearchToolBm25Name$outboundSchema = z.enum(AnthropicToolSearchToolBm25Name);
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const AnthropicToolSearchToolBm25Type$outboundSchema = openEnums.outboundSchema(AnthropicToolSearchToolBm25Type);
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const AnthropicToolSearchToolBm25$outboundSchema = z.object({
|
|
23
|
+
allowedCallers: z.array(AnthropicAllowedCallers$outboundSchema).optional(),
|
|
24
|
+
cacheControl: AnthropicCacheControlDirective$outboundSchema.optional(),
|
|
25
|
+
deferLoading: z.boolean().optional(),
|
|
26
|
+
name: AnthropicToolSearchToolBm25Name$outboundSchema,
|
|
27
|
+
strict: z.boolean().optional(),
|
|
28
|
+
type: AnthropicToolSearchToolBm25Type$outboundSchema,
|
|
29
|
+
}).transform((v) => {
|
|
30
|
+
return remap$(v, {
|
|
31
|
+
allowedCallers: "allowed_callers",
|
|
32
|
+
cacheControl: "cache_control",
|
|
33
|
+
deferLoading: "defer_loading",
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
export function anthropicToolSearchToolBm25ToJSON(anthropicToolSearchToolBm25) {
|
|
37
|
+
return JSON.stringify(AnthropicToolSearchToolBm25$outboundSchema.parse(anthropicToolSearchToolBm25));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=anthropictoolsearchtoolbm25.js.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { AnthropicAllowedCallers } from "./anthropicallowedcallers.js";
|
|
4
|
+
import { AnthropicCacheControlDirective, AnthropicCacheControlDirective$Outbound } from "./anthropiccachecontroldirective.js";
|
|
5
|
+
export declare const AnthropicToolSearchToolRegexName: {
|
|
6
|
+
readonly ToolSearchToolRegex: "tool_search_tool_regex";
|
|
7
|
+
};
|
|
8
|
+
export type AnthropicToolSearchToolRegexName = ClosedEnum<typeof AnthropicToolSearchToolRegexName>;
|
|
9
|
+
export declare const AnthropicToolSearchToolRegexType: {
|
|
10
|
+
readonly ToolSearchToolRegex20251119: "tool_search_tool_regex_20251119";
|
|
11
|
+
readonly ToolSearchToolRegex: "tool_search_tool_regex";
|
|
12
|
+
};
|
|
13
|
+
export type AnthropicToolSearchToolRegexType = OpenEnum<typeof AnthropicToolSearchToolRegexType>;
|
|
14
|
+
export type AnthropicToolSearchToolRegex = {
|
|
15
|
+
allowedCallers?: Array<AnthropicAllowedCallers> | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.
|
|
18
|
+
*/
|
|
19
|
+
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
20
|
+
deferLoading?: boolean | undefined;
|
|
21
|
+
name: AnthropicToolSearchToolRegexName;
|
|
22
|
+
strict?: boolean | undefined;
|
|
23
|
+
type: AnthropicToolSearchToolRegexType;
|
|
24
|
+
};
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare const AnthropicToolSearchToolRegexName$outboundSchema: z.ZodEnum<typeof AnthropicToolSearchToolRegexName>;
|
|
27
|
+
/** @internal */
|
|
28
|
+
export declare const AnthropicToolSearchToolRegexType$outboundSchema: z.ZodType<string, AnthropicToolSearchToolRegexType>;
|
|
29
|
+
/** @internal */
|
|
30
|
+
export type AnthropicToolSearchToolRegex$Outbound = {
|
|
31
|
+
allowed_callers?: Array<string> | undefined;
|
|
32
|
+
cache_control?: AnthropicCacheControlDirective$Outbound | undefined;
|
|
33
|
+
defer_loading?: boolean | undefined;
|
|
34
|
+
name: string;
|
|
35
|
+
strict?: boolean | undefined;
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
/** @internal */
|
|
39
|
+
export declare const AnthropicToolSearchToolRegex$outboundSchema: z.ZodType<AnthropicToolSearchToolRegex$Outbound, AnthropicToolSearchToolRegex>;
|
|
40
|
+
export declare function anthropicToolSearchToolRegexToJSON(anthropicToolSearchToolRegex: AnthropicToolSearchToolRegex): string;
|
|
41
|
+
//# sourceMappingURL=anthropictoolsearchtoolregex.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 70c2d1fd66ec
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import * as openEnums from "../types/enums.js";
|
|
8
|
+
import { AnthropicAllowedCallers$outboundSchema, } from "./anthropicallowedcallers.js";
|
|
9
|
+
import { AnthropicCacheControlDirective$outboundSchema, } from "./anthropiccachecontroldirective.js";
|
|
10
|
+
export const AnthropicToolSearchToolRegexName = {
|
|
11
|
+
ToolSearchToolRegex: "tool_search_tool_regex",
|
|
12
|
+
};
|
|
13
|
+
export const AnthropicToolSearchToolRegexType = {
|
|
14
|
+
ToolSearchToolRegex20251119: "tool_search_tool_regex_20251119",
|
|
15
|
+
ToolSearchToolRegex: "tool_search_tool_regex",
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const AnthropicToolSearchToolRegexName$outboundSchema = z.enum(AnthropicToolSearchToolRegexName);
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const AnthropicToolSearchToolRegexType$outboundSchema = openEnums.outboundSchema(AnthropicToolSearchToolRegexType);
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const AnthropicToolSearchToolRegex$outboundSchema = z.object({
|
|
23
|
+
allowedCallers: z.array(AnthropicAllowedCallers$outboundSchema).optional(),
|
|
24
|
+
cacheControl: AnthropicCacheControlDirective$outboundSchema.optional(),
|
|
25
|
+
deferLoading: z.boolean().optional(),
|
|
26
|
+
name: AnthropicToolSearchToolRegexName$outboundSchema,
|
|
27
|
+
strict: z.boolean().optional(),
|
|
28
|
+
type: AnthropicToolSearchToolRegexType$outboundSchema,
|
|
29
|
+
}).transform((v) => {
|
|
30
|
+
return remap$(v, {
|
|
31
|
+
allowedCallers: "allowed_callers",
|
|
32
|
+
cacheControl: "cache_control",
|
|
33
|
+
deferLoading: "defer_loading",
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
export function anthropicToolSearchToolRegexToJSON(anthropicToolSearchToolRegex) {
|
|
37
|
+
return JSON.stringify(AnthropicToolSearchToolRegex$outboundSchema.parse(anthropicToolSearchToolRegex));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=anthropictoolsearchtoolregex.js.map
|
|
@@ -79,6 +79,7 @@ export declare const BYOKProviderSlug: {
|
|
|
79
79
|
readonly Recraft: "recraft";
|
|
80
80
|
readonly Reka: "reka";
|
|
81
81
|
readonly Relace: "relace";
|
|
82
|
+
readonly Runway: "runway";
|
|
82
83
|
readonly SailResearch: "sail-research";
|
|
83
84
|
readonly Sakana: "sakana";
|
|
84
85
|
readonly Sambanova: "sambanova";
|
|
@@ -223,7 +223,7 @@ export type ChatRequest = {
|
|
|
223
223
|
*/
|
|
224
224
|
stop?: string | Array<string> | null | undefined;
|
|
225
225
|
/**
|
|
226
|
-
* Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`.
|
|
226
|
+
* Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`. When a condition fires while the model is still emitting tool calls, the pending tool calls are executed and one final turn is made with tool calls disabled so the response ends with a natural-language answer instead of an unfinished tool call.
|
|
227
227
|
*/
|
|
228
228
|
stopServerToolsWhen?: Array<StopServerToolsWhenCondition> | undefined;
|
|
229
229
|
/**
|
|
@@ -308,6 +308,9 @@ export type ImageGenerationProviderPreferencesOptions = {
|
|
|
308
308
|
replicate?: {
|
|
309
309
|
[k: string]: any;
|
|
310
310
|
} | undefined;
|
|
311
|
+
runway?: {
|
|
312
|
+
[k: string]: any;
|
|
313
|
+
} | undefined;
|
|
311
314
|
sailResearch?: {
|
|
312
315
|
[k: string]: any;
|
|
313
316
|
} | undefined;
|
|
@@ -731,6 +734,9 @@ export type ImageGenerationProviderPreferencesOptions$Outbound = {
|
|
|
731
734
|
replicate?: {
|
|
732
735
|
[k: string]: any;
|
|
733
736
|
} | undefined;
|
|
737
|
+
runway?: {
|
|
738
|
+
[k: string]: any;
|
|
739
|
+
} | undefined;
|
|
734
740
|
"sail-research"?: {
|
|
735
741
|
[k: string]: any;
|
|
736
742
|
} | undefined;
|
|
@@ -119,6 +119,7 @@ export const ImageGenerationProviderPreferencesOptions$outboundSchema = z.object
|
|
|
119
119
|
reka: z.record(z.string(), z.any()).optional(),
|
|
120
120
|
relace: z.record(z.string(), z.any()).optional(),
|
|
121
121
|
replicate: z.record(z.string(), z.any()).optional(),
|
|
122
|
+
runway: z.record(z.string(), z.any()).optional(),
|
|
122
123
|
sailResearch: z.record(z.string(), z.any()).optional(),
|
|
123
124
|
sakana: z.record(z.string(), z.any()).optional(),
|
|
124
125
|
sambanova: z.record(z.string(), z.any()).optional(),
|
package/esm/models/index.d.ts
CHANGED
|
@@ -35,6 +35,8 @@ export * from "./anthropicspeed.js";
|
|
|
35
35
|
export * from "./anthropictextblockparam.js";
|
|
36
36
|
export * from "./anthropicthinkingdisplay.js";
|
|
37
37
|
export * from "./anthropicthinkingturns.js";
|
|
38
|
+
export * from "./anthropictoolsearchtoolbm25.js";
|
|
39
|
+
export * from "./anthropictoolsearchtoolregex.js";
|
|
38
40
|
export * from "./anthropictooluseskeep.js";
|
|
39
41
|
export * from "./anthropictoolusestrigger.js";
|
|
40
42
|
export * from "./anthropicunknownusageiteration.js";
|
package/esm/models/index.js
CHANGED
|
@@ -39,6 +39,8 @@ export * from "./anthropicspeed.js";
|
|
|
39
39
|
export * from "./anthropictextblockparam.js";
|
|
40
40
|
export * from "./anthropicthinkingdisplay.js";
|
|
41
41
|
export * from "./anthropicthinkingturns.js";
|
|
42
|
+
export * from "./anthropictoolsearchtoolbm25.js";
|
|
43
|
+
export * from "./anthropictoolsearchtoolregex.js";
|
|
42
44
|
export * from "./anthropictooluseskeep.js";
|
|
43
45
|
export * from "./anthropictoolusestrigger.js";
|
|
44
46
|
export * from "./anthropicunknownusageiteration.js";
|
|
@@ -7,6 +7,8 @@ import { AnthropicInputTokensTrigger, AnthropicInputTokensTrigger$Outbound } fro
|
|
|
7
7
|
import { AnthropicTextBlockParam, AnthropicTextBlockParam$Outbound } from "./anthropictextblockparam.js";
|
|
8
8
|
import { AnthropicThinkingDisplay } from "./anthropicthinkingdisplay.js";
|
|
9
9
|
import { AnthropicThinkingTurns, AnthropicThinkingTurns$Outbound } from "./anthropicthinkingturns.js";
|
|
10
|
+
import { AnthropicToolSearchToolBm25, AnthropicToolSearchToolBm25$Outbound } from "./anthropictoolsearchtoolbm25.js";
|
|
11
|
+
import { AnthropicToolSearchToolRegex, AnthropicToolSearchToolRegex$Outbound } from "./anthropictoolsearchtoolregex.js";
|
|
10
12
|
import { AnthropicToolUsesKeep, AnthropicToolUsesKeep$Outbound } from "./anthropictooluseskeep.js";
|
|
11
13
|
import { AnthropicToolUsesTrigger, AnthropicToolUsesTrigger$Outbound } from "./anthropictoolusestrigger.js";
|
|
12
14
|
import { AnthropicWebSearchToolUserLocation, AnthropicWebSearchToolUserLocation$Outbound } from "./anthropicwebsearchtooluserlocation.js";
|
|
@@ -244,7 +246,7 @@ export type ToolCustom = {
|
|
|
244
246
|
name: string;
|
|
245
247
|
type?: ToolTypeCustom | undefined;
|
|
246
248
|
};
|
|
247
|
-
export type MessagesRequestToolUnion = ToolAdvisor20260301 | ToolCustom | ToolBash20250124 | ToolTextEditor20250124 | ToolWebSearch20250305 | ToolWebSearch20260209 | BashServerTool | DatetimeServerTool | ImageGenerationServerToolOpenRouter | MessagesSearchModelsServerTool | WebFetchServerTool | OpenRouterWebSearchServerTool | MessagesRequestTool;
|
|
249
|
+
export type MessagesRequestToolUnion = ToolAdvisor20260301 | ToolCustom | ToolBash20250124 | ToolTextEditor20250124 | ToolWebSearch20250305 | ToolWebSearch20260209 | AnthropicToolSearchToolBm25 | AnthropicToolSearchToolRegex | BashServerTool | DatetimeServerTool | ImageGenerationServerToolOpenRouter | MessagesSearchModelsServerTool | WebFetchServerTool | OpenRouterWebSearchServerTool | MessagesRequestTool;
|
|
248
250
|
/**
|
|
249
251
|
* Request schema for Anthropic Messages API endpoint
|
|
250
252
|
*/
|
|
@@ -283,7 +285,7 @@ export type MessagesRequest = {
|
|
|
283
285
|
speed?: Speed | null | undefined;
|
|
284
286
|
stopSequences?: Array<string> | undefined;
|
|
285
287
|
/**
|
|
286
|
-
* Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`.
|
|
288
|
+
* Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`. When a condition fires while the model is still emitting tool calls, the pending tool calls are executed and one final turn is made with tool calls disabled so the response ends with a natural-language answer instead of an unfinished tool call.
|
|
287
289
|
*/
|
|
288
290
|
stopServerToolsWhen?: Array<StopServerToolsWhenCondition> | undefined;
|
|
289
291
|
stream?: boolean | undefined;
|
|
@@ -291,7 +293,7 @@ export type MessagesRequest = {
|
|
|
291
293
|
temperature?: number | undefined;
|
|
292
294
|
thinking?: ThinkingEnabled | ThinkingDisabled | ThinkingAdaptive | undefined;
|
|
293
295
|
toolChoice?: ToolChoiceAuto | ToolChoiceAny | ToolChoiceNone | ToolChoiceTool | undefined;
|
|
294
|
-
tools?: Array<ToolAdvisor20260301 | ToolCustom | ToolBash20250124 | ToolTextEditor20250124 | ToolWebSearch20250305 | ToolWebSearch20260209 | BashServerTool | DatetimeServerTool | ImageGenerationServerToolOpenRouter | MessagesSearchModelsServerTool | WebFetchServerTool | OpenRouterWebSearchServerTool | MessagesRequestTool> | undefined;
|
|
296
|
+
tools?: Array<ToolAdvisor20260301 | ToolCustom | ToolBash20250124 | ToolTextEditor20250124 | ToolWebSearch20250305 | ToolWebSearch20260209 | AnthropicToolSearchToolBm25 | AnthropicToolSearchToolRegex | BashServerTool | DatetimeServerTool | ImageGenerationServerToolOpenRouter | MessagesSearchModelsServerTool | WebFetchServerTool | OpenRouterWebSearchServerTool | MessagesRequestTool> | undefined;
|
|
295
297
|
topK?: number | undefined;
|
|
296
298
|
topP?: number | undefined;
|
|
297
299
|
/**
|
|
@@ -577,7 +579,7 @@ export type ToolCustom$Outbound = {
|
|
|
577
579
|
export declare const ToolCustom$outboundSchema: z.ZodType<ToolCustom$Outbound, ToolCustom>;
|
|
578
580
|
export declare function toolCustomToJSON(toolCustom: ToolCustom): string;
|
|
579
581
|
/** @internal */
|
|
580
|
-
export type MessagesRequestToolUnion$Outbound = ToolAdvisor20260301$Outbound | ToolCustom$Outbound | ToolBash20250124$Outbound | ToolTextEditor20250124$Outbound | ToolWebSearch20250305$Outbound | ToolWebSearch20260209$Outbound | BashServerTool$Outbound | DatetimeServerTool$Outbound | ImageGenerationServerToolOpenRouter$Outbound | MessagesSearchModelsServerTool$Outbound | WebFetchServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | MessagesRequestTool$Outbound;
|
|
582
|
+
export type MessagesRequestToolUnion$Outbound = ToolAdvisor20260301$Outbound | ToolCustom$Outbound | ToolBash20250124$Outbound | ToolTextEditor20250124$Outbound | ToolWebSearch20250305$Outbound | ToolWebSearch20260209$Outbound | AnthropicToolSearchToolBm25$Outbound | AnthropicToolSearchToolRegex$Outbound | BashServerTool$Outbound | DatetimeServerTool$Outbound | ImageGenerationServerToolOpenRouter$Outbound | MessagesSearchModelsServerTool$Outbound | WebFetchServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | MessagesRequestTool$Outbound;
|
|
581
583
|
/** @internal */
|
|
582
584
|
export declare const MessagesRequestToolUnion$outboundSchema: z.ZodType<MessagesRequestToolUnion$Outbound, MessagesRequestToolUnion>;
|
|
583
585
|
export declare function messagesRequestToolUnionToJSON(messagesRequestToolUnion: MessagesRequestToolUnion): string;
|
|
@@ -604,7 +606,7 @@ export type MessagesRequest$Outbound = {
|
|
|
604
606
|
temperature?: number | undefined;
|
|
605
607
|
thinking?: ThinkingEnabled$Outbound | ThinkingDisabled$Outbound | ThinkingAdaptive$Outbound | undefined;
|
|
606
608
|
tool_choice?: ToolChoiceAuto$Outbound | ToolChoiceAny$Outbound | ToolChoiceNone$Outbound | ToolChoiceTool$Outbound | undefined;
|
|
607
|
-
tools?: Array<ToolAdvisor20260301$Outbound | ToolCustom$Outbound | ToolBash20250124$Outbound | ToolTextEditor20250124$Outbound | ToolWebSearch20250305$Outbound | ToolWebSearch20260209$Outbound | BashServerTool$Outbound | DatetimeServerTool$Outbound | ImageGenerationServerToolOpenRouter$Outbound | MessagesSearchModelsServerTool$Outbound | WebFetchServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | MessagesRequestTool$Outbound> | undefined;
|
|
609
|
+
tools?: Array<ToolAdvisor20260301$Outbound | ToolCustom$Outbound | ToolBash20250124$Outbound | ToolTextEditor20250124$Outbound | ToolWebSearch20250305$Outbound | ToolWebSearch20260209$Outbound | AnthropicToolSearchToolBm25$Outbound | AnthropicToolSearchToolRegex$Outbound | BashServerTool$Outbound | DatetimeServerTool$Outbound | ImageGenerationServerToolOpenRouter$Outbound | MessagesSearchModelsServerTool$Outbound | WebFetchServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | MessagesRequestTool$Outbound> | undefined;
|
|
608
610
|
top_k?: number | undefined;
|
|
609
611
|
top_p?: number | undefined;
|
|
610
612
|
trace?: TraceConfig$Outbound | undefined;
|
|
@@ -12,6 +12,8 @@ import { AnthropicInputTokensTrigger$outboundSchema, } from "./anthropicinputtok
|
|
|
12
12
|
import { AnthropicTextBlockParam$outboundSchema, } from "./anthropictextblockparam.js";
|
|
13
13
|
import { AnthropicThinkingDisplay$outboundSchema, } from "./anthropicthinkingdisplay.js";
|
|
14
14
|
import { AnthropicThinkingTurns$outboundSchema, } from "./anthropicthinkingturns.js";
|
|
15
|
+
import { AnthropicToolSearchToolBm25$outboundSchema, } from "./anthropictoolsearchtoolbm25.js";
|
|
16
|
+
import { AnthropicToolSearchToolRegex$outboundSchema, } from "./anthropictoolsearchtoolregex.js";
|
|
15
17
|
import { AnthropicToolUsesKeep$outboundSchema, } from "./anthropictooluseskeep.js";
|
|
16
18
|
import { AnthropicToolUsesTrigger$outboundSchema, } from "./anthropictoolusestrigger.js";
|
|
17
19
|
import { AnthropicWebSearchToolUserLocation$outboundSchema, } from "./anthropicwebsearchtooluserlocation.js";
|
|
@@ -503,6 +505,8 @@ export const MessagesRequestToolUnion$outboundSchema = z.union([
|
|
|
503
505
|
z.lazy(() => ToolTextEditor20250124$outboundSchema),
|
|
504
506
|
z.lazy(() => ToolWebSearch20250305$outboundSchema),
|
|
505
507
|
z.lazy(() => ToolWebSearch20260209$outboundSchema),
|
|
508
|
+
AnthropicToolSearchToolBm25$outboundSchema,
|
|
509
|
+
AnthropicToolSearchToolRegex$outboundSchema,
|
|
506
510
|
BashServerTool$outboundSchema,
|
|
507
511
|
DatetimeServerTool$outboundSchema,
|
|
508
512
|
ImageGenerationServerToolOpenRouter$outboundSchema,
|
|
@@ -568,6 +572,8 @@ export const MessagesRequest$outboundSchema = z.object({
|
|
|
568
572
|
z.lazy(() => ToolTextEditor20250124$outboundSchema),
|
|
569
573
|
z.lazy(() => ToolWebSearch20250305$outboundSchema),
|
|
570
574
|
z.lazy(() => ToolWebSearch20260209$outboundSchema),
|
|
575
|
+
AnthropicToolSearchToolBm25$outboundSchema,
|
|
576
|
+
AnthropicToolSearchToolRegex$outboundSchema,
|
|
571
577
|
BashServerTool$outboundSchema,
|
|
572
578
|
DatetimeServerTool$outboundSchema,
|
|
573
579
|
ImageGenerationServerToolOpenRouter$outboundSchema,
|
|
@@ -103,6 +103,7 @@ export declare const Provider: {
|
|
|
103
103
|
readonly Recraft: "recraft";
|
|
104
104
|
readonly Reka: "reka";
|
|
105
105
|
readonly Relace: "relace";
|
|
106
|
+
readonly Runway: "runway";
|
|
106
107
|
readonly SailResearch: "sail-research";
|
|
107
108
|
readonly Sakana: "sakana";
|
|
108
109
|
readonly Sambanova: "sambanova";
|
|
@@ -303,6 +303,9 @@ export type ProviderOptions = {
|
|
|
303
303
|
replicate?: {
|
|
304
304
|
[k: string]: any;
|
|
305
305
|
} | undefined;
|
|
306
|
+
runway?: {
|
|
307
|
+
[k: string]: any;
|
|
308
|
+
} | undefined;
|
|
306
309
|
sailResearch?: {
|
|
307
310
|
[k: string]: any;
|
|
308
311
|
} | undefined;
|
|
@@ -681,6 +684,9 @@ export type ProviderOptions$Outbound = {
|
|
|
681
684
|
replicate?: {
|
|
682
685
|
[k: string]: any;
|
|
683
686
|
} | undefined;
|
|
687
|
+
runway?: {
|
|
688
|
+
[k: string]: any;
|
|
689
|
+
} | undefined;
|
|
684
690
|
"sail-research"?: {
|
|
685
691
|
[k: string]: any;
|
|
686
692
|
} | undefined;
|
|
@@ -106,6 +106,7 @@ export const ProviderOptions$outboundSchema = z.object({
|
|
|
106
106
|
reka: z.record(z.string(), z.any()).optional(),
|
|
107
107
|
relace: z.record(z.string(), z.any()).optional(),
|
|
108
108
|
replicate: z.record(z.string(), z.any()).optional(),
|
|
109
|
+
runway: z.record(z.string(), z.any()).optional(),
|
|
109
110
|
sailResearch: z.record(z.string(), z.any()).optional(),
|
|
110
111
|
sakana: z.record(z.string(), z.any()).optional(),
|
|
111
112
|
sambanova: z.record(z.string(), z.any()).optional(),
|
|
@@ -216,7 +216,7 @@ export type ResponsesRequest = {
|
|
|
216
216
|
*/
|
|
217
217
|
sessionId?: string | undefined;
|
|
218
218
|
/**
|
|
219
|
-
* Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`.
|
|
219
|
+
* Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`. When a condition fires while the model is still emitting tool calls, the pending tool calls are executed and one final turn is made with tool calls disabled so the response ends with a natural-language answer instead of an unfinished tool call.
|
|
220
220
|
*/
|
|
221
221
|
stopServerToolsWhen?: Array<StopServerToolsWhenCondition> | undefined;
|
|
222
222
|
store?: false | undefined;
|
|
@@ -324,6 +324,9 @@ export type VideoGenerationRequestOptions = {
|
|
|
324
324
|
replicate?: {
|
|
325
325
|
[k: string]: any;
|
|
326
326
|
} | undefined;
|
|
327
|
+
runway?: {
|
|
328
|
+
[k: string]: any;
|
|
329
|
+
} | undefined;
|
|
327
330
|
sailResearch?: {
|
|
328
331
|
[k: string]: any;
|
|
329
332
|
} | undefined;
|
|
@@ -772,6 +775,9 @@ export type VideoGenerationRequestOptions$Outbound = {
|
|
|
772
775
|
replicate?: {
|
|
773
776
|
[k: string]: any;
|
|
774
777
|
} | undefined;
|
|
778
|
+
runway?: {
|
|
779
|
+
[k: string]: any;
|
|
780
|
+
} | undefined;
|
|
775
781
|
"sail-research"?: {
|
|
776
782
|
[k: string]: any;
|
|
777
783
|
} | undefined;
|
|
@@ -136,6 +136,7 @@ export const VideoGenerationRequestOptions$outboundSchema = z.object({
|
|
|
136
136
|
reka: z.record(z.string(), z.any()).optional(),
|
|
137
137
|
relace: z.record(z.string(), z.any()).optional(),
|
|
138
138
|
replicate: z.record(z.string(), z.any()).optional(),
|
|
139
|
+
runway: z.record(z.string(), z.any()).optional(),
|
|
139
140
|
sailResearch: z.record(z.string(), z.any()).optional(),
|
|
140
141
|
sakana: z.record(z.string(), z.any()).optional(),
|
|
141
142
|
sambanova: z.record(z.string(), z.any()).optional(),
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
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",
|
|
77
|
-
"test": "vitest --run --project unit",
|
|
78
76
|
"test:e2e": "vitest --run --project e2e",
|
|
79
|
-
"test:transit": "exit 0",
|
|
80
77
|
"test:watch": "vitest --watch --project unit",
|
|
81
78
|
"typecheck": "tsc --noEmit",
|
|
79
|
+
"test": "vitest --run --project unit",
|
|
80
|
+
"test:transit": "exit 0",
|
|
81
|
+
"typecheck:transit": "exit 0",
|
|
82
|
+
"compile": "tsc",
|
|
82
83
|
"postinstall": "node scripts/check-types.js || true",
|
|
83
|
-
"prepare": "npm run build"
|
|
84
|
-
"typecheck:transit": "exit 0"
|
|
84
|
+
"prepare": "npm run build"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|