@openrouter/sdk 1.2.0 → 1.2.2

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: "1.2.0";
52
+ readonly sdkVersion: "1.2.2";
53
53
  readonly genVersion: "2.914.0";
54
- readonly userAgent: "speakeasy-sdk/typescript 1.2.0 2.914.0 1.0.0 @openrouter/sdk";
54
+ readonly userAgent: "speakeasy-sdk/typescript 1.2.2 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.2.0",
29
+ sdkVersion: "1.2.2",
30
30
  genVersion: "2.914.0",
31
- userAgent: "speakeasy-sdk/typescript 1.2.0 2.914.0 1.0.0 @openrouter/sdk",
31
+ userAgent: "speakeasy-sdk/typescript 1.2.2 2.914.0 1.0.0 @openrouter/sdk",
32
32
  };
33
33
  //# sourceMappingURL=config.js.map
@@ -94,6 +94,7 @@ export declare const BYOKProviderSlug: {
94
94
  readonly Switchpoint: "switchpoint";
95
95
  readonly Tencent: "tencent";
96
96
  readonly Tenstorrent: "tenstorrent";
97
+ readonly Thinkingmachines: "thinkingmachines";
97
98
  readonly Together: "together";
98
99
  readonly Upstage: "upstage";
99
100
  readonly Venice: "venice";
@@ -97,6 +97,7 @@ export const BYOKProviderSlug = {
97
97
  Switchpoint: "switchpoint",
98
98
  Tencent: "tencent",
99
99
  Tenstorrent: "tenstorrent",
100
+ Thinkingmachines: "thinkingmachines",
100
101
  Together: "together",
101
102
  Upstage: "upstage",
102
103
  Venice: "venice",
@@ -82,17 +82,18 @@ export type ChatRequestReasoningEffort = OpenEnum<typeof ChatRequestReasoningEff
82
82
  */
83
83
  export type ResponseFormat = ChatFormatGrammarConfig | ChatFormatJsonObjectConfig | ChatFormatJsonSchemaConfig | ChatFormatPythonConfig | ChatFormatTextConfig;
84
84
  /**
85
- * The service tier to use for processing this request.
85
+ * The service tier to use for processing this request. `fast` is accepted as an alias for `priority`.
86
86
  */
87
87
  export declare const ChatRequestServiceTier: {
88
88
  readonly Auto: "auto";
89
89
  readonly Default: "default";
90
+ readonly Fast: "fast";
90
91
  readonly Flex: "flex";
91
92
  readonly Priority: "priority";
92
93
  readonly Scale: "scale";
93
94
  };
94
95
  /**
95
- * The service tier to use for processing this request.
96
+ * The service tier to use for processing this request. `fast` is accepted as an alias for `priority`.
96
97
  */
97
98
  export type ChatRequestServiceTier = OpenEnum<typeof ChatRequestServiceTier>;
98
99
  /**
@@ -211,7 +212,7 @@ export type ChatRequest = {
211
212
  */
212
213
  seed?: number | null | undefined;
213
214
  /**
214
- * The service tier to use for processing this request.
215
+ * The service tier to use for processing this request. `fast` is accepted as an alias for `priority`.
215
216
  */
216
217
  serviceTier?: ChatRequestServiceTier | null | undefined;
217
218
  /**
@@ -63,11 +63,12 @@ export const ChatRequestReasoningEffort = {
63
63
  None: "none",
64
64
  };
65
65
  /**
66
- * The service tier to use for processing this request.
66
+ * The service tier to use for processing this request. `fast` is accepted as an alias for `priority`.
67
67
  */
68
68
  export const ChatRequestServiceTier = {
69
69
  Auto: "auto",
70
70
  Default: "default",
71
+ Fast: "fast",
71
72
  Flex: "flex",
72
73
  Priority: "priority",
73
74
  Scale: "scale",
@@ -365,6 +365,9 @@ export type ImageGenerationProviderPreferencesOptions = {
365
365
  tenstorrent?: {
366
366
  [k: string]: any;
367
367
  } | undefined;
368
+ thinkingmachines?: {
369
+ [k: string]: any;
370
+ } | undefined;
368
371
  together?: {
369
372
  [k: string]: any;
370
373
  } | undefined;
@@ -806,6 +809,9 @@ export type ImageGenerationProviderPreferencesOptions$Outbound = {
806
809
  tenstorrent?: {
807
810
  [k: string]: any;
808
811
  } | undefined;
812
+ thinkingmachines?: {
813
+ [k: string]: any;
814
+ } | undefined;
809
815
  together?: {
810
816
  [k: string]: any;
811
817
  } | undefined;
@@ -138,6 +138,7 @@ export const ImageGenerationProviderPreferencesOptions$outboundSchema = z.object
138
138
  targon: z.record(z.string(), z.any()).optional(),
139
139
  tencent: z.record(z.string(), z.any()).optional(),
140
140
  tenstorrent: z.record(z.string(), z.any()).optional(),
141
+ thinkingmachines: z.record(z.string(), z.any()).optional(),
141
142
  together: z.record(z.string(), z.any()).optional(),
142
143
  togetherLite: z.record(z.string(), z.any()).optional(),
143
144
  ubicloud: z.record(z.string(), z.any()).optional(),
@@ -118,6 +118,7 @@ export declare const Provider: {
118
118
  readonly Switchpoint: "switchpoint";
119
119
  readonly Tencent: "tencent";
120
120
  readonly Tenstorrent: "tenstorrent";
121
+ readonly Thinkingmachines: "thinkingmachines";
121
122
  readonly Together: "together";
122
123
  readonly Upstage: "upstage";
123
124
  readonly Venice: "venice";
@@ -101,6 +101,7 @@ export const Provider = {
101
101
  Switchpoint: "switchpoint",
102
102
  Tencent: "tencent",
103
103
  Tenstorrent: "tenstorrent",
104
+ Thinkingmachines: "thinkingmachines",
104
105
  Together: "together",
105
106
  Upstage: "upstage",
106
107
  Venice: "venice",
@@ -91,6 +91,7 @@ export declare const ProviderName: {
91
91
  readonly Switchpoint: "Switchpoint";
92
92
  readonly Tencent: "Tencent";
93
93
  readonly Tenstorrent: "Tenstorrent";
94
+ readonly ThinkingMachines: "Thinking Machines";
94
95
  readonly Together: "Together";
95
96
  readonly Upstage: "Upstage";
96
97
  readonly Venice: "Venice";
@@ -94,6 +94,7 @@ export const ProviderName = {
94
94
  Switchpoint: "Switchpoint",
95
95
  Tencent: "Tencent",
96
96
  Tenstorrent: "Tenstorrent",
97
+ ThinkingMachines: "Thinking Machines",
97
98
  Together: "Together",
98
99
  Upstage: "Upstage",
99
100
  Venice: "Venice",
@@ -360,6 +360,9 @@ export type ProviderOptions = {
360
360
  tenstorrent?: {
361
361
  [k: string]: any;
362
362
  } | undefined;
363
+ thinkingmachines?: {
364
+ [k: string]: any;
365
+ } | undefined;
363
366
  together?: {
364
367
  [k: string]: any;
365
368
  } | undefined;
@@ -756,6 +759,9 @@ export type ProviderOptions$Outbound = {
756
759
  tenstorrent?: {
757
760
  [k: string]: any;
758
761
  } | undefined;
762
+ thinkingmachines?: {
763
+ [k: string]: any;
764
+ } | undefined;
759
765
  together?: {
760
766
  [k: string]: any;
761
767
  } | undefined;
@@ -125,6 +125,7 @@ export const ProviderOptions$outboundSchema = z.object({
125
125
  targon: z.record(z.string(), z.any()).optional(),
126
126
  tencent: z.record(z.string(), z.any()).optional(),
127
127
  tenstorrent: z.record(z.string(), z.any()).optional(),
128
+ thinkingmachines: z.record(z.string(), z.any()).optional(),
128
129
  together: z.record(z.string(), z.any()).optional(),
129
130
  togetherLite: z.record(z.string(), z.any()).optional(),
130
131
  ubicloud: z.record(z.string(), z.any()).optional(),
@@ -123,6 +123,7 @@ export declare const ProviderResponseProviderName: {
123
123
  readonly Switchpoint: "Switchpoint";
124
124
  readonly Tencent: "Tencent";
125
125
  readonly Tenstorrent: "Tenstorrent";
126
+ readonly ThinkingMachines: "Thinking Machines";
126
127
  readonly Together: "Together";
127
128
  readonly Upstage: "Upstage";
128
129
  readonly Venice: "Venice";
@@ -127,6 +127,7 @@ export const ProviderResponseProviderName = {
127
127
  Switchpoint: "Switchpoint",
128
128
  Tencent: "Tencent",
129
129
  Tenstorrent: "Tenstorrent",
130
+ ThinkingMachines: "Thinking Machines",
130
131
  Together: "Together",
131
132
  Upstage: "Upstage",
132
133
  Venice: "Venice",
@@ -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 DataResidencyMismatch: "data_residency_mismatch";
25
26
  };
26
27
  export type Code = OpenEnum<typeof Code>;
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
+ DataResidencyMismatch: "data_residency_mismatch",
28
29
  };
29
30
  /** @internal */
30
31
  export const Code$inboundSchema = openEnums
@@ -69,13 +69,20 @@ export type ReasoningConfig = {
69
69
  enabled?: boolean | null | undefined;
70
70
  maxTokens?: number | null | undefined;
71
71
  };
72
+ /**
73
+ * The service tier to use for processing this request. `fast` is accepted as an alias for `priority`.
74
+ */
72
75
  export declare const ResponsesRequestServiceTier: {
73
76
  readonly Auto: "auto";
74
77
  readonly Default: "default";
78
+ readonly Fast: "fast";
75
79
  readonly Flex: "flex";
76
80
  readonly Priority: "priority";
77
81
  readonly Scale: "scale";
78
82
  };
83
+ /**
84
+ * The service tier to use for processing this request. `fast` is accepted as an alias for `priority`.
85
+ */
79
86
  export type ResponsesRequestServiceTier = OpenEnum<typeof ResponsesRequestServiceTier>;
80
87
  /**
81
88
  * Function tool definition
@@ -213,6 +220,9 @@ export type ResponsesRequest = {
213
220
  * Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account.
214
221
  */
215
222
  safetyIdentifier?: string | null | undefined;
223
+ /**
224
+ * The service tier to use for processing this request. `fast` is accepted as an alias for `priority`.
225
+ */
216
226
  serviceTier?: ResponsesRequestServiceTier | null | undefined;
217
227
  /**
218
228
  * A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.
@@ -59,9 +59,13 @@ import { WebFetchServerTool$outboundSchema, } from "./webfetchservertool.js";
59
59
  import { WebSearchPlugin$outboundSchema, } from "./websearchplugin.js";
60
60
  import { WebSearchServerTool$outboundSchema, } from "./websearchservertool.js";
61
61
  import { WebSearchServerToolOpenRouter$outboundSchema, } from "./websearchservertoolopenrouter.js";
62
+ /**
63
+ * The service tier to use for processing this request. `fast` is accepted as an alias for `priority`.
64
+ */
62
65
  export const ResponsesRequestServiceTier = {
63
66
  Auto: "auto",
64
67
  Default: "default",
68
+ Fast: "fast",
65
69
  Flex: "flex",
66
70
  Priority: "priority",
67
71
  Scale: "scale",
@@ -381,6 +381,9 @@ export type VideoGenerationRequestOptions = {
381
381
  tenstorrent?: {
382
382
  [k: string]: any;
383
383
  } | undefined;
384
+ thinkingmachines?: {
385
+ [k: string]: any;
386
+ } | undefined;
384
387
  together?: {
385
388
  [k: string]: any;
386
389
  } | undefined;
@@ -848,6 +851,9 @@ export type VideoGenerationRequestOptions$Outbound = {
848
851
  tenstorrent?: {
849
852
  [k: string]: any;
850
853
  } | undefined;
854
+ thinkingmachines?: {
855
+ [k: string]: any;
856
+ } | undefined;
851
857
  together?: {
852
858
  [k: string]: any;
853
859
  } | undefined;
@@ -156,6 +156,7 @@ export const VideoGenerationRequestOptions$outboundSchema = z.object({
156
156
  targon: z.record(z.string(), z.any()).optional(),
157
157
  tencent: z.record(z.string(), z.any()).optional(),
158
158
  tenstorrent: z.record(z.string(), z.any()).optional(),
159
+ thinkingmachines: z.record(z.string(), z.any()).optional(),
159
160
  together: z.record(z.string(), z.any()).optional(),
160
161
  togetherLite: z.record(z.string(), z.any()).optional(),
161
162
  ubicloud: z.record(z.string(), z.any()).optional(),
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.2.0",
5
+ "version": "1.2.2",
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.0",
3
+ "version": "1.2.2",
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
- "prepare": "npm run build",
77
- "test": "vitest --run --project unit",
78
- "test:transit": "exit 0",
79
- "typecheck": "tsc --noEmit",
80
- "typecheck:transit": "exit 0",
81
76
  "compile": "tsc",
82
77
  "postinstall": "node scripts/check-types.js || true",
83
78
  "test:e2e": "vitest --run --project e2e",
84
- "test:watch": "vitest --watch --project unit"
79
+ "test:transit": "exit 0",
80
+ "typecheck": "tsc --noEmit",
81
+ "prepare": "npm run build",
82
+ "test": "vitest --run --project unit",
83
+ "test:watch": "vitest --watch --project unit",
84
+ "typecheck:transit": "exit 0"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {