@openrouter/sdk 0.13.55 → 0.13.57
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/byokproviderslug.d.ts +1 -0
- package/esm/models/byokproviderslug.js +1 -0
- package/esm/models/chatrequest.d.ts +6 -0
- package/esm/models/chatrequest.js +2 -0
- package/esm/models/imagegenerationproviderpreferences.d.ts +6 -0
- package/esm/models/imagegenerationproviderpreferences.js +1 -0
- package/esm/models/index.d.ts +2 -0
- package/esm/models/index.js +2 -0
- package/esm/models/operations/listbyokkeys.d.ts +1 -0
- package/esm/models/operations/listbyokkeys.js +1 -0
- package/esm/models/parameter.d.ts +1 -0
- package/esm/models/parameter.js +1 -0
- package/esm/models/prediction.d.ts +31 -0
- package/esm/models/prediction.js +26 -0
- package/esm/models/predictioncontenttext.d.ts +24 -0
- package/esm/models/predictioncontenttext.js +19 -0
- 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 +1 -0
- package/esm/models/providerresponse.d.ts +1 -0
- package/esm/models/providerresponse.js +1 -0
- package/esm/models/videogenerationrequest.d.ts +6 -0
- package/esm/models/videogenerationrequest.js +1 -0
- package/jsr.json +1 -1
- package/package.json +6 -6
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.57";
|
|
53
53
|
readonly genVersion: "2.884.4";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.13.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.13.57 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.57",
|
|
30
30
|
genVersion: "2.884.4",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 0.13.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 0.13.57 2.884.4 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -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 { Prediction, Prediction$Outbound } from "./prediction.js";
|
|
22
23
|
import { PromptCacheOptions, PromptCacheOptions$Outbound } from "./promptcacheoptions.js";
|
|
23
24
|
import { ProviderPreferences, ProviderPreferences$Outbound } from "./providerpreferences.js";
|
|
24
25
|
import { ResponseHealingPlugin, ResponseHealingPlugin$Outbound } from "./responsehealingplugin.js";
|
|
@@ -171,6 +172,10 @@ export type ChatRequest = {
|
|
|
171
172
|
* Plugins you want to enable for this request, including their settings.
|
|
172
173
|
*/
|
|
173
174
|
plugins?: Array<AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | WebSearchPlugin | WebFetchPlugin> | undefined;
|
|
175
|
+
/**
|
|
176
|
+
* Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance.
|
|
177
|
+
*/
|
|
178
|
+
prediction?: Prediction | null | undefined;
|
|
174
179
|
/**
|
|
175
180
|
* Presence penalty (-2.0 to 2.0)
|
|
176
181
|
*/
|
|
@@ -320,6 +325,7 @@ export type ChatRequest$Outbound = {
|
|
|
320
325
|
models?: Array<string> | undefined;
|
|
321
326
|
parallel_tool_calls?: boolean | null | undefined;
|
|
322
327
|
plugins?: Array<AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound> | undefined;
|
|
328
|
+
prediction?: Prediction$Outbound | null | undefined;
|
|
323
329
|
presence_penalty?: number | null | undefined;
|
|
324
330
|
prompt_cache_key?: string | null | undefined;
|
|
325
331
|
prompt_cache_options?: PromptCacheOptions$Outbound | 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 { Prediction$outboundSchema, } from "./prediction.js";
|
|
27
28
|
import { PromptCacheOptions$outboundSchema, } from "./promptcacheoptions.js";
|
|
28
29
|
import { ProviderPreferences$outboundSchema, } from "./providerpreferences.js";
|
|
29
30
|
import { ResponseHealingPlugin$outboundSchema, } from "./responsehealingplugin.js";
|
|
@@ -151,6 +152,7 @@ export const ChatRequest$outboundSchema = z.object({
|
|
|
151
152
|
WebSearchPlugin$outboundSchema,
|
|
152
153
|
WebFetchPlugin$outboundSchema,
|
|
153
154
|
])).optional(),
|
|
155
|
+
prediction: z.nullable(Prediction$outboundSchema).optional(),
|
|
154
156
|
presencePenalty: z.nullable(z.number()).optional(),
|
|
155
157
|
promptCacheKey: z.nullable(z.string()).optional(),
|
|
156
158
|
promptCacheOptions: z.nullable(PromptCacheOptions$outboundSchema).optional(),
|
|
@@ -188,6 +188,9 @@ export type ImageGenerationProviderPreferencesOptions = {
|
|
|
188
188
|
klusterai?: {
|
|
189
189
|
[k: string]: any | null;
|
|
190
190
|
} | undefined;
|
|
191
|
+
krea?: {
|
|
192
|
+
[k: string]: any | null;
|
|
193
|
+
} | undefined;
|
|
191
194
|
lambda?: {
|
|
192
195
|
[k: string]: any | null;
|
|
193
196
|
} | undefined;
|
|
@@ -602,6 +605,9 @@ export type ImageGenerationProviderPreferencesOptions$Outbound = {
|
|
|
602
605
|
klusterai?: {
|
|
603
606
|
[k: string]: any | null;
|
|
604
607
|
} | undefined;
|
|
608
|
+
krea?: {
|
|
609
|
+
[k: string]: any | null;
|
|
610
|
+
} | undefined;
|
|
605
611
|
lambda?: {
|
|
606
612
|
[k: string]: any | null;
|
|
607
613
|
} | undefined;
|
|
@@ -79,6 +79,7 @@ export const ImageGenerationProviderPreferencesOptions$outboundSchema = z.object
|
|
|
79
79
|
ioNet: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
80
80
|
ionstream: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
81
81
|
klusterai: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
82
|
+
krea: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
82
83
|
lambda: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
83
84
|
lepton: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
84
85
|
liquid: z.record(z.string(), z.nullable(z.any())).optional(),
|
package/esm/models/index.d.ts
CHANGED
|
@@ -396,6 +396,8 @@ export * from "./percentilethroughputcutoffs.js";
|
|
|
396
396
|
export * from "./perrequestlimits.js";
|
|
397
397
|
export * from "./pipelinestage.js";
|
|
398
398
|
export * from "./pipelinestagetype.js";
|
|
399
|
+
export * from "./prediction.js";
|
|
400
|
+
export * from "./predictioncontenttext.js";
|
|
399
401
|
export * from "./preferredmaxlatency.js";
|
|
400
402
|
export * from "./preferredminthroughput.js";
|
|
401
403
|
export * from "./preset.js";
|
package/esm/models/index.js
CHANGED
|
@@ -400,6 +400,8 @@ export * from "./percentilethroughputcutoffs.js";
|
|
|
400
400
|
export * from "./perrequestlimits.js";
|
|
401
401
|
export * from "./pipelinestage.js";
|
|
402
402
|
export * from "./pipelinestagetype.js";
|
|
403
|
+
export * from "./prediction.js";
|
|
404
|
+
export * from "./predictioncontenttext.js";
|
|
403
405
|
export * from "./preferredmaxlatency.js";
|
|
404
406
|
export * from "./preferredminthroughput.js";
|
|
405
407
|
export * from "./preset.js";
|
|
@@ -14,6 +14,7 @@ export declare const Parameter: {
|
|
|
14
14
|
readonly LogitBias: "logit_bias";
|
|
15
15
|
readonly Logprobs: "logprobs";
|
|
16
16
|
readonly TopLogprobs: "top_logprobs";
|
|
17
|
+
readonly Prediction: "prediction";
|
|
17
18
|
readonly Seed: "seed";
|
|
18
19
|
readonly ResponseFormat: "response_format";
|
|
19
20
|
readonly StructuredOutputs: "structured_outputs";
|
package/esm/models/parameter.js
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { PredictionContentText, PredictionContentText$Outbound } from "./predictioncontenttext.js";
|
|
4
|
+
export type PredictionContent = string | Array<PredictionContentText>;
|
|
5
|
+
export declare const PredictionType: {
|
|
6
|
+
readonly Content: "content";
|
|
7
|
+
};
|
|
8
|
+
export type PredictionType = ClosedEnum<typeof PredictionType>;
|
|
9
|
+
/**
|
|
10
|
+
* Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance.
|
|
11
|
+
*/
|
|
12
|
+
export type Prediction = {
|
|
13
|
+
content: string | Array<PredictionContentText>;
|
|
14
|
+
type: PredictionType;
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
export type PredictionContent$Outbound = string | Array<PredictionContentText$Outbound>;
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const PredictionContent$outboundSchema: z.ZodType<PredictionContent$Outbound, PredictionContent>;
|
|
20
|
+
export declare function predictionContentToJSON(predictionContent: PredictionContent): string;
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const PredictionType$outboundSchema: z.ZodEnum<typeof PredictionType>;
|
|
23
|
+
/** @internal */
|
|
24
|
+
export type Prediction$Outbound = {
|
|
25
|
+
content: string | Array<PredictionContentText$Outbound>;
|
|
26
|
+
type: string;
|
|
27
|
+
};
|
|
28
|
+
/** @internal */
|
|
29
|
+
export declare const Prediction$outboundSchema: z.ZodType<Prediction$Outbound, Prediction>;
|
|
30
|
+
export declare function predictionToJSON(prediction: Prediction): string;
|
|
31
|
+
//# sourceMappingURL=prediction.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 4fcc379ba382
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { PredictionContentText$outboundSchema, } from "./predictioncontenttext.js";
|
|
7
|
+
export const PredictionType = {
|
|
8
|
+
Content: "content",
|
|
9
|
+
};
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const PredictionContent$outboundSchema = z.union([z.string(), z.array(PredictionContentText$outboundSchema)]);
|
|
12
|
+
export function predictionContentToJSON(predictionContent) {
|
|
13
|
+
return JSON.stringify(PredictionContent$outboundSchema.parse(predictionContent));
|
|
14
|
+
}
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const PredictionType$outboundSchema = z
|
|
17
|
+
.enum(PredictionType);
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const Prediction$outboundSchema = z.object({
|
|
20
|
+
content: z.union([z.string(), z.array(PredictionContentText$outboundSchema)]),
|
|
21
|
+
type: PredictionType$outboundSchema,
|
|
22
|
+
});
|
|
23
|
+
export function predictionToJSON(prediction) {
|
|
24
|
+
return JSON.stringify(Prediction$outboundSchema.parse(prediction));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=prediction.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
export declare const PredictionContentTextType: {
|
|
4
|
+
readonly Text: "text";
|
|
5
|
+
};
|
|
6
|
+
export type PredictionContentTextType = ClosedEnum<typeof PredictionContentTextType>;
|
|
7
|
+
/**
|
|
8
|
+
* Text content part for a predicted output.
|
|
9
|
+
*/
|
|
10
|
+
export type PredictionContentText = {
|
|
11
|
+
text: string;
|
|
12
|
+
type: PredictionContentTextType;
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare const PredictionContentTextType$outboundSchema: z.ZodEnum<typeof PredictionContentTextType>;
|
|
16
|
+
/** @internal */
|
|
17
|
+
export type PredictionContentText$Outbound = {
|
|
18
|
+
text: string;
|
|
19
|
+
type: string;
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const PredictionContentText$outboundSchema: z.ZodType<PredictionContentText$Outbound, PredictionContentText>;
|
|
23
|
+
export declare function predictionContentTextToJSON(predictionContentText: PredictionContentText): string;
|
|
24
|
+
//# sourceMappingURL=predictioncontenttext.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: e7414b3545df
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
export const PredictionContentTextType = {
|
|
7
|
+
Text: "text",
|
|
8
|
+
};
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const PredictionContentTextType$outboundSchema = z.enum(PredictionContentTextType);
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const PredictionContentText$outboundSchema = z.object({
|
|
13
|
+
text: z.string(),
|
|
14
|
+
type: PredictionContentTextType$outboundSchema,
|
|
15
|
+
});
|
|
16
|
+
export function predictionContentTextToJSON(predictionContentText) {
|
|
17
|
+
return JSON.stringify(PredictionContentText$outboundSchema.parse(predictionContentText));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=predictioncontenttext.js.map
|
|
@@ -183,6 +183,9 @@ export type ProviderOptions = {
|
|
|
183
183
|
klusterai?: {
|
|
184
184
|
[k: string]: any | null;
|
|
185
185
|
} | undefined;
|
|
186
|
+
krea?: {
|
|
187
|
+
[k: string]: any | null;
|
|
188
|
+
} | undefined;
|
|
186
189
|
lambda?: {
|
|
187
190
|
[k: string]: any | null;
|
|
188
191
|
} | undefined;
|
|
@@ -552,6 +555,9 @@ export type ProviderOptions$Outbound = {
|
|
|
552
555
|
klusterai?: {
|
|
553
556
|
[k: string]: any | null;
|
|
554
557
|
} | undefined;
|
|
558
|
+
krea?: {
|
|
559
|
+
[k: string]: any | null;
|
|
560
|
+
} | undefined;
|
|
555
561
|
lambda?: {
|
|
556
562
|
[k: string]: any | null;
|
|
557
563
|
} | undefined;
|
|
@@ -66,6 +66,7 @@ export const ProviderOptions$outboundSchema = z.object({
|
|
|
66
66
|
ioNet: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
67
67
|
ionstream: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
68
68
|
klusterai: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
69
|
+
krea: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
69
70
|
lambda: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
70
71
|
lepton: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
71
72
|
liquid: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
@@ -204,6 +204,9 @@ export type VideoGenerationRequestOptions = {
|
|
|
204
204
|
klusterai?: {
|
|
205
205
|
[k: string]: any | null;
|
|
206
206
|
} | undefined;
|
|
207
|
+
krea?: {
|
|
208
|
+
[k: string]: any | null;
|
|
209
|
+
} | undefined;
|
|
207
210
|
lambda?: {
|
|
208
211
|
[k: string]: any | null;
|
|
209
212
|
} | undefined;
|
|
@@ -640,6 +643,9 @@ export type VideoGenerationRequestOptions$Outbound = {
|
|
|
640
643
|
klusterai?: {
|
|
641
644
|
[k: string]: any | null;
|
|
642
645
|
} | undefined;
|
|
646
|
+
krea?: {
|
|
647
|
+
[k: string]: any | null;
|
|
648
|
+
} | undefined;
|
|
643
649
|
lambda?: {
|
|
644
650
|
[k: string]: any | null;
|
|
645
651
|
} | undefined;
|
|
@@ -96,6 +96,7 @@ export const VideoGenerationRequestOptions$outboundSchema = z.object({
|
|
|
96
96
|
ioNet: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
97
97
|
ionstream: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
98
98
|
klusterai: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
99
|
+
krea: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
99
100
|
lambda: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
100
101
|
lepton: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
101
102
|
liquid: z.record(z.string(), z.nullable(z.any())).optional(),
|
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.57",
|
|
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": "tsc",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"
|
|
77
|
-
"postinstall": "node scripts/check-types.js || true",
|
|
76
|
+
"prepare": "npm run build",
|
|
78
77
|
"test": "vitest --run --project unit",
|
|
79
|
-
"test:e2e": "vitest --run --project e2e",
|
|
80
78
|
"test:transit": "exit 0",
|
|
79
|
+
"typecheck:transit": "exit 0",
|
|
80
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
81
|
+
"test:e2e": "vitest --run --project e2e",
|
|
81
82
|
"test:watch": "vitest --watch --project unit",
|
|
82
83
|
"typecheck": "tsc --noEmit",
|
|
83
|
-
"
|
|
84
|
-
"typecheck:transit": "exit 0"
|
|
84
|
+
"compile": "tsc"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|