@openrouter/sdk 0.13.61 → 0.13.62
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.
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/openresponsesresult.d.ts +5 -0
- package/esm/models/openresponsesresult.js +3 -0
- package/esm/models/promptcacheoptions.d.ts +7 -0
- package/esm/models/promptcacheoptions.js +12 -1
- package/jsr.json +1 -1
- package/package.json +4 -4
package/esm/lib/config.d.ts
CHANGED
|
@@ -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.
|
|
52
|
+
readonly sdkVersion: "0.13.62";
|
|
53
53
|
readonly genVersion: "2.914.0";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.13.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.13.62 2.914.0 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.
|
|
29
|
+
sdkVersion: "0.13.62",
|
|
30
30
|
genVersion: "2.914.0",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 0.13.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 0.13.62 2.914.0 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -23,6 +23,7 @@ import { OpenRouterMetadata } from "./openroutermetadata.js";
|
|
|
23
23
|
import { OutputItems } from "./outputitems.js";
|
|
24
24
|
import { Preview20250311WebSearchServerTool } from "./preview20250311websearchservertool.js";
|
|
25
25
|
import { PreviewWebSearchServerTool } from "./previewwebsearchservertool.js";
|
|
26
|
+
import { PromptCacheOptions } from "./promptcacheoptions.js";
|
|
26
27
|
import { ResponsesErrorField } from "./responseserrorfield.js";
|
|
27
28
|
import { ServerToolUseDetails } from "./servertoolusedetails.js";
|
|
28
29
|
import { ShellServerTool } from "./shellservertool.js";
|
|
@@ -139,6 +140,10 @@ export type OpenResponsesResult = {
|
|
|
139
140
|
previousResponseId?: string | null | undefined;
|
|
140
141
|
prompt?: StoredPromptTemplate | null | undefined;
|
|
141
142
|
promptCacheKey?: string | null | undefined;
|
|
143
|
+
/**
|
|
144
|
+
* Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.
|
|
145
|
+
*/
|
|
146
|
+
promptCacheOptions?: PromptCacheOptions | null | undefined;
|
|
142
147
|
reasoning?: BaseReasoningConfig | null | undefined;
|
|
143
148
|
safetyIdentifier?: string | null | undefined;
|
|
144
149
|
serviceTier?: string | null | undefined;
|
|
@@ -26,6 +26,7 @@ import { OpenRouterMetadata$inboundSchema, } from "./openroutermetadata.js";
|
|
|
26
26
|
import { OutputItems$inboundSchema } from "./outputitems.js";
|
|
27
27
|
import { Preview20250311WebSearchServerTool$inboundSchema, } from "./preview20250311websearchservertool.js";
|
|
28
28
|
import { PreviewWebSearchServerTool$inboundSchema, } from "./previewwebsearchservertool.js";
|
|
29
|
+
import { PromptCacheOptions$inboundSchema, } from "./promptcacheoptions.js";
|
|
29
30
|
import { ResponsesErrorField$inboundSchema, } from "./responseserrorfield.js";
|
|
30
31
|
import { ServerToolUseDetails$inboundSchema, } from "./servertoolusedetails.js";
|
|
31
32
|
import { ShellServerTool$inboundSchema, } from "./shellservertool.js";
|
|
@@ -158,6 +159,7 @@ export const OpenResponsesResult$inboundSchema = z.object({
|
|
|
158
159
|
previous_response_id: z.nullable(z.string()).optional(),
|
|
159
160
|
prompt: z.nullable(StoredPromptTemplate$inboundSchema).optional(),
|
|
160
161
|
prompt_cache_key: z.nullable(z.string()).optional(),
|
|
162
|
+
prompt_cache_options: z.nullable(PromptCacheOptions$inboundSchema).optional(),
|
|
161
163
|
reasoning: z.nullable(BaseReasoningConfig$inboundSchema).optional(),
|
|
162
164
|
safety_identifier: z.nullable(z.string()).optional(),
|
|
163
165
|
service_tier: z.nullable(z.string()).optional(),
|
|
@@ -203,6 +205,7 @@ export const OpenResponsesResult$inboundSchema = z.object({
|
|
|
203
205
|
"presence_penalty": "presencePenalty",
|
|
204
206
|
"previous_response_id": "previousResponseId",
|
|
205
207
|
"prompt_cache_key": "promptCacheKey",
|
|
208
|
+
"prompt_cache_options": "promptCacheOptions",
|
|
206
209
|
"safety_identifier": "safetyIdentifier",
|
|
207
210
|
"service_tier": "serviceTier",
|
|
208
211
|
"tool_choice": "toolChoice",
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
3
5
|
export declare const PromptCacheOptionsMode: {
|
|
4
6
|
readonly Explicit: "explicit";
|
|
5
7
|
};
|
|
@@ -12,8 +14,12 @@ export type PromptCacheOptions = {
|
|
|
12
14
|
ttl?: string | null | undefined;
|
|
13
15
|
};
|
|
14
16
|
/** @internal */
|
|
17
|
+
export declare const PromptCacheOptionsMode$inboundSchema: z.ZodEnum<typeof PromptCacheOptionsMode>;
|
|
18
|
+
/** @internal */
|
|
15
19
|
export declare const PromptCacheOptionsMode$outboundSchema: z.ZodEnum<typeof PromptCacheOptionsMode>;
|
|
16
20
|
/** @internal */
|
|
21
|
+
export declare const PromptCacheOptions$inboundSchema: z.ZodType<PromptCacheOptions, unknown>;
|
|
22
|
+
/** @internal */
|
|
17
23
|
export type PromptCacheOptions$Outbound = {
|
|
18
24
|
mode: string;
|
|
19
25
|
ttl?: string | null | undefined;
|
|
@@ -21,4 +27,5 @@ export type PromptCacheOptions$Outbound = {
|
|
|
21
27
|
/** @internal */
|
|
22
28
|
export declare const PromptCacheOptions$outboundSchema: z.ZodType<PromptCacheOptions$Outbound, PromptCacheOptions>;
|
|
23
29
|
export declare function promptCacheOptionsToJSON(promptCacheOptions: PromptCacheOptions): string;
|
|
30
|
+
export declare function promptCacheOptionsFromJSON(jsonString: string): SafeParseResult<PromptCacheOptions, SDKValidationError>;
|
|
24
31
|
//# sourceMappingURL=promptcacheoptions.d.ts.map
|
|
@@ -3,11 +3,19 @@
|
|
|
3
3
|
* @generated-id: beb41f51263a
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
6
7
|
export const PromptCacheOptionsMode = {
|
|
7
8
|
Explicit: "explicit",
|
|
8
9
|
};
|
|
9
10
|
/** @internal */
|
|
10
|
-
export const PromptCacheOptionsMode$
|
|
11
|
+
export const PromptCacheOptionsMode$inboundSchema = z.enum(PromptCacheOptionsMode);
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const PromptCacheOptionsMode$outboundSchema = PromptCacheOptionsMode$inboundSchema;
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const PromptCacheOptions$inboundSchema = z.object({
|
|
16
|
+
mode: PromptCacheOptionsMode$inboundSchema,
|
|
17
|
+
ttl: z.nullable(z.string()).optional(),
|
|
18
|
+
});
|
|
11
19
|
/** @internal */
|
|
12
20
|
export const PromptCacheOptions$outboundSchema = z.object({
|
|
13
21
|
mode: PromptCacheOptionsMode$outboundSchema,
|
|
@@ -16,4 +24,7 @@ export const PromptCacheOptions$outboundSchema = z.object({
|
|
|
16
24
|
export function promptCacheOptionsToJSON(promptCacheOptions) {
|
|
17
25
|
return JSON.stringify(PromptCacheOptions$outboundSchema.parse(promptCacheOptions));
|
|
18
26
|
}
|
|
27
|
+
export function promptCacheOptionsFromJSON(jsonString) {
|
|
28
|
+
return safeParse(jsonString, (x) => PromptCacheOptions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PromptCacheOptions' from JSON`);
|
|
29
|
+
}
|
|
19
30
|
//# sourceMappingURL=promptcacheoptions.js.map
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.62",
|
|
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": [
|
|
@@ -74,12 +74,12 @@
|
|
|
74
74
|
"build": "tsc",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
76
|
"test": "vitest --run --project unit",
|
|
77
|
-
"test:
|
|
77
|
+
"test:e2e": "vitest --run --project e2e",
|
|
78
|
+
"typecheck": "tsc --noEmit",
|
|
78
79
|
"typecheck:transit": "exit 0",
|
|
79
80
|
"prepare": "npm run build",
|
|
80
|
-
"test:e2e": "vitest --run --project e2e",
|
|
81
81
|
"test:transit": "exit 0",
|
|
82
|
-
"
|
|
82
|
+
"test:watch": "vitest --watch --project unit",
|
|
83
83
|
"compile": "tsc",
|
|
84
84
|
"postinstall": "node scripts/check-types.js || true"
|
|
85
85
|
},
|