@openrouter/sdk 0.13.47 → 0.13.49

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.
@@ -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: "0.13.47";
52
+ readonly sdkVersion: "0.13.49";
53
53
  readonly genVersion: "2.884.4";
54
- readonly userAgent: "speakeasy-sdk/typescript 0.13.47 2.884.4 1.0.0 @openrouter/sdk";
54
+ readonly userAgent: "speakeasy-sdk/typescript 0.13.49 2.884.4 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: "0.13.47",
29
+ sdkVersion: "0.13.49",
30
30
  genVersion: "2.884.4",
31
- userAgent: "speakeasy-sdk/typescript 0.13.47 2.884.4 1.0.0 @openrouter/sdk",
31
+ userAgent: "speakeasy-sdk/typescript 0.13.49 2.884.4 1.0.0 @openrouter/sdk",
32
32
  };
33
33
  //# sourceMappingURL=config.js.map
@@ -0,0 +1,11 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ export type AnthropicCacheCreation = {
5
+ ephemeral1hInputTokens: number;
6
+ ephemeral5mInputTokens: number;
7
+ };
8
+ /** @internal */
9
+ export declare const AnthropicCacheCreation$inboundSchema: z.ZodType<AnthropicCacheCreation, unknown>;
10
+ export declare function anthropicCacheCreationFromJSON(jsonString: string): SafeParseResult<AnthropicCacheCreation, SDKValidationError>;
11
+ //# sourceMappingURL=anthropiccachecreation.d.ts.map
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 6772980a7ab5
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 AnthropicCacheCreation$inboundSchema = z.object({
10
+ ephemeral_1h_input_tokens: z.int(),
11
+ ephemeral_5m_input_tokens: z.int(),
12
+ }).transform((v) => {
13
+ return remap$(v, {
14
+ "ephemeral_1h_input_tokens": "ephemeral1hInputTokens",
15
+ "ephemeral_5m_input_tokens": "ephemeral5mInputTokens",
16
+ });
17
+ });
18
+ export function anthropicCacheCreationFromJSON(jsonString) {
19
+ return safeParse(jsonString, (x) => AnthropicCacheCreation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AnthropicCacheCreation' from JSON`);
20
+ }
21
+ //# sourceMappingURL=anthropiccachecreation.js.map
@@ -1,5 +1,6 @@
1
1
  import * as z from "zod/v4";
2
2
  import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { AnthropicCacheCreation } from "./anthropiccachecreation.js";
3
4
  import { AnthropicSpeed } from "./anthropicspeed.js";
4
5
  import { AnthropicUsageIteration } from "./anthropicusageiteration.js";
5
6
  import { CostDetails } from "./costdetails.js";
@@ -64,6 +65,7 @@ export type ServerToolUse = {
64
65
  * Token and cost usage for the image generation request, when available
65
66
  */
66
67
  export type ImageGenerationUsage = {
68
+ cacheCreation?: AnthropicCacheCreation | null | undefined;
67
69
  /**
68
70
  * The tokens generated
69
71
  */
@@ -5,6 +5,7 @@
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { safeParse } from "../lib/schemas.js";
8
+ import { AnthropicCacheCreation$inboundSchema, } from "./anthropiccachecreation.js";
8
9
  import { AnthropicSpeed$inboundSchema, } from "./anthropicspeed.js";
9
10
  import { AnthropicUsageIteration$inboundSchema, } from "./anthropicusageiteration.js";
10
11
  import { CostDetails$inboundSchema } from "./costdetails.js";
@@ -60,6 +61,7 @@ export function serverToolUseFromJSON(jsonString) {
60
61
  }
61
62
  /** @internal */
62
63
  export const ImageGenerationUsage$inboundSchema = z.object({
64
+ cache_creation: z.nullable(AnthropicCacheCreation$inboundSchema).optional(),
63
65
  completion_tokens: z.int(),
64
66
  completion_tokens_details: z.nullable(z.lazy(() => ImageGenerationUsageCompletionTokensDetails$inboundSchema)).optional(),
65
67
  cost: z.nullable(z.number()).optional(),
@@ -76,6 +78,7 @@ export const ImageGenerationUsage$inboundSchema = z.object({
76
78
  total_tokens: z.int(),
77
79
  }).transform((v) => {
78
80
  return remap$(v, {
81
+ "cache_creation": "cacheCreation",
79
82
  "completion_tokens": "completionTokens",
80
83
  "completion_tokens_details": "completionTokensDetails",
81
84
  "cost_details": "costDetails",
@@ -14,6 +14,7 @@ export * from "./anthropicbase64imagesource.js";
14
14
  export * from "./anthropicbase64pdfsource.js";
15
15
  export * from "./anthropiccachecontroldirective.js";
16
16
  export * from "./anthropiccachecontrolttl.js";
17
+ export * from "./anthropiccachecreation.js";
17
18
  export * from "./anthropiccitationcharlocationparam.js";
18
19
  export * from "./anthropiccitationcontentblocklocationparam.js";
19
20
  export * from "./anthropiccitationpagelocationparam.js";
@@ -18,6 +18,7 @@ export * from "./anthropicbase64imagesource.js";
18
18
  export * from "./anthropicbase64pdfsource.js";
19
19
  export * from "./anthropiccachecontroldirective.js";
20
20
  export * from "./anthropiccachecontrolttl.js";
21
+ export * from "./anthropiccachecreation.js";
21
22
  export * from "./anthropiccitationcharlocationparam.js";
22
23
  export * from "./anthropiccitationcontentblocklocationparam.js";
23
24
  export * from "./anthropiccitationpagelocationparam.js";
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "0.13.47",
5
+ "version": "0.13.49",
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": "0.13.47",
3
+ "version": "0.13.49",
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,14 +73,14 @@
73
73
  "lint": "eslint --cache --max-warnings=0 src",
74
74
  "build": "tsc",
75
75
  "prepublishOnly": "npm run build",
76
- "compile": "tsc",
77
76
  "postinstall": "node scripts/check-types.js || true",
78
77
  "prepare": "npm run build",
79
78
  "test": "vitest --run --project unit",
80
79
  "test:e2e": "vitest --run --project e2e",
80
+ "typecheck": "tsc --noEmit",
81
+ "compile": "tsc",
81
82
  "test:transit": "exit 0",
82
83
  "test:watch": "vitest --watch --project unit",
83
- "typecheck": "tsc --noEmit",
84
84
  "typecheck:transit": "exit 0"
85
85
  },
86
86
  "peerDependencies": {},