@openrouter/sdk 1.2.48 → 1.2.50

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.
@@ -14,5 +14,5 @@ import { Result } from "../types/fp.js";
14
14
  * @remarks
15
15
  * Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required.
16
16
  */
17
- export declare function betaAnalyticsGetAnalyticsMeta(client: OpenRouterCore, request?: operations.GetAnalyticsMetaRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.GetAnalyticsMetaResponse, errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
18
- //# sourceMappingURL=betaAnalyticsGetAnalyticsMeta.d.ts.map
17
+ export declare function analyticsGetAnalyticsMeta(client: OpenRouterCore, request?: operations.GetAnalyticsMetaRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.GetAnalyticsMetaResponse, errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
18
+ //# sourceMappingURL=analyticsGetAnalyticsMeta.d.ts.map
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: fd48bb0a54a8
3
+ * @generated-id: f7372eee4934
4
4
  */
5
5
  import { encodeSimple } from "../lib/encodings.js";
6
6
  import { matchStatusCode } from "../lib/http.js";
@@ -18,7 +18,7 @@ import { APIPromise } from "../types/async.js";
18
18
  * @remarks
19
19
  * Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required.
20
20
  */
21
- export function betaAnalyticsGetAnalyticsMeta(client, request, options) {
21
+ export function analyticsGetAnalyticsMeta(client, request, options) {
22
22
  return new APIPromise($do(client, request, options));
23
23
  }
24
24
  async function $do(client, request, options) {
@@ -93,4 +93,4 @@ async function $do(client, request, options) {
93
93
  }
94
94
  return [result, { status: "complete", request: req, response }];
95
95
  }
96
- //# sourceMappingURL=betaAnalyticsGetAnalyticsMeta.js.map
96
+ //# sourceMappingURL=analyticsGetAnalyticsMeta.js.map
@@ -14,5 +14,5 @@ import { Result } from "../types/fp.js";
14
14
  * @remarks
15
15
  * Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required.
16
16
  */
17
- export declare function betaAnalyticsQueryAnalytics(client: OpenRouterCore, request: operations.QueryAnalyticsRequest, options?: RequestOptions): APIPromise<Result<operations.QueryAnalyticsResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.RequestTimeoutResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
18
- //# sourceMappingURL=betaAnalyticsQueryAnalytics.d.ts.map
17
+ export declare function analyticsQueryAnalytics(client: OpenRouterCore, request: operations.QueryAnalyticsRequest, options?: RequestOptions): APIPromise<Result<operations.QueryAnalyticsResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.RequestTimeoutResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
18
+ //# sourceMappingURL=analyticsQueryAnalytics.d.ts.map
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 979cbc58b672
3
+ * @generated-id: 36a22bd7b94b
4
4
  */
5
5
  import { encodeJSON, encodeSimple } from "../lib/encodings.js";
6
6
  import { matchStatusCode } from "../lib/http.js";
@@ -18,7 +18,7 @@ import { APIPromise } from "../types/async.js";
18
18
  * @remarks
19
19
  * Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required.
20
20
  */
21
- export function betaAnalyticsQueryAnalytics(client, request, options) {
21
+ export function analyticsQueryAnalytics(client, request, options) {
22
22
  return new APIPromise($do(client, request, options));
23
23
  }
24
24
  async function $do(client, request, options) {
@@ -94,4 +94,4 @@ async function $do(client, request, options) {
94
94
  }
95
95
  return [result, { status: "complete", request: req, response }];
96
96
  }
97
- //# sourceMappingURL=betaAnalyticsQueryAnalytics.js.map
97
+ //# sourceMappingURL=analyticsQueryAnalytics.js.map
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
13
13
  * Create a guardrail
14
14
  *
15
15
  * @remarks
16
- * Create a new guardrail for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
16
+ * Create a new guardrail for the authenticated user. A newly created guardrail enforces nothing until it is assigned to API keys or organization members; `workspace_id` places the guardrail in a workspace but does not apply it to that workspace's traffic. To restrict all traffic in a workspace, update the workspace's default guardrail instead. [Management key](/docs/guides/overview/auth/management-api-keys) required.
17
17
  */
18
18
  export declare function guardrailsCreate(client: OpenRouterCore, request: operations.CreateGuardrailRequest, options?: RequestOptions): APIPromise<Result<models.CreateGuardrailResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
19
19
  //# sourceMappingURL=guardrailsCreate.d.ts.map
@@ -17,7 +17,7 @@ import { APIPromise } from "../types/async.js";
17
17
  * Create a guardrail
18
18
  *
19
19
  * @remarks
20
- * Create a new guardrail for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
20
+ * Create a new guardrail for the authenticated user. A newly created guardrail enforces nothing until it is assigned to API keys or organization members; `workspace_id` places the guardrail in a workspace but does not apply it to that workspace's traffic. To restrict all traffic in a workspace, update the workspace's default guardrail instead. [Management key](/docs/guides/overview/auth/management-api-keys) required.
21
21
  */
22
22
  export function guardrailsCreate(client, request, options) {
23
23
  return new APIPromise($do(client, request, options));
@@ -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.2.48";
53
+ readonly sdkVersion: "1.2.50";
54
54
  readonly genVersion: "2.914.0";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.2.48 2.914.0 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.2.50 2.914.0 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.2.48",
32
+ sdkVersion: "1.2.50",
33
33
  genVersion: "2.914.0",
34
- userAgent: "speakeasy-sdk/typescript 1.2.48 2.914.0 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.2.50 2.914.0 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -86,7 +86,7 @@ export type CreateGuardrailRequest = {
86
86
  */
87
87
  resetInterval?: GuardrailInterval | null | undefined;
88
88
  /**
89
- * The workspace to create the guardrail in. When omitted, the guardrail is created in the default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly.
89
+ * The workspace to create the guardrail in. When omitted, the guardrail is created in the default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly. This only places the guardrail in the workspace; the created guardrail enforces nothing for that workspace's traffic until it is assigned to API keys or members. To restrict all traffic in a workspace, update the workspace's default guardrail instead.
90
90
  */
91
91
  workspaceId?: string | undefined;
92
92
  };
@@ -100,7 +100,7 @@ export type Guardrail = {
100
100
  */
101
101
  updatedAt?: string | null | undefined;
102
102
  /**
103
- * The workspace this guardrail is scoped to, or `null` for an unscoped legacy guardrail predating workspaces. A `null` value does not mean the default workspace, and does not apply the guardrail across every workspace.
103
+ * The workspace this guardrail belongs to, or `null` for an unscoped legacy guardrail predating workspaces. Workspace membership organizes the guardrail; it does not apply the guardrail to the workspace's traffic. A `null` value does not mean the default workspace, and does not apply the guardrail across every workspace.
104
104
  */
105
105
  workspaceId: string | null;
106
106
  };
@@ -9,5 +9,19 @@ export declare class Analytics extends ClientSDK {
9
9
  * Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). [Management key](/docs/guides/overview/auth/management-api-keys) required.
10
10
  */
11
11
  getUserActivity(request?: operations.GetUserActivityRequest | undefined, options?: RequestOptions): Promise<models.ActivityResponse>;
12
+ /**
13
+ * Get available analytics metrics and dimensions
14
+ *
15
+ * @remarks
16
+ * Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required.
17
+ */
18
+ getAnalyticsMeta(request?: operations.GetAnalyticsMetaRequest | undefined, options?: RequestOptions): Promise<operations.GetAnalyticsMetaResponse>;
19
+ /**
20
+ * Query analytics data
21
+ *
22
+ * @remarks
23
+ * Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required.
24
+ */
25
+ queryAnalytics(request: operations.QueryAnalyticsRequest, options?: RequestOptions): Promise<operations.QueryAnalyticsResponse>;
12
26
  }
13
27
  //# sourceMappingURL=analytics.d.ts.map
@@ -2,7 +2,9 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  * @generated-id: 411d91261be3
4
4
  */
5
+ import { analyticsGetAnalyticsMeta } from "../funcs/analyticsGetAnalyticsMeta.js";
5
6
  import { analyticsGetUserActivity } from "../funcs/analyticsGetUserActivity.js";
7
+ import { analyticsQueryAnalytics } from "../funcs/analyticsQueryAnalytics.js";
6
8
  import { ClientSDK } from "../lib/sdks.js";
7
9
  import { unwrapAsync } from "../types/fp.js";
8
10
  export class Analytics extends ClientSDK {
@@ -15,5 +17,23 @@ export class Analytics extends ClientSDK {
15
17
  async getUserActivity(request, options) {
16
18
  return unwrapAsync(analyticsGetUserActivity(this, request, options));
17
19
  }
20
+ /**
21
+ * Get available analytics metrics and dimensions
22
+ *
23
+ * @remarks
24
+ * Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required.
25
+ */
26
+ async getAnalyticsMeta(request, options) {
27
+ return unwrapAsync(analyticsGetAnalyticsMeta(this, request, options));
28
+ }
29
+ /**
30
+ * Query analytics data
31
+ *
32
+ * @remarks
33
+ * Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required.
34
+ */
35
+ async queryAnalytics(request, options) {
36
+ return unwrapAsync(analyticsQueryAnalytics(this, request, options));
37
+ }
18
38
  }
19
39
  //# sourceMappingURL=analytics.js.map
package/esm/sdk/beta.d.ts CHANGED
@@ -1,9 +1,6 @@
1
1
  import { ClientSDK } from "../lib/sdks.js";
2
- import { BetaAnalytics } from "./betaanalytics.js";
3
2
  import { BetaResponses } from "./betaresponses.js";
4
3
  export declare class Beta extends ClientSDK {
5
- private _analytics?;
6
- get analytics(): BetaAnalytics;
7
4
  private _responses?;
8
5
  get responses(): BetaResponses;
9
6
  }
package/esm/sdk/beta.js CHANGED
@@ -3,12 +3,8 @@
3
3
  * @generated-id: afeac65e28f8
4
4
  */
5
5
  import { ClientSDK } from "../lib/sdks.js";
6
- import { BetaAnalytics } from "./betaanalytics.js";
7
6
  import { BetaResponses } from "./betaresponses.js";
8
7
  export class Beta extends ClientSDK {
9
- get analytics() {
10
- return (this._analytics ?? (this._analytics = new BetaAnalytics(this._options)));
11
- }
12
8
  get responses() {
13
9
  return (this._responses ?? (this._responses = new BetaResponses(this._options)));
14
10
  }
@@ -16,7 +16,7 @@ export declare class Guardrails extends ClientSDK {
16
16
  * Create a guardrail
17
17
  *
18
18
  * @remarks
19
- * Create a new guardrail for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
19
+ * Create a new guardrail for the authenticated user. A newly created guardrail enforces nothing until it is assigned to API keys or organization members; `workspace_id` places the guardrail in a workspace but does not apply it to that workspace's traffic. To restrict all traffic in a workspace, update the workspace's default guardrail instead. [Management key](/docs/guides/overview/auth/management-api-keys) required.
20
20
  */
21
21
  create(request: operations.CreateGuardrailRequest, options?: RequestOptions): Promise<models.CreateGuardrailResponse>;
22
22
  /**
@@ -32,7 +32,7 @@ export class Guardrails extends ClientSDK {
32
32
  * Create a guardrail
33
33
  *
34
34
  * @remarks
35
- * Create a new guardrail for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
35
+ * Create a new guardrail for the authenticated user. A newly created guardrail enforces nothing until it is assigned to API keys or organization members; `workspace_id` places the guardrail in a workspace but does not apply it to that workspace's traffic. To restrict all traffic in a workspace, update the workspace's default guardrail instead. [Management key](/docs/guides/overview/auth/management-api-keys) required.
36
36
  */
37
37
  async create(request, options) {
38
38
  return unwrapAsync(guardrailsCreate(this, request, options));
package/esm/sdk/sdk.d.ts CHANGED
@@ -36,8 +36,6 @@ export { ToolType };
36
36
  export declare class OpenRouter extends ClientSDK {
37
37
  private _analytics?;
38
38
  get analytics(): Analytics;
39
- private _beta?;
40
- get beta(): Beta;
41
39
  private _tts?;
42
40
  get tts(): TTS;
43
41
  private _stt?;
@@ -84,6 +82,8 @@ export declare class OpenRouter extends ClientSDK {
84
82
  get rerank(): Rerank;
85
83
  private _responses?;
86
84
  get responses(): Responses;
85
+ private _beta?;
86
+ get beta(): Beta;
87
87
  private _scim?;
88
88
  get scim(): Scim;
89
89
  private _videoGeneration?;
package/esm/sdk/sdk.js CHANGED
@@ -39,9 +39,6 @@ export class OpenRouter extends ClientSDK {
39
39
  get analytics() {
40
40
  return (this._analytics ?? (this._analytics = new Analytics(this._options)));
41
41
  }
42
- get beta() {
43
- return (this._beta ?? (this._beta = new Beta(this._options)));
44
- }
45
42
  get tts() {
46
43
  return (this._tts ?? (this._tts = new TTS(this._options)));
47
44
  }
@@ -111,6 +108,9 @@ export class OpenRouter extends ClientSDK {
111
108
  get responses() {
112
109
  return (this._responses ?? (this._responses = new Responses(this._options)));
113
110
  }
111
+ get beta() {
112
+ return (this._beta ?? (this._beta = new Beta(this._options)));
113
+ }
114
114
  get scim() {
115
115
  return (this._scim ?? (this._scim = new Scim(this._options)));
116
116
  }
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.2.48",
5
+ "version": "1.2.50",
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.2.48",
3
+ "version": "1.2.50",
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,14 +74,14 @@
74
74
  "build": "tsc",
75
75
  "prepublishOnly": "npm run build",
76
76
  "compile": "tsc",
77
- "postinstall": "node scripts/check-types.js || true",
78
- "test": "vitest --run --project unit",
79
- "typecheck": "tsc --noEmit",
80
- "typecheck:transit": "exit 0",
81
77
  "prepare": "npm run build",
78
+ "test": "vitest --run --project unit",
82
79
  "test:e2e": "vitest --run --project e2e",
80
+ "test:watch": "vitest --watch --project unit",
81
+ "postinstall": "node scripts/check-types.js || true",
83
82
  "test:transit": "exit 0",
84
- "test:watch": "vitest --watch --project unit"
83
+ "typecheck": "tsc --noEmit",
84
+ "typecheck:transit": "exit 0"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {
@@ -1,19 +0,0 @@
1
- import { ClientSDK, RequestOptions } from "../lib/sdks.js";
2
- import * as operations from "../models/operations/index.js";
3
- export declare class BetaAnalytics extends ClientSDK {
4
- /**
5
- * Get available analytics metrics and dimensions
6
- *
7
- * @remarks
8
- * Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required.
9
- */
10
- getAnalyticsMeta(request?: operations.GetAnalyticsMetaRequest | undefined, options?: RequestOptions): Promise<operations.GetAnalyticsMetaResponse>;
11
- /**
12
- * Query analytics data
13
- *
14
- * @remarks
15
- * Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required.
16
- */
17
- queryAnalytics(request: operations.QueryAnalyticsRequest, options?: RequestOptions): Promise<operations.QueryAnalyticsResponse>;
18
- }
19
- //# sourceMappingURL=betaanalytics.d.ts.map
@@ -1,29 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 814879ad7548
4
- */
5
- import { betaAnalyticsGetAnalyticsMeta } from "../funcs/betaAnalyticsGetAnalyticsMeta.js";
6
- import { betaAnalyticsQueryAnalytics } from "../funcs/betaAnalyticsQueryAnalytics.js";
7
- import { ClientSDK } from "../lib/sdks.js";
8
- import { unwrapAsync } from "../types/fp.js";
9
- export class BetaAnalytics extends ClientSDK {
10
- /**
11
- * Get available analytics metrics and dimensions
12
- *
13
- * @remarks
14
- * Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required.
15
- */
16
- async getAnalyticsMeta(request, options) {
17
- return unwrapAsync(betaAnalyticsGetAnalyticsMeta(this, request, options));
18
- }
19
- /**
20
- * Query analytics data
21
- *
22
- * @remarks
23
- * Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required.
24
- */
25
- async queryAnalytics(request, options) {
26
- return unwrapAsync(betaAnalyticsQueryAnalytics(this, request, options));
27
- }
28
- }
29
- //# sourceMappingURL=betaanalytics.js.map