@openrouter/sdk 1.4.15 → 1.4.17

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.4.15";
53
+ readonly sdkVersion: "1.4.17";
54
54
  readonly genVersion: "2.914.0";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.4.15 2.914.0 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.4.17 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.15",
32
+ sdkVersion: "1.4.17",
33
33
  genVersion: "2.914.0",
34
- userAgent: "speakeasy-sdk/typescript 1.4.15 2.914.0 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.4.17 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",
@@ -85,6 +85,7 @@ export declare const ImageGenerationRequestResolution: {
85
85
  readonly FiveHundredAndTwelve: "512";
86
86
  readonly SevenHundredAndSixtyEight: "768";
87
87
  readonly OneK: "1K";
88
+ readonly OneDot5K: "1.5K";
88
89
  readonly TwoK: "2K";
89
90
  readonly FourK: "4K";
90
91
  };
@@ -74,6 +74,7 @@ export const ImageGenerationRequestResolution = {
74
74
  FiveHundredAndTwelve: "512",
75
75
  SevenHundredAndSixtyEight: "768",
76
76
  OneK: "1K",
77
+ OneDot5K: "1.5K",
77
78
  TwoK: "2K",
78
79
  FourK: "4K",
79
80
  };
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.4.15",
5
+ "version": "1.4.17",
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.4.15",
3
+ "version": "1.4.17",
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
- "provenance": true,
25
- "access": "public"
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
+ "test:transit": "exit 0",
77
+ "test:watch": "vitest --watch --project unit",
76
78
  "typecheck:transit": "exit 0",
77
- "compile": "tsc && node scripts/unbarrel-imports.js",
78
79
  "postinstall": "node scripts/check-types.js || true",
80
+ "prepare": "npm run build",
79
81
  "test:e2e": "vitest --run --project e2e",
80
- "test:watch": "vitest --watch --project unit",
81
82
  "typecheck": "tsc --noEmit",
82
- "prepare": "npm run build",
83
- "test": "vitest --run --project unit",
84
- "test:transit": "exit 0"
83
+ "compile": "tsc && node scripts/unbarrel-imports.js",
84
+ "test": "vitest --run --project unit"
85
85
  },
86
86
  "peerDependencies": {
87
87