@openrouter/sdk 1.5.39 → 1.5.40
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/funcs/alphaDecisionsCreate.d.ts +1 -1
- package/esm/funcs/alphaDecisionsCreate.js +1 -1
- package/esm/funcs/modelsList.js +1 -0
- 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/imagegenerationproviderpreferences.d.ts +6 -0
- package/esm/models/imagegenerationproviderpreferences.js +1 -0
- package/esm/models/operations/getmodels.d.ts +5 -0
- package/esm/models/operations/getmodels.js +1 -0
- package/esm/models/operations/listbyokkeys.d.ts +1 -0
- package/esm/models/operations/listbyokkeys.js +1 -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/esm/sdk/decisions.d.ts +1 -1
- package/esm/sdk/decisions.js +1 -1
- package/jsr.json +1 -1
- package/package.json +4 -4
|
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
|
|
|
13
13
|
* Submit a Decisions request
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
|
-
* Asks a Decisions model typed questions (`noul`, `choice`, `score`, `box`) about the content in `state` and returns one typed answer per question with its probabilities. Images, audio and video go in `state` as `image_url`, `input_audio` and `video_url` parts; PNG and JPEG images can instead go once in `assets` and be referenced by key. Which question types, media parts and asset references an endpoint accepts depends on the provider; a request an endpoint cannot serve fails with `400` before anything is sent upstream. See the [Multimodal Decisions guide](/docs/guides/community/multimodal-decisions) for the per-provider table. Alpha: the shape may change.
|
|
16
|
+
* Asks a Decisions model typed questions (`noul`, `choice`, `score`, `box`) about the content in `state` and returns one typed answer per question with its probabilities. Images, audio and video go in `state` as `image_url`, `input_audio` and `video_url` parts; PNG and JPEG images can instead go once in `assets` and be referenced by key. Which question types, media parts and asset references an endpoint accepts depends on the provider; a request an endpoint cannot serve fails with `400` before anything is sent upstream. See the [Multimodal Decisions guide](/docs/guides/community/multimodal-decisions) for the per-provider table. Typed fields (text, numbers, dates, lists, estimates, forecasts) come from [`POST /api/alpha/extractions`](/docs/guides/community/extractions), which takes the same envelope with `fields` in place of `questions` (text `state` only; images and PDFs go in `assets`). Alpha: the shape may change.
|
|
17
17
|
*/
|
|
18
18
|
export declare function alphaDecisionsCreate(client: OpenRouterCore, request: operations.CreateApiAlphaDecisionsRequest, options?: RequestOptions): APIPromise<Result<models.DecisionsResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.PaymentRequiredResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.PayloadTooLargeResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | errors.ServiceUnavailableResponseError | errors.EdgeNetworkTimeoutResponseError | errors.ProviderOverloadedResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
19
19
|
//# sourceMappingURL=alphaDecisionsCreate.d.ts.map
|
|
@@ -18,7 +18,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
18
18
|
* Submit a Decisions request
|
|
19
19
|
*
|
|
20
20
|
* @remarks
|
|
21
|
-
* Asks a Decisions model typed questions (`noul`, `choice`, `score`, `box`) about the content in `state` and returns one typed answer per question with its probabilities. Images, audio and video go in `state` as `image_url`, `input_audio` and `video_url` parts; PNG and JPEG images can instead go once in `assets` and be referenced by key. Which question types, media parts and asset references an endpoint accepts depends on the provider; a request an endpoint cannot serve fails with `400` before anything is sent upstream. See the [Multimodal Decisions guide](/docs/guides/community/multimodal-decisions) for the per-provider table. Alpha: the shape may change.
|
|
21
|
+
* Asks a Decisions model typed questions (`noul`, `choice`, `score`, `box`) about the content in `state` and returns one typed answer per question with its probabilities. Images, audio and video go in `state` as `image_url`, `input_audio` and `video_url` parts; PNG and JPEG images can instead go once in `assets` and be referenced by key. Which question types, media parts and asset references an endpoint accepts depends on the provider; a request an endpoint cannot serve fails with `400` before anything is sent upstream. See the [Multimodal Decisions guide](/docs/guides/community/multimodal-decisions) for the per-provider table. Typed fields (text, numbers, dates, lists, estimates, forecasts) come from [`POST /api/alpha/extractions`](/docs/guides/community/extractions), which takes the same envelope with `fields` in place of `questions` (text `state` only; images and PDFs go in `assets`). Alpha: the shape may change.
|
|
22
22
|
*/
|
|
23
23
|
export function alphaDecisionsCreate(client, request, options) {
|
|
24
24
|
return new APIPromise($do(client, request, options));
|
package/esm/funcs/modelsList.js
CHANGED
|
@@ -32,6 +32,7 @@ async function $do(client, request, options) {
|
|
|
32
32
|
"category": payload?.category,
|
|
33
33
|
"context": payload?.context,
|
|
34
34
|
"distillable": payload?.distillable,
|
|
35
|
+
"endpoints": payload?.endpoints,
|
|
35
36
|
"input_modalities": payload?.input_modalities,
|
|
36
37
|
"limit": payload?.limit,
|
|
37
38
|
"max_age_days": payload?.max_age_days,
|
package/esm/lib/config.d.ts
CHANGED
|
@@ -50,8 +50,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
50
50
|
export declare const SDK_METADATA: {
|
|
51
51
|
readonly language: "typescript";
|
|
52
52
|
readonly openapiDocVersion: "1.0.0";
|
|
53
|
-
readonly sdkVersion: "1.5.
|
|
53
|
+
readonly sdkVersion: "1.5.40";
|
|
54
54
|
readonly genVersion: "2.950.13";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.5.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.5.40 2.950.13 1.0.0 @openrouter/sdk";
|
|
56
56
|
};
|
|
57
57
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -29,8 +29,8 @@ export function serverURLFromOptions(options) {
|
|
|
29
29
|
export const SDK_METADATA = {
|
|
30
30
|
language: "typescript",
|
|
31
31
|
openapiDocVersion: "1.0.0",
|
|
32
|
-
sdkVersion: "1.5.
|
|
32
|
+
sdkVersion: "1.5.40",
|
|
33
33
|
genVersion: "2.950.13",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.5.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.5.40 2.950.13 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -12,6 +12,7 @@ export declare const BYOKProviderSlug: {
|
|
|
12
12
|
readonly AmazonBedrockClaudeOnAws: "amazon-bedrock/claude-on-aws";
|
|
13
13
|
readonly AmazonNova: "amazon-nova";
|
|
14
14
|
readonly Ambient: "ambient";
|
|
15
|
+
readonly Antdigital: "antdigital";
|
|
15
16
|
readonly Anthropic: "anthropic";
|
|
16
17
|
readonly Anthropic2: "anthropic/2";
|
|
17
18
|
readonly ArceeAi: "arcee-ai";
|
|
@@ -35,6 +35,9 @@ export type ImageGenerationProviderPreferencesOptions = {
|
|
|
35
35
|
ambient?: {
|
|
36
36
|
[k: string]: any;
|
|
37
37
|
} | undefined;
|
|
38
|
+
antdigital?: {
|
|
39
|
+
[k: string]: any;
|
|
40
|
+
} | undefined;
|
|
38
41
|
anthropic?: {
|
|
39
42
|
[k: string]: any;
|
|
40
43
|
} | undefined;
|
|
@@ -539,6 +542,9 @@ export type ImageGenerationProviderPreferencesOptions$Outbound = {
|
|
|
539
542
|
ambient?: {
|
|
540
543
|
[k: string]: any;
|
|
541
544
|
} | undefined;
|
|
545
|
+
antdigital?: {
|
|
546
|
+
[k: string]: any;
|
|
547
|
+
} | undefined;
|
|
542
548
|
anthropic?: {
|
|
543
549
|
[k: string]: any;
|
|
544
550
|
} | undefined;
|
|
@@ -28,6 +28,7 @@ export const ImageGenerationProviderPreferencesOptions$outboundSchema = z.object
|
|
|
28
28
|
amazonBedrockClaudeOnAws: z.record(z.string(), z.any()).optional(),
|
|
29
29
|
amazonNova: z.record(z.string(), z.any()).optional(),
|
|
30
30
|
ambient: z.record(z.string(), z.any()).optional(),
|
|
31
|
+
antdigital: z.record(z.string(), z.any()).optional(),
|
|
31
32
|
anthropic: z.record(z.string(), z.any()).optional(),
|
|
32
33
|
anthropic2: z.record(z.string(), z.any()).optional(),
|
|
33
34
|
anyscale: z.record(z.string(), z.any()).optional(),
|
|
@@ -150,6 +150,10 @@ export type GetModelsRequest = {
|
|
|
150
150
|
* Filter models by input modality. Comma-separated list of: text, image, audio, file.
|
|
151
151
|
*/
|
|
152
152
|
inputModalities?: string | undefined;
|
|
153
|
+
/**
|
|
154
|
+
* Filter models by the request API paths they serve, as listed in each model's `endpoints` field. Comma-separated; a model must serve every listed path. Valid values: /api/v1/chat/completions, /api/v1/completions, /api/v1/messages, /api/v1/responses, /api/v1/embeddings, /api/v1/rerank, /api/alpha/decisions, /api/alpha/extractions, /api/v1/videos, /api/v1/audio/speech, /api/v1/audio/transcriptions, /api/v1/images, /api/v1/batches. When set without `output_modalities`, models of every output modality are considered (the companion `/api/alpha/extractions` route is served by text and decisions models alike).
|
|
155
|
+
*/
|
|
156
|
+
endpoints?: string | undefined;
|
|
153
157
|
/**
|
|
154
158
|
* Minimum context length (tokens). Models with smaller context are excluded.
|
|
155
159
|
*/
|
|
@@ -261,6 +265,7 @@ export type GetModelsRequest$Outbound = {
|
|
|
261
265
|
sort?: string | undefined;
|
|
262
266
|
q?: string | undefined;
|
|
263
267
|
input_modalities?: string | undefined;
|
|
268
|
+
endpoints?: string | undefined;
|
|
264
269
|
context?: number | undefined;
|
|
265
270
|
min_price?: number | null | undefined;
|
|
266
271
|
max_price?: number | null | undefined;
|
|
@@ -85,6 +85,7 @@ export const GetModelsRequest$outboundSchema = z.object({
|
|
|
85
85
|
sort: GetModelsSort$outboundSchema.optional(),
|
|
86
86
|
q: z.string().optional(),
|
|
87
87
|
inputModalities: z.string().optional(),
|
|
88
|
+
endpoints: z.string().optional(),
|
|
88
89
|
context: z.int().optional(),
|
|
89
90
|
minPrice: z.nullable(z.number()).optional(),
|
|
90
91
|
maxPrice: z.nullable(z.number()).optional(),
|
|
@@ -36,6 +36,7 @@ export declare const Provider: {
|
|
|
36
36
|
readonly AmazonBedrockClaudeOnAws: "amazon-bedrock/claude-on-aws";
|
|
37
37
|
readonly AmazonNova: "amazon-nova";
|
|
38
38
|
readonly Ambient: "ambient";
|
|
39
|
+
readonly Antdigital: "antdigital";
|
|
39
40
|
readonly Anthropic: "anthropic";
|
|
40
41
|
readonly Anthropic2: "anthropic/2";
|
|
41
42
|
readonly ArceeAi: "arcee-ai";
|
|
@@ -7,6 +7,7 @@ export declare const ProviderName: {
|
|
|
7
7
|
readonly AionLabs: "AionLabs";
|
|
8
8
|
readonly Alibaba: "Alibaba";
|
|
9
9
|
readonly Ambient: "Ambient";
|
|
10
|
+
readonly AntDigital: "Ant Digital";
|
|
10
11
|
readonly Baidu: "Baidu";
|
|
11
12
|
readonly AmazonBedrock: "Amazon Bedrock";
|
|
12
13
|
readonly AmazonNova: "Amazon Nova";
|
|
@@ -30,6 +30,9 @@ export type ProviderOptions = {
|
|
|
30
30
|
ambient?: {
|
|
31
31
|
[k: string]: any;
|
|
32
32
|
} | undefined;
|
|
33
|
+
antdigital?: {
|
|
34
|
+
[k: string]: any;
|
|
35
|
+
} | undefined;
|
|
33
36
|
anthropic?: {
|
|
34
37
|
[k: string]: any;
|
|
35
38
|
} | undefined;
|
|
@@ -489,6 +492,9 @@ export type ProviderOptions$Outbound = {
|
|
|
489
492
|
ambient?: {
|
|
490
493
|
[k: string]: any;
|
|
491
494
|
} | undefined;
|
|
495
|
+
antdigital?: {
|
|
496
|
+
[k: string]: any;
|
|
497
|
+
} | undefined;
|
|
492
498
|
anthropic?: {
|
|
493
499
|
[k: string]: any;
|
|
494
500
|
} | undefined;
|
|
@@ -15,6 +15,7 @@ export const ProviderOptions$outboundSchema = z.object({
|
|
|
15
15
|
amazonBedrockClaudeOnAws: z.record(z.string(), z.any()).optional(),
|
|
16
16
|
amazonNova: z.record(z.string(), z.any()).optional(),
|
|
17
17
|
ambient: z.record(z.string(), z.any()).optional(),
|
|
18
|
+
antdigital: z.record(z.string(), z.any()).optional(),
|
|
18
19
|
anthropic: z.record(z.string(), z.any()).optional(),
|
|
19
20
|
anthropic2: z.record(z.string(), z.any()).optional(),
|
|
20
21
|
anyscale: z.record(z.string(), z.any()).optional(),
|
|
@@ -40,6 +40,7 @@ export declare const ProviderResponseProviderName: {
|
|
|
40
40
|
readonly AionLabs: "AionLabs";
|
|
41
41
|
readonly Alibaba: "Alibaba";
|
|
42
42
|
readonly Ambient: "Ambient";
|
|
43
|
+
readonly AntDigital: "Ant Digital";
|
|
43
44
|
readonly Baidu: "Baidu";
|
|
44
45
|
readonly AmazonBedrock: "Amazon Bedrock";
|
|
45
46
|
readonly AmazonNova: "Amazon Nova";
|
|
@@ -52,6 +52,9 @@ export type VideoGenerationRequestOptions = {
|
|
|
52
52
|
ambient?: {
|
|
53
53
|
[k: string]: any;
|
|
54
54
|
} | undefined;
|
|
55
|
+
antdigital?: {
|
|
56
|
+
[k: string]: any;
|
|
57
|
+
} | undefined;
|
|
55
58
|
anthropic?: {
|
|
56
59
|
[k: string]: any;
|
|
57
60
|
} | undefined;
|
|
@@ -607,6 +610,9 @@ export type VideoGenerationRequestOptions$Outbound = {
|
|
|
607
610
|
ambient?: {
|
|
608
611
|
[k: string]: any;
|
|
609
612
|
} | undefined;
|
|
613
|
+
antdigital?: {
|
|
614
|
+
[k: string]: any;
|
|
615
|
+
} | undefined;
|
|
610
616
|
anthropic?: {
|
|
611
617
|
[k: string]: any;
|
|
612
618
|
} | undefined;
|
|
@@ -48,6 +48,7 @@ export const VideoGenerationRequestOptions$outboundSchema = z.object({
|
|
|
48
48
|
amazonBedrockClaudeOnAws: z.record(z.string(), z.any()).optional(),
|
|
49
49
|
amazonNova: z.record(z.string(), z.any()).optional(),
|
|
50
50
|
ambient: z.record(z.string(), z.any()).optional(),
|
|
51
|
+
antdigital: z.record(z.string(), z.any()).optional(),
|
|
51
52
|
anthropic: z.record(z.string(), z.any()).optional(),
|
|
52
53
|
anthropic2: z.record(z.string(), z.any()).optional(),
|
|
53
54
|
anyscale: z.record(z.string(), z.any()).optional(),
|
package/esm/sdk/decisions.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare class Decisions extends ClientSDK {
|
|
|
6
6
|
* Submit a Decisions request
|
|
7
7
|
*
|
|
8
8
|
* @remarks
|
|
9
|
-
* Asks a Decisions model typed questions (`noul`, `choice`, `score`, `box`) about the content in `state` and returns one typed answer per question with its probabilities. Images, audio and video go in `state` as `image_url`, `input_audio` and `video_url` parts; PNG and JPEG images can instead go once in `assets` and be referenced by key. Which question types, media parts and asset references an endpoint accepts depends on the provider; a request an endpoint cannot serve fails with `400` before anything is sent upstream. See the [Multimodal Decisions guide](/docs/guides/community/multimodal-decisions) for the per-provider table. Alpha: the shape may change.
|
|
9
|
+
* Asks a Decisions model typed questions (`noul`, `choice`, `score`, `box`) about the content in `state` and returns one typed answer per question with its probabilities. Images, audio and video go in `state` as `image_url`, `input_audio` and `video_url` parts; PNG and JPEG images can instead go once in `assets` and be referenced by key. Which question types, media parts and asset references an endpoint accepts depends on the provider; a request an endpoint cannot serve fails with `400` before anything is sent upstream. See the [Multimodal Decisions guide](/docs/guides/community/multimodal-decisions) for the per-provider table. Typed fields (text, numbers, dates, lists, estimates, forecasts) come from [`POST /api/alpha/extractions`](/docs/guides/community/extractions), which takes the same envelope with `fields` in place of `questions` (text `state` only; images and PDFs go in `assets`). Alpha: the shape may change.
|
|
10
10
|
*/
|
|
11
11
|
create(request: operations.CreateApiAlphaDecisionsRequest, options?: RequestOptions): Promise<models.DecisionsResponse>;
|
|
12
12
|
}
|
package/esm/sdk/decisions.js
CHANGED
|
@@ -10,7 +10,7 @@ export class Decisions extends ClientSDK {
|
|
|
10
10
|
* Submit a Decisions request
|
|
11
11
|
*
|
|
12
12
|
* @remarks
|
|
13
|
-
* Asks a Decisions model typed questions (`noul`, `choice`, `score`, `box`) about the content in `state` and returns one typed answer per question with its probabilities. Images, audio and video go in `state` as `image_url`, `input_audio` and `video_url` parts; PNG and JPEG images can instead go once in `assets` and be referenced by key. Which question types, media parts and asset references an endpoint accepts depends on the provider; a request an endpoint cannot serve fails with `400` before anything is sent upstream. See the [Multimodal Decisions guide](/docs/guides/community/multimodal-decisions) for the per-provider table. Alpha: the shape may change.
|
|
13
|
+
* Asks a Decisions model typed questions (`noul`, `choice`, `score`, `box`) about the content in `state` and returns one typed answer per question with its probabilities. Images, audio and video go in `state` as `image_url`, `input_audio` and `video_url` parts; PNG and JPEG images can instead go once in `assets` and be referenced by key. Which question types, media parts and asset references an endpoint accepts depends on the provider; a request an endpoint cannot serve fails with `400` before anything is sent upstream. See the [Multimodal Decisions guide](/docs/guides/community/multimodal-decisions) for the per-provider table. Typed fields (text, numbers, dates, lists, estimates, forecasts) come from [`POST /api/alpha/extractions`](/docs/guides/community/extractions), which takes the same envelope with `fields` in place of `questions` (text `state` only; images and PDFs go in `assets`). Alpha: the shape may change.
|
|
14
14
|
*/
|
|
15
15
|
async create(request, options) {
|
|
16
16
|
return unwrapAsync(alphaDecisionsCreate(this, request, options));
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.40",
|
|
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,13 +74,13 @@
|
|
|
74
74
|
"build": "tsc && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
76
|
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
77
|
+
"prepare": "npm run build",
|
|
78
|
+
"typecheck": "tsc --noEmit",
|
|
77
79
|
"postinstall": "node scripts/check-types.js || true",
|
|
80
|
+
"test": "vitest --run --project unit",
|
|
78
81
|
"test:e2e": "vitest --run --project e2e",
|
|
79
82
|
"test:transit": "exit 0",
|
|
80
83
|
"test:watch": "vitest --watch --project unit",
|
|
81
|
-
"typecheck": "tsc --noEmit",
|
|
82
|
-
"prepare": "npm run build",
|
|
83
|
-
"test": "vitest --run --project unit",
|
|
84
84
|
"typecheck:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|