@openrouter/sdk 0.13.35 → 0.13.36
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/basereasoningconfig.d.ts +5 -0
- package/esm/models/basereasoningconfig.js +2 -0
- package/esm/models/index.d.ts +3 -0
- package/esm/models/index.js +3 -0
- package/esm/models/inputtext.d.ts +6 -0
- package/esm/models/inputtext.js +14 -0
- package/esm/models/promptcachebreakpoint.d.ts +29 -0
- package/esm/models/promptcachebreakpoint.js +28 -0
- package/esm/models/promptcacheoptions.d.ts +24 -0
- package/esm/models/promptcacheoptions.js +19 -0
- package/esm/models/reasoningconfig.d.ts +6 -0
- package/esm/models/reasoningconfig.js +2 -0
- package/esm/models/reasoningcontext.d.ts +19 -0
- package/esm/models/reasoningcontext.js +18 -0
- package/esm/models/responsesrequest.d.ts +6 -0
- package/esm/models/responsesrequest.js +3 -0
- package/esm/models/usage.d.ts +1 -0
- package/esm/models/usage.js +2 -0
- package/jsr.json +1 -1
- package/package.json +9 -9
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.36";
|
|
53
53
|
readonly genVersion: "2.884.4";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.13.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.13.36 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.
|
|
29
|
+
sdkVersion: "0.13.36",
|
|
30
30
|
genVersion: "2.884.4",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 0.13.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 0.13.36 2.884.4 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
import { ReasoningContext } from "./reasoningcontext.js";
|
|
4
5
|
import { ReasoningEffort } from "./reasoningeffort.js";
|
|
5
6
|
import { ReasoningMode } from "./reasoningmode.js";
|
|
6
7
|
import { ReasoningSummaryVerbosity } from "./reasoningsummaryverbosity.js";
|
|
7
8
|
export type BaseReasoningConfig = {
|
|
9
|
+
/**
|
|
10
|
+
* Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer.
|
|
11
|
+
*/
|
|
12
|
+
context?: ReasoningContext | null | undefined;
|
|
8
13
|
effort?: ReasoningEffort | null | undefined;
|
|
9
14
|
/**
|
|
10
15
|
* Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer.
|
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { ReasoningContext$inboundSchema, } from "./reasoningcontext.js";
|
|
7
8
|
import { ReasoningEffort$inboundSchema, } from "./reasoningeffort.js";
|
|
8
9
|
import { ReasoningMode$inboundSchema } from "./reasoningmode.js";
|
|
9
10
|
import { ReasoningSummaryVerbosity$inboundSchema, } from "./reasoningsummaryverbosity.js";
|
|
10
11
|
/** @internal */
|
|
11
12
|
export const BaseReasoningConfig$inboundSchema = z.object({
|
|
13
|
+
context: z.nullable(ReasoningContext$inboundSchema).optional(),
|
|
12
14
|
effort: z.nullable(ReasoningEffort$inboundSchema).optional(),
|
|
13
15
|
mode: z.nullable(ReasoningMode$inboundSchema).optional(),
|
|
14
16
|
summary: z.nullable(ReasoningSummaryVerbosity$inboundSchema).optional(),
|
package/esm/models/index.d.ts
CHANGED
|
@@ -392,6 +392,8 @@ export * from "./presetwithdesignatedversion.js";
|
|
|
392
392
|
export * from "./preview20250311websearchservertool.js";
|
|
393
393
|
export * from "./previewwebsearchservertool.js";
|
|
394
394
|
export * from "./previewwebsearchuserlocation.js";
|
|
395
|
+
export * from "./promptcachebreakpoint.js";
|
|
396
|
+
export * from "./promptcacheoptions.js";
|
|
395
397
|
export * from "./promptinjectionscanscope.js";
|
|
396
398
|
export * from "./providername.js";
|
|
397
399
|
export * from "./provideroptions.js";
|
|
@@ -408,6 +410,7 @@ export * from "./rankingsdailyitem.js";
|
|
|
408
410
|
export * from "./rankingsdailymeta.js";
|
|
409
411
|
export * from "./rankingsdailyresponse.js";
|
|
410
412
|
export * from "./reasoningconfig.js";
|
|
413
|
+
export * from "./reasoningcontext.js";
|
|
411
414
|
export * from "./reasoningdeltaevent.js";
|
|
412
415
|
export * from "./reasoningdetailencrypted.js";
|
|
413
416
|
export * from "./reasoningdetailservertoolcall.js";
|
package/esm/models/index.js
CHANGED
|
@@ -396,6 +396,8 @@ export * from "./presetwithdesignatedversion.js";
|
|
|
396
396
|
export * from "./preview20250311websearchservertool.js";
|
|
397
397
|
export * from "./previewwebsearchservertool.js";
|
|
398
398
|
export * from "./previewwebsearchuserlocation.js";
|
|
399
|
+
export * from "./promptcachebreakpoint.js";
|
|
400
|
+
export * from "./promptcacheoptions.js";
|
|
399
401
|
export * from "./promptinjectionscanscope.js";
|
|
400
402
|
export * from "./providername.js";
|
|
401
403
|
export * from "./provideroptions.js";
|
|
@@ -412,6 +414,7 @@ export * from "./rankingsdailyitem.js";
|
|
|
412
414
|
export * from "./rankingsdailymeta.js";
|
|
413
415
|
export * from "./rankingsdailyresponse.js";
|
|
414
416
|
export * from "./reasoningconfig.js";
|
|
417
|
+
export * from "./reasoningcontext.js";
|
|
415
418
|
export * from "./reasoningdeltaevent.js";
|
|
416
419
|
export * from "./reasoningdetailencrypted.js";
|
|
417
420
|
export * from "./reasoningdetailservertoolcall.js";
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
import { PromptCacheBreakpoint, PromptCacheBreakpoint$Outbound } from "./promptcachebreakpoint.js";
|
|
4
5
|
/**
|
|
5
6
|
* Text input content item
|
|
6
7
|
*/
|
|
7
8
|
export type InputText = {
|
|
9
|
+
/**
|
|
10
|
+
* Marks an explicit prompt-cache boundary on this content block. Everything through the block carrying this marker is part of the candidate cached prefix. Only supported by OpenAI GPT-5.6 and newer.
|
|
11
|
+
*/
|
|
12
|
+
promptCacheBreakpoint?: PromptCacheBreakpoint | null | undefined;
|
|
8
13
|
text: string;
|
|
9
14
|
type: "input_text";
|
|
10
15
|
};
|
|
@@ -12,6 +17,7 @@ export type InputText = {
|
|
|
12
17
|
export declare const InputText$inboundSchema: z.ZodType<InputText, unknown>;
|
|
13
18
|
/** @internal */
|
|
14
19
|
export type InputText$Outbound = {
|
|
20
|
+
prompt_cache_breakpoint?: PromptCacheBreakpoint$Outbound | null | undefined;
|
|
15
21
|
text: string;
|
|
16
22
|
type: "input_text";
|
|
17
23
|
};
|
package/esm/models/inputtext.js
CHANGED
|
@@ -3,16 +3,30 @@
|
|
|
3
3
|
* @generated-id: 8d6c10a240ae
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { PromptCacheBreakpoint$inboundSchema, PromptCacheBreakpoint$outboundSchema, } from "./promptcachebreakpoint.js";
|
|
7
9
|
/** @internal */
|
|
8
10
|
export const InputText$inboundSchema = z.object({
|
|
11
|
+
prompt_cache_breakpoint: z.nullable(PromptCacheBreakpoint$inboundSchema)
|
|
12
|
+
.optional(),
|
|
9
13
|
text: z.string(),
|
|
10
14
|
type: z.literal("input_text"),
|
|
15
|
+
}).transform((v) => {
|
|
16
|
+
return remap$(v, {
|
|
17
|
+
"prompt_cache_breakpoint": "promptCacheBreakpoint",
|
|
18
|
+
});
|
|
11
19
|
});
|
|
12
20
|
/** @internal */
|
|
13
21
|
export const InputText$outboundSchema = z.object({
|
|
22
|
+
promptCacheBreakpoint: z.nullable(PromptCacheBreakpoint$outboundSchema)
|
|
23
|
+
.optional(),
|
|
14
24
|
text: z.string(),
|
|
15
25
|
type: z.literal("input_text"),
|
|
26
|
+
}).transform((v) => {
|
|
27
|
+
return remap$(v, {
|
|
28
|
+
promptCacheBreakpoint: "prompt_cache_breakpoint",
|
|
29
|
+
});
|
|
16
30
|
});
|
|
17
31
|
export function inputTextToJSON(inputText) {
|
|
18
32
|
return JSON.stringify(InputText$outboundSchema.parse(inputText));
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
export declare const PromptCacheBreakpointMode: {
|
|
6
|
+
readonly Explicit: "explicit";
|
|
7
|
+
};
|
|
8
|
+
export type PromptCacheBreakpointMode = ClosedEnum<typeof PromptCacheBreakpointMode>;
|
|
9
|
+
/**
|
|
10
|
+
* Marks an explicit prompt-cache boundary on this content block. Everything through the block carrying this marker is part of the candidate cached prefix. Only supported by OpenAI GPT-5.6 and newer.
|
|
11
|
+
*/
|
|
12
|
+
export type PromptCacheBreakpoint = {
|
|
13
|
+
mode: PromptCacheBreakpointMode;
|
|
14
|
+
};
|
|
15
|
+
/** @internal */
|
|
16
|
+
export declare const PromptCacheBreakpointMode$inboundSchema: z.ZodEnum<typeof PromptCacheBreakpointMode>;
|
|
17
|
+
/** @internal */
|
|
18
|
+
export declare const PromptCacheBreakpointMode$outboundSchema: z.ZodEnum<typeof PromptCacheBreakpointMode>;
|
|
19
|
+
/** @internal */
|
|
20
|
+
export declare const PromptCacheBreakpoint$inboundSchema: z.ZodType<PromptCacheBreakpoint, unknown>;
|
|
21
|
+
/** @internal */
|
|
22
|
+
export type PromptCacheBreakpoint$Outbound = {
|
|
23
|
+
mode: string;
|
|
24
|
+
};
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare const PromptCacheBreakpoint$outboundSchema: z.ZodType<PromptCacheBreakpoint$Outbound, PromptCacheBreakpoint>;
|
|
27
|
+
export declare function promptCacheBreakpointToJSON(promptCacheBreakpoint: PromptCacheBreakpoint): string;
|
|
28
|
+
export declare function promptCacheBreakpointFromJSON(jsonString: string): SafeParseResult<PromptCacheBreakpoint, SDKValidationError>;
|
|
29
|
+
//# sourceMappingURL=promptcachebreakpoint.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: f8222f76987b
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
export const PromptCacheBreakpointMode = {
|
|
8
|
+
Explicit: "explicit",
|
|
9
|
+
};
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const PromptCacheBreakpointMode$inboundSchema = z.enum(PromptCacheBreakpointMode);
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const PromptCacheBreakpointMode$outboundSchema = PromptCacheBreakpointMode$inboundSchema;
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const PromptCacheBreakpoint$inboundSchema = z.object({
|
|
16
|
+
mode: PromptCacheBreakpointMode$inboundSchema,
|
|
17
|
+
});
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const PromptCacheBreakpoint$outboundSchema = z.object({
|
|
20
|
+
mode: PromptCacheBreakpointMode$outboundSchema,
|
|
21
|
+
});
|
|
22
|
+
export function promptCacheBreakpointToJSON(promptCacheBreakpoint) {
|
|
23
|
+
return JSON.stringify(PromptCacheBreakpoint$outboundSchema.parse(promptCacheBreakpoint));
|
|
24
|
+
}
|
|
25
|
+
export function promptCacheBreakpointFromJSON(jsonString) {
|
|
26
|
+
return safeParse(jsonString, (x) => PromptCacheBreakpoint$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PromptCacheBreakpoint' from JSON`);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=promptcachebreakpoint.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
export declare const PromptCacheOptionsMode: {
|
|
4
|
+
readonly Explicit: "explicit";
|
|
5
|
+
};
|
|
6
|
+
export type PromptCacheOptionsMode = ClosedEnum<typeof PromptCacheOptionsMode>;
|
|
7
|
+
/**
|
|
8
|
+
* 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.
|
|
9
|
+
*/
|
|
10
|
+
export type PromptCacheOptions = {
|
|
11
|
+
mode: PromptCacheOptionsMode;
|
|
12
|
+
ttl?: string | null | undefined;
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare const PromptCacheOptionsMode$outboundSchema: z.ZodEnum<typeof PromptCacheOptionsMode>;
|
|
16
|
+
/** @internal */
|
|
17
|
+
export type PromptCacheOptions$Outbound = {
|
|
18
|
+
mode: string;
|
|
19
|
+
ttl?: string | null | undefined;
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const PromptCacheOptions$outboundSchema: z.ZodType<PromptCacheOptions$Outbound, PromptCacheOptions>;
|
|
23
|
+
export declare function promptCacheOptionsToJSON(promptCacheOptions: PromptCacheOptions): string;
|
|
24
|
+
//# sourceMappingURL=promptcacheoptions.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: beb41f51263a
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
export const PromptCacheOptionsMode = {
|
|
7
|
+
Explicit: "explicit",
|
|
8
|
+
};
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const PromptCacheOptionsMode$outboundSchema = z.enum(PromptCacheOptionsMode);
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const PromptCacheOptions$outboundSchema = z.object({
|
|
13
|
+
mode: PromptCacheOptionsMode$outboundSchema,
|
|
14
|
+
ttl: z.nullable(z.string()).optional(),
|
|
15
|
+
});
|
|
16
|
+
export function promptCacheOptionsToJSON(promptCacheOptions) {
|
|
17
|
+
return JSON.stringify(PromptCacheOptions$outboundSchema.parse(promptCacheOptions));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=promptcacheoptions.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import { ReasoningContext } from "./reasoningcontext.js";
|
|
2
3
|
import { ReasoningEffort } from "./reasoningeffort.js";
|
|
3
4
|
import { ReasoningMode } from "./reasoningmode.js";
|
|
4
5
|
import { ReasoningSummaryVerbosity } from "./reasoningsummaryverbosity.js";
|
|
@@ -6,6 +7,10 @@ import { ReasoningSummaryVerbosity } from "./reasoningsummaryverbosity.js";
|
|
|
6
7
|
* Configuration for reasoning mode in the response
|
|
7
8
|
*/
|
|
8
9
|
export type ReasoningConfig = {
|
|
10
|
+
/**
|
|
11
|
+
* Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer.
|
|
12
|
+
*/
|
|
13
|
+
context?: ReasoningContext | null | undefined;
|
|
9
14
|
effort?: ReasoningEffort | null | undefined;
|
|
10
15
|
/**
|
|
11
16
|
* Selects the reasoning mode. `standard` is the default; `pro` engages deeper reasoning on models that support it, billed at standard token rates. Only supported by OpenAI GPT-5.6 and newer.
|
|
@@ -17,6 +22,7 @@ export type ReasoningConfig = {
|
|
|
17
22
|
};
|
|
18
23
|
/** @internal */
|
|
19
24
|
export type ReasoningConfig$Outbound = {
|
|
25
|
+
context?: string | null | undefined;
|
|
20
26
|
effort?: string | null | undefined;
|
|
21
27
|
mode?: string | null | undefined;
|
|
22
28
|
summary?: string | null | undefined;
|
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { ReasoningContext$outboundSchema, } from "./reasoningcontext.js";
|
|
7
8
|
import { ReasoningEffort$outboundSchema, } from "./reasoningeffort.js";
|
|
8
9
|
import { ReasoningMode$outboundSchema, } from "./reasoningmode.js";
|
|
9
10
|
import { ReasoningSummaryVerbosity$outboundSchema, } from "./reasoningsummaryverbosity.js";
|
|
10
11
|
/** @internal */
|
|
11
12
|
export const ReasoningConfig$outboundSchema = z.object({
|
|
13
|
+
context: z.nullable(ReasoningContext$outboundSchema).optional(),
|
|
12
14
|
effort: z.nullable(ReasoningEffort$outboundSchema).optional(),
|
|
13
15
|
mode: z.nullable(ReasoningMode$outboundSchema).optional(),
|
|
14
16
|
summary: z.nullable(ReasoningSummaryVerbosity$outboundSchema).optional(),
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
/**
|
|
4
|
+
* Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ReasoningContext: {
|
|
7
|
+
readonly Auto: "auto";
|
|
8
|
+
readonly AllTurns: "all_turns";
|
|
9
|
+
readonly CurrentTurn: "current_turn";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer.
|
|
13
|
+
*/
|
|
14
|
+
export type ReasoningContext = OpenEnum<typeof ReasoningContext>;
|
|
15
|
+
/** @internal */
|
|
16
|
+
export declare const ReasoningContext$inboundSchema: z.ZodType<ReasoningContext, unknown>;
|
|
17
|
+
/** @internal */
|
|
18
|
+
export declare const ReasoningContext$outboundSchema: z.ZodType<string, ReasoningContext>;
|
|
19
|
+
//# sourceMappingURL=reasoningcontext.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 999ae13f294f
|
|
4
|
+
*/
|
|
5
|
+
import * as openEnums from "../types/enums.js";
|
|
6
|
+
/**
|
|
7
|
+
* Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer.
|
|
8
|
+
*/
|
|
9
|
+
export const ReasoningContext = {
|
|
10
|
+
Auto: "auto",
|
|
11
|
+
AllTurns: "all_turns",
|
|
12
|
+
CurrentTurn: "current_turn",
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const ReasoningContext$inboundSchema = openEnums.inboundSchema(ReasoningContext);
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const ReasoningContext$outboundSchema = openEnums.outboundSchema(ReasoningContext);
|
|
18
|
+
//# sourceMappingURL=reasoningcontext.js.map
|
|
@@ -32,6 +32,7 @@ import { OutputModalityEnum } from "./outputmodalityenum.js";
|
|
|
32
32
|
import { ParetoRouterPlugin, ParetoRouterPlugin$Outbound } from "./paretorouterplugin.js";
|
|
33
33
|
import { Preview20250311WebSearchServerTool, Preview20250311WebSearchServerTool$Outbound } from "./preview20250311websearchservertool.js";
|
|
34
34
|
import { PreviewWebSearchServerTool, PreviewWebSearchServerTool$Outbound } from "./previewwebsearchservertool.js";
|
|
35
|
+
import { PromptCacheOptions, PromptCacheOptions$Outbound } from "./promptcacheoptions.js";
|
|
35
36
|
import { ProviderPreferences, ProviderPreferences$Outbound } from "./providerpreferences.js";
|
|
36
37
|
import { ReasoningConfig, ReasoningConfig$Outbound } from "./reasoningconfig.js";
|
|
37
38
|
import { ResponseHealingPlugin, ResponseHealingPlugin$Outbound } from "./responsehealingplugin.js";
|
|
@@ -137,6 +138,10 @@ export type ResponsesRequest = {
|
|
|
137
138
|
previousResponseId?: string | null | undefined;
|
|
138
139
|
prompt?: StoredPromptTemplate | null | undefined;
|
|
139
140
|
promptCacheKey?: string | null | undefined;
|
|
141
|
+
/**
|
|
142
|
+
* 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.
|
|
143
|
+
*/
|
|
144
|
+
promptCacheOptions?: PromptCacheOptions | null | undefined;
|
|
140
145
|
/**
|
|
141
146
|
* When multiple model providers are available, optionally indicate your routing preference.
|
|
142
147
|
*/
|
|
@@ -264,6 +269,7 @@ export type ResponsesRequest$Outbound = {
|
|
|
264
269
|
previous_response_id?: string | null | undefined;
|
|
265
270
|
prompt?: StoredPromptTemplate$Outbound | null | undefined;
|
|
266
271
|
prompt_cache_key?: string | null | undefined;
|
|
272
|
+
prompt_cache_options?: PromptCacheOptions$Outbound | null | undefined;
|
|
267
273
|
provider?: ProviderPreferences$Outbound | null | undefined;
|
|
268
274
|
reasoning?: ReasoningConfig$Outbound | null | undefined;
|
|
269
275
|
safety_identifier?: string | null | undefined;
|
|
@@ -37,6 +37,7 @@ import { OutputModalityEnum$outboundSchema, } from "./outputmodalityenum.js";
|
|
|
37
37
|
import { ParetoRouterPlugin$outboundSchema, } from "./paretorouterplugin.js";
|
|
38
38
|
import { Preview20250311WebSearchServerTool$outboundSchema, } from "./preview20250311websearchservertool.js";
|
|
39
39
|
import { PreviewWebSearchServerTool$outboundSchema, } from "./previewwebsearchservertool.js";
|
|
40
|
+
import { PromptCacheOptions$outboundSchema, } from "./promptcacheoptions.js";
|
|
40
41
|
import { ProviderPreferences$outboundSchema, } from "./providerpreferences.js";
|
|
41
42
|
import { ReasoningConfig$outboundSchema, } from "./reasoningconfig.js";
|
|
42
43
|
import { ResponseHealingPlugin$outboundSchema, } from "./responsehealingplugin.js";
|
|
@@ -152,6 +153,7 @@ export const ResponsesRequest$outboundSchema = z.object({
|
|
|
152
153
|
previousResponseId: z.nullable(z.string()).optional(),
|
|
153
154
|
prompt: z.nullable(StoredPromptTemplate$outboundSchema).optional(),
|
|
154
155
|
promptCacheKey: z.nullable(z.string()).optional(),
|
|
156
|
+
promptCacheOptions: z.nullable(PromptCacheOptions$outboundSchema).optional(),
|
|
155
157
|
provider: z.nullable(ProviderPreferences$outboundSchema).optional(),
|
|
156
158
|
reasoning: z.nullable(ReasoningConfig$outboundSchema).optional(),
|
|
157
159
|
safetyIdentifier: z.nullable(z.string()).optional(),
|
|
@@ -209,6 +211,7 @@ export const ResponsesRequest$outboundSchema = z.object({
|
|
|
209
211
|
presencePenalty: "presence_penalty",
|
|
210
212
|
previousResponseId: "previous_response_id",
|
|
211
213
|
promptCacheKey: "prompt_cache_key",
|
|
214
|
+
promptCacheOptions: "prompt_cache_options",
|
|
212
215
|
safetyIdentifier: "safety_identifier",
|
|
213
216
|
serviceTier: "service_tier",
|
|
214
217
|
sessionId: "session_id",
|
package/esm/models/usage.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
4
|
export type InputTokensDetails = {
|
|
5
|
+
cacheWriteTokens?: number | null | undefined;
|
|
5
6
|
cachedTokens: number;
|
|
6
7
|
};
|
|
7
8
|
export type OutputTokensDetails = {
|
package/esm/models/usage.js
CHANGED
|
@@ -7,9 +7,11 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
/** @internal */
|
|
9
9
|
export const InputTokensDetails$inboundSchema = z.object({
|
|
10
|
+
cache_write_tokens: z.nullable(z.int()).optional(),
|
|
10
11
|
cached_tokens: z.int(),
|
|
11
12
|
}).transform((v) => {
|
|
12
13
|
return remap$(v, {
|
|
14
|
+
"cache_write_tokens": "cacheWriteTokens",
|
|
13
15
|
"cached_tokens": "cachedTokens",
|
|
14
16
|
});
|
|
15
17
|
});
|
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.36",
|
|
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": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"packageManager": "pnpm@10.22.0",
|
|
23
23
|
"publishConfig": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"provenance": true,
|
|
25
|
+
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"main": "./esm/index.js",
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"
|
|
77
|
-
"prepare": "npm run build",
|
|
78
|
-
"test": "vitest --run --project unit",
|
|
76
|
+
"test:transit": "exit 0",
|
|
79
77
|
"typecheck": "tsc --noEmit",
|
|
80
78
|
"typecheck:transit": "exit 0",
|
|
79
|
+
"test:watch": "vitest --watch --project unit",
|
|
80
|
+
"compile": "tsc",
|
|
81
81
|
"postinstall": "node scripts/check-types.js || true",
|
|
82
|
-
"
|
|
83
|
-
"test
|
|
84
|
-
"test:
|
|
82
|
+
"prepare": "npm run build",
|
|
83
|
+
"test": "vitest --run --project unit",
|
|
84
|
+
"test:e2e": "vitest --run --project e2e"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|