@openrouter/sdk 1.2.83 → 1.2.85
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/costdetails.d.ts +4 -0
- package/esm/models/costdetails.js +2 -0
- package/esm/models/openresponsesresult.d.ts +4 -0
- package/esm/models/openresponsesresult.js +2 -0
- package/esm/models/operations/createauthkeyscode.d.ts +1 -1
- package/esm/models/operations/createkeys.d.ts +1 -1
- package/esm/models/operations/queryanalytics.d.ts +6 -0
- package/jsr.json +1 -1
- package/package.json +8 -8
package/esm/lib/config.d.ts
CHANGED
|
@@ -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.
|
|
53
|
+
readonly sdkVersion: "1.2.85";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.85 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.
|
|
32
|
+
sdkVersion: "1.2.85",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.2.85 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -5,6 +5,10 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
|
5
5
|
* Breakdown of upstream inference costs
|
|
6
6
|
*/
|
|
7
7
|
export type CostDetails = {
|
|
8
|
+
/**
|
|
9
|
+
* Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly.
|
|
10
|
+
*/
|
|
11
|
+
serverToolCost?: number | null | undefined;
|
|
8
12
|
upstreamInferenceCompletionsCost: number;
|
|
9
13
|
upstreamInferenceCost?: number | null | undefined;
|
|
10
14
|
upstreamInferencePromptCost: number;
|
|
@@ -8,11 +8,13 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
8
8
|
/** @internal */
|
|
9
9
|
export const CostDetails$inboundSchema = z
|
|
10
10
|
.object({
|
|
11
|
+
server_tool_cost: z.nullable(z.number()).optional(),
|
|
11
12
|
upstream_inference_completions_cost: z.number(),
|
|
12
13
|
upstream_inference_cost: z.nullable(z.number()).optional(),
|
|
13
14
|
upstream_inference_prompt_cost: z.number(),
|
|
14
15
|
}).transform((v) => {
|
|
15
16
|
return remap$(v, {
|
|
17
|
+
"server_tool_cost": "serverToolCost",
|
|
16
18
|
"upstream_inference_completions_cost": "upstreamInferenceCompletionsCost",
|
|
17
19
|
"upstream_inference_cost": "upstreamInferenceCost",
|
|
18
20
|
"upstream_inference_prompt_cost": "upstreamInferencePromptCost",
|
|
@@ -88,6 +88,10 @@ export type OutputTokensDetails = {
|
|
|
88
88
|
reasoningTokens: number;
|
|
89
89
|
};
|
|
90
90
|
export type UsageCostDetails = {
|
|
91
|
+
/**
|
|
92
|
+
* Metered server-tool execution cost (for example, shell sandbox time) billed for this request, in USD. Matches the billed checkpoint and settlement amounts exactly.
|
|
93
|
+
*/
|
|
94
|
+
serverToolCost?: number | null | undefined;
|
|
91
95
|
upstreamInferenceCost?: number | null | undefined;
|
|
92
96
|
upstreamInferenceInputCost: number;
|
|
93
97
|
upstreamInferenceOutputCost: number;
|
|
@@ -102,11 +102,13 @@ export function outputTokensDetailsFromJSON(jsonString) {
|
|
|
102
102
|
}
|
|
103
103
|
/** @internal */
|
|
104
104
|
export const UsageCostDetails$inboundSchema = z.object({
|
|
105
|
+
server_tool_cost: z.nullable(z.number()).optional(),
|
|
105
106
|
upstream_inference_cost: z.nullable(z.number()).optional(),
|
|
106
107
|
upstream_inference_input_cost: z.number(),
|
|
107
108
|
upstream_inference_output_cost: z.number(),
|
|
108
109
|
}).transform((v) => {
|
|
109
110
|
return remap$(v, {
|
|
111
|
+
"server_tool_cost": "serverToolCost",
|
|
110
112
|
"upstream_inference_cost": "upstreamInferenceCost",
|
|
111
113
|
"upstream_inference_input_cost": "upstreamInferenceInputCost",
|
|
112
114
|
"upstream_inference_output_cost": "upstreamInferenceOutputCost",
|
|
@@ -60,7 +60,7 @@ export type CreateAuthKeysCodeRequestBody = {
|
|
|
60
60
|
*/
|
|
61
61
|
codeChallengeMethod?: CreateAuthKeysCodeCodeChallengeMethod | undefined;
|
|
62
62
|
/**
|
|
63
|
-
* Optional expiration
|
|
63
|
+
* Optional ISO 8601 UTC expiration timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected.
|
|
64
64
|
*/
|
|
65
65
|
expiresAt?: Date | null | undefined;
|
|
66
66
|
/**
|
|
@@ -41,7 +41,7 @@ export type CreateKeysRequestBody = {
|
|
|
41
41
|
*/
|
|
42
42
|
creatorUserId?: string | null | undefined;
|
|
43
43
|
/**
|
|
44
|
-
* Optional ISO 8601 UTC timestamp
|
|
44
|
+
* Optional ISO 8601 UTC expiration timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected.
|
|
45
45
|
*/
|
|
46
46
|
expiresAt?: Date | null | undefined;
|
|
47
47
|
/**
|
|
@@ -102,7 +102,13 @@ export type OrderBy = {
|
|
|
102
102
|
field: string;
|
|
103
103
|
};
|
|
104
104
|
export type TimeRange = {
|
|
105
|
+
/**
|
|
106
|
+
* ISO 8601 UTC timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected.
|
|
107
|
+
*/
|
|
105
108
|
end: Date;
|
|
109
|
+
/**
|
|
110
|
+
* ISO 8601 UTC timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected.
|
|
111
|
+
*/
|
|
106
112
|
start: Date;
|
|
107
113
|
};
|
|
108
114
|
export type QueryAnalyticsRequestBody = {
|
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.85",
|
|
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
|
+
"access": "public",
|
|
25
|
+
"provenance": true
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"main": "./esm/index.js",
|
|
@@ -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:e2e": "vitest --run --project e2e",
|
|
77
|
+
"typecheck": "tsc --noEmit",
|
|
76
78
|
"compile": "tsc",
|
|
77
|
-
"prepare": "npm run build",
|
|
78
|
-
"test:transit": "exit 0",
|
|
79
|
-
"typecheck:transit": "exit 0",
|
|
80
79
|
"postinstall": "node scripts/check-types.js || true",
|
|
81
80
|
"test": "vitest --run --project unit",
|
|
82
|
-
"test:
|
|
81
|
+
"test:transit": "exit 0",
|
|
83
82
|
"test:watch": "vitest --watch --project unit",
|
|
84
|
-
"typecheck": "
|
|
83
|
+
"typecheck:transit": "exit 0",
|
|
84
|
+
"prepare": "npm run build"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|