@openrouter/sdk 1.2.117 → 1.2.118

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.2.117";
53
+ readonly sdkVersion: "1.2.118";
54
54
  readonly genVersion: "2.914.0";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.2.117 2.914.0 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.2.118 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.2.117",
32
+ sdkVersion: "1.2.118",
33
33
  genVersion: "2.914.0",
34
- userAgent: "speakeasy-sdk/typescript 1.2.117 2.914.0 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.2.118 2.914.0 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -59,6 +59,10 @@ export type AdditionalToolsItemToolFunction = {
59
59
  } | null;
60
60
  strict?: boolean | null | undefined;
61
61
  type: AdditionalToolsItemTypeFunction;
62
+ /**
63
+ * Lets the model keep working after calling this tool instead of waiting for its output. The tool is still executed by the client; return the result in a later request as a `function_call_output` with the original `call_id`. Only honored by providers whose Responses API supports async tools; ignored elsewhere.
64
+ */
65
+ async?: boolean | undefined;
62
66
  /**
63
67
  * Withhold this tool from the model until `openrouter:tool_search` finds it. Requires the tool search server tool; at least one tool must remain non-deferred.
64
68
  */
@@ -99,6 +103,7 @@ export type AdditionalToolsItemToolFunction$Outbound = {
99
103
  } | null;
100
104
  strict?: boolean | null | undefined;
101
105
  type: string;
106
+ async?: boolean | undefined;
102
107
  defer_loading?: boolean | undefined;
103
108
  };
104
109
  /** @internal */
@@ -74,6 +74,7 @@ export const AdditionalToolsItemToolFunction$outboundSchema = z.object({
74
74
  parameters: z.nullable(z.record(z.string(), z.any())),
75
75
  strict: z.nullable(z.boolean()).optional(),
76
76
  type: AdditionalToolsItemTypeFunction$outboundSchema,
77
+ async: z.boolean().optional(),
77
78
  deferLoading: z.boolean().optional(),
78
79
  }).transform((v) => {
79
80
  return remap$(v, {
@@ -25,6 +25,10 @@ export type CustomToolTypeCustom = ClosedEnum<typeof CustomToolTypeCustom>;
25
25
  * Custom tool configuration
26
26
  */
27
27
  export type CustomTool = {
28
+ /**
29
+ * Lets the model keep working after calling this tool instead of waiting for its output. The tool is still executed by the client; return the result in a later request as a `function_call_output` with the original `call_id`. Only honored by providers whose Responses API supports async tools; ignored elsewhere.
30
+ */
31
+ async?: boolean | undefined;
28
32
  description?: string | undefined;
29
33
  format?: FormatText | FormatGrammar | discriminatedUnionTypes.Unknown<"type"> | undefined;
30
34
  name: string;
@@ -72,6 +76,7 @@ export declare const CustomToolTypeCustom$outboundSchema: z.ZodEnum<typeof Custo
72
76
  export declare const CustomTool$inboundSchema: z.ZodType<CustomTool, unknown>;
73
77
  /** @internal */
74
78
  export type CustomTool$Outbound = {
79
+ async?: boolean | undefined;
75
80
  description?: string | undefined;
76
81
  format?: FormatText$Outbound | FormatGrammar$Outbound | undefined;
77
82
  name: string;
@@ -77,6 +77,7 @@ export const CustomToolTypeCustom$outboundSchema = CustomToolTypeCustom$inboundS
77
77
  /** @internal */
78
78
  export const CustomTool$inboundSchema = z
79
79
  .object({
80
+ async: z.boolean().optional(),
80
81
  description: z.string().optional(),
81
82
  format: discriminatedUnion("type", {
82
83
  text: z.lazy(() => FormatText$inboundSchema),
@@ -87,6 +88,7 @@ export const CustomTool$inboundSchema = z
87
88
  });
88
89
  /** @internal */
89
90
  export const CustomTool$outboundSchema = z.object({
91
+ async: z.boolean().optional(),
90
92
  description: z.string().optional(),
91
93
  format: z.union([
92
94
  z.lazy(() => FormatText$outboundSchema),
@@ -9,6 +9,10 @@ export type CustomToolCallItemType = ClosedEnum<typeof CustomToolCallItemType>;
9
9
  * A call to a custom (freeform-grammar) tool created by the model — distinct from `function_call`. Used for tools like Codex CLI's `apply_patch` whose payload is opaque text rather than JSON arguments.
10
10
  */
11
11
  export type CustomToolCallItem = {
12
+ /**
13
+ * True when the model called a tool declared with `async: true` and may continue its turn before the output is returned. Return the result in a later request as a `function_call_output` with this `call_id`.
14
+ */
15
+ async?: boolean | undefined;
12
16
  callId: string;
13
17
  id?: string | undefined;
14
18
  input: string;
@@ -24,6 +28,7 @@ export type CustomToolCallItem = {
24
28
  export declare const CustomToolCallItemType$outboundSchema: z.ZodEnum<typeof CustomToolCallItemType>;
25
29
  /** @internal */
26
30
  export type CustomToolCallItem$Outbound = {
31
+ async?: boolean | undefined;
27
32
  call_id: string;
28
33
  id?: string | undefined;
29
34
  input: string;
@@ -12,6 +12,7 @@ export const CustomToolCallItemType = {
12
12
  export const CustomToolCallItemType$outboundSchema = z.enum(CustomToolCallItemType);
13
13
  /** @internal */
14
14
  export const CustomToolCallItem$outboundSchema = z.object({
15
+ async: z.boolean().optional(),
15
16
  callId: z.string(),
16
17
  id: z.string().optional(),
17
18
  input: z.string(),
@@ -16,6 +16,10 @@ export type FunctionCallItemType = ClosedEnum<typeof FunctionCallItemType>;
16
16
  */
17
17
  export type FunctionCallItem = {
18
18
  arguments: string;
19
+ /**
20
+ * True when the model called a tool declared with `async: true` and may continue its turn before the output is returned. Return the result in a later request as a `function_call_output` with this `call_id`.
21
+ */
22
+ async?: boolean | undefined;
19
23
  callId: string;
20
24
  id: string;
21
25
  name: string;
@@ -47,6 +51,7 @@ export declare const FunctionCallItemType$outboundSchema: z.ZodEnum<typeof Funct
47
51
  /** @internal */
48
52
  export type FunctionCallItem$Outbound = {
49
53
  arguments: string;
54
+ async?: boolean | undefined;
50
55
  call_id: string;
51
56
  id: string;
52
57
  name: string;
@@ -28,6 +28,7 @@ export const FunctionCallItemType$outboundSchema = z.enum(FunctionCallItemType);
28
28
  /** @internal */
29
29
  export const FunctionCallItem$outboundSchema = z.object({
30
30
  arguments: z.string(),
31
+ async: z.boolean().optional(),
31
32
  callId: z.string(),
32
33
  id: z.string(),
33
34
  name: z.string(),
@@ -33,7 +33,7 @@ export type FusionPluginTool = {
33
33
  };
34
34
  export type FusionPlugin = {
35
35
  /**
36
- * For a Fusion run started by the `openrouter/fusion` model slug or `openrouter:fusion` server tool, slugs of models to run in parallel as the "expert panel" the analyst analyzes. Each model receives the same user prompt with web_search + web_fetch enabled. Capped at 8 models to bound cost amplification. When omitted, defaults to the Quality preset from the /labs/fusion UI (~anthropic/claude-opus-latest, ~openai/gpt-latest, ~google/gemini-pro-latest).
36
+ * For a Fusion run started by the `openrouter/fusion` model slug or `openrouter:fusion` server tool, slugs of models to run in parallel as the "expert panel" the analyst analyzes. Each model receives the same user prompt with web_search + web_fetch enabled. Capped at 8 models to bound cost amplification. When omitted, defaults to the Quality preset from the /labs/fusion UI (~anthropic/claude-opus-latest, ~openai/gpt-sol-latest, ~google/gemini-pro-latest).
37
37
  */
38
38
  analysisModels?: Array<string> | undefined;
39
39
  /**
@@ -12,6 +12,10 @@ export type AllowedCaller = OpenEnum<typeof AllowedCaller>;
12
12
  */
13
13
  export type NamespaceFunctionTool = {
14
14
  allowedCallers?: Array<AllowedCaller> | null | undefined;
15
+ /**
16
+ * Lets the model keep working after calling this tool instead of waiting for its output. The tool is still executed by the client; return the result in a later request as a `function_call_output` with the original `call_id`. Only honored by providers whose Responses API supports async tools; ignored elsewhere.
17
+ */
18
+ async?: boolean | undefined;
15
19
  deferLoading?: boolean | undefined;
16
20
  description?: string | null | undefined;
17
21
  name: string;
@@ -33,6 +37,7 @@ export declare const NamespaceFunctionTool$inboundSchema: z.ZodType<NamespaceFun
33
37
  /** @internal */
34
38
  export type NamespaceFunctionTool$Outbound = {
35
39
  allowed_callers?: Array<string> | null | undefined;
40
+ async?: boolean | undefined;
36
41
  defer_loading?: boolean | undefined;
37
42
  description?: string | null | undefined;
38
43
  name: string;
@@ -17,6 +17,7 @@ export const AllowedCaller$outboundSchema = openEnums.outboundSchema(AllowedCall
17
17
  /** @internal */
18
18
  export const NamespaceFunctionTool$inboundSchema = z.object({
19
19
  allowed_callers: z.nullable(z.array(AllowedCaller$inboundSchema)).optional(),
20
+ async: z.boolean().optional(),
20
21
  defer_loading: z.boolean().optional(),
21
22
  description: z.nullable(z.string()).optional(),
22
23
  name: z.string(),
@@ -34,6 +35,7 @@ export const NamespaceFunctionTool$inboundSchema = z.object({
34
35
  /** @internal */
35
36
  export const NamespaceFunctionTool$outboundSchema = z.object({
36
37
  allowedCallers: z.nullable(z.array(AllowedCaller$outboundSchema)).optional(),
38
+ async: z.boolean().optional(),
37
39
  deferLoading: z.boolean().optional(),
38
40
  description: z.nullable(z.string()).optional(),
39
41
  name: z.string(),
@@ -7,6 +7,10 @@ export declare const OpenAIResponseCustomToolCallType: {
7
7
  };
8
8
  export type OpenAIResponseCustomToolCallType = ClosedEnum<typeof OpenAIResponseCustomToolCallType>;
9
9
  export type OpenAIResponseCustomToolCall = {
10
+ /**
11
+ * True when the model called a tool declared with `async: true` and may continue its turn before the output is returned. Return the result in a later request as a `function_call_output` with this `call_id`.
12
+ */
13
+ async?: boolean | undefined;
10
14
  callId: string;
11
15
  id?: string | undefined;
12
16
  input: string;
@@ -12,6 +12,7 @@ export const OpenAIResponseCustomToolCallType = {
12
12
  export const OpenAIResponseCustomToolCallType$inboundSchema = z.enum(OpenAIResponseCustomToolCallType);
13
13
  /** @internal */
14
14
  export const OpenAIResponseCustomToolCall$inboundSchema = z.object({
15
+ async: z.boolean().optional(),
15
16
  call_id: z.string(),
16
17
  id: z.string().optional(),
17
18
  input: z.string(),
@@ -15,6 +15,10 @@ export declare const OpenAIResponseFunctionToolCallType: {
15
15
  export type OpenAIResponseFunctionToolCallType = ClosedEnum<typeof OpenAIResponseFunctionToolCallType>;
16
16
  export type OpenAIResponseFunctionToolCall = {
17
17
  arguments: string;
18
+ /**
19
+ * True when the model called a tool declared with `async: true` and may continue its turn before the output is returned. Return the result in a later request as a `function_call_output` with this `call_id`.
20
+ */
21
+ async?: boolean | undefined;
18
22
  callId: string;
19
23
  id?: string | undefined;
20
24
  name: string;
@@ -21,6 +21,7 @@ export const OpenAIResponseFunctionToolCallType$inboundSchema = z.enum(OpenAIRes
21
21
  /** @internal */
22
22
  export const OpenAIResponseFunctionToolCall$inboundSchema = z.object({
23
23
  arguments: z.string(),
24
+ async: z.boolean().optional(),
24
25
  call_id: z.string(),
25
26
  id: z.string().optional(),
26
27
  name: z.string(),
@@ -46,6 +46,10 @@ export type OpenResponsesResultToolFunction = {
46
46
  } | null;
47
47
  strict?: boolean | null | undefined;
48
48
  type: "function";
49
+ /**
50
+ * Lets the model keep working after calling this tool instead of waiting for its output. The tool is still executed by the client; return the result in a later request as a `function_call_output` with the original `call_id`. Only honored by providers whose Responses API supports async tools; ignored elsewhere.
51
+ */
52
+ async?: boolean | undefined;
49
53
  /**
50
54
  * Withhold this tool from the model until `openrouter:tool_search` finds it. Requires the tool search server tool; at least one tool must remain non-deferred.
51
55
  */
@@ -46,6 +46,7 @@ export const OpenResponsesResultToolFunction$inboundSchema = z.object({
46
46
  parameters: z.nullable(z.record(z.string(), z.any())),
47
47
  strict: z.nullable(z.boolean()).optional(),
48
48
  type: z.literal("function"),
49
+ async: z.boolean().optional(),
49
50
  defer_loading: z.boolean().optional(),
50
51
  }).transform((v) => {
51
52
  return remap$(v, {
@@ -16,6 +16,10 @@ export type OutputCustomToolCallItemType = ClosedEnum<typeof OutputCustomToolCal
16
16
  * A call to a custom (freeform-grammar) tool created by the model — distinct from `function_call`. Used for tools like Codex CLI's `apply_patch` whose payload is opaque text rather than JSON arguments.
17
17
  */
18
18
  export type OutputCustomToolCallItem = {
19
+ /**
20
+ * True when the model called a tool declared with `async: true` and may continue its turn before the output is returned. Return the result in a later request as a `function_call_output` with this `call_id`.
21
+ */
22
+ async?: boolean | undefined;
19
23
  callId: string;
20
24
  id?: string | undefined;
21
25
  input: string;
@@ -39,6 +43,7 @@ export declare const OutputCustomToolCallItemType$outboundSchema: z.ZodEnum<type
39
43
  export declare const OutputCustomToolCallItem$inboundSchema: z.ZodType<OutputCustomToolCallItem, unknown>;
40
44
  /** @internal */
41
45
  export type OutputCustomToolCallItem$Outbound = {
46
+ async?: boolean | undefined;
42
47
  call_id: string;
43
48
  id?: string | undefined;
44
49
  input: string;
@@ -24,6 +24,7 @@ export const OutputCustomToolCallItemType$inboundSchema = z.enum(OutputCustomToo
24
24
  export const OutputCustomToolCallItemType$outboundSchema = OutputCustomToolCallItemType$inboundSchema;
25
25
  /** @internal */
26
26
  export const OutputCustomToolCallItem$inboundSchema = z.object({
27
+ async: z.boolean().optional(),
27
28
  call_id: z.string(),
28
29
  id: z.string().optional(),
29
30
  input: z.string(),
@@ -38,6 +39,7 @@ export const OutputCustomToolCallItem$inboundSchema = z.object({
38
39
  });
39
40
  /** @internal */
40
41
  export const OutputCustomToolCallItem$outboundSchema = z.object({
42
+ async: z.boolean().optional(),
41
43
  callId: z.string(),
42
44
  id: z.string().optional(),
43
45
  input: z.string(),
@@ -27,6 +27,10 @@ export type OutputFunctionCallItemSubagentItem = {
27
27
  };
28
28
  export type OutputFunctionCallItem = {
29
29
  arguments: string;
30
+ /**
31
+ * True when the model called a tool declared with `async: true` and may continue its turn before the output is returned. Return the result in a later request as a `function_call_output` with this `call_id`.
32
+ */
33
+ async?: boolean | undefined;
30
34
  callId: string;
31
35
  id?: string | undefined;
32
36
  name: string;
@@ -85,6 +89,7 @@ export declare const OutputFunctionCallItem$inboundSchema: z.ZodType<OutputFunct
85
89
  /** @internal */
86
90
  export type OutputFunctionCallItem$Outbound = {
87
91
  arguments: string;
92
+ async?: boolean | undefined;
88
93
  call_id: string;
89
94
  id?: string | undefined;
90
95
  name: string;
@@ -76,6 +76,7 @@ export function outputFunctionCallItemSubagentItemFromJSON(jsonString) {
76
76
  /** @internal */
77
77
  export const OutputFunctionCallItem$inboundSchema = z.object({
78
78
  arguments: z.string(),
79
+ async: z.boolean().optional(),
79
80
  call_id: z.string(),
80
81
  id: z.string().optional(),
81
82
  name: z.string(),
@@ -98,6 +99,7 @@ export const OutputFunctionCallItem$inboundSchema = z.object({
98
99
  /** @internal */
99
100
  export const OutputFunctionCallItem$outboundSchema = z.object({
100
101
  arguments: z.string(),
102
+ async: z.boolean().optional(),
101
103
  callId: z.string(),
102
104
  id: z.string().optional(),
103
105
  name: z.string(),
@@ -22,6 +22,7 @@ export declare const Code: {
22
22
  readonly FailedToDownloadImage: "failed_to_download_image";
23
23
  readonly ImageFileNotFound: "image_file_not_found";
24
24
  readonly BioPolicy: "bio_policy";
25
+ readonly CyberPolicy: "cyber_policy";
25
26
  readonly MisalignmentPolicyViolation: "misalignment_policy_violation";
26
27
  readonly DataResidencyMismatch: "data_residency_mismatch";
27
28
  };
@@ -25,6 +25,7 @@ export const Code = {
25
25
  FailedToDownloadImage: "failed_to_download_image",
26
26
  ImageFileNotFound: "image_file_not_found",
27
27
  BioPolicy: "bio_policy",
28
+ CyberPolicy: "cyber_policy",
28
29
  MisalignmentPolicyViolation: "misalignment_policy_violation",
29
30
  DataResidencyMismatch: "data_residency_mismatch",
30
31
  };
@@ -96,6 +96,10 @@ export type ResponsesRequestToolFunction = {
96
96
  } | null;
97
97
  strict?: boolean | null | undefined;
98
98
  type: "function";
99
+ /**
100
+ * Lets the model keep working after calling this tool instead of waiting for its output. The tool is still executed by the client; return the result in a later request as a `function_call_output` with the original `call_id`. Only honored by providers whose Responses API supports async tools; ignored elsewhere.
101
+ */
102
+ async?: boolean | undefined;
99
103
  /**
100
104
  * Withhold this tool from the model until `openrouter:tool_search` finds it. Requires the tool search server tool; at least one tool must remain non-deferred.
101
105
  */
@@ -343,6 +347,7 @@ export type ResponsesRequestToolFunction$Outbound = {
343
347
  } | null;
344
348
  strict?: boolean | null | undefined;
345
349
  type: "function";
350
+ async?: boolean | undefined;
346
351
  defer_loading?: boolean | undefined;
347
352
  };
348
353
  /** @internal */
@@ -112,6 +112,7 @@ export const ResponsesRequestToolFunction$outboundSchema = z.object({
112
112
  parameters: z.nullable(z.record(z.string(), z.any())),
113
113
  strict: z.nullable(z.boolean()).optional(),
114
114
  type: z.literal("function"),
115
+ async: z.boolean().optional(),
115
116
  deferLoading: z.boolean().optional(),
116
117
  }).transform((v) => {
117
118
  return remap$(v, {
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.2.117",
5
+ "version": "1.2.118",
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.2.117",
3
+ "version": "1.2.118",
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
+ "test:watch": "vitest --watch --project unit",
76
77
  "compile": "tsc",
77
- "postinstall": "node scripts/check-types.js || true",
78
- "prepare": "npm run build",
79
- "test:e2e": "vitest --run --project e2e",
80
- "typecheck": "tsc --noEmit",
81
78
  "test": "vitest --run --project unit",
79
+ "test:e2e": "vitest --run --project e2e",
82
80
  "test:transit": "exit 0",
83
- "test:watch": "vitest --watch --project unit",
84
- "typecheck:transit": "exit 0"
81
+ "typecheck": "tsc --noEmit",
82
+ "typecheck:transit": "exit 0",
83
+ "postinstall": "node scripts/check-types.js || true",
84
+ "prepare": "npm run build"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {