@openrouter/sdk 1.5.135 → 1.5.136

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.135";
52
+ readonly sdkVersion: "1.5.136";
53
53
  readonly genVersion: "2.960.8";
54
- readonly userAgent: "speakeasy-sdk/typescript 1.5.135 2.960.8 1.0.0 @openrouter/sdk";
54
+ readonly userAgent: "speakeasy-sdk/typescript 1.5.136 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.135",
28
+ sdkVersion: "1.5.136",
29
29
  genVersion: "2.960.8",
30
- userAgent: "speakeasy-sdk/typescript 1.5.135 2.960.8 1.0.0 @openrouter/sdk",
30
+ userAgent: "speakeasy-sdk/typescript 1.5.136 2.960.8 1.0.0 @openrouter/sdk",
31
31
  };
32
32
  //# sourceMappingURL=config.js.map
@@ -786,6 +786,7 @@ export * from "./responsehealingplugin.js";
786
786
  export * from "./responseincludesenum.js";
787
787
  export * from "./responseoutputtext.js";
788
788
  export * from "./responsesbadrequestresponseerrordata.js";
789
+ export * from "./responsescontextmanagement.js";
789
790
  export * from "./responsesinputtransformation.js";
790
791
  export * from "./responsesrequest.js";
791
792
  export * from "./responsesstreamingresponse.js";
@@ -789,6 +789,7 @@ export * from "./responsehealingplugin.js";
789
789
  export * from "./responseincludesenum.js";
790
790
  export * from "./responseoutputtext.js";
791
791
  export * from "./responsesbadrequestresponseerrordata.js";
792
+ export * from "./responsescontextmanagement.js";
792
793
  export * from "./responsesinputtransformation.js";
793
794
  export * from "./responsesrequest.js";
794
795
  export * from "./responsesstreamingresponse.js";
@@ -0,0 +1,27 @@
1
+ import * as z from "zod/v4";
2
+ /**
3
+ * A server-side context management entry. With `compaction`, the provider compacts the conversation once input exceeds `compact_threshold` and returns a `compaction` output item; pass that item back in `input` on later turns.
4
+ */
5
+ export type ResponsesContextManagement = {
6
+ /**
7
+ * Input token count at which server-side compaction is triggered.
8
+ */
9
+ compactThreshold?: number | null | undefined;
10
+ /**
11
+ * The context management strategy. Currently only `compaction` is supported.
12
+ */
13
+ type: string;
14
+ additionalProperties?: {
15
+ [k: string]: any;
16
+ } | undefined;
17
+ };
18
+ /** @internal */
19
+ export type ResponsesContextManagement$Outbound = {
20
+ compact_threshold?: number | null | undefined;
21
+ type: string;
22
+ [additionalProperties: string]: unknown;
23
+ };
24
+ /** @internal */
25
+ export declare const ResponsesContextManagement$outboundSchema: z.ZodType<ResponsesContextManagement$Outbound, ResponsesContextManagement>;
26
+ export declare function responsesContextManagementToJSON(responsesContextManagement: ResponsesContextManagement): string;
27
+ //# sourceMappingURL=responsescontextmanagement.d.ts.map
@@ -0,0 +1,23 @@
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 ResponsesContextManagement$outboundSchema = z.object({
8
+ compactThreshold: z.nullable(z.int()).optional(),
9
+ type: z.string(),
10
+ additionalProperties: z.record(z.string(), z.any()).optional(),
11
+ }).transform((v) => {
12
+ return {
13
+ ...v.additionalProperties,
14
+ ...remap$(v, {
15
+ compactThreshold: "compact_threshold",
16
+ additionalProperties: null,
17
+ }),
18
+ };
19
+ });
20
+ export function responsesContextManagementToJSON(responsesContextManagement) {
21
+ return JSON.stringify(ResponsesContextManagement$outboundSchema.parse(responsesContextManagement));
22
+ }
23
+ //# sourceMappingURL=responsescontextmanagement.js.map
@@ -46,6 +46,7 @@ import { ReasoningMode } from "./reasoningmode.js";
46
46
  import { ReasoningSummaryVerbosity } from "./reasoningsummaryverbosity.js";
47
47
  import { ResponseHealingPlugin, ResponseHealingPlugin$Outbound } from "./responsehealingplugin.js";
48
48
  import { ResponseIncludesEnum } from "./responseincludesenum.js";
49
+ import { ResponsesContextManagement, ResponsesContextManagement$Outbound } from "./responsescontextmanagement.js";
49
50
  import { SearchModelsServerToolOpenRouter, SearchModelsServerToolOpenRouter$Outbound } from "./searchmodelsservertoolopenrouter.js";
50
51
  import { ShellServerTool, ShellServerTool$Outbound } from "./shellservertool.js";
51
52
  import { ShellServerToolOpenRouter, ShellServerToolOpenRouter$Outbound } from "./shellservertoolopenrouter.js";
@@ -207,6 +208,10 @@ export type ResponsesRequest = {
207
208
  * Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.
208
209
  */
209
210
  cacheControl?: AnthropicCacheControlDirective | undefined;
211
+ /**
212
+ * Server-side context management (compaction). Supported for OpenAI models served by OpenAI or Azure, which return `compaction` output items. Providers translated to another API format drop it. Replay returned `compaction` items in `input` on later turns.
213
+ */
214
+ contextManagement?: Array<ResponsesContextManagement> | null | undefined;
210
215
  /**
211
216
  * Debug options for inspecting request transformations (streaming only)
212
217
  */
@@ -487,6 +492,7 @@ export type ResponsesRequest$Outbound = {
487
492
  access_programs?: ResponsesRequestAccessPrograms$Outbound | undefined;
488
493
  background?: boolean | null | undefined;
489
494
  cache_control?: AnthropicCacheControlDirective$Outbound | undefined;
495
+ context_management?: Array<ResponsesContextManagement$Outbound> | null | undefined;
490
496
  debug?: ChatDebugOptions$Outbound | undefined;
491
497
  deferred_tools?: DeferredToolsControl$Outbound | undefined;
492
498
  frequency_penalty?: number | null | undefined;
@@ -50,6 +50,7 @@ import { ReasoningMode$outboundSchema, } from "./reasoningmode.js";
50
50
  import { ReasoningSummaryVerbosity$outboundSchema, } from "./reasoningsummaryverbosity.js";
51
51
  import { ResponseHealingPlugin$outboundSchema, } from "./responsehealingplugin.js";
52
52
  import { ResponseIncludesEnum$outboundSchema, } from "./responseincludesenum.js";
53
+ import { ResponsesContextManagement$outboundSchema, } from "./responsescontextmanagement.js";
53
54
  import { SearchModelsServerToolOpenRouter$outboundSchema, } from "./searchmodelsservertoolopenrouter.js";
54
55
  import { ShellServerTool$outboundSchema, } from "./shellservertool.js";
55
56
  import { ShellServerToolOpenRouter$outboundSchema, } from "./shellservertoolopenrouter.js";
@@ -202,6 +203,7 @@ export const ResponsesRequest$outboundSchema = z.object({
202
203
  .optional(),
203
204
  background: z.nullable(z.boolean()).optional(),
204
205
  cacheControl: AnthropicCacheControlDirective$outboundSchema.optional(),
206
+ contextManagement: z.nullable(z.array(ResponsesContextManagement$outboundSchema)).optional(),
205
207
  debug: ChatDebugOptions$outboundSchema.optional(),
206
208
  deferredTools: DeferredToolsControl$outboundSchema.optional(),
207
209
  frequencyPenalty: z.nullable(z.number()).optional(),
@@ -292,6 +294,7 @@ export const ResponsesRequest$outboundSchema = z.object({
292
294
  return remap$(v, {
293
295
  accessPrograms: "access_programs",
294
296
  cacheControl: "cache_control",
297
+ contextManagement: "context_management",
295
298
  deferredTools: "deferred_tools",
296
299
  frequencyPenalty: "frequency_penalty",
297
300
  imageConfig: "image_config",
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.5.135",
5
+ "version": "1.5.136",
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.135",
3
+ "version": "1.5.136",
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": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js",
75
75
  "prepublishOnly": "npm run build",
76
- "typecheck": "tsc --noEmit",
77
- "typecheck:transit": "exit 0",
78
- "postinstall": "node scripts/check-types.js || true",
79
76
  "compile": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js",
80
- "prepare": "npm run build",
81
77
  "test": "vitest --run --project unit",
82
78
  "test:e2e": "vitest --run --project e2e",
83
79
  "test:transit": "exit 0",
80
+ "typecheck": "tsc --noEmit",
81
+ "typecheck:transit": "exit 0",
82
+ "postinstall": "node scripts/check-types.js || true",
83
+ "prepare": "npm run build",
84
84
  "test:watch": "vitest --watch --project unit"
85
85
  },
86
86
  "peerDependencies": {