@openrouter/sdk 0.13.52 → 0.13.54
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/anthropiccachecontroldirective.d.ts +1 -1
- package/esm/models/anthropicdocumentblockparam.d.ts +1 -1
- package/esm/models/anthropicimageblockparam.d.ts +1 -1
- package/esm/models/anthropicsearchresultblockparam.d.ts +1 -1
- package/esm/models/anthropictextblockparam.d.ts +1 -1
- package/esm/models/byokproviderslug.d.ts +1 -0
- package/esm/models/byokproviderslug.js +1 -0
- package/esm/models/chatcontentcachecontrol.d.ts +1 -1
- package/esm/models/chatcontenttext.d.ts +7 -1
- package/esm/models/chatcontenttext.js +7 -0
- package/esm/models/chatfunctiontool.d.ts +1 -1
- package/esm/models/chatrequest.d.ts +9 -1
- package/esm/models/chatrequest.js +5 -0
- package/esm/models/fusionservertoolconfig.d.ts +1 -1
- package/esm/models/imagegenerationproviderpreferences.d.ts +6 -0
- package/esm/models/imagegenerationproviderpreferences.js +2 -0
- package/esm/models/inputtext.d.ts +1 -1
- package/esm/models/messagesmessageparam.d.ts +5 -5
- package/esm/models/messagesrequest.d.ts +8 -8
- package/esm/models/operations/listbyokkeys.d.ts +1 -0
- package/esm/models/operations/listbyokkeys.js +1 -0
- package/esm/models/promptcachebreakpoint.d.ts +1 -1
- package/esm/models/providername.d.ts +1 -0
- package/esm/models/providername.js +1 -0
- package/esm/models/provideroptions.d.ts +6 -0
- package/esm/models/provideroptions.js +2 -0
- package/esm/models/providerresponse.d.ts +1 -0
- package/esm/models/providerresponse.js +1 -0
- package/esm/models/responsesrequest.d.ts +1 -1
- package/esm/models/videogenerationrequest.d.ts +6 -0
- package/esm/models/videogenerationrequest.js +2 -0
- 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.54";
|
|
53
53
|
readonly genVersion: "2.884.4";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.13.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.13.54 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.54",
|
|
30
30
|
genVersion: "2.884.4",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 0.13.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 0.13.54 2.884.4 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -6,7 +6,7 @@ export declare const AnthropicCacheControlDirectiveType: {
|
|
|
6
6
|
};
|
|
7
7
|
export type AnthropicCacheControlDirectiveType = ClosedEnum<typeof AnthropicCacheControlDirectiveType>;
|
|
8
8
|
/**
|
|
9
|
-
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request.
|
|
9
|
+
* 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.
|
|
10
10
|
*/
|
|
11
11
|
export type AnthropicCacheControlDirective = {
|
|
12
12
|
ttl?: AnthropicCacheControlTtl | undefined;
|
|
@@ -18,7 +18,7 @@ export type SourceContent = {
|
|
|
18
18
|
export type AnthropicDocumentBlockParamSourceUnion = AnthropicBase64PdfSource | AnthropicPlainTextSource | SourceContent | AnthropicUrlPdfSource | AnthropicFileDocumentSource;
|
|
19
19
|
export type AnthropicDocumentBlockParam = {
|
|
20
20
|
/**
|
|
21
|
-
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request.
|
|
21
|
+
* 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.
|
|
22
22
|
*/
|
|
23
23
|
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
24
24
|
citations?: AnthropicDocumentBlockParamCitations | null | undefined;
|
|
@@ -5,7 +5,7 @@ import { AnthropicUrlImageSource, AnthropicUrlImageSource$Outbound } from "./ant
|
|
|
5
5
|
export type AnthropicImageBlockParamSource = AnthropicBase64ImageSource | AnthropicUrlImageSource;
|
|
6
6
|
export type AnthropicImageBlockParam = {
|
|
7
7
|
/**
|
|
8
|
-
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request.
|
|
8
|
+
* 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.
|
|
9
9
|
*/
|
|
10
10
|
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
11
11
|
source: AnthropicBase64ImageSource | AnthropicUrlImageSource;
|
|
@@ -6,7 +6,7 @@ export type AnthropicSearchResultBlockParamCitations = {
|
|
|
6
6
|
};
|
|
7
7
|
export type AnthropicSearchResultBlockParam = {
|
|
8
8
|
/**
|
|
9
|
-
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request.
|
|
9
|
+
* 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.
|
|
10
10
|
*/
|
|
11
11
|
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
12
12
|
citations?: AnthropicSearchResultBlockParamCitations | undefined;
|
|
@@ -8,7 +8,7 @@ import { AnthropicCitationWebSearchResultLocationParam, AnthropicCitationWebSear
|
|
|
8
8
|
export type Citation = AnthropicCitationCharLocationParam | AnthropicCitationContentBlockLocationParam | AnthropicCitationPageLocationParam | AnthropicCitationSearchResultLocationParam | AnthropicCitationWebSearchResultLocationParam;
|
|
9
9
|
export type AnthropicTextBlockParam = {
|
|
10
10
|
/**
|
|
11
|
-
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request.
|
|
11
|
+
* 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.
|
|
12
12
|
*/
|
|
13
13
|
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
14
14
|
citations?: Array<AnthropicCitationCharLocationParam | AnthropicCitationContentBlockLocationParam | AnthropicCitationPageLocationParam | AnthropicCitationSearchResultLocationParam | AnthropicCitationWebSearchResultLocationParam> | null | undefined;
|
|
@@ -77,6 +77,7 @@ export declare const BYOKProviderSlug: {
|
|
|
77
77
|
readonly Recraft: "recraft";
|
|
78
78
|
readonly Reka: "reka";
|
|
79
79
|
readonly Relace: "relace";
|
|
80
|
+
readonly SailResearch: "sail-research";
|
|
80
81
|
readonly Sakana: "sakana";
|
|
81
82
|
readonly Sambanova: "sambanova";
|
|
82
83
|
readonly Seed: "seed";
|
|
@@ -8,7 +8,7 @@ export declare const ChatContentCacheControlType: {
|
|
|
8
8
|
};
|
|
9
9
|
export type ChatContentCacheControlType = ClosedEnum<typeof ChatContentCacheControlType>;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request.
|
|
12
12
|
*/
|
|
13
13
|
export type ChatContentCacheControl = {
|
|
14
14
|
ttl?: AnthropicCacheControlTtl | undefined;
|
|
@@ -3,6 +3,7 @@ import { ClosedEnum } from "../types/enums.js";
|
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { ChatContentCacheControl, ChatContentCacheControl$Outbound } from "./chatcontentcachecontrol.js";
|
|
5
5
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
6
|
+
import { PromptCacheBreakpoint, PromptCacheBreakpoint$Outbound } from "./promptcachebreakpoint.js";
|
|
6
7
|
export declare const ChatContentTextType: {
|
|
7
8
|
readonly Text: "text";
|
|
8
9
|
};
|
|
@@ -12,9 +13,13 @@ export type ChatContentTextType = ClosedEnum<typeof ChatContentTextType>;
|
|
|
12
13
|
*/
|
|
13
14
|
export type ChatContentText = {
|
|
14
15
|
/**
|
|
15
|
-
*
|
|
16
|
+
* Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request.
|
|
16
17
|
*/
|
|
17
18
|
cacheControl?: ChatContentCacheControl | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically.
|
|
21
|
+
*/
|
|
22
|
+
promptCacheBreakpoint?: PromptCacheBreakpoint | null | undefined;
|
|
18
23
|
text: string;
|
|
19
24
|
type: ChatContentTextType;
|
|
20
25
|
};
|
|
@@ -27,6 +32,7 @@ export declare const ChatContentText$inboundSchema: z.ZodType<ChatContentText, u
|
|
|
27
32
|
/** @internal */
|
|
28
33
|
export type ChatContentText$Outbound = {
|
|
29
34
|
cache_control?: ChatContentCacheControl$Outbound | undefined;
|
|
35
|
+
prompt_cache_breakpoint?: PromptCacheBreakpoint$Outbound | null | undefined;
|
|
30
36
|
text: string;
|
|
31
37
|
type: string;
|
|
32
38
|
};
|
|
@@ -6,6 +6,7 @@ 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
8
|
import { ChatContentCacheControl$inboundSchema, ChatContentCacheControl$outboundSchema, } from "./chatcontentcachecontrol.js";
|
|
9
|
+
import { PromptCacheBreakpoint$inboundSchema, PromptCacheBreakpoint$outboundSchema, } from "./promptcachebreakpoint.js";
|
|
9
10
|
export const ChatContentTextType = {
|
|
10
11
|
Text: "text",
|
|
11
12
|
};
|
|
@@ -16,21 +17,27 @@ export const ChatContentTextType$outboundSchema = ChatContentTextType$inboundSch
|
|
|
16
17
|
/** @internal */
|
|
17
18
|
export const ChatContentText$inboundSchema = z.object({
|
|
18
19
|
cache_control: ChatContentCacheControl$inboundSchema.optional(),
|
|
20
|
+
prompt_cache_breakpoint: z.nullable(PromptCacheBreakpoint$inboundSchema)
|
|
21
|
+
.optional(),
|
|
19
22
|
text: z.string(),
|
|
20
23
|
type: ChatContentTextType$inboundSchema,
|
|
21
24
|
}).transform((v) => {
|
|
22
25
|
return remap$(v, {
|
|
23
26
|
"cache_control": "cacheControl",
|
|
27
|
+
"prompt_cache_breakpoint": "promptCacheBreakpoint",
|
|
24
28
|
});
|
|
25
29
|
});
|
|
26
30
|
/** @internal */
|
|
27
31
|
export const ChatContentText$outboundSchema = z.object({
|
|
28
32
|
cacheControl: ChatContentCacheControl$outboundSchema.optional(),
|
|
33
|
+
promptCacheBreakpoint: z.nullable(PromptCacheBreakpoint$outboundSchema)
|
|
34
|
+
.optional(),
|
|
29
35
|
text: z.string(),
|
|
30
36
|
type: ChatContentTextType$outboundSchema,
|
|
31
37
|
}).transform((v) => {
|
|
32
38
|
return remap$(v, {
|
|
33
39
|
cacheControl: "cache_control",
|
|
40
|
+
promptCacheBreakpoint: "prompt_cache_breakpoint",
|
|
34
41
|
});
|
|
35
42
|
});
|
|
36
43
|
export function chatContentTextToJSON(chatContentText) {
|
|
@@ -41,7 +41,7 @@ export declare const ChatFunctionToolType: {
|
|
|
41
41
|
export type ChatFunctionToolType = ClosedEnum<typeof ChatFunctionToolType>;
|
|
42
42
|
export type ChatFunctionToolFunction = {
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request.
|
|
45
45
|
*/
|
|
46
46
|
cacheControl?: ChatContentCacheControl | undefined;
|
|
47
47
|
/**
|
|
@@ -19,6 +19,7 @@ import { FusionPlugin, FusionPlugin$Outbound } from "./fusionplugin.js";
|
|
|
19
19
|
import { ImageConfig, ImageConfig$Outbound } from "./imageconfig.js";
|
|
20
20
|
import { ModerationPlugin, ModerationPlugin$Outbound } from "./moderationplugin.js";
|
|
21
21
|
import { ParetoRouterPlugin, ParetoRouterPlugin$Outbound } from "./paretorouterplugin.js";
|
|
22
|
+
import { PromptCacheOptions, PromptCacheOptions$Outbound } from "./promptcacheoptions.js";
|
|
22
23
|
import { ProviderPreferences, ProviderPreferences$Outbound } from "./providerpreferences.js";
|
|
23
24
|
import { ResponseHealingPlugin, ResponseHealingPlugin$Outbound } from "./responsehealingplugin.js";
|
|
24
25
|
import { StopServerToolsWhenCondition, StopServerToolsWhenCondition$Outbound } from "./stopservertoolswhencondition.js";
|
|
@@ -101,7 +102,7 @@ export type Stop = string | Array<string> | any;
|
|
|
101
102
|
*/
|
|
102
103
|
export type ChatRequest = {
|
|
103
104
|
/**
|
|
104
|
-
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request.
|
|
105
|
+
* 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.
|
|
105
106
|
*/
|
|
106
107
|
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
107
108
|
/**
|
|
@@ -174,6 +175,11 @@ export type ChatRequest = {
|
|
|
174
175
|
* Presence penalty (-2.0 to 2.0)
|
|
175
176
|
*/
|
|
176
177
|
presencePenalty?: number | null | undefined;
|
|
178
|
+
promptCacheKey?: string | null | undefined;
|
|
179
|
+
/**
|
|
180
|
+
* 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.
|
|
181
|
+
*/
|
|
182
|
+
promptCacheOptions?: PromptCacheOptions | null | undefined;
|
|
177
183
|
/**
|
|
178
184
|
* When multiple model providers are available, optionally indicate your routing preference.
|
|
179
185
|
*/
|
|
@@ -315,6 +321,8 @@ export type ChatRequest$Outbound = {
|
|
|
315
321
|
parallel_tool_calls?: boolean | null | undefined;
|
|
316
322
|
plugins?: Array<AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound> | undefined;
|
|
317
323
|
presence_penalty?: number | null | undefined;
|
|
324
|
+
prompt_cache_key?: string | null | undefined;
|
|
325
|
+
prompt_cache_options?: PromptCacheOptions$Outbound | null | undefined;
|
|
318
326
|
provider?: ProviderPreferences$Outbound | null | undefined;
|
|
319
327
|
reasoning?: ChatRequestReasoning$Outbound | undefined;
|
|
320
328
|
reasoning_effort?: string | null | undefined;
|
|
@@ -24,6 +24,7 @@ import { FusionPlugin$outboundSchema, } from "./fusionplugin.js";
|
|
|
24
24
|
import { ImageConfig$outboundSchema, } from "./imageconfig.js";
|
|
25
25
|
import { ModerationPlugin$outboundSchema, } from "./moderationplugin.js";
|
|
26
26
|
import { ParetoRouterPlugin$outboundSchema, } from "./paretorouterplugin.js";
|
|
27
|
+
import { PromptCacheOptions$outboundSchema, } from "./promptcacheoptions.js";
|
|
27
28
|
import { ProviderPreferences$outboundSchema, } from "./providerpreferences.js";
|
|
28
29
|
import { ResponseHealingPlugin$outboundSchema, } from "./responsehealingplugin.js";
|
|
29
30
|
import { StopServerToolsWhenCondition$outboundSchema, } from "./stopservertoolswhencondition.js";
|
|
@@ -151,6 +152,8 @@ export const ChatRequest$outboundSchema = z.object({
|
|
|
151
152
|
WebFetchPlugin$outboundSchema,
|
|
152
153
|
])).optional(),
|
|
153
154
|
presencePenalty: z.nullable(z.number()).optional(),
|
|
155
|
+
promptCacheKey: z.nullable(z.string()).optional(),
|
|
156
|
+
promptCacheOptions: z.nullable(PromptCacheOptions$outboundSchema).optional(),
|
|
154
157
|
provider: z.nullable(ProviderPreferences$outboundSchema).optional(),
|
|
155
158
|
reasoning: z.lazy(() => ChatRequestReasoning$outboundSchema).optional(),
|
|
156
159
|
reasoningEffort: z.nullable(ChatRequestReasoningEffort$outboundSchema)
|
|
@@ -192,6 +195,8 @@ export const ChatRequest$outboundSchema = z.object({
|
|
|
192
195
|
minP: "min_p",
|
|
193
196
|
parallelToolCalls: "parallel_tool_calls",
|
|
194
197
|
presencePenalty: "presence_penalty",
|
|
198
|
+
promptCacheKey: "prompt_cache_key",
|
|
199
|
+
promptCacheOptions: "prompt_cache_options",
|
|
195
200
|
reasoningEffort: "reasoning_effort",
|
|
196
201
|
repetitionPenalty: "repetition_penalty",
|
|
197
202
|
responseFormat: "response_format",
|
|
@@ -51,7 +51,7 @@ export type FusionServerToolConfig = {
|
|
|
51
51
|
*/
|
|
52
52
|
analysisModels?: Array<string> | undefined;
|
|
53
53
|
/**
|
|
54
|
-
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request.
|
|
54
|
+
* 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.
|
|
55
55
|
*/
|
|
56
56
|
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
57
57
|
/**
|
|
@@ -302,6 +302,9 @@ export type ImageGenerationProviderPreferencesOptions = {
|
|
|
302
302
|
replicate?: {
|
|
303
303
|
[k: string]: any | null;
|
|
304
304
|
} | undefined;
|
|
305
|
+
sailResearch?: {
|
|
306
|
+
[k: string]: any | null;
|
|
307
|
+
} | undefined;
|
|
305
308
|
sakana?: {
|
|
306
309
|
[k: string]: any | null;
|
|
307
310
|
} | undefined;
|
|
@@ -713,6 +716,9 @@ export type ImageGenerationProviderPreferencesOptions$Outbound = {
|
|
|
713
716
|
replicate?: {
|
|
714
717
|
[k: string]: any | null;
|
|
715
718
|
} | undefined;
|
|
719
|
+
"sail-research"?: {
|
|
720
|
+
[k: string]: any | null;
|
|
721
|
+
} | undefined;
|
|
716
722
|
sakana?: {
|
|
717
723
|
[k: string]: any | null;
|
|
718
724
|
} | undefined;
|
|
@@ -117,6 +117,7 @@ export const ImageGenerationProviderPreferencesOptions$outboundSchema = z.object
|
|
|
117
117
|
reka: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
118
118
|
relace: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
119
119
|
replicate: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
120
|
+
sailResearch: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
120
121
|
sakana: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
121
122
|
sambanova: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
122
123
|
sambanovaCloaked: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
@@ -160,6 +161,7 @@ export const ImageGenerationProviderPreferencesOptions$outboundSchema = z.object
|
|
|
160
161
|
mancerOld: "mancer-old",
|
|
161
162
|
nexAgi: "nex-agi",
|
|
162
163
|
openInference: "open-inference",
|
|
164
|
+
sailResearch: "sail-research",
|
|
163
165
|
sambanovaCloaked: "sambanova-cloaked",
|
|
164
166
|
sfCompute: "sf-compute",
|
|
165
167
|
togetherLite: "together-lite",
|
|
@@ -7,7 +7,7 @@ import { PromptCacheBreakpoint, PromptCacheBreakpoint$Outbound } from "./promptc
|
|
|
7
7
|
*/
|
|
8
8
|
export type InputText = {
|
|
9
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.
|
|
10
|
+
* Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically.
|
|
11
11
|
*/
|
|
12
12
|
promptCacheBreakpoint?: PromptCacheBreakpoint | null | undefined;
|
|
13
13
|
text: string;
|
|
@@ -9,7 +9,7 @@ import { AnthropicWebSearchResultBlockParam, AnthropicWebSearchResultBlockParam$
|
|
|
9
9
|
import { MessagesAdvisorToolResultBlock, MessagesAdvisorToolResultBlock$Outbound } from "./messagesadvisortoolresultblock.js";
|
|
10
10
|
export type ContentCompaction = {
|
|
11
11
|
/**
|
|
12
|
-
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request.
|
|
12
|
+
* 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.
|
|
13
13
|
*/
|
|
14
14
|
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
15
15
|
content: string | null;
|
|
@@ -34,7 +34,7 @@ export type ContentWebSearchToolResultError = {
|
|
|
34
34
|
export type MessagesMessageParamContentUnion3 = ContentWebSearchToolResultError | Array<AnthropicWebSearchResultBlockParam>;
|
|
35
35
|
export type ContentWebSearchToolResult = {
|
|
36
36
|
/**
|
|
37
|
-
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request.
|
|
37
|
+
* 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.
|
|
38
38
|
*/
|
|
39
39
|
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
40
40
|
content: ContentWebSearchToolResultError | Array<AnthropicWebSearchResultBlockParam>;
|
|
@@ -43,7 +43,7 @@ export type ContentWebSearchToolResult = {
|
|
|
43
43
|
};
|
|
44
44
|
export type ContentServerToolUse = {
|
|
45
45
|
/**
|
|
46
|
-
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request.
|
|
46
|
+
* 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.
|
|
47
47
|
*/
|
|
48
48
|
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
49
49
|
id: string;
|
|
@@ -68,7 +68,7 @@ export type MessagesMessageParamContentUnion1 = AnthropicTextBlockParam | Anthro
|
|
|
68
68
|
export type MessagesMessageParamContentUnion2 = string | Array<AnthropicTextBlockParam | AnthropicImageBlockParam | ContentToolReference | AnthropicSearchResultBlockParam | AnthropicDocumentBlockParam>;
|
|
69
69
|
export type ContentToolResult = {
|
|
70
70
|
/**
|
|
71
|
-
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request.
|
|
71
|
+
* 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.
|
|
72
72
|
*/
|
|
73
73
|
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
74
74
|
content?: string | Array<AnthropicTextBlockParam | AnthropicImageBlockParam | ContentToolReference | AnthropicSearchResultBlockParam | AnthropicDocumentBlockParam> | undefined;
|
|
@@ -78,7 +78,7 @@ export type ContentToolResult = {
|
|
|
78
78
|
};
|
|
79
79
|
export type ContentToolUse = {
|
|
80
80
|
/**
|
|
81
|
-
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request.
|
|
81
|
+
* 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.
|
|
82
82
|
*/
|
|
83
83
|
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
84
84
|
id: string;
|
|
@@ -133,7 +133,7 @@ export declare const ToolTypeEphemeral: {
|
|
|
133
133
|
};
|
|
134
134
|
export type ToolTypeEphemeral = ClosedEnum<typeof ToolTypeEphemeral>;
|
|
135
135
|
/**
|
|
136
|
-
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request.
|
|
136
|
+
* 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.
|
|
137
137
|
*/
|
|
138
138
|
export type Caching = {
|
|
139
139
|
ttl?: AnthropicCacheControlTtl | undefined;
|
|
@@ -150,7 +150,7 @@ export type TypeAdvisor20260301 = ClosedEnum<typeof TypeAdvisor20260301>;
|
|
|
150
150
|
export type ToolAdvisor20260301 = {
|
|
151
151
|
allowedCallers?: Array<AnthropicAllowedCallers> | undefined;
|
|
152
152
|
/**
|
|
153
|
-
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request.
|
|
153
|
+
* 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.
|
|
154
154
|
*/
|
|
155
155
|
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
156
156
|
caching?: Caching | null | undefined;
|
|
@@ -173,7 +173,7 @@ export type ToolWebSearch20260209 = {
|
|
|
173
173
|
allowedDomains?: Array<string> | null | undefined;
|
|
174
174
|
blockedDomains?: Array<string> | null | undefined;
|
|
175
175
|
/**
|
|
176
|
-
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request.
|
|
176
|
+
* 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.
|
|
177
177
|
*/
|
|
178
178
|
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
179
179
|
maxUses?: number | null | undefined;
|
|
@@ -193,7 +193,7 @@ export type ToolWebSearch20250305 = {
|
|
|
193
193
|
allowedDomains?: Array<string> | null | undefined;
|
|
194
194
|
blockedDomains?: Array<string> | null | undefined;
|
|
195
195
|
/**
|
|
196
|
-
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request.
|
|
196
|
+
* 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.
|
|
197
197
|
*/
|
|
198
198
|
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
199
199
|
maxUses?: number | null | undefined;
|
|
@@ -211,7 +211,7 @@ export declare const TypeTextEditor20250124: {
|
|
|
211
211
|
export type TypeTextEditor20250124 = ClosedEnum<typeof TypeTextEditor20250124>;
|
|
212
212
|
export type ToolTextEditor20250124 = {
|
|
213
213
|
/**
|
|
214
|
-
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request.
|
|
214
|
+
* 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.
|
|
215
215
|
*/
|
|
216
216
|
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
217
217
|
name: NameStrReplaceEditor;
|
|
@@ -227,7 +227,7 @@ export declare const TypeBash20250124: {
|
|
|
227
227
|
export type TypeBash20250124 = ClosedEnum<typeof TypeBash20250124>;
|
|
228
228
|
export type ToolBash20250124 = {
|
|
229
229
|
/**
|
|
230
|
-
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request.
|
|
230
|
+
* 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.
|
|
231
231
|
*/
|
|
232
232
|
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
233
233
|
name: NameBash;
|
|
@@ -247,7 +247,7 @@ export declare const ToolTypeCustom: {
|
|
|
247
247
|
export type ToolTypeCustom = ClosedEnum<typeof ToolTypeCustom>;
|
|
248
248
|
export type ToolCustom = {
|
|
249
249
|
/**
|
|
250
|
-
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request.
|
|
250
|
+
* 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.
|
|
251
251
|
*/
|
|
252
252
|
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
253
253
|
description?: string | undefined;
|
|
@@ -261,7 +261,7 @@ export type MessagesRequestToolUnion = ToolAdvisor20260301 | ToolCustom | ToolBa
|
|
|
261
261
|
*/
|
|
262
262
|
export type MessagesRequest = {
|
|
263
263
|
/**
|
|
264
|
-
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request.
|
|
264
|
+
* 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.
|
|
265
265
|
*/
|
|
266
266
|
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
267
267
|
contextManagement?: ContextManagement | null | undefined;
|
|
@@ -101,6 +101,7 @@ export declare const Provider: {
|
|
|
101
101
|
readonly Recraft: "recraft";
|
|
102
102
|
readonly Reka: "reka";
|
|
103
103
|
readonly Relace: "relace";
|
|
104
|
+
readonly SailResearch: "sail-research";
|
|
104
105
|
readonly Sakana: "sakana";
|
|
105
106
|
readonly Sambanova: "sambanova";
|
|
106
107
|
readonly Seed: "seed";
|
|
@@ -7,7 +7,7 @@ export declare const PromptCacheBreakpointMode: {
|
|
|
7
7
|
};
|
|
8
8
|
export type PromptCacheBreakpointMode = ClosedEnum<typeof PromptCacheBreakpointMode>;
|
|
9
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.
|
|
10
|
+
* Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically.
|
|
11
11
|
*/
|
|
12
12
|
export type PromptCacheBreakpoint = {
|
|
13
13
|
mode: PromptCacheBreakpointMode;
|
|
@@ -74,6 +74,7 @@ export declare const ProviderName: {
|
|
|
74
74
|
readonly Recraft: "Recraft";
|
|
75
75
|
readonly Reka: "Reka";
|
|
76
76
|
readonly Relace: "Relace";
|
|
77
|
+
readonly SailResearch: "Sail Research";
|
|
77
78
|
readonly SakanaAI: "Sakana AI";
|
|
78
79
|
readonly SambaNova: "SambaNova";
|
|
79
80
|
readonly Seed: "Seed";
|
|
@@ -297,6 +297,9 @@ export type ProviderOptions = {
|
|
|
297
297
|
replicate?: {
|
|
298
298
|
[k: string]: any | null;
|
|
299
299
|
} | undefined;
|
|
300
|
+
sailResearch?: {
|
|
301
|
+
[k: string]: any | null;
|
|
302
|
+
} | undefined;
|
|
300
303
|
sakana?: {
|
|
301
304
|
[k: string]: any | null;
|
|
302
305
|
} | undefined;
|
|
@@ -663,6 +666,9 @@ export type ProviderOptions$Outbound = {
|
|
|
663
666
|
replicate?: {
|
|
664
667
|
[k: string]: any | null;
|
|
665
668
|
} | undefined;
|
|
669
|
+
"sail-research"?: {
|
|
670
|
+
[k: string]: any | null;
|
|
671
|
+
} | undefined;
|
|
666
672
|
sakana?: {
|
|
667
673
|
[k: string]: any | null;
|
|
668
674
|
} | undefined;
|
|
@@ -104,6 +104,7 @@ export const ProviderOptions$outboundSchema = z.object({
|
|
|
104
104
|
reka: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
105
105
|
relace: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
106
106
|
replicate: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
107
|
+
sailResearch: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
107
108
|
sakana: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
108
109
|
sambanova: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
109
110
|
sambanovaCloaked: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
@@ -147,6 +148,7 @@ export const ProviderOptions$outboundSchema = z.object({
|
|
|
147
148
|
mancerOld: "mancer-old",
|
|
148
149
|
nexAgi: "nex-agi",
|
|
149
150
|
openInference: "open-inference",
|
|
151
|
+
sailResearch: "sail-research",
|
|
150
152
|
sambanovaCloaked: "sambanova-cloaked",
|
|
151
153
|
sfCompute: "sf-compute",
|
|
152
154
|
togetherLite: "together-lite",
|
|
@@ -107,6 +107,7 @@ export declare const ProviderResponseProviderName: {
|
|
|
107
107
|
readonly Recraft: "Recraft";
|
|
108
108
|
readonly Reka: "Reka";
|
|
109
109
|
readonly Relace: "Relace";
|
|
110
|
+
readonly SailResearch: "Sail Research";
|
|
110
111
|
readonly SakanaAI: "Sakana AI";
|
|
111
112
|
readonly SambaNova: "SambaNova";
|
|
112
113
|
readonly Seed: "Seed";
|
|
@@ -127,7 +127,7 @@ export type ResponsesRequestToolUnion = ResponsesRequestToolFunction | (PreviewW
|
|
|
127
127
|
export type ResponsesRequest = {
|
|
128
128
|
background?: boolean | null | undefined;
|
|
129
129
|
/**
|
|
130
|
-
* Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request.
|
|
130
|
+
* 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.
|
|
131
131
|
*/
|
|
132
132
|
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
133
133
|
/**
|
|
@@ -318,6 +318,9 @@ export type VideoGenerationRequestOptions = {
|
|
|
318
318
|
replicate?: {
|
|
319
319
|
[k: string]: any | null;
|
|
320
320
|
} | undefined;
|
|
321
|
+
sailResearch?: {
|
|
322
|
+
[k: string]: any | null;
|
|
323
|
+
} | undefined;
|
|
321
324
|
sakana?: {
|
|
322
325
|
[k: string]: any | null;
|
|
323
326
|
} | undefined;
|
|
@@ -751,6 +754,9 @@ export type VideoGenerationRequestOptions$Outbound = {
|
|
|
751
754
|
replicate?: {
|
|
752
755
|
[k: string]: any | null;
|
|
753
756
|
} | undefined;
|
|
757
|
+
"sail-research"?: {
|
|
758
|
+
[k: string]: any | null;
|
|
759
|
+
} | undefined;
|
|
754
760
|
sakana?: {
|
|
755
761
|
[k: string]: any | null;
|
|
756
762
|
} | undefined;
|
|
@@ -134,6 +134,7 @@ export const VideoGenerationRequestOptions$outboundSchema = z.object({
|
|
|
134
134
|
reka: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
135
135
|
relace: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
136
136
|
replicate: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
137
|
+
sailResearch: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
137
138
|
sakana: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
138
139
|
sambanova: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
139
140
|
sambanovaCloaked: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
@@ -177,6 +178,7 @@ export const VideoGenerationRequestOptions$outboundSchema = z.object({
|
|
|
177
178
|
mancerOld: "mancer-old",
|
|
178
179
|
nexAgi: "nex-agi",
|
|
179
180
|
openInference: "open-inference",
|
|
181
|
+
sailResearch: "sail-research",
|
|
180
182
|
sambanovaCloaked: "sambanova-cloaked",
|
|
181
183
|
sfCompute: "sf-compute",
|
|
182
184
|
togetherLite: "together-lite",
|
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.54",
|
|
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,13 +73,13 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"postinstall": "node scripts/check-types.js || true",
|
|
77
|
-
"test": "vitest --run --project unit",
|
|
78
|
-
"typecheck:transit": "exit 0",
|
|
79
76
|
"compile": "tsc",
|
|
77
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
80
78
|
"prepare": "npm run build",
|
|
79
|
+
"test": "vitest --run --project unit",
|
|
81
80
|
"test:e2e": "vitest --run --project e2e",
|
|
82
81
|
"test:transit": "exit 0",
|
|
82
|
+
"typecheck:transit": "exit 0",
|
|
83
83
|
"test:watch": "vitest --watch --project unit",
|
|
84
84
|
"typecheck": "tsc --noEmit"
|
|
85
85
|
},
|