@openrouter/sdk 1.5.85 → 1.5.87

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.5.85";
53
+ readonly sdkVersion: "1.5.87";
54
54
  readonly genVersion: "2.950.13";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.5.85 2.950.13 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.5.87 2.950.13 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.5.85",
32
+ sdkVersion: "1.5.87",
33
33
  genVersion: "2.950.13",
34
- userAgent: "speakeasy-sdk/typescript 1.5.85 2.950.13 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.5.87 2.950.13 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -17,7 +17,7 @@ export declare const BYOKKeyDeclaredRegion: {
17
17
  export type BYOKKeyDeclaredRegion = OpenEnum<typeof BYOKKeyDeclaredRegion>;
18
18
  export type BYOKKey = {
19
19
  /**
20
- * Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` means no restriction. A workspace-scoped management key can only name API keys in its own workspace.
20
+ * Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` means no restriction. Keys newly added to a credential pinned to a workspace must be in that workspace; a listed key that has since moved to another workspace stays listed.
21
21
  */
22
22
  allowedApiKeyHashes: Array<string> | null;
23
23
  /**
@@ -110,6 +110,7 @@ export declare const BYOKProviderSlug: {
110
110
  readonly Seed: "seed";
111
111
  readonly Siliconflow: "siliconflow";
112
112
  readonly Sourceful: "sourceful";
113
+ readonly Speechify: "speechify";
113
114
  readonly Stepfun: "stepfun";
114
115
  readonly Streamlake: "streamlake";
115
116
  readonly Switchpoint: "switchpoint";
@@ -113,6 +113,7 @@ export const BYOKProviderSlug = {
113
113
  Seed: "seed",
114
114
  Siliconflow: "siliconflow",
115
115
  Sourceful: "sourceful",
116
+ Speechify: "speechify",
116
117
  Stepfun: "stepfun",
117
118
  Streamlake: "streamlake",
118
119
  Switchpoint: "switchpoint",
@@ -27,6 +27,8 @@ import { ParetoRouterPlugin, ParetoRouterPlugin$Outbound } from "./paretorouterp
27
27
  import { Prediction, Prediction$Outbound } from "./prediction.js";
28
28
  import { PromptCacheOptions, PromptCacheOptions$Outbound } from "./promptcacheoptions.js";
29
29
  import { ProviderPreferences, ProviderPreferences$Outbound } from "./providerpreferences.js";
30
+ import { ReasoningContext } from "./reasoningcontext.js";
31
+ import { ReasoningMode } from "./reasoningmode.js";
30
32
  import { ResponseHealingPlugin, ResponseHealingPlugin$Outbound } from "./responsehealingplugin.js";
31
33
  import { StopServerToolsWhenCondition, StopServerToolsWhenCondition$Outbound } from "./stopservertoolswhencondition.js";
32
34
  import { SwitchyardRouterPlugin, SwitchyardRouterPlugin$Outbound } from "./switchyardrouterplugin.js";
@@ -60,14 +62,30 @@ export type ChatRequestEffort = OpenEnum<typeof ChatRequestEffort>;
60
62
  * Configuration options for reasoning models
61
63
  */
62
64
  export type ChatRequestReasoning = {
65
+ /**
66
+ * 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.
67
+ */
68
+ context?: ReasoningContext | null | undefined;
63
69
  /**
64
70
  * Constrains effort on reasoning for reasoning models
65
71
  */
66
72
  effort?: ChatRequestEffort | null | undefined;
73
+ /**
74
+ * Enables reasoning with default settings. Defaults to being inferred from `effort` or `max_tokens`.
75
+ */
76
+ enabled?: boolean | undefined;
77
+ /**
78
+ * When true, the model still reasons but the reasoning is omitted from the response. Defaults to false.
79
+ */
80
+ exclude?: boolean | undefined;
67
81
  /**
68
82
  * Maximum number of tokens the model may spend on reasoning, for models that take a reasoning token budget instead of an effort level. Cannot be combined with `reasoning.effort` or the top-level `reasoning_effort`: a request that sets both is rejected with "Only one of "reasoning.effort" and "reasoning.max_tokens" can be specified".
69
83
  */
70
84
  maxTokens?: number | null | undefined;
85
+ /**
86
+ * 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.
87
+ */
88
+ mode?: ReasoningMode | null | undefined;
71
89
  summary?: ChatReasoningSummaryVerbosityEnum | null | undefined;
72
90
  };
73
91
  /**
@@ -297,8 +315,12 @@ export declare function chatRequestPluginToJSON(chatRequestPlugin: ChatRequestPl
297
315
  export declare const ChatRequestEffort$outboundSchema: z.ZodType<string, ChatRequestEffort>;
298
316
  /** @internal */
299
317
  export type ChatRequestReasoning$Outbound = {
318
+ context?: string | null | undefined;
300
319
  effort?: string | null | undefined;
320
+ enabled?: boolean | undefined;
321
+ exclude?: boolean | undefined;
301
322
  max_tokens?: number | null | undefined;
323
+ mode?: string | null | undefined;
302
324
  summary?: string | null | undefined;
303
325
  };
304
326
  /** @internal */
@@ -32,6 +32,8 @@ import { ParetoRouterPlugin$outboundSchema, } from "./paretorouterplugin.js";
32
32
  import { Prediction$outboundSchema, } from "./prediction.js";
33
33
  import { PromptCacheOptions$outboundSchema, } from "./promptcacheoptions.js";
34
34
  import { ProviderPreferences$outboundSchema, } from "./providerpreferences.js";
35
+ import { ReasoningContext$outboundSchema, } from "./reasoningcontext.js";
36
+ import { ReasoningMode$outboundSchema, } from "./reasoningmode.js";
35
37
  import { ResponseHealingPlugin$outboundSchema, } from "./responsehealingplugin.js";
36
38
  import { StopServerToolsWhenCondition$outboundSchema, } from "./stopservertoolswhencondition.js";
37
39
  import { SwitchyardRouterPlugin$outboundSchema, } from "./switchyardrouterplugin.js";
@@ -106,8 +108,12 @@ export function chatRequestPluginToJSON(chatRequestPlugin) {
106
108
  export const ChatRequestEffort$outboundSchema = openEnums.outboundSchema(ChatRequestEffort);
107
109
  /** @internal */
108
110
  export const ChatRequestReasoning$outboundSchema = z.object({
111
+ context: z.nullable(ReasoningContext$outboundSchema).optional(),
109
112
  effort: z.nullable(ChatRequestEffort$outboundSchema).optional(),
113
+ enabled: z.boolean().optional(),
114
+ exclude: z.boolean().optional(),
110
115
  maxTokens: z.nullable(z.int()).optional(),
116
+ mode: z.nullable(ReasoningMode$outboundSchema).optional(),
111
117
  summary: z.nullable(ChatReasoningSummaryVerbosityEnum$outboundSchema)
112
118
  .optional(),
113
119
  }).transform((v) => {
@@ -15,7 +15,7 @@ export declare const CreateBYOKKeyRequestDeclaredRegion: {
15
15
  export type CreateBYOKKeyRequestDeclaredRegion = OpenEnum<typeof CreateBYOKKeyRequestDeclaredRegion>;
16
16
  export type CreateBYOKKeyRequest = {
17
17
  /**
18
- * Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` means no restriction. Must contain at least one hash if provided. Hashes that do not belong to your account return a 400; for a workspace-scoped management key, so do hashes of API keys outside its own workspace.
18
+ * Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` means no restriction. Must contain at least one hash if provided. Hashes that do not belong to your account return a 400; for a credential pinned to a workspace, so do hashes of API keys outside that workspace.
19
19
  */
20
20
  allowedApiKeyHashes?: Array<string> | null | undefined;
21
21
  /**
@@ -30,7 +30,7 @@ export declare const CreateObservabilityDestinationRequestType: {
30
30
  export type CreateObservabilityDestinationRequestType = OpenEnum<typeof CreateObservabilityDestinationRequestType>;
31
31
  export type CreateObservabilityDestinationRequest = {
32
32
  /**
33
- * Optional allowlist of OpenRouter API key hashes whose traffic is forwarded. `null` or omitted means all keys. Must contain at least one hash if provided. A workspace-scoped management key can only name API keys in its own workspace; any other hash returns 400.
33
+ * Optional allowlist of OpenRouter API key hashes whose traffic is forwarded. `null` or omitted means all keys. Must contain at least one hash if provided. Every hash must belong to an API key in the destination's workspace; any other hash returns 400.
34
34
  */
35
35
  apiKeyHashes?: Array<string> | null | undefined;
36
36
  /**
@@ -407,6 +407,9 @@ export type ImageGenerationProviderPreferencesOptions = {
407
407
  sourceful?: {
408
408
  [k: string]: any;
409
409
  } | undefined;
410
+ speechify?: {
411
+ [k: string]: any;
412
+ } | undefined;
410
413
  stealth?: {
411
414
  [k: string]: any;
412
415
  } | undefined;
@@ -920,6 +923,9 @@ export type ImageGenerationProviderPreferencesOptions$Outbound = {
920
923
  sourceful?: {
921
924
  [k: string]: any;
922
925
  } | undefined;
926
+ speechify?: {
927
+ [k: string]: any;
928
+ } | undefined;
923
929
  stealth?: {
924
930
  [k: string]: any;
925
931
  } | undefined;
@@ -152,6 +152,7 @@ export const ImageGenerationProviderPreferencesOptions$outboundSchema = z.object
152
152
  sfCompute: z.record(z.string(), z.any()).optional(),
153
153
  siliconflow: z.record(z.string(), z.any()).optional(),
154
154
  sourceful: z.record(z.string(), z.any()).optional(),
155
+ speechify: z.record(z.string(), z.any()).optional(),
155
156
  stealth: z.record(z.string(), z.any()).optional(),
156
157
  stepfun: z.record(z.string(), z.any()).optional(),
157
158
  streamlake: z.record(z.string(), z.any()).optional(),
@@ -134,6 +134,7 @@ export declare const Provider: {
134
134
  readonly Seed: "seed";
135
135
  readonly Siliconflow: "siliconflow";
136
136
  readonly Sourceful: "sourceful";
137
+ readonly Speechify: "speechify";
137
138
  readonly Stepfun: "stepfun";
138
139
  readonly Streamlake: "streamlake";
139
140
  readonly Switchpoint: "switchpoint";
@@ -117,6 +117,7 @@ export const Provider = {
117
117
  Seed: "seed",
118
118
  Siliconflow: "siliconflow",
119
119
  Sourceful: "sourceful",
120
+ Speechify: "speechify",
120
121
  Stepfun: "stepfun",
121
122
  Streamlake: "streamlake",
122
123
  Switchpoint: "switchpoint",
@@ -104,6 +104,7 @@ export declare const ProviderName: {
104
104
  readonly Seed: "Seed";
105
105
  readonly SiliconFlow: "SiliconFlow";
106
106
  readonly Sourceful: "Sourceful";
107
+ readonly Speechify: "Speechify";
107
108
  readonly StepFun: "StepFun";
108
109
  readonly Stealth: "Stealth";
109
110
  readonly StreamLake: "StreamLake";
@@ -107,6 +107,7 @@ export const ProviderName = {
107
107
  Seed: "Seed",
108
108
  SiliconFlow: "SiliconFlow",
109
109
  Sourceful: "Sourceful",
110
+ Speechify: "Speechify",
110
111
  StepFun: "StepFun",
111
112
  Stealth: "Stealth",
112
113
  StreamLake: "StreamLake",
@@ -402,6 +402,9 @@ export type ProviderOptions = {
402
402
  sourceful?: {
403
403
  [k: string]: any;
404
404
  } | undefined;
405
+ speechify?: {
406
+ [k: string]: any;
407
+ } | undefined;
405
408
  stealth?: {
406
409
  [k: string]: any;
407
410
  } | undefined;
@@ -870,6 +873,9 @@ export type ProviderOptions$Outbound = {
870
873
  sourceful?: {
871
874
  [k: string]: any;
872
875
  } | undefined;
876
+ speechify?: {
877
+ [k: string]: any;
878
+ } | undefined;
873
879
  stealth?: {
874
880
  [k: string]: any;
875
881
  } | undefined;
@@ -139,6 +139,7 @@ export const ProviderOptions$outboundSchema = z.object({
139
139
  sfCompute: z.record(z.string(), z.any()).optional(),
140
140
  siliconflow: z.record(z.string(), z.any()).optional(),
141
141
  sourceful: z.record(z.string(), z.any()).optional(),
142
+ speechify: z.record(z.string(), z.any()).optional(),
142
143
  stealth: z.record(z.string(), z.any()).optional(),
143
144
  stepfun: z.record(z.string(), z.any()).optional(),
144
145
  streamlake: z.record(z.string(), z.any()).optional(),
@@ -137,6 +137,7 @@ export declare const ProviderResponseProviderName: {
137
137
  readonly Seed: "Seed";
138
138
  readonly SiliconFlow: "SiliconFlow";
139
139
  readonly Sourceful: "Sourceful";
140
+ readonly Speechify: "Speechify";
140
141
  readonly StepFun: "StepFun";
141
142
  readonly Stealth: "Stealth";
142
143
  readonly StreamLake: "StreamLake";
@@ -141,6 +141,7 @@ export const ProviderResponseProviderName = {
141
141
  Seed: "Seed",
142
142
  SiliconFlow: "SiliconFlow",
143
143
  Sourceful: "Sourceful",
144
+ Speechify: "Speechify",
144
145
  StepFun: "StepFun",
145
146
  Stealth: "Stealth",
146
147
  StreamLake: "StreamLake",
@@ -14,7 +14,7 @@ export declare const UpdateBYOKKeyRequestDeclaredRegion: {
14
14
  export type UpdateBYOKKeyRequestDeclaredRegion = OpenEnum<typeof UpdateBYOKKeyRequestDeclaredRegion>;
15
15
  export type UpdateBYOKKeyRequest = {
16
16
  /**
17
- * Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` clears the restriction. Must contain at least one hash if provided. Hashes that do not belong to your account return a 400; for a workspace-scoped management key, so do hashes of API keys outside its own workspace.
17
+ * Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` clears the restriction. Must contain at least one hash if provided. Hashes that do not belong to your account return a 400; for a credential pinned to a workspace, so do hashes of API keys outside that workspace, unless the credential already lists them (a listed key that has since moved to another workspace stays listed and can be written back).
18
18
  */
19
19
  allowedApiKeyHashes?: Array<string> | null | undefined;
20
20
  /**
@@ -3,7 +3,7 @@ import { ObservabilityDataRegionInput } from "./observabilitydataregioninput.js"
3
3
  import { ObservabilityFilterRulesConfigNullable, ObservabilityFilterRulesConfigNullable$Outbound } from "./observabilityfilterrulesconfignullable.js";
4
4
  export type UpdateObservabilityDestinationRequest = {
5
5
  /**
6
- * Optional allowlist of OpenRouter API key hashes. `null` clears the filter (all keys). Omitting leaves the current value, including any API key from another workspace that an organization-scoped key attached. Must contain at least one hash if provided. A workspace-scoped management key can only name API keys in its own workspace; any other hash returns 400.
6
+ * Optional allowlist of OpenRouter API key hashes. `null` clears the filter (all keys). Omitting leaves the current value. Must contain at least one hash if provided. Every hash must belong to an API key in the destination's workspace; any other hash returns 400. A hash the destination already lists is kept even if that key has since moved to another workspace, so an already-listed hash can always be written back.
7
7
  */
8
8
  apiKeyHashes?: Array<string> | null | undefined;
9
9
  /**
@@ -5,7 +5,7 @@ import { InputReference, InputReference$Outbound } from "./inputreference.js";
5
5
  import { ProviderName } from "./providername.js";
6
6
  import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js";
7
7
  /**
8
- * Aspect ratio of the generated video
8
+ * Aspect ratio of the generated video. Omit it to use the model default, which on models with adaptive aspect ratio (e.g. BytePlus Seedance) follows the input image or video.
9
9
  */
10
10
  export declare const VideoGenerationRequestAspectRatio: {
11
11
  readonly OneHundredAndSixtyNine: "16:9";
@@ -19,7 +19,7 @@ export declare const VideoGenerationRequestAspectRatio: {
19
19
  readonly NineHundredAndTwentyOne: "9:21";
20
20
  };
21
21
  /**
22
- * Aspect ratio of the generated video
22
+ * Aspect ratio of the generated video. Omit it to use the model default, which on models with adaptive aspect ratio (e.g. BytePlus Seedance) follows the input image or video.
23
23
  */
24
24
  export type VideoGenerationRequestAspectRatio = OpenEnum<typeof VideoGenerationRequestAspectRatio>;
25
25
  export type VideoGenerationRequestIgnore = ProviderName | string;
@@ -427,6 +427,9 @@ export type VideoGenerationRequestOptions = {
427
427
  sourceful?: {
428
428
  [k: string]: any;
429
429
  } | undefined;
430
+ speechify?: {
431
+ [k: string]: any;
432
+ } | undefined;
430
433
  stealth?: {
431
434
  [k: string]: any;
432
435
  } | undefined;
@@ -532,7 +535,7 @@ export declare const VideoGenerationRequestResolution: {
532
535
  export type VideoGenerationRequestResolution = OpenEnum<typeof VideoGenerationRequestResolution>;
533
536
  export type VideoGenerationRequest = {
534
537
  /**
535
- * Aspect ratio of the generated video
538
+ * Aspect ratio of the generated video. Omit it to use the model default, which on models with adaptive aspect ratio (e.g. BytePlus Seedance) follows the input image or video.
536
539
  */
537
540
  aspectRatio?: VideoGenerationRequestAspectRatio | undefined;
538
541
  /**
@@ -544,7 +547,7 @@ export type VideoGenerationRequest = {
544
547
  */
545
548
  creativity?: number | undefined;
546
549
  /**
547
- * Duration of the generated video in seconds
550
+ * Duration of the generated video in seconds, or -1 to let the provider choose the length (e.g. following an input video). -1 is only accepted by models that list it in supported_durations.
548
551
  */
549
552
  duration?: number | undefined;
550
553
  /**
@@ -1014,6 +1017,9 @@ export type VideoGenerationRequestOptions$Outbound = {
1014
1017
  sourceful?: {
1015
1018
  [k: string]: any;
1016
1019
  } | undefined;
1020
+ speechify?: {
1021
+ [k: string]: any;
1022
+ } | undefined;
1017
1023
  stealth?: {
1018
1024
  [k: string]: any;
1019
1025
  } | undefined;
@@ -10,7 +10,7 @@ import { InputReference$outboundSchema, } from "./inputreference.js";
10
10
  import { ProviderName$outboundSchema } from "./providername.js";
11
11
  import { TraceConfig$outboundSchema, } from "./traceconfig.js";
12
12
  /**
13
- * Aspect ratio of the generated video
13
+ * Aspect ratio of the generated video. Omit it to use the model default, which on models with adaptive aspect ratio (e.g. BytePlus Seedance) follows the input image or video.
14
14
  */
15
15
  export const VideoGenerationRequestAspectRatio = {
16
16
  OneHundredAndSixtyNine: "16:9",
@@ -183,6 +183,7 @@ export const VideoGenerationRequestOptions$outboundSchema = z.object({
183
183
  sfCompute: z.record(z.string(), z.any()).optional(),
184
184
  siliconflow: z.record(z.string(), z.any()).optional(),
185
185
  sourceful: z.record(z.string(), z.any()).optional(),
186
+ speechify: z.record(z.string(), z.any()).optional(),
186
187
  stealth: z.record(z.string(), z.any()).optional(),
187
188
  stepfun: z.record(z.string(), z.any()).optional(),
188
189
  streamlake: z.record(z.string(), z.any()).optional(),
@@ -165,7 +165,7 @@ export type VideoModel = {
165
165
  */
166
166
  supportedAspectRatios: Array<SupportedAspectRatio> | null;
167
167
  /**
168
- * Supported video durations in seconds
168
+ * Supported video durations in seconds. -1 means the model accepts duration -1 and chooses the length itself.
169
169
  */
170
170
  supportedDurations: Array<number> | null;
171
171
  /**
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.5.85",
5
+ "version": "1.5.87",
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.5.85",
3
+ "version": "1.5.87",
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 && node scripts/unbarrel-imports.js",
75
75
  "prepublishOnly": "npm run build",
76
76
  "compile": "tsc && node scripts/unbarrel-imports.js",
77
- "postinstall": "node scripts/check-types.js || true",
78
- "test": "vitest --run --project unit",
79
- "test:e2e": "vitest --run --project e2e",
80
- "test:watch": "vitest --watch --project unit",
81
77
  "prepare": "npm run build",
82
78
  "test:transit": "exit 0",
79
+ "test:watch": "vitest --watch --project unit",
83
80
  "typecheck": "tsc --noEmit",
84
- "typecheck:transit": "exit 0"
81
+ "typecheck:transit": "exit 0",
82
+ "postinstall": "node scripts/check-types.js || true",
83
+ "test": "vitest --run --project unit",
84
+ "test:e2e": "vitest --run --project e2e"
85
85
  },
86
86
  "peerDependencies": {
87
87