@openrouter/sdk 0.13.33 → 0.13.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,8 +49,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
49
49
  export declare const SDK_METADATA: {
50
50
  readonly language: "typescript";
51
51
  readonly openapiDocVersion: "1.0.0";
52
- readonly sdkVersion: "0.13.33";
52
+ readonly sdkVersion: "0.13.35";
53
53
  readonly genVersion: "2.884.4";
54
- readonly userAgent: "speakeasy-sdk/typescript 0.13.33 2.884.4 1.0.0 @openrouter/sdk";
54
+ readonly userAgent: "speakeasy-sdk/typescript 0.13.35 2.884.4 1.0.0 @openrouter/sdk";
55
55
  };
56
56
  //# sourceMappingURL=config.d.ts.map
package/esm/lib/config.js CHANGED
@@ -26,8 +26,8 @@ export function serverURLFromOptions(options) {
26
26
  export const SDK_METADATA = {
27
27
  language: "typescript",
28
28
  openapiDocVersion: "1.0.0",
29
- sdkVersion: "0.13.33",
29
+ sdkVersion: "0.13.35",
30
30
  genVersion: "2.884.4",
31
- userAgent: "speakeasy-sdk/typescript 0.13.33 2.884.4 1.0.0 @openrouter/sdk",
31
+ userAgent: "speakeasy-sdk/typescript 0.13.35 2.884.4 1.0.0 @openrouter/sdk",
32
32
  };
33
33
  //# sourceMappingURL=config.js.map
@@ -2,9 +2,14 @@ import * as z from "zod/v4";
2
2
  import { Result as SafeParseResult } from "../types/fp.js";
3
3
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
4
  import { ReasoningEffort } from "./reasoningeffort.js";
5
+ import { ReasoningMode } from "./reasoningmode.js";
5
6
  import { ReasoningSummaryVerbosity } from "./reasoningsummaryverbosity.js";
6
7
  export type BaseReasoningConfig = {
7
8
  effort?: ReasoningEffort | null | undefined;
9
+ /**
10
+ * Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer.
11
+ */
12
+ mode?: ReasoningMode | null | undefined;
8
13
  summary?: ReasoningSummaryVerbosity | null | undefined;
9
14
  };
10
15
  /** @internal */
@@ -5,10 +5,12 @@
5
5
  import * as z from "zod/v4";
6
6
  import { safeParse } from "../lib/schemas.js";
7
7
  import { ReasoningEffort$inboundSchema, } from "./reasoningeffort.js";
8
+ import { ReasoningMode$inboundSchema } from "./reasoningmode.js";
8
9
  import { ReasoningSummaryVerbosity$inboundSchema, } from "./reasoningsummaryverbosity.js";
9
10
  /** @internal */
10
11
  export const BaseReasoningConfig$inboundSchema = z.object({
11
12
  effort: z.nullable(ReasoningEffort$inboundSchema).optional(),
13
+ mode: z.nullable(ReasoningMode$inboundSchema).optional(),
12
14
  summary: z.nullable(ReasoningSummaryVerbosity$inboundSchema).optional(),
13
15
  });
14
16
  export function baseReasoningConfigFromJSON(jsonString) {
@@ -410,6 +410,7 @@ export * from "./rankingsdailyresponse.js";
410
410
  export * from "./reasoningconfig.js";
411
411
  export * from "./reasoningdeltaevent.js";
412
412
  export * from "./reasoningdetailencrypted.js";
413
+ export * from "./reasoningdetailservertoolcall.js";
413
414
  export * from "./reasoningdetailsummary.js";
414
415
  export * from "./reasoningdetailtext.js";
415
416
  export * from "./reasoningdetailunion.js";
@@ -417,6 +418,7 @@ export * from "./reasoningdoneevent.js";
417
418
  export * from "./reasoningeffort.js";
418
419
  export * from "./reasoningformat.js";
419
420
  export * from "./reasoningitem.js";
421
+ export * from "./reasoningmode.js";
420
422
  export * from "./reasoningsummarypartaddedevent.js";
421
423
  export * from "./reasoningsummarypartdoneevent.js";
422
424
  export * from "./reasoningsummarytext.js";
@@ -414,6 +414,7 @@ export * from "./rankingsdailyresponse.js";
414
414
  export * from "./reasoningconfig.js";
415
415
  export * from "./reasoningdeltaevent.js";
416
416
  export * from "./reasoningdetailencrypted.js";
417
+ export * from "./reasoningdetailservertoolcall.js";
417
418
  export * from "./reasoningdetailsummary.js";
418
419
  export * from "./reasoningdetailtext.js";
419
420
  export * from "./reasoningdetailunion.js";
@@ -421,6 +422,7 @@ export * from "./reasoningdoneevent.js";
421
422
  export * from "./reasoningeffort.js";
422
423
  export * from "./reasoningformat.js";
423
424
  export * from "./reasoningitem.js";
425
+ export * from "./reasoningmode.js";
424
426
  export * from "./reasoningsummarypartaddedevent.js";
425
427
  export * from "./reasoningsummarypartdoneevent.js";
426
428
  export * from "./reasoningsummarytext.js";
@@ -1,11 +1,16 @@
1
1
  import * as z from "zod/v4";
2
2
  import { ReasoningEffort } from "./reasoningeffort.js";
3
+ import { ReasoningMode } from "./reasoningmode.js";
3
4
  import { ReasoningSummaryVerbosity } from "./reasoningsummaryverbosity.js";
4
5
  /**
5
6
  * Configuration for reasoning mode in the response
6
7
  */
7
8
  export type ReasoningConfig = {
8
9
  effort?: ReasoningEffort | null | undefined;
10
+ /**
11
+ * Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer.
12
+ */
13
+ mode?: ReasoningMode | null | undefined;
9
14
  summary?: ReasoningSummaryVerbosity | null | undefined;
10
15
  enabled?: boolean | null | undefined;
11
16
  maxTokens?: number | null | undefined;
@@ -13,6 +18,7 @@ export type ReasoningConfig = {
13
18
  /** @internal */
14
19
  export type ReasoningConfig$Outbound = {
15
20
  effort?: string | null | undefined;
21
+ mode?: string | null | undefined;
16
22
  summary?: string | null | undefined;
17
23
  enabled?: boolean | null | undefined;
18
24
  max_tokens?: number | null | undefined;
@@ -5,10 +5,12 @@
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { ReasoningEffort$outboundSchema, } from "./reasoningeffort.js";
8
+ import { ReasoningMode$outboundSchema, } from "./reasoningmode.js";
8
9
  import { ReasoningSummaryVerbosity$outboundSchema, } from "./reasoningsummaryverbosity.js";
9
10
  /** @internal */
10
11
  export const ReasoningConfig$outboundSchema = z.object({
11
12
  effort: z.nullable(ReasoningEffort$outboundSchema).optional(),
13
+ mode: z.nullable(ReasoningMode$outboundSchema).optional(),
12
14
  summary: z.nullable(ReasoningSummaryVerbosity$outboundSchema).optional(),
13
15
  enabled: z.nullable(z.boolean()).optional(),
14
16
  maxTokens: z.nullable(z.int()).optional(),
@@ -0,0 +1,35 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ import { ReasoningFormat } from "./reasoningformat.js";
5
+ /**
6
+ * Record of an OpenRouter server-tool invocation (e.g. openrouter:fusion), carried in reasoning_details so a prior tool call can be rehydrated into a later turn of the same conversation.
7
+ */
8
+ export type ReasoningDetailServerToolCall = {
9
+ arguments: string;
10
+ format?: ReasoningFormat | null | undefined;
11
+ id?: string | null | undefined;
12
+ index?: number | undefined;
13
+ result: string;
14
+ toolCallId?: string | null | undefined;
15
+ toolName: string;
16
+ type: "reasoning.server_tool_call";
17
+ };
18
+ /** @internal */
19
+ export declare const ReasoningDetailServerToolCall$inboundSchema: z.ZodType<ReasoningDetailServerToolCall, unknown>;
20
+ /** @internal */
21
+ export type ReasoningDetailServerToolCall$Outbound = {
22
+ arguments: string;
23
+ format?: string | null | undefined;
24
+ id?: string | null | undefined;
25
+ index?: number | undefined;
26
+ result: string;
27
+ tool_call_id?: string | null | undefined;
28
+ tool_name: string;
29
+ type: "reasoning.server_tool_call";
30
+ };
31
+ /** @internal */
32
+ export declare const ReasoningDetailServerToolCall$outboundSchema: z.ZodType<ReasoningDetailServerToolCall$Outbound, ReasoningDetailServerToolCall>;
33
+ export declare function reasoningDetailServerToolCallToJSON(reasoningDetailServerToolCall: ReasoningDetailServerToolCall): string;
34
+ export declare function reasoningDetailServerToolCallFromJSON(jsonString: string): SafeParseResult<ReasoningDetailServerToolCall, SDKValidationError>;
35
+ //# sourceMappingURL=reasoningdetailservertoolcall.d.ts.map
@@ -0,0 +1,47 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: e2bb1917981b
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { safeParse } from "../lib/schemas.js";
8
+ import { ReasoningFormat$inboundSchema, ReasoningFormat$outboundSchema, } from "./reasoningformat.js";
9
+ /** @internal */
10
+ export const ReasoningDetailServerToolCall$inboundSchema = z.object({
11
+ arguments: z.string(),
12
+ format: z.nullable(ReasoningFormat$inboundSchema).optional(),
13
+ id: z.nullable(z.string()).optional(),
14
+ index: z.int().optional(),
15
+ result: z.string(),
16
+ tool_call_id: z.nullable(z.string()).optional(),
17
+ tool_name: z.string(),
18
+ type: z.literal("reasoning.server_tool_call"),
19
+ }).transform((v) => {
20
+ return remap$(v, {
21
+ "tool_call_id": "toolCallId",
22
+ "tool_name": "toolName",
23
+ });
24
+ });
25
+ /** @internal */
26
+ export const ReasoningDetailServerToolCall$outboundSchema = z.object({
27
+ arguments: z.string(),
28
+ format: z.nullable(ReasoningFormat$outboundSchema).optional(),
29
+ id: z.nullable(z.string()).optional(),
30
+ index: z.int().optional(),
31
+ result: z.string(),
32
+ toolCallId: z.nullable(z.string()).optional(),
33
+ toolName: z.string(),
34
+ type: z.literal("reasoning.server_tool_call"),
35
+ }).transform((v) => {
36
+ return remap$(v, {
37
+ toolCallId: "tool_call_id",
38
+ toolName: "tool_name",
39
+ });
40
+ });
41
+ export function reasoningDetailServerToolCallToJSON(reasoningDetailServerToolCall) {
42
+ return JSON.stringify(ReasoningDetailServerToolCall$outboundSchema.parse(reasoningDetailServerToolCall));
43
+ }
44
+ export function reasoningDetailServerToolCallFromJSON(jsonString) {
45
+ return safeParse(jsonString, (x) => ReasoningDetailServerToolCall$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ReasoningDetailServerToolCall' from JSON`);
46
+ }
47
+ //# sourceMappingURL=reasoningdetailservertoolcall.js.map
@@ -3,16 +3,17 @@ import * as discriminatedUnionTypes from "../types/discriminatedUnion.js";
3
3
  import { Result as SafeParseResult } from "../types/fp.js";
4
4
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
5
  import { ReasoningDetailEncrypted, ReasoningDetailEncrypted$Outbound } from "./reasoningdetailencrypted.js";
6
+ import { ReasoningDetailServerToolCall, ReasoningDetailServerToolCall$Outbound } from "./reasoningdetailservertoolcall.js";
6
7
  import { ReasoningDetailSummary, ReasoningDetailSummary$Outbound } from "./reasoningdetailsummary.js";
7
8
  import { ReasoningDetailText, ReasoningDetailText$Outbound } from "./reasoningdetailtext.js";
8
9
  /**
9
10
  * Reasoning detail union schema
10
11
  */
11
- export type ReasoningDetailUnion = ReasoningDetailEncrypted | ReasoningDetailSummary | ReasoningDetailText | discriminatedUnionTypes.Unknown<"type">;
12
+ export type ReasoningDetailUnion = ReasoningDetailEncrypted | ReasoningDetailServerToolCall | ReasoningDetailSummary | ReasoningDetailText | discriminatedUnionTypes.Unknown<"type">;
12
13
  /** @internal */
13
14
  export declare const ReasoningDetailUnion$inboundSchema: z.ZodType<ReasoningDetailUnion, unknown>;
14
15
  /** @internal */
15
- export type ReasoningDetailUnion$Outbound = ReasoningDetailEncrypted$Outbound | ReasoningDetailSummary$Outbound | ReasoningDetailText$Outbound;
16
+ export type ReasoningDetailUnion$Outbound = ReasoningDetailEncrypted$Outbound | ReasoningDetailServerToolCall$Outbound | ReasoningDetailSummary$Outbound | ReasoningDetailText$Outbound;
16
17
  /** @internal */
17
18
  export declare const ReasoningDetailUnion$outboundSchema: z.ZodType<ReasoningDetailUnion$Outbound, ReasoningDetailUnion>;
18
19
  export declare function reasoningDetailUnionToJSON(reasoningDetailUnion: ReasoningDetailUnion): string;
@@ -6,17 +6,20 @@ import * as z from "zod/v4";
6
6
  import { safeParse } from "../lib/schemas.js";
7
7
  import { discriminatedUnion } from "../types/discriminatedUnion.js";
8
8
  import { ReasoningDetailEncrypted$inboundSchema, ReasoningDetailEncrypted$outboundSchema, } from "./reasoningdetailencrypted.js";
9
+ import { ReasoningDetailServerToolCall$inboundSchema, ReasoningDetailServerToolCall$outboundSchema, } from "./reasoningdetailservertoolcall.js";
9
10
  import { ReasoningDetailSummary$inboundSchema, ReasoningDetailSummary$outboundSchema, } from "./reasoningdetailsummary.js";
10
11
  import { ReasoningDetailText$inboundSchema, ReasoningDetailText$outboundSchema, } from "./reasoningdetailtext.js";
11
12
  /** @internal */
12
13
  export const ReasoningDetailUnion$inboundSchema = discriminatedUnion("type", {
13
14
  ["reasoning.encrypted"]: ReasoningDetailEncrypted$inboundSchema,
15
+ ["reasoning.server_tool_call"]: ReasoningDetailServerToolCall$inboundSchema,
14
16
  ["reasoning.summary"]: ReasoningDetailSummary$inboundSchema,
15
17
  ["reasoning.text"]: ReasoningDetailText$inboundSchema,
16
18
  });
17
19
  /** @internal */
18
20
  export const ReasoningDetailUnion$outboundSchema = z.union([
19
21
  ReasoningDetailEncrypted$outboundSchema,
22
+ ReasoningDetailServerToolCall$outboundSchema,
20
23
  ReasoningDetailSummary$outboundSchema,
21
24
  ReasoningDetailText$outboundSchema,
22
25
  ]);
@@ -0,0 +1,18 @@
1
+ import * as z from "zod/v4";
2
+ import { OpenEnum } from "../types/enums.js";
3
+ /**
4
+ * Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer.
5
+ */
6
+ export declare const ReasoningMode: {
7
+ readonly Standard: "standard";
8
+ readonly Pro: "pro";
9
+ };
10
+ /**
11
+ * Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer.
12
+ */
13
+ export type ReasoningMode = OpenEnum<typeof ReasoningMode>;
14
+ /** @internal */
15
+ export declare const ReasoningMode$inboundSchema: z.ZodType<ReasoningMode, unknown>;
16
+ /** @internal */
17
+ export declare const ReasoningMode$outboundSchema: z.ZodType<string, ReasoningMode>;
18
+ //# sourceMappingURL=reasoningmode.d.ts.map
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 0f9d520ad1ae
4
+ */
5
+ import * as openEnums from "../types/enums.js";
6
+ /**
7
+ * Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer.
8
+ */
9
+ export const ReasoningMode = {
10
+ Standard: "standard",
11
+ Pro: "pro",
12
+ };
13
+ /** @internal */
14
+ export const ReasoningMode$inboundSchema = openEnums.inboundSchema(ReasoningMode);
15
+ /** @internal */
16
+ export const ReasoningMode$outboundSchema = openEnums.outboundSchema(ReasoningMode);
17
+ //# sourceMappingURL=reasoningmode.js.map
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "0.13.33",
5
+ "version": "0.13.35",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openrouter/sdk",
3
- "version": "0.13.33",
3
+ "version": "0.13.35",
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": [
@@ -74,14 +74,14 @@
74
74
  "build": "tsc",
75
75
  "prepublishOnly": "npm run build",
76
76
  "compile": "tsc",
77
- "postinstall": "node scripts/check-types.js || true",
78
- "test": "vitest --run --project unit",
79
- "test:watch": "vitest --watch --project unit",
80
77
  "prepare": "npm run build",
78
+ "test": "vitest --run --project unit",
79
+ "typecheck": "tsc --noEmit",
80
+ "typecheck:transit": "exit 0",
81
+ "postinstall": "node scripts/check-types.js || true",
81
82
  "test:e2e": "vitest --run --project e2e",
82
83
  "test:transit": "exit 0",
83
- "typecheck": "tsc --noEmit",
84
- "typecheck:transit": "exit 0"
84
+ "test:watch": "vitest --watch --project unit"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {