@openrouter/sdk 1.4.15 → 1.4.16
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/activityitem.d.ts +4 -0
- package/esm/models/activityitem.js +2 -0
- package/jsr.json +1 -1
- package/package.json +7 -7
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.4.
|
|
53
|
+
readonly sdkVersion: "1.4.16";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.4.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.4.16 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.4.
|
|
32
|
+
sdkVersion: "1.4.16",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.4.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.4.16 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -6,6 +6,10 @@ export type ActivityItem = {
|
|
|
6
6
|
* BYOK inference cost in USD (external credits spent)
|
|
7
7
|
*/
|
|
8
8
|
byokUsageInference: number;
|
|
9
|
+
/**
|
|
10
|
+
* Total prompt tokens read from the provider prompt cache (cache hits). Generally a subset of `prompt_tokens`; for replayed response-cache hits the provider may report the two counters over disjoint token sets, so `cached_tokens` can exceed `prompt_tokens`.
|
|
11
|
+
*/
|
|
12
|
+
cachedTokens: number;
|
|
9
13
|
/**
|
|
10
14
|
* Total completion tokens generated
|
|
11
15
|
*/
|
|
@@ -9,6 +9,7 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
9
9
|
export const ActivityItem$inboundSchema = z
|
|
10
10
|
.object({
|
|
11
11
|
byok_usage_inference: z.number(),
|
|
12
|
+
cached_tokens: z.int(),
|
|
12
13
|
completion_tokens: z.int(),
|
|
13
14
|
date: z.string(),
|
|
14
15
|
endpoint_id: z.string(),
|
|
@@ -23,6 +24,7 @@ export const ActivityItem$inboundSchema = z
|
|
|
23
24
|
}).transform((v) => {
|
|
24
25
|
return remap$(v, {
|
|
25
26
|
"byok_usage_inference": "byokUsageInference",
|
|
27
|
+
"cached_tokens": "cachedTokens",
|
|
26
28
|
"completion_tokens": "completionTokens",
|
|
27
29
|
"endpoint_id": "endpointId",
|
|
28
30
|
"model_permaslug": "modelPermaslug",
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.16",
|
|
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 && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"typecheck:transit": "exit 0",
|
|
77
76
|
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
77
|
+
"test": "vitest --run --project unit",
|
|
78
78
|
"postinstall": "node scripts/check-types.js || true",
|
|
79
|
+
"prepare": "npm run build",
|
|
79
80
|
"test:e2e": "vitest --run --project e2e",
|
|
81
|
+
"test:transit": "exit 0",
|
|
80
82
|
"test:watch": "vitest --watch --project unit",
|
|
81
83
|
"typecheck": "tsc --noEmit",
|
|
82
|
-
"
|
|
83
|
-
"test": "vitest --run --project unit",
|
|
84
|
-
"test:transit": "exit 0"
|
|
84
|
+
"typecheck:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
|