@openrouter/sdk 1.5.37 → 1.5.38

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.5.37";
53
+ readonly sdkVersion: "1.5.38";
54
54
  readonly genVersion: "2.950.13";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.5.37 2.950.13 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.5.38 2.950.13 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.5.37",
32
+ sdkVersion: "1.5.38",
33
33
  genVersion: "2.950.13",
34
- userAgent: "speakeasy-sdk/typescript 1.5.37 2.950.13 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.5.38 2.950.13 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -5,6 +5,7 @@ import { DecisionsBoxAnswer } from "./decisionsboxanswer.js";
5
5
  import { DecisionsChoiceAnswer } from "./decisionschoiceanswer.js";
6
6
  import { DecisionsNoulAnswer } from "./decisionsnoulanswer.js";
7
7
  import { DecisionsScoreAnswer } from "./decisionsscoreanswer.js";
8
+ import { DecisionsUsageInputTokensDetails } from "./decisionsusageinputtokensdetails.js";
8
9
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
9
10
  /**
10
11
  * A Decisions answer using a boolean, choice, score, or image bounding-box evaluation.
@@ -13,6 +14,10 @@ export type DecisionsResponseAnswers = DecisionsBoxAnswer | DecisionsChoiceAnswe
13
14
  export type DecisionsResponseUsage = {
14
15
  cost?: number | undefined;
15
16
  inputTokens: number;
17
+ /**
18
+ * Of `input_tokens`, those the provider served from its prompt cache.
19
+ */
20
+ inputTokensDetails?: DecisionsUsageInputTokensDetails | undefined;
16
21
  outputTokens: number;
17
22
  };
18
23
  export type DecisionsResponse = {
@@ -10,6 +10,7 @@ import { DecisionsBoxAnswer$inboundSchema, } from "./decisionsboxanswer.js";
10
10
  import { DecisionsChoiceAnswer$inboundSchema, } from "./decisionschoiceanswer.js";
11
11
  import { DecisionsNoulAnswer$inboundSchema, } from "./decisionsnoulanswer.js";
12
12
  import { DecisionsScoreAnswer$inboundSchema, } from "./decisionsscoreanswer.js";
13
+ import { DecisionsUsageInputTokensDetails$inboundSchema, } from "./decisionsusageinputtokensdetails.js";
13
14
  /** @internal */
14
15
  export const DecisionsResponseAnswers$inboundSchema = discriminatedUnion("type", {
15
16
  box: DecisionsBoxAnswer$inboundSchema,
@@ -24,10 +25,13 @@ export function decisionsResponseAnswersFromJSON(jsonString) {
24
25
  export const DecisionsResponseUsage$inboundSchema = z.object({
25
26
  cost: z.number().optional(),
26
27
  input_tokens: z.int(),
28
+ input_tokens_details: DecisionsUsageInputTokensDetails$inboundSchema
29
+ .optional(),
27
30
  output_tokens: z.int(),
28
31
  }).transform((v) => {
29
32
  return remap$(v, {
30
33
  "input_tokens": "inputTokens",
34
+ "input_tokens_details": "inputTokensDetails",
31
35
  "output_tokens": "outputTokens",
32
36
  });
33
37
  });
@@ -0,0 +1,13 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ /**
5
+ * Of `input_tokens`, those the provider served from its prompt cache.
6
+ */
7
+ export type DecisionsUsageInputTokensDetails = {
8
+ cachedTokens: number;
9
+ };
10
+ /** @internal */
11
+ export declare const DecisionsUsageInputTokensDetails$inboundSchema: z.ZodType<DecisionsUsageInputTokensDetails, unknown>;
12
+ export declare function decisionsUsageInputTokensDetailsFromJSON(jsonString: string): SafeParseResult<DecisionsUsageInputTokensDetails, SDKValidationError>;
13
+ //# sourceMappingURL=decisionsusageinputtokensdetails.d.ts.map
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: b181089cef6c
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { safeParse } from "../lib/schemas.js";
8
+ /** @internal */
9
+ export const DecisionsUsageInputTokensDetails$inboundSchema = z.object({
10
+ cached_tokens: z.int(),
11
+ }).transform((v) => {
12
+ return remap$(v, {
13
+ "cached_tokens": "cachedTokens",
14
+ });
15
+ });
16
+ export function decisionsUsageInputTokensDetailsFromJSON(jsonString) {
17
+ return safeParse(jsonString, (x) => DecisionsUsageInputTokensDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DecisionsUsageInputTokensDetails' from JSON`);
18
+ }
19
+ //# sourceMappingURL=decisionsusageinputtokensdetails.js.map
@@ -310,6 +310,7 @@ export * from "./decisionsrequest.js";
310
310
  export * from "./decisionsresponse.js";
311
311
  export * from "./decisionsscoreanswer.js";
312
312
  export * from "./decisionsscorequestion.js";
313
+ export * from "./decisionsusageinputtokensdetails.js";
313
314
  export * from "./defaultparameters.js";
314
315
  export * from "./deferredbm25search.js";
315
316
  export * from "./deferredcustomsearch.js";
@@ -314,6 +314,7 @@ export * from "./decisionsrequest.js";
314
314
  export * from "./decisionsresponse.js";
315
315
  export * from "./decisionsscoreanswer.js";
316
316
  export * from "./decisionsscorequestion.js";
317
+ export * from "./decisionsusageinputtokensdetails.js";
317
318
  export * from "./defaultparameters.js";
318
319
  export * from "./deferredbm25search.js";
319
320
  export * from "./deferredcustomsearch.js";
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.5.37",
5
+ "version": "1.5.38",
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.5.37",
3
+ "version": "1.5.38",
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 && node scripts/unbarrel-imports.js",
75
75
  "prepublishOnly": "npm run build",
76
+ "typecheck": "tsc --noEmit",
77
+ "typecheck:transit": "exit 0",
76
78
  "compile": "tsc && node scripts/unbarrel-imports.js",
79
+ "test:watch": "vitest --watch --project unit",
80
+ "postinstall": "node scripts/check-types.js || true",
77
81
  "prepare": "npm run build",
78
82
  "test": "vitest --run --project unit",
79
83
  "test:e2e": "vitest --run --project e2e",
80
- "test:transit": "exit 0",
81
- "typecheck:transit": "exit 0",
82
- "postinstall": "node scripts/check-types.js || true",
83
- "test:watch": "vitest --watch --project unit",
84
- "typecheck": "tsc --noEmit"
84
+ "test:transit": "exit 0"
85
85
  },
86
86
  "peerDependencies": {
87
87