@openrouter/sdk 1.5.115 → 1.5.116

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: "1.5.115";
52
+ readonly sdkVersion: "1.5.116";
53
53
  readonly genVersion: "2.960.8";
54
- readonly userAgent: "speakeasy-sdk/typescript 1.5.115 2.960.8 1.0.0 @openrouter/sdk";
54
+ readonly userAgent: "speakeasy-sdk/typescript 1.5.116 2.960.8 1.0.0 @openrouter/sdk";
55
55
  };
56
56
  //# sourceMappingURL=config.d.ts.map
package/esm/lib/config.js CHANGED
@@ -25,8 +25,8 @@ export function serverURLFromOptions(options) {
25
25
  export const SDK_METADATA = {
26
26
  language: "typescript",
27
27
  openapiDocVersion: "1.0.0",
28
- sdkVersion: "1.5.115",
28
+ sdkVersion: "1.5.116",
29
29
  genVersion: "2.960.8",
30
- userAgent: "speakeasy-sdk/typescript 1.5.115 2.960.8 1.0.0 @openrouter/sdk",
30
+ userAgent: "speakeasy-sdk/typescript 1.5.116 2.960.8 1.0.0 @openrouter/sdk",
31
31
  };
32
32
  //# sourceMappingURL=config.js.map
@@ -723,6 +723,7 @@ export * from "./privateendpointdeclaredparameter.js";
723
723
  export * from "./privateendpointdeclaredregion.js";
724
724
  export * from "./privateendpointparametercheck.js";
725
725
  export * from "./privateendpointpricing.js";
726
+ export * from "./privateendpointpromptcaching.js";
726
727
  export * from "./privateendpointquantization.js";
727
728
  export * from "./privateendpointreasoningreturnmechanism.js";
728
729
  export * from "./privateendpointresponse.js";
@@ -907,6 +908,7 @@ export * from "./updatemoderationguardrailpolicyrequest.js";
907
908
  export * from "./updateobservabilitydestinationrequest.js";
908
909
  export * from "./updateobservabilitydestinationresponse.js";
909
910
  export * from "./updateorganizationsettingsrequest.js";
911
+ export * from "./updateprivateendpointpromptcaching.js";
910
912
  export * from "./updateprivateendpointrequest.js";
911
913
  export * from "./updateprivateendpointsettingsrequest.js";
912
914
  export * from "./updateprivateproviderrequest.js";
@@ -726,6 +726,7 @@ export * from "./privateendpointdeclaredparameter.js";
726
726
  export * from "./privateendpointdeclaredregion.js";
727
727
  export * from "./privateendpointparametercheck.js";
728
728
  export * from "./privateendpointpricing.js";
729
+ export * from "./privateendpointpromptcaching.js";
729
730
  export * from "./privateendpointquantization.js";
730
731
  export * from "./privateendpointreasoningreturnmechanism.js";
731
732
  export * from "./privateendpointresponse.js";
@@ -910,6 +911,7 @@ export * from "./updatemoderationguardrailpolicyrequest.js";
910
911
  export * from "./updateobservabilitydestinationrequest.js";
911
912
  export * from "./updateobservabilitydestinationresponse.js";
912
913
  export * from "./updateorganizationsettingsrequest.js";
914
+ export * from "./updateprivateendpointpromptcaching.js";
913
915
  export * from "./updateprivateendpointrequest.js";
914
916
  export * from "./updateprivateendpointsettingsrequest.js";
915
917
  export * from "./updateprivateproviderrequest.js";
@@ -0,0 +1,20 @@
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
+ * Prompt-caching controls for an OpenAI-compatible private endpoint. Accepted fields default on after validation; explicit owner settings override the defaults.
6
+ */
7
+ export type PrivateEndpointPromptCaching = {
8
+ /**
9
+ * Forward top-level, message, and tool cache_control markers. Defaults on after endpoint validation accepts these fields; otherwise off. Set false to opt out, or true to declare support explicitly.
10
+ */
11
+ cacheControl: boolean;
12
+ /**
13
+ * Send an OpenRouter-derived, customer-isolated prompt_cache_key, not the caller-supplied key. Defaults on after endpoint validation accepts the field; otherwise off. Set false to opt out, or true to declare support explicitly. HIPAA and unknown workspace posture withhold OpenRouter caching directives and the derived key; this does not control upstream retention.
14
+ */
15
+ promptCacheKey: boolean;
16
+ };
17
+ /** @internal */
18
+ export declare const PrivateEndpointPromptCaching$inboundSchema: z.ZodType<PrivateEndpointPromptCaching, unknown>;
19
+ export declare function privateEndpointPromptCachingFromJSON(jsonString: string): SafeParseResult<PrivateEndpointPromptCaching, SDKValidationError>;
20
+ //# sourceMappingURL=privateendpointpromptcaching.d.ts.map
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4";
5
+ import { remap as remap$ } from "../lib/primitives.js";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ /** @internal */
8
+ export const PrivateEndpointPromptCaching$inboundSchema = z.object({
9
+ cache_control: z.boolean(),
10
+ prompt_cache_key: z.boolean(),
11
+ }).transform((v) => {
12
+ return remap$(v, {
13
+ "cache_control": "cacheControl",
14
+ "prompt_cache_key": "promptCacheKey",
15
+ });
16
+ });
17
+ export function privateEndpointPromptCachingFromJSON(jsonString) {
18
+ return safeParse(jsonString, (x) => PrivateEndpointPromptCaching$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PrivateEndpointPromptCaching' from JSON`);
19
+ }
20
+ //# sourceMappingURL=privateendpointpromptcaching.js.map
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
2
2
  import { OpenEnum } from "../types/enums.js";
3
3
  import { Result as SafeParseResult } from "../types/fp.js";
4
4
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
+ import { PrivateEndpointPromptCaching } from "./privateendpointpromptcaching.js";
5
6
  import { PrivateEndpointQuantization } from "./privateendpointquantization.js";
6
7
  import { PrivateEndpointReasoningReturnMechanism } from "./privateendpointreasoningreturnmechanism.js";
7
8
  export type PrivateEndpointSettingsCompletions = {
@@ -115,6 +116,10 @@ export type PrivateEndpointSettings = {
115
116
  * Longest prompt, in tokens, or `null` for no cap below the context length. Cannot exceed `context_length`, or the model context length while `context_length` is `null`.
116
117
  */
117
118
  maxPromptTokens: number | null;
119
+ /**
120
+ * Prompt-caching controls for an OpenAI-compatible private endpoint. Accepted fields default on after validation; explicit owner settings override the defaults.
121
+ */
122
+ promptCaching?: PrivateEndpointPromptCaching | undefined;
118
123
  /**
119
124
  * Weight precision the deployment runs at; `unknown` when not stated.
120
125
  */
@@ -5,6 +5,7 @@ import * as z from "zod/v4";
5
5
  import { remap as remap$ } from "../lib/primitives.js";
6
6
  import { safeParse } from "../lib/schemas.js";
7
7
  import * as openEnums from "../types/enums.js";
8
+ import { PrivateEndpointPromptCaching$inboundSchema, } from "./privateendpointpromptcaching.js";
8
9
  import { PrivateEndpointQuantization$inboundSchema, } from "./privateendpointquantization.js";
9
10
  import { PrivateEndpointReasoningReturnMechanism$inboundSchema, } from "./privateendpointreasoningreturnmechanism.js";
10
11
  export const PrivateEndpointSettingsExcludedParameter = {
@@ -93,6 +94,7 @@ export const PrivateEndpointSettings$inboundSchema = z.object({
93
94
  inputs: z.lazy(() => PrivateEndpointSettingsInputs$inboundSchema),
94
95
  max_completion_tokens: z.nullable(z.int()),
95
96
  max_prompt_tokens: z.nullable(z.int()),
97
+ prompt_caching: PrivateEndpointPromptCaching$inboundSchema.optional(),
96
98
  quantization: PrivateEndpointQuantization$inboundSchema,
97
99
  reasoning: z.lazy(() => PrivateEndpointSettingsReasoning$inboundSchema),
98
100
  tool_choice: z.lazy(() => PrivateEndpointSettingsToolChoice$inboundSchema),
@@ -102,6 +104,7 @@ export const PrivateEndpointSettings$inboundSchema = z.object({
102
104
  "excluded_parameters": "excludedParameters",
103
105
  "max_completion_tokens": "maxCompletionTokens",
104
106
  "max_prompt_tokens": "maxPromptTokens",
107
+ "prompt_caching": "promptCaching",
105
108
  "tool_choice": "toolChoice",
106
109
  });
107
110
  });
@@ -0,0 +1,23 @@
1
+ import * as z from "zod/v4";
2
+ /**
3
+ * Change only the named prompt-caching flags; omitted flags keep their stored value.
4
+ */
5
+ export type UpdatePrivateEndpointPromptCaching = {
6
+ /**
7
+ * Forward top-level, message, and tool cache_control markers. Defaults on after endpoint validation accepts these fields; otherwise off. Set false to opt out, or true to declare support explicitly.
8
+ */
9
+ cacheControl?: boolean | undefined;
10
+ /**
11
+ * Send an OpenRouter-derived, customer-isolated prompt_cache_key, not the caller-supplied key. Defaults on after endpoint validation accepts the field; otherwise off. Set false to opt out, or true to declare support explicitly. HIPAA and unknown workspace posture withhold OpenRouter caching directives and the derived key; this does not control upstream retention.
12
+ */
13
+ promptCacheKey?: boolean | undefined;
14
+ };
15
+ /** @internal */
16
+ export type UpdatePrivateEndpointPromptCaching$Outbound = {
17
+ cache_control?: boolean | undefined;
18
+ prompt_cache_key?: boolean | undefined;
19
+ };
20
+ /** @internal */
21
+ export declare const UpdatePrivateEndpointPromptCaching$outboundSchema: z.ZodType<UpdatePrivateEndpointPromptCaching$Outbound, UpdatePrivateEndpointPromptCaching>;
22
+ export declare function updatePrivateEndpointPromptCachingToJSON(updatePrivateEndpointPromptCaching: UpdatePrivateEndpointPromptCaching): string;
23
+ //# sourceMappingURL=updateprivateendpointpromptcaching.d.ts.map
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4";
5
+ import { remap as remap$ } from "../lib/primitives.js";
6
+ /** @internal */
7
+ export const UpdatePrivateEndpointPromptCaching$outboundSchema = z.object({
8
+ cacheControl: z.boolean().optional(),
9
+ promptCacheKey: z.boolean().optional(),
10
+ }).transform((v) => {
11
+ return remap$(v, {
12
+ cacheControl: "cache_control",
13
+ promptCacheKey: "prompt_cache_key",
14
+ });
15
+ });
16
+ export function updatePrivateEndpointPromptCachingToJSON(updatePrivateEndpointPromptCaching) {
17
+ return JSON.stringify(UpdatePrivateEndpointPromptCaching$outboundSchema.parse(updatePrivateEndpointPromptCaching));
18
+ }
19
+ //# sourceMappingURL=updateprivateendpointpromptcaching.js.map
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
2
2
  import { OpenEnum } from "../types/enums.js";
3
3
  import { PrivateEndpointQuantization } from "./privateendpointquantization.js";
4
4
  import { PrivateEndpointReasoningReturnMechanism } from "./privateendpointreasoningreturnmechanism.js";
5
+ import { UpdatePrivateEndpointPromptCaching, UpdatePrivateEndpointPromptCaching$Outbound } from "./updateprivateendpointpromptcaching.js";
5
6
  export type UpdatePrivateEndpointSettingsRequestCompletions = {
6
7
  /**
7
8
  * Serves `/chat/completions`; `null` uses the provider default.
@@ -113,6 +114,10 @@ export type UpdatePrivateEndpointSettingsRequest = {
113
114
  * Longest prompt, in tokens, or `null` for no cap below the context length. Cannot exceed `context_length`, or the model context length while `context_length` is `null`.
114
115
  */
115
116
  maxPromptTokens?: number | null | undefined;
117
+ /**
118
+ * Change only the named prompt-caching flags; omitted flags keep their stored value.
119
+ */
120
+ promptCaching?: UpdatePrivateEndpointPromptCaching | undefined;
116
121
  /**
117
122
  * Weight precision the deployment runs at; `unknown` when not stated.
118
123
  */
@@ -167,6 +172,7 @@ export type UpdatePrivateEndpointSettingsRequest$Outbound = {
167
172
  inputs?: UpdatePrivateEndpointSettingsRequestInputs$Outbound | undefined;
168
173
  max_completion_tokens?: number | null | undefined;
169
174
  max_prompt_tokens?: number | null | undefined;
175
+ prompt_caching?: UpdatePrivateEndpointPromptCaching$Outbound | undefined;
170
176
  quantization?: string | undefined;
171
177
  reasoning?: UpdatePrivateEndpointSettingsRequestReasoning$Outbound | undefined;
172
178
  tool_choice?: UpdatePrivateEndpointSettingsRequestToolChoice$Outbound | undefined;
@@ -6,6 +6,7 @@ import { remap as remap$ } from "../lib/primitives.js";
6
6
  import * as openEnums from "../types/enums.js";
7
7
  import { PrivateEndpointQuantization$outboundSchema, } from "./privateendpointquantization.js";
8
8
  import { PrivateEndpointReasoningReturnMechanism$outboundSchema, } from "./privateendpointreasoningreturnmechanism.js";
9
+ import { UpdatePrivateEndpointPromptCaching$outboundSchema, } from "./updateprivateendpointpromptcaching.js";
9
10
  export const UpdatePrivateEndpointSettingsRequestExcludedParameter = {
10
11
  Temperature: "temperature",
11
12
  TopP: "top_p",
@@ -92,6 +93,7 @@ export const UpdatePrivateEndpointSettingsRequest$outboundSchema = z.object({
92
93
  inputs: z.lazy(() => UpdatePrivateEndpointSettingsRequestInputs$outboundSchema).optional(),
93
94
  maxCompletionTokens: z.nullable(z.int()).optional(),
94
95
  maxPromptTokens: z.nullable(z.int()).optional(),
96
+ promptCaching: UpdatePrivateEndpointPromptCaching$outboundSchema.optional(),
95
97
  quantization: PrivateEndpointQuantization$outboundSchema.optional(),
96
98
  reasoning: z.lazy(() => UpdatePrivateEndpointSettingsRequestReasoning$outboundSchema).optional(),
97
99
  toolChoice: z.lazy(() => UpdatePrivateEndpointSettingsRequestToolChoice$outboundSchema).optional(),
@@ -101,6 +103,7 @@ export const UpdatePrivateEndpointSettingsRequest$outboundSchema = z.object({
101
103
  excludedParameters: "excluded_parameters",
102
104
  maxCompletionTokens: "max_completion_tokens",
103
105
  maxPromptTokens: "max_prompt_tokens",
106
+ promptCaching: "prompt_caching",
104
107
  toolChoice: "tool_choice",
105
108
  });
106
109
  });
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.5.115",
5
+ "version": "1.5.116",
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.115",
3
+ "version": "1.5.116",
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": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js",
75
75
  "prepublishOnly": "npm run build",
76
+ "test": "vitest --run --project unit",
77
+ "test:watch": "vitest --watch --project unit",
76
78
  "typecheck": "tsc --noEmit",
77
- "typecheck:transit": "exit 0",
78
- "compile": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js",
79
- "prepare": "npm run build",
80
79
  "postinstall": "node scripts/check-types.js || true",
81
- "test": "vitest --run --project unit",
80
+ "prepare": "npm run build",
82
81
  "test:e2e": "vitest --run --project e2e",
83
82
  "test:transit": "exit 0",
84
- "test:watch": "vitest --watch --project unit"
83
+ "typecheck:transit": "exit 0",
84
+ "compile": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js"
85
85
  },
86
86
  "peerDependencies": {
87
87