@openrouter/sdk 1.5.44 → 1.5.46

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 (40) hide show
  1. package/esm/funcs/providersListProviderEndpoints.d.ts +19 -0
  2. package/esm/funcs/providersListProviderEndpoints.js +108 -0
  3. package/esm/lib/config.d.ts +2 -2
  4. package/esm/lib/config.js +2 -2
  5. package/esm/models/decisionsrefusalanswer.d.ts +13 -0
  6. package/esm/models/decisionsrefusalanswer.js +14 -0
  7. package/esm/models/decisionsresponse.d.ts +9 -3
  8. package/esm/models/decisionsresponse.js +5 -0
  9. package/esm/models/decisionsurlcitationannotation.d.ts +29 -0
  10. package/esm/models/decisionsurlcitationannotation.js +34 -0
  11. package/esm/models/endpointsummary.d.ts +65 -0
  12. package/esm/models/endpointsummary.js +48 -0
  13. package/esm/models/endpointtestprofile.d.ts +271 -0
  14. package/esm/models/endpointtestprofile.js +252 -0
  15. package/esm/models/index.d.ts +9 -0
  16. package/esm/models/index.js +9 -0
  17. package/esm/models/operations/gettaskclassifications.d.ts +4 -4
  18. package/esm/models/operations/gettaskclassifications.js +3 -3
  19. package/esm/models/operations/index.d.ts +1 -0
  20. package/esm/models/operations/index.js +1 -0
  21. package/esm/models/operations/listproviderendpoints.d.ts +106 -0
  22. package/esm/models/operations/listproviderendpoints.js +55 -0
  23. package/esm/models/providerendpoints.d.ts +34 -0
  24. package/esm/models/providerendpoints.js +32 -0
  25. package/esm/models/providerendpointsresponse.d.ts +11 -0
  26. package/esm/models/providerendpointsresponse.js +15 -0
  27. package/esm/models/providerendpointstats.d.ts +11 -0
  28. package/esm/models/providerendpointstats.js +17 -0
  29. package/esm/models/providerendpointstatsavailable.d.ts +66 -0
  30. package/esm/models/providerendpointstatsavailable.js +51 -0
  31. package/esm/models/providerendpointstatsunavailable.d.ts +10 -0
  32. package/esm/models/providerendpointstatsunavailable.js +14 -0
  33. package/esm/models/speechrequest.d.ts +45 -2
  34. package/esm/models/speechrequest.js +23 -0
  35. package/esm/models/sttrequest.d.ts +45 -2
  36. package/esm/models/sttrequest.js +23 -0
  37. package/esm/sdk/providers.d.ts +8 -0
  38. package/esm/sdk/providers.js +10 -0
  39. package/jsr.json +1 -1
  40. package/package.json +3 -3
@@ -5,6 +5,7 @@
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
7
  import * as openEnums from "../types/enums.js";
8
+ import { ProviderName$outboundSchema } from "./providername.js";
8
9
  import { ProviderOptions$outboundSchema, } from "./provideroptions.js";
9
10
  import { STTInputAudio$outboundSchema, } from "./sttinputaudio.js";
10
11
  import { STTTimestampGranularity$outboundSchema, } from "./stttimestampgranularity.js";
@@ -31,13 +32,35 @@ export const STTRequestResponseFormat = {
31
32
  /** @internal */
32
33
  export const STTRequestDataCollection$outboundSchema = openEnums.outboundSchema(STTRequestDataCollection);
33
34
  /** @internal */
35
+ export const STTRequestIgnore$outboundSchema = z.union([ProviderName$outboundSchema, z.string()]);
36
+ export function sttRequestIgnoreToJSON(sttRequestIgnore) {
37
+ return JSON.stringify(STTRequestIgnore$outboundSchema.parse(sttRequestIgnore));
38
+ }
39
+ /** @internal */
40
+ export const STTRequestOnly$outboundSchema = z.union([ProviderName$outboundSchema, z.string()]);
41
+ export function sttRequestOnlyToJSON(sttRequestOnly) {
42
+ return JSON.stringify(STTRequestOnly$outboundSchema.parse(sttRequestOnly));
43
+ }
44
+ /** @internal */
45
+ export const STTRequestOrder$outboundSchema = z.union([ProviderName$outboundSchema, z.string()]);
46
+ export function sttRequestOrderToJSON(sttRequestOrder) {
47
+ return JSON.stringify(STTRequestOrder$outboundSchema.parse(sttRequestOrder));
48
+ }
49
+ /** @internal */
34
50
  export const STTRequestProvider$outboundSchema = z.object({
51
+ allowFallbacks: z.nullable(z.boolean()).optional(),
35
52
  dataCollection: z.nullable(STTRequestDataCollection$outboundSchema)
36
53
  .optional(),
54
+ ignore: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()]))).optional(),
55
+ only: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()])))
56
+ .optional(),
37
57
  options: ProviderOptions$outboundSchema.optional(),
58
+ order: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()])))
59
+ .optional(),
38
60
  zdr: z.nullable(z.boolean()).optional(),
39
61
  }).transform((v) => {
40
62
  return remap$(v, {
63
+ allowFallbacks: "allow_fallbacks",
41
64
  dataCollection: "data_collection",
42
65
  });
43
66
  });
@@ -1,9 +1,17 @@
1
1
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
2
+ import * as models from "../models/index.js";
2
3
  import * as operations from "../models/operations/index.js";
3
4
  export declare class Providers extends ClientSDK {
4
5
  /**
5
6
  * List all providers
6
7
  */
7
8
  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>;
8
16
  }
9
17
  //# sourceMappingURL=providers.d.ts.map
@@ -3,6 +3,7 @@
3
3
  * @generated-id: fb8faa7013d0
4
4
  */
5
5
  import { providersList } from "../funcs/providersList.js";
6
+ import { providersListProviderEndpoints } from "../funcs/providersListProviderEndpoints.js";
6
7
  import { ClientSDK } from "../lib/sdks.js";
7
8
  import { unwrapAsync } from "../types/fp.js";
8
9
  export class Providers extends ClientSDK {
@@ -12,5 +13,14 @@ export class Providers extends ClientSDK {
12
13
  async list(request, options) {
13
14
  return unwrapAsync(providersList(this, request, options));
14
15
  }
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
+ }
15
25
  }
16
26
  //# 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.44",
5
+ "version": "1.5.46",
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.44",
3
+ "version": "1.5.46",
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": [
@@ -76,11 +76,11 @@
76
76
  "compile": "tsc && node scripts/unbarrel-imports.js",
77
77
  "postinstall": "node scripts/check-types.js || true",
78
78
  "prepare": "npm run build",
79
+ "test": "vitest --run --project unit",
79
80
  "test:e2e": "vitest --run --project e2e",
80
- "test:watch": "vitest --watch --project unit",
81
81
  "typecheck:transit": "exit 0",
82
- "test": "vitest --run --project unit",
83
82
  "test:transit": "exit 0",
83
+ "test:watch": "vitest --watch --project unit",
84
84
  "typecheck": "tsc --noEmit"
85
85
  },
86
86
  "peerDependencies": {