@openrouter/sdk 1.5.47 → 1.5.49

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.
Files changed (34) hide show
  1. package/esm/lib/config.d.ts +2 -2
  2. package/esm/lib/config.js +2 -2
  3. package/esm/models/index.d.ts +0 -7
  4. package/esm/models/index.js +0 -7
  5. package/esm/models/operations/gettaskclassifications.d.ts +4 -4
  6. package/esm/models/operations/gettaskclassifications.js +3 -3
  7. package/esm/models/operations/index.d.ts +0 -1
  8. package/esm/models/operations/index.js +0 -1
  9. package/esm/models/videogenerationrequest.d.ts +36 -2
  10. package/esm/models/videogenerationrequest.js +21 -0
  11. package/esm/models/workspacemember.d.ts +5 -3
  12. package/esm/models/workspacemember.js +3 -1
  13. package/esm/sdk/providers.d.ts +0 -8
  14. package/esm/sdk/providers.js +0 -10
  15. package/jsr.json +1 -1
  16. package/package.json +8 -8
  17. package/esm/funcs/providersListProviderEndpoints.d.ts +0 -19
  18. package/esm/funcs/providersListProviderEndpoints.js +0 -108
  19. package/esm/models/endpointsummary.d.ts +0 -65
  20. package/esm/models/endpointsummary.js +0 -48
  21. package/esm/models/endpointtestprofile.d.ts +0 -271
  22. package/esm/models/endpointtestprofile.js +0 -252
  23. package/esm/models/operations/listproviderendpoints.d.ts +0 -106
  24. package/esm/models/operations/listproviderendpoints.js +0 -55
  25. package/esm/models/providerendpoints.d.ts +0 -34
  26. package/esm/models/providerendpoints.js +0 -32
  27. package/esm/models/providerendpointsresponse.d.ts +0 -11
  28. package/esm/models/providerendpointsresponse.js +0 -15
  29. package/esm/models/providerendpointstats.d.ts +0 -11
  30. package/esm/models/providerendpointstats.js +0 -17
  31. package/esm/models/providerendpointstatsavailable.d.ts +0 -66
  32. package/esm/models/providerendpointstatsavailable.js +0 -51
  33. package/esm/models/providerendpointstatsunavailable.d.ts +0 -10
  34. package/esm/models/providerendpointstatsunavailable.js +0 -14
@@ -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.47";
53
+ readonly sdkVersion: "1.5.49";
54
54
  readonly genVersion: "2.950.13";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.5.47 2.950.13 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.5.49 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.47",
32
+ sdkVersion: "1.5.49",
33
33
  genVersion: "2.950.13",
34
- userAgent: "speakeasy-sdk/typescript 1.5.47 2.950.13 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.5.49 2.950.13 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -332,8 +332,6 @@ export * from "./embeddings.js";
332
332
  export * from "./endpointinfo.js";
333
333
  export * from "./endpointsmetadata.js";
334
334
  export * from "./endpointstatus.js";
335
- export * from "./endpointsummary.js";
336
- export * from "./endpointtestprofile.js";
337
335
  export * from "./enumcapability.js";
338
336
  export * from "./errorevent.js";
339
337
  export * from "./externaluser.js";
@@ -674,11 +672,6 @@ export * from "./privateprovider.js";
674
672
  export * from "./promptcachebreakpoint.js";
675
673
  export * from "./promptcacheoptions.js";
676
674
  export * from "./promptinjectionscanscope.js";
677
- export * from "./providerendpoints.js";
678
- export * from "./providerendpointsresponse.js";
679
- export * from "./providerendpointstats.js";
680
- export * from "./providerendpointstatsavailable.js";
681
- export * from "./providerendpointstatsunavailable.js";
682
675
  export * from "./providername.js";
683
676
  export * from "./provideroptions.js";
684
677
  export * from "./provideroverloadedresponseerrordata.js";
@@ -336,8 +336,6 @@ export * from "./embeddings.js";
336
336
  export * from "./endpointinfo.js";
337
337
  export * from "./endpointsmetadata.js";
338
338
  export * from "./endpointstatus.js";
339
- export * from "./endpointsummary.js";
340
- export * from "./endpointtestprofile.js";
341
339
  export * from "./enumcapability.js";
342
340
  export * from "./errorevent.js";
343
341
  export * from "./externaluser.js";
@@ -678,11 +676,6 @@ export * from "./privateprovider.js";
678
676
  export * from "./promptcachebreakpoint.js";
679
677
  export * from "./promptcacheoptions.js";
680
678
  export * from "./promptinjectionscanscope.js";
681
- export * from "./providerendpoints.js";
682
- export * from "./providerendpointsresponse.js";
683
- export * from "./providerendpointstats.js";
684
- export * from "./providerendpointstatsavailable.js";
685
- export * from "./providerendpointstatsunavailable.js";
686
679
  export * from "./providername.js";
687
680
  export * from "./provideroptions.js";
688
681
  export * from "./provideroverloadedresponseerrordata.js";
@@ -24,13 +24,13 @@ export type GetTaskClassificationsGlobals = {
24
24
  /**
25
25
  * Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.
26
26
  */
27
- export declare const GetTaskClassificationsWindow: {
27
+ export declare const Window: {
28
28
  readonly Sevend: "7d";
29
29
  };
30
30
  /**
31
31
  * Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.
32
32
  */
33
- export type GetTaskClassificationsWindow = ClosedEnum<typeof GetTaskClassificationsWindow>;
33
+ export type Window = ClosedEnum<typeof Window>;
34
34
  export type GetTaskClassificationsRequest = {
35
35
  /**
36
36
  * The app identifier should be your app's URL and is used as the primary identifier for rankings.
@@ -54,10 +54,10 @@ export type GetTaskClassificationsRequest = {
54
54
  /**
55
55
  * Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.
56
56
  */
57
- window?: GetTaskClassificationsWindow | undefined;
57
+ window?: Window | undefined;
58
58
  };
59
59
  /** @internal */
60
- export declare const GetTaskClassificationsWindow$outboundSchema: z.ZodEnum<typeof GetTaskClassificationsWindow>;
60
+ export declare const Window$outboundSchema: z.ZodEnum<typeof Window>;
61
61
  /** @internal */
62
62
  export type GetTaskClassificationsRequest$Outbound = {
63
63
  "HTTP-Referer"?: string | undefined;
@@ -7,17 +7,17 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  /**
8
8
  * Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.
9
9
  */
10
- export const GetTaskClassificationsWindow = {
10
+ export const Window = {
11
11
  Sevend: "7d",
12
12
  };
13
13
  /** @internal */
14
- export const GetTaskClassificationsWindow$outboundSchema = z.enum(GetTaskClassificationsWindow);
14
+ export const Window$outboundSchema = z.enum(Window);
15
15
  /** @internal */
16
16
  export const GetTaskClassificationsRequest$outboundSchema = z.object({
17
17
  httpReferer: z.string().optional(),
18
18
  appTitle: z.string().optional(),
19
19
  appCategories: z.string().optional(),
20
- window: GetTaskClassificationsWindow$outboundSchema.default("7d"),
20
+ window: Window$outboundSchema.default("7d"),
21
21
  }).transform((v) => {
22
22
  return remap$(v, {
23
23
  httpReferer: "HTTP-Referer",
@@ -112,7 +112,6 @@ export * from "./listpresets.js";
112
112
  export * from "./listpresetversions.js";
113
113
  export * from "./listprivateendpoints.js";
114
114
  export * from "./listprivateproviders.js";
115
- export * from "./listproviderendpoints.js";
116
115
  export * from "./listproviders.js";
117
116
  export * from "./listscimgroupmappings.js";
118
117
  export * from "./listscimgroups.js";
@@ -116,7 +116,6 @@ export * from "./listpresets.js";
116
116
  export * from "./listpresetversions.js";
117
117
  export * from "./listprivateendpoints.js";
118
118
  export * from "./listprivateproviders.js";
119
- export * from "./listproviderendpoints.js";
120
119
  export * from "./listproviders.js";
121
120
  export * from "./listscimgroupmappings.js";
122
121
  export * from "./listscimgroups.js";
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
2
2
  import { OpenEnum } from "../types/enums.js";
3
3
  import { FrameImage, FrameImage$Outbound } from "./frameimage.js";
4
4
  import { InputReference, InputReference$Outbound } from "./inputreference.js";
5
+ import { ProviderName } from "./providername.js";
5
6
  import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js";
6
7
  /**
7
8
  * Aspect ratio of the generated video
@@ -21,6 +22,8 @@ export declare const VideoGenerationRequestAspectRatio: {
21
22
  * Aspect ratio of the generated video
22
23
  */
23
24
  export type VideoGenerationRequestAspectRatio = OpenEnum<typeof VideoGenerationRequestAspectRatio>;
25
+ export type VideoGenerationRequestIgnore = ProviderName | string;
26
+ export type VideoGenerationRequestOnly = ProviderName | string;
24
27
  /**
25
28
  * Provider-specific options keyed by provider slug. The provider segment is case-insensitive; an endpoint tag after `/` must match the endpoint slug exactly. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped.
26
29
  */
@@ -488,11 +491,24 @@ export type VideoGenerationRequestOptions = {
488
491
  [k: string]: any;
489
492
  } | undefined;
490
493
  };
494
+ export type VideoGenerationRequestOrder = ProviderName | string;
491
495
  /**
492
- * Provider-specific passthrough configuration
496
+ * Provider routing preferences (order, only, ignore) and provider-specific passthrough configuration
493
497
  */
494
498
  export type VideoGenerationRequestProvider = {
499
+ /**
500
+ * List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.
501
+ */
502
+ ignore?: Array<ProviderName | string> | null | undefined;
503
+ /**
504
+ * List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.
505
+ */
506
+ only?: Array<ProviderName | string> | null | undefined;
495
507
  options?: VideoGenerationRequestOptions | undefined;
508
+ /**
509
+ * An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.
510
+ */
511
+ order?: Array<ProviderName | string> | null | undefined;
496
512
  };
497
513
  /**
498
514
  * Resolution of the generated video
@@ -550,7 +566,7 @@ export type VideoGenerationRequest = {
550
566
  */
551
567
  prompt?: string | undefined;
552
568
  /**
553
- * Provider-specific passthrough configuration
569
+ * Provider routing preferences (order, only, ignore) and provider-specific passthrough configuration
554
570
  */
555
571
  provider?: VideoGenerationRequestProvider | undefined;
556
572
  /**
@@ -585,6 +601,16 @@ export type VideoGenerationRequest = {
585
601
  /** @internal */
586
602
  export declare const VideoGenerationRequestAspectRatio$outboundSchema: z.ZodType<string, VideoGenerationRequestAspectRatio>;
587
603
  /** @internal */
604
+ export type VideoGenerationRequestIgnore$Outbound = string | string;
605
+ /** @internal */
606
+ export declare const VideoGenerationRequestIgnore$outboundSchema: z.ZodType<VideoGenerationRequestIgnore$Outbound, VideoGenerationRequestIgnore>;
607
+ export declare function videoGenerationRequestIgnoreToJSON(videoGenerationRequestIgnore: VideoGenerationRequestIgnore): string;
608
+ /** @internal */
609
+ export type VideoGenerationRequestOnly$Outbound = string | string;
610
+ /** @internal */
611
+ export declare const VideoGenerationRequestOnly$outboundSchema: z.ZodType<VideoGenerationRequestOnly$Outbound, VideoGenerationRequestOnly>;
612
+ export declare function videoGenerationRequestOnlyToJSON(videoGenerationRequestOnly: VideoGenerationRequestOnly): string;
613
+ /** @internal */
588
614
  export type VideoGenerationRequestOptions$Outbound = {
589
615
  "01ai"?: {
590
616
  [k: string]: any;
@@ -1053,8 +1079,16 @@ export type VideoGenerationRequestOptions$Outbound = {
1053
1079
  export declare const VideoGenerationRequestOptions$outboundSchema: z.ZodType<VideoGenerationRequestOptions$Outbound, VideoGenerationRequestOptions>;
1054
1080
  export declare function videoGenerationRequestOptionsToJSON(videoGenerationRequestOptions: VideoGenerationRequestOptions): string;
1055
1081
  /** @internal */
1082
+ export type VideoGenerationRequestOrder$Outbound = string | string;
1083
+ /** @internal */
1084
+ export declare const VideoGenerationRequestOrder$outboundSchema: z.ZodType<VideoGenerationRequestOrder$Outbound, VideoGenerationRequestOrder>;
1085
+ export declare function videoGenerationRequestOrderToJSON(videoGenerationRequestOrder: VideoGenerationRequestOrder): string;
1086
+ /** @internal */
1056
1087
  export type VideoGenerationRequestProvider$Outbound = {
1088
+ ignore?: Array<string | string> | null | undefined;
1089
+ only?: Array<string | string> | null | undefined;
1057
1090
  options?: VideoGenerationRequestOptions$Outbound | undefined;
1091
+ order?: Array<string | string> | null | undefined;
1058
1092
  };
1059
1093
  /** @internal */
1060
1094
  export declare const VideoGenerationRequestProvider$outboundSchema: z.ZodType<VideoGenerationRequestProvider$Outbound, VideoGenerationRequestProvider>;
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../lib/primitives.js";
7
7
  import * as openEnums from "../types/enums.js";
8
8
  import { FrameImage$outboundSchema, } from "./frameimage.js";
9
9
  import { InputReference$outboundSchema, } from "./inputreference.js";
10
+ import { ProviderName$outboundSchema } from "./providername.js";
10
11
  import { TraceConfig$outboundSchema, } from "./traceconfig.js";
11
12
  /**
12
13
  * Aspect ratio of the generated video
@@ -38,6 +39,16 @@ export const VideoGenerationRequestResolution = {
38
39
  /** @internal */
39
40
  export const VideoGenerationRequestAspectRatio$outboundSchema = openEnums.outboundSchema(VideoGenerationRequestAspectRatio);
40
41
  /** @internal */
42
+ export const VideoGenerationRequestIgnore$outboundSchema = z.union([ProviderName$outboundSchema, z.string()]);
43
+ export function videoGenerationRequestIgnoreToJSON(videoGenerationRequestIgnore) {
44
+ return JSON.stringify(VideoGenerationRequestIgnore$outboundSchema.parse(videoGenerationRequestIgnore));
45
+ }
46
+ /** @internal */
47
+ export const VideoGenerationRequestOnly$outboundSchema = z.union([ProviderName$outboundSchema, z.string()]);
48
+ export function videoGenerationRequestOnlyToJSON(videoGenerationRequestOnly) {
49
+ return JSON.stringify(VideoGenerationRequestOnly$outboundSchema.parse(videoGenerationRequestOnly));
50
+ }
51
+ /** @internal */
41
52
  export const VideoGenerationRequestOptions$outboundSchema = z.object({
42
53
  oneai: z.record(z.string(), z.any()).optional(),
43
54
  ai21: z.record(z.string(), z.any()).optional(),
@@ -234,9 +245,19 @@ export function videoGenerationRequestOptionsToJSON(videoGenerationRequestOption
234
245
  return JSON.stringify(VideoGenerationRequestOptions$outboundSchema.parse(videoGenerationRequestOptions));
235
246
  }
236
247
  /** @internal */
248
+ export const VideoGenerationRequestOrder$outboundSchema = z.union([ProviderName$outboundSchema, z.string()]);
249
+ export function videoGenerationRequestOrderToJSON(videoGenerationRequestOrder) {
250
+ return JSON.stringify(VideoGenerationRequestOrder$outboundSchema.parse(videoGenerationRequestOrder));
251
+ }
252
+ /** @internal */
237
253
  export const VideoGenerationRequestProvider$outboundSchema = z.object({
254
+ ignore: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()]))).optional(),
255
+ only: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()])))
256
+ .optional(),
238
257
  options: z.lazy(() => VideoGenerationRequestOptions$outboundSchema)
239
258
  .optional(),
259
+ order: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()])))
260
+ .optional(),
240
261
  });
241
262
  export function videoGenerationRequestProviderToJSON(videoGenerationRequestProvider) {
242
263
  return JSON.stringify(VideoGenerationRequestProvider$outboundSchema.parse(videoGenerationRequestProvider));
@@ -3,14 +3,16 @@ import { OpenEnum } from "../types/enums.js";
3
3
  import { Result as SafeParseResult } from "../types/fp.js";
4
4
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
5
  /**
6
- * Role of the member in the workspace
6
+ * Role of the member in the workspace. `viewer` and `restricted_viewer` are read-only: `viewer` can view the whole workspace, and `restricted_viewer` can view only their own activity.
7
7
  */
8
8
  export declare const WorkspaceMemberRole: {
9
9
  readonly Admin: "admin";
10
10
  readonly Member: "member";
11
+ readonly Viewer: "viewer";
12
+ readonly RestrictedViewer: "restricted_viewer";
11
13
  };
12
14
  /**
13
- * Role of the member in the workspace
15
+ * Role of the member in the workspace. `viewer` and `restricted_viewer` are read-only: `viewer` can view the whole workspace, and `restricted_viewer` can view only their own activity.
14
16
  */
15
17
  export type WorkspaceMemberRole = OpenEnum<typeof WorkspaceMemberRole>;
16
18
  export type WorkspaceMember = {
@@ -23,7 +25,7 @@ export type WorkspaceMember = {
23
25
  */
24
26
  id: string;
25
27
  /**
26
- * Role of the member in the workspace
28
+ * Role of the member in the workspace. `viewer` and `restricted_viewer` are read-only: `viewer` can view the whole workspace, and `restricted_viewer` can view only their own activity.
27
29
  */
28
30
  role: WorkspaceMemberRole;
29
31
  /**
@@ -7,11 +7,13 @@ import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { safeParse } from "../lib/schemas.js";
8
8
  import * as openEnums from "../types/enums.js";
9
9
  /**
10
- * Role of the member in the workspace
10
+ * Role of the member in the workspace. `viewer` and `restricted_viewer` are read-only: `viewer` can view the whole workspace, and `restricted_viewer` can view only their own activity.
11
11
  */
12
12
  export const WorkspaceMemberRole = {
13
13
  Admin: "admin",
14
14
  Member: "member",
15
+ Viewer: "viewer",
16
+ RestrictedViewer: "restricted_viewer",
15
17
  };
16
18
  /** @internal */
17
19
  export const WorkspaceMemberRole$inboundSchema = openEnums.inboundSchema(WorkspaceMemberRole);
@@ -1,17 +1,9 @@
1
1
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
2
- import * as models from "../models/index.js";
3
2
  import * as operations from "../models/operations/index.js";
4
3
  export declare class Providers extends ClientSDK {
5
4
  /**
6
5
  * List all providers
7
6
  */
8
7
  list(request?: operations.ListProvidersRequest | undefined, options?: RequestOptions): Promise<operations.ListProvidersResponse>;
9
- /**
10
- * List a provider's endpoints with provider-wide stats
11
- *
12
- * @remarks
13
- * Returns every endpoint the provider serves, hidden ones included, with the provider-wide uptime, routing, latency and throughput stats over the window. Requires provider ownership, membership, or admin access.
14
- */
15
- listProviderEndpoints(request: operations.ListProviderEndpointsRequest, options?: RequestOptions): Promise<models.ProviderEndpointsResponse>;
16
8
  }
17
9
  //# sourceMappingURL=providers.d.ts.map
@@ -3,7 +3,6 @@
3
3
  * @generated-id: fb8faa7013d0
4
4
  */
5
5
  import { providersList } from "../funcs/providersList.js";
6
- import { providersListProviderEndpoints } from "../funcs/providersListProviderEndpoints.js";
7
6
  import { ClientSDK } from "../lib/sdks.js";
8
7
  import { unwrapAsync } from "../types/fp.js";
9
8
  export class Providers extends ClientSDK {
@@ -13,14 +12,5 @@ export class Providers extends ClientSDK {
13
12
  async list(request, options) {
14
13
  return unwrapAsync(providersList(this, request, options));
15
14
  }
16
- /**
17
- * List a provider's endpoints with provider-wide stats
18
- *
19
- * @remarks
20
- * Returns every endpoint the provider serves, hidden ones included, with the provider-wide uptime, routing, latency and throughput stats over the window. Requires provider ownership, membership, or admin access.
21
- */
22
- async listProviderEndpoints(request, options) {
23
- return unwrapAsync(providersListProviderEndpoints(this, request, options));
24
- }
25
15
  }
26
16
  //# sourceMappingURL=providers.js.map
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.5.47",
5
+ "version": "1.5.49",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openrouter/sdk",
3
- "version": "1.5.47",
3
+ "version": "1.5.49",
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
- "access": "public",
25
- "provenance": true
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 && node scripts/unbarrel-imports.js",
75
75
  "prepublishOnly": "npm run build",
76
+ "test": "vitest --run --project unit",
77
+ "test:e2e": "vitest --run --project e2e",
78
+ "typecheck": "tsc --noEmit",
79
+ "typecheck:transit": "exit 0",
76
80
  "compile": "tsc && node scripts/unbarrel-imports.js",
77
81
  "postinstall": "node scripts/check-types.js || true",
78
82
  "prepare": "npm run build",
79
- "test": "vitest --run --project unit",
80
- "test:e2e": "vitest --run --project e2e",
81
83
  "test:transit": "exit 0",
82
- "test:watch": "vitest --watch --project unit",
83
- "typecheck": "tsc --noEmit",
84
- "typecheck:transit": "exit 0"
84
+ "test:watch": "vitest --watch --project unit"
85
85
  },
86
86
  "peerDependencies": {
87
87
 
@@ -1,19 +0,0 @@
1
- import { OpenRouterCore } from "../core.js";
2
- import { RequestOptions } from "../lib/sdks.js";
3
- import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
4
- import * as errors from "../models/errors/index.js";
5
- import { OpenRouterError } from "../models/errors/openroutererror.js";
6
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
7
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
8
- import * as models from "../models/index.js";
9
- import * as operations from "../models/operations/index.js";
10
- import { APIPromise } from "../types/async.js";
11
- import { Result } from "../types/fp.js";
12
- /**
13
- * List a provider's endpoints with provider-wide stats
14
- *
15
- * @remarks
16
- * Returns every endpoint the provider serves, hidden ones included, with the provider-wide uptime, routing, latency and throughput stats over the window. Requires provider ownership, membership, or admin access.
17
- */
18
- export declare function providersListProviderEndpoints(client: OpenRouterCore, request: operations.ListProviderEndpointsRequest, options?: RequestOptions): APIPromise<Result<models.ProviderEndpointsResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
19
- //# sourceMappingURL=providersListProviderEndpoints.d.ts.map
@@ -1,108 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 1ca2bac6860f
4
- */
5
- import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
6
- import { matchStatusCode } from "../lib/http.js";
7
- import * as M from "../lib/matchers.js";
8
- import { compactMap } from "../lib/primitives.js";
9
- import { safeParse } from "../lib/schemas.js";
10
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
- import { pathToFunc } from "../lib/url.js";
12
- import { BadRequestResponseError$inboundSchema as errors_BadRequestResponseError$inboundSchema } from "../models/errors/badrequestresponseerror.js"; import { ForbiddenResponseError$inboundSchema as errors_ForbiddenResponseError$inboundSchema } from "../models/errors/forbiddenresponseerror.js"; import { InternalServerResponseError$inboundSchema as errors_InternalServerResponseError$inboundSchema } from "../models/errors/internalserverresponseerror.js"; import { NotFoundResponseError$inboundSchema as errors_NotFoundResponseError$inboundSchema } from "../models/errors/notfoundresponseerror.js"; import { TooManyRequestsResponseError$inboundSchema as errors_TooManyRequestsResponseError$inboundSchema } from "../models/errors/toomanyrequestsresponseerror.js"; import { UnauthorizedResponseError$inboundSchema as errors_UnauthorizedResponseError$inboundSchema } from "../models/errors/unauthorizedresponseerror.js";
13
- import { ProviderEndpointsResponse$inboundSchema as models_ProviderEndpointsResponse$inboundSchema } from "../models/providerendpointsresponse.js";
14
- import { ListProviderEndpointsRequest$outboundSchema as operations_ListProviderEndpointsRequest$outboundSchema } from "../models/operations/listproviderendpoints.js";
15
- import { APIPromise } from "../types/async.js";
16
- /**
17
- * List a provider's endpoints with provider-wide stats
18
- *
19
- * @remarks
20
- * Returns every endpoint the provider serves, hidden ones included, with the provider-wide uptime, routing, latency and throughput stats over the window. Requires provider ownership, membership, or admin access.
21
- */
22
- export function providersListProviderEndpoints(client, request, options) {
23
- return new APIPromise($do(client, request, options));
24
- }
25
- async function $do(client, request, options) {
26
- const parsed = safeParse(request, (value) => operations_ListProviderEndpointsRequest$outboundSchema.parse(value), "Input validation failed");
27
- if (!parsed.ok) {
28
- return [parsed, { status: "invalid" }];
29
- }
30
- const payload = parsed.value;
31
- const body = null;
32
- const pathParams = {
33
- provider_slug: encodeSimple("provider_slug", payload.provider_slug, {
34
- explode: false,
35
- charEncoding: "percent",
36
- }),
37
- };
38
- const path = pathToFunc("/providers/{provider_slug}/endpoints")(pathParams);
39
- const query = encodeFormQuery({
40
- "perf_workload": payload.perf_workload,
41
- "window": payload.window,
42
- });
43
- const headers = new Headers(compactMap({
44
- Accept: "application/json",
45
- "HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
46
- "X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
47
- "X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
48
- }));
49
- const secConfig = await extractSecurity(client._options.apiKey);
50
- const securityInput = secConfig == null ? {} : { apiKey: secConfig };
51
- const requestSecurity = resolveGlobalSecurity(securityInput);
52
- const context = {
53
- options: client._options,
54
- baseURL: options?.serverURL ?? client._baseURL ?? "",
55
- operationID: "listProviderEndpoints",
56
- oAuth2Scopes: null,
57
- resolvedSecurity: requestSecurity,
58
- securitySource: client._options.apiKey,
59
- retryConfig: options?.retries
60
- || client._options.retryConfig
61
- || {
62
- strategy: "backoff",
63
- backoff: {
64
- initialInterval: 500,
65
- maxInterval: 60000,
66
- exponent: 1.5,
67
- maxElapsedTime: 3600000,
68
- },
69
- retryConnectionErrors: true,
70
- }
71
- || { strategy: "none" },
72
- retryCodes: options?.retryCodes || ["5XX"],
73
- };
74
- const requestRes = client._createRequest(context, {
75
- security: requestSecurity,
76
- method: "GET",
77
- baseURL: options?.serverURL,
78
- path: path,
79
- headers: headers,
80
- query: query,
81
- body: body,
82
- userAgent: client._options.userAgent,
83
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
84
- }, options);
85
- if (!requestRes.ok) {
86
- return [requestRes, { status: "invalid" }];
87
- }
88
- const req = requestRes.value;
89
- const doResult = await client._do(req, {
90
- context,
91
- isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
92
- retryConfig: context.retryConfig,
93
- retryCodes: context.retryCodes,
94
- });
95
- if (!doResult.ok) {
96
- return [doResult, { status: "request-error", request: req }];
97
- }
98
- const response = doResult.value;
99
- const responseFields = {
100
- HttpMeta: { Response: response, Request: req },
101
- };
102
- const [result] = await M.match(M.json(200, models_ProviderEndpointsResponse$inboundSchema), M.jsonErr(400, errors_BadRequestResponseError$inboundSchema), M.jsonErr(401, errors_UnauthorizedResponseError$inboundSchema), M.jsonErr(403, errors_ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors_NotFoundResponseError$inboundSchema), M.jsonErr(429, errors_TooManyRequestsResponseError$inboundSchema), M.jsonErr(500, errors_InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
103
- if (!result.ok) {
104
- return [result, { status: "complete", request: req, response }];
105
- }
106
- return [result, { status: "complete", request: req, response }];
107
- }
108
- //# sourceMappingURL=providersListProviderEndpoints.js.map
@@ -1,65 +0,0 @@
1
- import * as z from "zod/v4";
2
- import { OpenEnum } from "../types/enums.js";
3
- import { Result as SafeParseResult } from "../types/fp.js";
4
- import { EndpointTestProfile } from "./endpointtestprofile.js";
5
- import { SDKValidationError } from "./errors/sdkvalidationerror.js";
6
- /**
7
- * Whether the endpoint is listed on OpenRouter
8
- */
9
- export declare const Visibility: {
10
- readonly Visible: "visible";
11
- readonly Hidden: "hidden";
12
- };
13
- /**
14
- * Whether the endpoint is listed on OpenRouter
15
- */
16
- export type Visibility = OpenEnum<typeof Visibility>;
17
- export type EndpointSummary = {
18
- /**
19
- * Endpoint ID
20
- */
21
- endpointId: string;
22
- /**
23
- * Public model slug
24
- */
25
- modelSlug: string;
26
- /**
27
- * When the endpoint was created
28
- */
29
- createdAt: string;
30
- /**
31
- * Permanent model slug the endpoint is listed under
32
- */
33
- modelPermaslug: string;
34
- /**
35
- * The provider's own model ID
36
- */
37
- providerModelId: string | null;
38
- /**
39
- * Provider name
40
- */
41
- providerName: string;
42
- /**
43
- * Serving region
44
- */
45
- providerRegion: string | null;
46
- /**
47
- * Service tier; null for the default tier
48
- */
49
- serviceTier: string | null;
50
- testProfile: EndpointTestProfile;
51
- /**
52
- * Endpoint variant
53
- */
54
- variant: string;
55
- /**
56
- * Whether the endpoint is listed on OpenRouter
57
- */
58
- visibility: Visibility;
59
- };
60
- /** @internal */
61
- export declare const Visibility$inboundSchema: z.ZodType<Visibility, unknown>;
62
- /** @internal */
63
- export declare const EndpointSummary$inboundSchema: z.ZodType<EndpointSummary, unknown>;
64
- export declare function endpointSummaryFromJSON(jsonString: string): SafeParseResult<EndpointSummary, SDKValidationError>;
65
- //# sourceMappingURL=endpointsummary.d.ts.map
@@ -1,48 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 31dc14145629
4
- */
5
- import * as z from "zod/v4";
6
- import { remap as remap$ } from "../lib/primitives.js";
7
- import { safeParse } from "../lib/schemas.js";
8
- import * as openEnums from "../types/enums.js";
9
- import { EndpointTestProfile$inboundSchema, } from "./endpointtestprofile.js";
10
- /**
11
- * Whether the endpoint is listed on OpenRouter
12
- */
13
- export const Visibility = {
14
- Visible: "visible",
15
- Hidden: "hidden",
16
- };
17
- /** @internal */
18
- export const Visibility$inboundSchema = openEnums.inboundSchema(Visibility);
19
- /** @internal */
20
- export const EndpointSummary$inboundSchema = z.object({
21
- endpoint_id: z.string(),
22
- model_slug: z.string(),
23
- created_at: z.string(),
24
- model_permaslug: z.string(),
25
- provider_model_id: z.nullable(z.string()),
26
- provider_name: z.string(),
27
- provider_region: z.nullable(z.string()),
28
- service_tier: z.nullable(z.string()),
29
- test_profile: EndpointTestProfile$inboundSchema,
30
- variant: z.string(),
31
- visibility: Visibility$inboundSchema,
32
- }).transform((v) => {
33
- return remap$(v, {
34
- "endpoint_id": "endpointId",
35
- "model_slug": "modelSlug",
36
- "created_at": "createdAt",
37
- "model_permaslug": "modelPermaslug",
38
- "provider_model_id": "providerModelId",
39
- "provider_name": "providerName",
40
- "provider_region": "providerRegion",
41
- "service_tier": "serviceTier",
42
- "test_profile": "testProfile",
43
- });
44
- });
45
- export function endpointSummaryFromJSON(jsonString) {
46
- return safeParse(jsonString, (x) => EndpointSummary$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EndpointSummary' from JSON`);
47
- }
48
- //# sourceMappingURL=endpointsummary.js.map