@openrouter/sdk 1.2.1 → 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.
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/chatrequest.d.ts +4 -3
- package/esm/models/chatrequest.js +2 -1
- package/esm/models/responseserrorfield.d.ts +1 -0
- package/esm/models/responseserrorfield.js +1 -0
- package/esm/models/responsesrequest.d.ts +10 -0
- package/esm/models/responsesrequest.js +4 -0
- package/jsr.json +1 -1
- package/package.json +7 -7
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.2.
|
|
52
|
+
readonly sdkVersion: "1.2.2";
|
|
53
53
|
readonly genVersion: "2.914.0";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
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.
|
|
29
|
+
sdkVersion: "1.2.2",
|
|
30
30
|
genVersion: "2.914.0",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 1.2.2 2.914.0 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -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",
|
|
@@ -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",
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.2.
|
|
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": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"packageManager": "pnpm@10.22.0",
|
|
23
23
|
"publishConfig": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"provenance": true,
|
|
25
|
+
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"main": "./esm/index.js",
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
76
|
"compile": "tsc",
|
|
77
77
|
"postinstall": "node scripts/check-types.js || true",
|
|
78
|
+
"test:e2e": "vitest --run --project e2e",
|
|
79
|
+
"test:transit": "exit 0",
|
|
80
|
+
"typecheck": "tsc --noEmit",
|
|
78
81
|
"prepare": "npm run build",
|
|
79
82
|
"test": "vitest --run --project unit",
|
|
80
|
-
"test:transit": "exit 0",
|
|
81
83
|
"test:watch": "vitest --watch --project unit",
|
|
82
|
-
"typecheck:transit": "exit 0"
|
|
83
|
-
"test:e2e": "vitest --run --project e2e",
|
|
84
|
-
"typecheck": "tsc --noEmit"
|
|
84
|
+
"typecheck:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|