@openrouter/sdk 1.5.124 → 1.5.126
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/analyticsGetAnalyticsMeta.d.ts +1 -1
- package/esm/funcs/analyticsGetAnalyticsMeta.js +1 -1
- package/esm/funcs/analyticsGetUserActivity.d.ts +1 -1
- package/esm/funcs/analyticsGetUserActivity.js +1 -1
- package/esm/funcs/analyticsQueryAnalytics.d.ts +1 -1
- package/esm/funcs/analyticsQueryAnalytics.js +1 -1
- package/esm/funcs/observabilityCreate.d.ts +1 -1
- package/esm/funcs/observabilityCreate.js +1 -1
- package/esm/funcs/observabilityUpdate.d.ts +1 -1
- package/esm/funcs/observabilityUpdate.js +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/chatwebsearchshorthand.d.ts +3 -3
- package/esm/models/legacywebsearchservertool.d.ts +1 -1
- package/esm/models/preview20250311websearchservertool.d.ts +1 -1
- package/esm/models/previewwebsearchservertool.d.ts +1 -1
- package/esm/models/websearchconfig.d.ts +3 -3
- package/esm/models/websearchplugin.d.ts +1 -1
- package/esm/models/websearchservertool.d.ts +1 -1
- package/esm/models/websearchservertoolconfig.d.ts +3 -3
- package/esm/models/workspace.d.ts +13 -10
- package/esm/models/workspace.js +8 -8
- package/esm/models/xsearchoptions.d.ts +1 -1
- package/esm/sdk/analytics.d.ts +3 -3
- package/esm/sdk/analytics.js +3 -3
- package/esm/sdk/observability.d.ts +2 -2
- package/esm/sdk/observability.js +2 -2
- package/jsr.json +1 -1
- package/package.json +7 -7
|
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
|
|
|
12
12
|
* Get available analytics metrics and dimensions
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. Workspace-scoped
|
|
15
|
+
* Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. Custom access requires an organization-scoped key with `analytics:view`. Workspace-scoped keys with base Read Only or Read Write access are also accepted. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
16
|
*/
|
|
17
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
18
|
//# sourceMappingURL=analyticsGetAnalyticsMeta.d.ts.map
|
|
@@ -15,7 +15,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
15
15
|
* Get available analytics metrics and dimensions
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
|
-
* Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. Workspace-scoped
|
|
18
|
+
* Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. Custom access requires an organization-scoped key with `analytics:view`. Workspace-scoped keys with base Read Only or Read Write access are also accepted. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
19
19
|
*/
|
|
20
20
|
export function analyticsGetAnalyticsMeta(client, request, options) {
|
|
21
21
|
return new APIPromise($do(client, request, options));
|
|
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
|
|
|
13
13
|
* Get user activity grouped by endpoint
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
|
-
* 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). A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: an omitted `workspace_id` defaults to it, a `workspace_id` naming any other workspace returns 403, `api_key_hash` and `user_id` resolve only keys and members of that workspace, and legacy activity with no workspace is excluded (including for the default workspace). [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
|
+
* 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). A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: an omitted `workspace_id` defaults to it, a `workspace_id` naming any other workspace returns 403, `api_key_hash` and `user_id` resolve only keys and members of that workspace, and legacy activity with no workspace is excluded (including for the default workspace). For Custom keys, `api_key_hash` also requires `api_keys:view_all` and does not resolve deleted keys. `user_id` also requires `workspace_members:view` on an explicit non-default workspace; organization and default-workspace member filtering requires `org_members:view`, which is not available as a Custom grant. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
17
17
|
*/
|
|
18
18
|
export declare function analyticsGetUserActivity(client: OpenRouterCore, request?: operations.GetUserActivityRequest | undefined, options?: RequestOptions): APIPromise<Result<models.ActivityResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
19
19
|
//# sourceMappingURL=analyticsGetUserActivity.d.ts.map
|
|
@@ -16,7 +16,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
16
16
|
* Get user activity grouped by endpoint
|
|
17
17
|
*
|
|
18
18
|
* @remarks
|
|
19
|
-
* 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). A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: an omitted `workspace_id` defaults to it, a `workspace_id` naming any other workspace returns 403, `api_key_hash` and `user_id` resolve only keys and members of that workspace, and legacy activity with no workspace is excluded (including for the default workspace). [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
19
|
+
* 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). A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: an omitted `workspace_id` defaults to it, a `workspace_id` naming any other workspace returns 403, `api_key_hash` and `user_id` resolve only keys and members of that workspace, and legacy activity with no workspace is excluded (including for the default workspace). For Custom keys, `api_key_hash` also requires `api_keys:view_all` and does not resolve deleted keys. `user_id` also requires `workspace_members:view` on an explicit non-default workspace; organization and default-workspace member filtering requires `org_members:view`, which is not available as a Custom grant. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
20
20
|
*/
|
|
21
21
|
export function analyticsGetUserActivity(client, request, options) {
|
|
22
22
|
return new APIPromise($do(client, request, options));
|
|
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
|
|
|
12
12
|
* Query analytics data
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* Execute an analytics query with specified metrics, dimensions, filters, and time range.
|
|
15
|
+
* Execute an analytics query with specified metrics, dimensions, filters, and time range. Custom access requires an organization-scoped key with `analytics:view`; grouping or filtering by `api_key_id` or `api_key_tag` also requires `api_keys:view_all`, and by `user` requires `org_members:view`. Key hash filters resolve only non-deleted ordinary keys. Workspace-scoped keys with base Read Only or Read Write access can query only their own workspace: a `workspace` filter naming another workspace is refused, legacy rows with no workspace are excluded (including for the default workspace), and possible-cache metrics such as `possible_cached_tokens` return 400. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
16
|
*/
|
|
17
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
18
|
//# sourceMappingURL=analyticsQueryAnalytics.d.ts.map
|
|
@@ -15,7 +15,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
15
15
|
* Query analytics data
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
|
-
* Execute an analytics query with specified metrics, dimensions, filters, and time range.
|
|
18
|
+
* Execute an analytics query with specified metrics, dimensions, filters, and time range. Custom access requires an organization-scoped key with `analytics:view`; grouping or filtering by `api_key_id` or `api_key_tag` also requires `api_keys:view_all`, and by `user` requires `org_members:view`. Key hash filters resolve only non-deleted ordinary keys. Workspace-scoped keys with base Read Only or Read Write access can query only their own workspace: a `workspace` filter naming another workspace is refused, legacy rows with no workspace are excluded (including for the default workspace), and possible-cache metrics such as `possible_cached_tokens` return 400. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
19
19
|
*/
|
|
20
20
|
export function analyticsQueryAnalytics(client, request, options) {
|
|
21
21
|
return new APIPromise($do(client, request, options));
|
|
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
|
|
|
13
13
|
* Create an observability destination
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
|
-
* Create a new observability destination. A maximum of 5 destinations per
|
|
16
|
+
* Create a new observability destination. A maximum of 5 enabled destinations per workspace, across all types, is allowed; disabled destinations do not count. A workspace already above the cap keeps its enabled destinations but cannot create or enable more until fewer than 5 are enabled. Defaults to the authenticated entity's default workspace, or a workspace-scoped management key's own workspace; use the `workspace_id` body field to scope to a different workspace. A workspace-scoped management key can only create in its own workspace; any other `workspace_id` returns 403. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
17
17
|
*/
|
|
18
18
|
export declare function observabilityCreate(client: OpenRouterCore, request: operations.CreateObservabilityDestinationRequest, options?: RequestOptions): APIPromise<Result<models.CreateObservabilityDestinationResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.ConflictResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
19
19
|
//# sourceMappingURL=observabilityCreate.d.ts.map
|
|
@@ -16,7 +16,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
16
16
|
* Create an observability destination
|
|
17
17
|
*
|
|
18
18
|
* @remarks
|
|
19
|
-
* Create a new observability destination. A maximum of 5 destinations per
|
|
19
|
+
* Create a new observability destination. A maximum of 5 enabled destinations per workspace, across all types, is allowed; disabled destinations do not count. A workspace already above the cap keeps its enabled destinations but cannot create or enable more until fewer than 5 are enabled. Defaults to the authenticated entity's default workspace, or a workspace-scoped management key's own workspace; use the `workspace_id` body field to scope to a different workspace. A workspace-scoped management key can only create in its own workspace; any other `workspace_id` returns 403. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
20
20
|
*/
|
|
21
21
|
export function observabilityCreate(client, request, options) {
|
|
22
22
|
return new APIPromise($do(client, request, options));
|
|
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
|
|
|
13
13
|
* Update an observability destination
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
|
-
* Update an existing observability destination. Only the fields provided in the request body are updated. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
|
+
* Update an existing observability destination. Only the fields provided in the request body are updated. Enabling a disabled destination returns 400 while the workspace already has 5 enabled destinations. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
17
17
|
*/
|
|
18
18
|
export declare function observabilityUpdate(client: OpenRouterCore, request: operations.UpdateObservabilityDestinationRequest, options?: RequestOptions): APIPromise<Result<models.UpdateObservabilityDestinationResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.ConflictResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
19
19
|
//# sourceMappingURL=observabilityUpdate.d.ts.map
|
|
@@ -16,7 +16,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
16
16
|
* Update an observability destination
|
|
17
17
|
*
|
|
18
18
|
* @remarks
|
|
19
|
-
* Update an existing observability destination. Only the fields provided in the request body are updated. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
19
|
+
* Update an existing observability destination. Only the fields provided in the request body are updated. Enabling a disabled destination returns 400 while the workspace already has 5 enabled destinations. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
20
20
|
*/
|
|
21
21
|
export function observabilityUpdate(client, request, options) {
|
|
22
22
|
return new APIPromise($do(client, request, options));
|
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: "1.5.
|
|
52
|
+
readonly sdkVersion: "1.5.126";
|
|
53
53
|
readonly genVersion: "2.960.8";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.5.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.5.126 2.960.8 1.0.0 @openrouter/sdk";
|
|
55
55
|
};
|
|
56
56
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -25,8 +25,8 @@ export function serverURLFromOptions(options) {
|
|
|
25
25
|
export const SDK_METADATA = {
|
|
26
26
|
language: "typescript",
|
|
27
27
|
openapiDocVersion: "1.0.0",
|
|
28
|
-
sdkVersion: "1.5.
|
|
28
|
+
sdkVersion: "1.5.126",
|
|
29
29
|
genVersion: "2.960.8",
|
|
30
|
-
userAgent: "speakeasy-sdk/typescript 1.5.
|
|
30
|
+
userAgent: "speakeasy-sdk/typescript 1.5.126 2.960.8 1.0.0 @openrouter/sdk",
|
|
31
31
|
};
|
|
32
32
|
//# sourceMappingURL=config.js.map
|
|
@@ -18,7 +18,7 @@ export type ChatWebSearchShorthandType = OpenEnum<typeof ChatWebSearchShorthandT
|
|
|
18
18
|
*/
|
|
19
19
|
export type ChatWebSearchShorthand = {
|
|
20
20
|
/**
|
|
21
|
-
* Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI,
|
|
21
|
+
* Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, SpaceXSI). Cannot be used with excluded_domains.
|
|
22
22
|
*/
|
|
23
23
|
allowedDomains?: Array<string> | undefined;
|
|
24
24
|
/**
|
|
@@ -26,7 +26,7 @@ export type ChatWebSearchShorthand = {
|
|
|
26
26
|
*/
|
|
27
27
|
engine?: WebSearchEngineEnum | undefined;
|
|
28
28
|
/**
|
|
29
|
-
* Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, OpenAI, and
|
|
29
|
+
* Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, OpenAI, and SpaceXSI. Cannot be used with allowed_domains.
|
|
30
30
|
*/
|
|
31
31
|
excludedDomains?: Array<string> | undefined;
|
|
32
32
|
/**
|
|
@@ -60,7 +60,7 @@ export type ChatWebSearchShorthand = {
|
|
|
60
60
|
*/
|
|
61
61
|
userLocation?: WebSearchUserLocationServerTool | undefined;
|
|
62
62
|
/**
|
|
63
|
-
* Enable
|
|
63
|
+
* Enable SpaceXSI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXSI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXSI, per post and per user profile fetched.
|
|
64
64
|
*/
|
|
65
65
|
xSearch?: XSearchOptions | undefined;
|
|
66
66
|
};
|
|
@@ -43,7 +43,7 @@ export type LegacyWebSearchServerTool = {
|
|
|
43
43
|
*/
|
|
44
44
|
userLocation?: WebSearchUserLocation | null | undefined;
|
|
45
45
|
/**
|
|
46
|
-
* Enable
|
|
46
|
+
* Enable SpaceXSI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXSI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXSI, per post and per user profile fetched.
|
|
47
47
|
*/
|
|
48
48
|
xSearch?: XSearchOptions | undefined;
|
|
49
49
|
};
|
|
@@ -40,7 +40,7 @@ export type Preview20250311WebSearchServerTool = {
|
|
|
40
40
|
type: Preview20250311WebSearchServerToolType;
|
|
41
41
|
userLocation?: PreviewWebSearchUserLocation | null | undefined;
|
|
42
42
|
/**
|
|
43
|
-
* Enable
|
|
43
|
+
* Enable SpaceXSI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXSI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXSI, per post and per user profile fetched.
|
|
44
44
|
*/
|
|
45
45
|
xSearch?: XSearchOptions | undefined;
|
|
46
46
|
};
|
|
@@ -40,7 +40,7 @@ export type PreviewWebSearchServerTool = {
|
|
|
40
40
|
type: PreviewWebSearchServerToolType;
|
|
41
41
|
userLocation?: PreviewWebSearchUserLocation | null | undefined;
|
|
42
42
|
/**
|
|
43
|
-
* Enable
|
|
43
|
+
* Enable SpaceXSI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXSI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXSI, per post and per user profile fetched.
|
|
44
44
|
*/
|
|
45
45
|
xSearch?: XSearchOptions | undefined;
|
|
46
46
|
};
|
|
@@ -6,7 +6,7 @@ import { WebSearchUserLocationServerTool, WebSearchUserLocationServerTool$Outbou
|
|
|
6
6
|
import { XSearchOptions, XSearchOptions$Outbound } from "./xsearchoptions.js";
|
|
7
7
|
export type WebSearchConfig = {
|
|
8
8
|
/**
|
|
9
|
-
* Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI,
|
|
9
|
+
* Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, SpaceXSI). Cannot be used with excluded_domains.
|
|
10
10
|
*/
|
|
11
11
|
allowedDomains?: Array<string> | undefined;
|
|
12
12
|
/**
|
|
@@ -14,7 +14,7 @@ export type WebSearchConfig = {
|
|
|
14
14
|
*/
|
|
15
15
|
engine?: WebSearchEngineEnum | undefined;
|
|
16
16
|
/**
|
|
17
|
-
* Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, OpenAI, and
|
|
17
|
+
* Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, OpenAI, and SpaceXSI. Cannot be used with allowed_domains.
|
|
18
18
|
*/
|
|
19
19
|
excludedDomains?: Array<string> | undefined;
|
|
20
20
|
/**
|
|
@@ -46,7 +46,7 @@ export type WebSearchConfig = {
|
|
|
46
46
|
*/
|
|
47
47
|
userLocation?: WebSearchUserLocationServerTool | undefined;
|
|
48
48
|
/**
|
|
49
|
-
* Enable
|
|
49
|
+
* Enable SpaceXSI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXSI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXSI, per post and per user profile fetched.
|
|
50
50
|
*/
|
|
51
51
|
xSearch?: XSearchOptions | undefined;
|
|
52
52
|
};
|
|
@@ -47,7 +47,7 @@ export type WebSearchPlugin = {
|
|
|
47
47
|
searchPrompt?: string | undefined;
|
|
48
48
|
userLocation?: UserLocation | null | undefined;
|
|
49
49
|
/**
|
|
50
|
-
* Enable
|
|
50
|
+
* Enable SpaceXSI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXSI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXSI, per post and per user profile fetched.
|
|
51
51
|
*/
|
|
52
52
|
xSearch?: XSearchOptions | undefined;
|
|
53
53
|
};
|
|
@@ -43,7 +43,7 @@ export type WebSearchServerTool = {
|
|
|
43
43
|
*/
|
|
44
44
|
userLocation?: WebSearchUserLocation | null | undefined;
|
|
45
45
|
/**
|
|
46
|
-
* Enable
|
|
46
|
+
* Enable SpaceXSI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXSI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXSI, per post and per user profile fetched.
|
|
47
47
|
*/
|
|
48
48
|
xSearch?: XSearchOptions | undefined;
|
|
49
49
|
};
|
|
@@ -9,7 +9,7 @@ import { XSearchOptions, XSearchOptions$Outbound } from "./xsearchoptions.js";
|
|
|
9
9
|
*/
|
|
10
10
|
export type WebSearchServerToolConfig = {
|
|
11
11
|
/**
|
|
12
|
-
* Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI,
|
|
12
|
+
* Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, SpaceXSI). Cannot be used with excluded_domains.
|
|
13
13
|
*/
|
|
14
14
|
allowedDomains?: Array<string> | undefined;
|
|
15
15
|
/**
|
|
@@ -17,7 +17,7 @@ export type WebSearchServerToolConfig = {
|
|
|
17
17
|
*/
|
|
18
18
|
engine?: WebSearchEngineEnum | undefined;
|
|
19
19
|
/**
|
|
20
|
-
* Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, OpenAI, and
|
|
20
|
+
* Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, OpenAI, and SpaceXSI. Cannot be used with allowed_domains.
|
|
21
21
|
*/
|
|
22
22
|
excludedDomains?: Array<string> | undefined;
|
|
23
23
|
/**
|
|
@@ -49,7 +49,7 @@ export type WebSearchServerToolConfig = {
|
|
|
49
49
|
*/
|
|
50
50
|
userLocation?: WebSearchUserLocationServerTool | undefined;
|
|
51
51
|
/**
|
|
52
|
-
* Enable
|
|
52
|
+
* Enable SpaceXSI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXSI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXSI, per post and per user profile fetched.
|
|
53
53
|
*/
|
|
54
54
|
xSearch?: XSearchOptions | undefined;
|
|
55
55
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
/**
|
|
5
|
+
* Workspace metadata. Configuration fields are omitted without permission to view workspace settings.
|
|
6
|
+
*/
|
|
4
7
|
export type Workspace = {
|
|
5
8
|
/**
|
|
6
9
|
* ISO 8601 timestamp of when the workspace was created
|
|
@@ -17,15 +20,15 @@ export type Workspace = {
|
|
|
17
20
|
/**
|
|
18
21
|
* Default image model for this workspace
|
|
19
22
|
*/
|
|
20
|
-
defaultImageModel
|
|
23
|
+
defaultImageModel?: string | null | undefined;
|
|
21
24
|
/**
|
|
22
25
|
* Default provider sort preference (price, throughput, latency, exacto)
|
|
23
26
|
*/
|
|
24
|
-
defaultProviderSort
|
|
27
|
+
defaultProviderSort?: string | null | undefined;
|
|
25
28
|
/**
|
|
26
29
|
* Default text model for this workspace
|
|
27
30
|
*/
|
|
28
|
-
defaultTextModel
|
|
31
|
+
defaultTextModel?: string | null | undefined;
|
|
29
32
|
/**
|
|
30
33
|
* Description of the workspace
|
|
31
34
|
*/
|
|
@@ -39,29 +42,29 @@ export type Workspace = {
|
|
|
39
42
|
*/
|
|
40
43
|
id: string;
|
|
41
44
|
/**
|
|
42
|
-
* Whether BYOK (bring-your-own-key) spend counts toward this workspace's budgets. Set it via the workspace budget endpoints.
|
|
45
|
+
* Whether BYOK (bring-your-own-key) spend counts toward this workspace's budgets. Omitted without settings and budget visibility. Set it via the workspace budget endpoints.
|
|
43
46
|
*/
|
|
44
47
|
includeByokInBudgets?: boolean | undefined;
|
|
45
48
|
/**
|
|
46
|
-
*
|
|
49
|
+
* API key IDs used to filter I/O logging. Null means all keys are logged. Omitted without access to workspace settings and API key identifiers.
|
|
47
50
|
*/
|
|
48
|
-
ioLoggingApiKeyIds
|
|
51
|
+
ioLoggingApiKeyIds?: Array<number> | null | undefined;
|
|
49
52
|
/**
|
|
50
53
|
* Sampling rate for I/O logging (0.0001-1). 1 means 100% of requests are logged.
|
|
51
54
|
*/
|
|
52
|
-
ioLoggingSamplingRate
|
|
55
|
+
ioLoggingSamplingRate?: number | undefined;
|
|
53
56
|
/**
|
|
54
57
|
* Whether data discount logging is enabled for this workspace
|
|
55
58
|
*/
|
|
56
|
-
isDataDiscountLoggingEnabled
|
|
59
|
+
isDataDiscountLoggingEnabled?: boolean | undefined;
|
|
57
60
|
/**
|
|
58
61
|
* Whether broadcast is enabled for this workspace
|
|
59
62
|
*/
|
|
60
|
-
isObservabilityBroadcastEnabled
|
|
63
|
+
isObservabilityBroadcastEnabled?: boolean | undefined;
|
|
61
64
|
/**
|
|
62
65
|
* Whether private logging is enabled for this workspace
|
|
63
66
|
*/
|
|
64
|
-
isObservabilityIoLoggingEnabled
|
|
67
|
+
isObservabilityIoLoggingEnabled?: boolean | undefined;
|
|
65
68
|
/**
|
|
66
69
|
* Name of the workspace
|
|
67
70
|
*/
|
package/esm/models/workspace.js
CHANGED
|
@@ -9,18 +9,18 @@ export const Workspace$inboundSchema = z.object({
|
|
|
9
9
|
created_at: z.string(),
|
|
10
10
|
created_by: z.nullable(z.string()),
|
|
11
11
|
default_guardrail_id: z.string(),
|
|
12
|
-
default_image_model: z.nullable(z.string()),
|
|
13
|
-
default_provider_sort: z.nullable(z.string()),
|
|
14
|
-
default_text_model: z.nullable(z.string()),
|
|
12
|
+
default_image_model: z.nullable(z.string()).optional(),
|
|
13
|
+
default_provider_sort: z.nullable(z.string()).optional(),
|
|
14
|
+
default_text_model: z.nullable(z.string()).optional(),
|
|
15
15
|
description: z.nullable(z.string()),
|
|
16
16
|
disabled_server_tools: z.nullable(z.array(z.string())).optional(),
|
|
17
17
|
id: z.string(),
|
|
18
18
|
include_byok_in_budgets: z.boolean().optional(),
|
|
19
|
-
io_logging_api_key_ids: z.nullable(z.array(z.int())),
|
|
20
|
-
io_logging_sampling_rate: z.number(),
|
|
21
|
-
is_data_discount_logging_enabled: z.boolean(),
|
|
22
|
-
is_observability_broadcast_enabled: z.boolean(),
|
|
23
|
-
is_observability_io_logging_enabled: z.boolean(),
|
|
19
|
+
io_logging_api_key_ids: z.nullable(z.array(z.int())).optional(),
|
|
20
|
+
io_logging_sampling_rate: z.number().optional(),
|
|
21
|
+
is_data_discount_logging_enabled: z.boolean().optional(),
|
|
22
|
+
is_observability_broadcast_enabled: z.boolean().optional(),
|
|
23
|
+
is_observability_io_logging_enabled: z.boolean().optional(),
|
|
24
24
|
name: z.string(),
|
|
25
25
|
slug: z.string(),
|
|
26
26
|
updated_at: z.nullable(z.string()),
|
|
@@ -3,7 +3,7 @@ import { Result as SafeParseResult } from "../types/fp.js";
|
|
|
3
3
|
import { RFCDate } from "../types/rfcdate.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
5
|
/**
|
|
6
|
-
* Enable
|
|
6
|
+
* Enable SpaceXSI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXSI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXSI, per post and per user profile fetched.
|
|
7
7
|
*/
|
|
8
8
|
export type XSearchOptions = {
|
|
9
9
|
/**
|
package/esm/sdk/analytics.d.ts
CHANGED
|
@@ -6,21 +6,21 @@ export declare class Analytics extends ClientSDK {
|
|
|
6
6
|
* Get user activity grouped by endpoint
|
|
7
7
|
*
|
|
8
8
|
* @remarks
|
|
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). A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: an omitted `workspace_id` defaults to it, a `workspace_id` naming any other workspace returns 403, `api_key_hash` and `user_id` resolve only keys and members of that workspace, and legacy activity with no workspace is excluded (including for the default workspace). [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
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). A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: an omitted `workspace_id` defaults to it, a `workspace_id` naming any other workspace returns 403, `api_key_hash` and `user_id` resolve only keys and members of that workspace, and legacy activity with no workspace is excluded (including for the default workspace). For Custom keys, `api_key_hash` also requires `api_keys:view_all` and does not resolve deleted keys. `user_id` also requires `workspace_members:view` on an explicit non-default workspace; organization and default-workspace member filtering requires `org_members:view`, which is not available as a Custom grant. [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
12
|
/**
|
|
13
13
|
* Get available analytics metrics and dimensions
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
|
-
* Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. Workspace-scoped
|
|
16
|
+
* Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. Custom access requires an organization-scoped key with `analytics:view`. Workspace-scoped keys with base Read Only or Read Write access are also accepted. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
17
17
|
*/
|
|
18
18
|
getAnalyticsMeta(request?: operations.GetAnalyticsMetaRequest | undefined, options?: RequestOptions): Promise<operations.GetAnalyticsMetaResponse>;
|
|
19
19
|
/**
|
|
20
20
|
* Query analytics data
|
|
21
21
|
*
|
|
22
22
|
* @remarks
|
|
23
|
-
* Execute an analytics query with specified metrics, dimensions, filters, and time range.
|
|
23
|
+
* Execute an analytics query with specified metrics, dimensions, filters, and time range. Custom access requires an organization-scoped key with `analytics:view`; grouping or filtering by `api_key_id` or `api_key_tag` also requires `api_keys:view_all`, and by `user` requires `org_members:view`. Key hash filters resolve only non-deleted ordinary keys. Workspace-scoped keys with base Read Only or Read Write access can query only their own workspace: a `workspace` filter naming another workspace is refused, legacy rows with no workspace are excluded (including for the default workspace), and possible-cache metrics such as `possible_cached_tokens` return 400. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
24
24
|
*/
|
|
25
25
|
queryAnalytics(request: operations.QueryAnalyticsRequest, options?: RequestOptions): Promise<operations.QueryAnalyticsResponse>;
|
|
26
26
|
}
|
package/esm/sdk/analytics.js
CHANGED
|
@@ -11,7 +11,7 @@ export class Analytics extends ClientSDK {
|
|
|
11
11
|
* Get user activity grouped by endpoint
|
|
12
12
|
*
|
|
13
13
|
* @remarks
|
|
14
|
-
* 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). A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: an omitted `workspace_id` defaults to it, a `workspace_id` naming any other workspace returns 403, `api_key_hash` and `user_id` resolve only keys and members of that workspace, and legacy activity with no workspace is excluded (including for the default workspace). [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
14
|
+
* 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). A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: an omitted `workspace_id` defaults to it, a `workspace_id` naming any other workspace returns 403, `api_key_hash` and `user_id` resolve only keys and members of that workspace, and legacy activity with no workspace is excluded (including for the default workspace). For Custom keys, `api_key_hash` also requires `api_keys:view_all` and does not resolve deleted keys. `user_id` also requires `workspace_members:view` on an explicit non-default workspace; organization and default-workspace member filtering requires `org_members:view`, which is not available as a Custom grant. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
15
15
|
*/
|
|
16
16
|
async getUserActivity(request, options) {
|
|
17
17
|
return unwrapAsync(analyticsGetUserActivity(this, request, options));
|
|
@@ -20,7 +20,7 @@ export class Analytics extends ClientSDK {
|
|
|
20
20
|
* Get available analytics metrics and dimensions
|
|
21
21
|
*
|
|
22
22
|
* @remarks
|
|
23
|
-
* Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. Workspace-scoped
|
|
23
|
+
* Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. Custom access requires an organization-scoped key with `analytics:view`. Workspace-scoped keys with base Read Only or Read Write access are also accepted. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
24
24
|
*/
|
|
25
25
|
async getAnalyticsMeta(request, options) {
|
|
26
26
|
return unwrapAsync(analyticsGetAnalyticsMeta(this, request, options));
|
|
@@ -29,7 +29,7 @@ export class Analytics extends ClientSDK {
|
|
|
29
29
|
* Query analytics data
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
|
-
* Execute an analytics query with specified metrics, dimensions, filters, and time range.
|
|
32
|
+
* Execute an analytics query with specified metrics, dimensions, filters, and time range. Custom access requires an organization-scoped key with `analytics:view`; grouping or filtering by `api_key_id` or `api_key_tag` also requires `api_keys:view_all`, and by `user` requires `org_members:view`. Key hash filters resolve only non-deleted ordinary keys. Workspace-scoped keys with base Read Only or Read Write access can query only their own workspace: a `workspace` filter naming another workspace is refused, legacy rows with no workspace are excluded (including for the default workspace), and possible-cache metrics such as `possible_cached_tokens` return 400. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
33
33
|
*/
|
|
34
34
|
async queryAnalytics(request, options) {
|
|
35
35
|
return unwrapAsync(analyticsQueryAnalytics(this, request, options));
|
|
@@ -16,7 +16,7 @@ export declare class Observability extends ClientSDK {
|
|
|
16
16
|
* Create an observability destination
|
|
17
17
|
*
|
|
18
18
|
* @remarks
|
|
19
|
-
* Create a new observability destination. A maximum of 5 destinations per
|
|
19
|
+
* Create a new observability destination. A maximum of 5 enabled destinations per workspace, across all types, is allowed; disabled destinations do not count. A workspace already above the cap keeps its enabled destinations but cannot create or enable more until fewer than 5 are enabled. Defaults to the authenticated entity's default workspace, or a workspace-scoped management key's own workspace; use the `workspace_id` body field to scope to a different workspace. A workspace-scoped management key can only create in its own workspace; any other `workspace_id` returns 403. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
20
20
|
*/
|
|
21
21
|
create(request: operations.CreateObservabilityDestinationRequest, options?: RequestOptions): Promise<models.CreateObservabilityDestinationResponse>;
|
|
22
22
|
/**
|
|
@@ -37,7 +37,7 @@ export declare class Observability extends ClientSDK {
|
|
|
37
37
|
* Update an observability destination
|
|
38
38
|
*
|
|
39
39
|
* @remarks
|
|
40
|
-
* Update an existing observability destination. Only the fields provided in the request body are updated. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
40
|
+
* Update an existing observability destination. Only the fields provided in the request body are updated. Enabling a disabled destination returns 400 while the workspace already has 5 enabled destinations. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
41
41
|
*/
|
|
42
42
|
update(request: operations.UpdateObservabilityDestinationRequest, options?: RequestOptions): Promise<models.UpdateObservabilityDestinationResponse>;
|
|
43
43
|
}
|
package/esm/sdk/observability.js
CHANGED
|
@@ -23,7 +23,7 @@ export class Observability extends ClientSDK {
|
|
|
23
23
|
* Create an observability destination
|
|
24
24
|
*
|
|
25
25
|
* @remarks
|
|
26
|
-
* Create a new observability destination. A maximum of 5 destinations per
|
|
26
|
+
* Create a new observability destination. A maximum of 5 enabled destinations per workspace, across all types, is allowed; disabled destinations do not count. A workspace already above the cap keeps its enabled destinations but cannot create or enable more until fewer than 5 are enabled. Defaults to the authenticated entity's default workspace, or a workspace-scoped management key's own workspace; use the `workspace_id` body field to scope to a different workspace. A workspace-scoped management key can only create in its own workspace; any other `workspace_id` returns 403. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
27
27
|
*/
|
|
28
28
|
async create(request, options) {
|
|
29
29
|
return unwrapAsync(observabilityCreate(this, request, options));
|
|
@@ -50,7 +50,7 @@ export class Observability extends ClientSDK {
|
|
|
50
50
|
* Update an observability destination
|
|
51
51
|
*
|
|
52
52
|
* @remarks
|
|
53
|
-
* Update an existing observability destination. Only the fields provided in the request body are updated. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
53
|
+
* Update an existing observability destination. Only the fields provided in the request body are updated. Enabling a disabled destination returns 400 while the workspace already has 5 enabled destinations. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
54
54
|
*/
|
|
55
55
|
async update(request, options) {
|
|
56
56
|
return unwrapAsync(observabilityUpdate(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.126",
|
|
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": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"
|
|
77
|
-
"
|
|
76
|
+
"test:e2e": "vitest --run --project e2e",
|
|
77
|
+
"test:transit": "exit 0",
|
|
78
78
|
"test:watch": "vitest --watch --project unit",
|
|
79
|
+
"typecheck": "tsc --noEmit",
|
|
80
|
+
"test": "vitest --run --project unit",
|
|
79
81
|
"typecheck:transit": "exit 0",
|
|
80
82
|
"compile": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js",
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"test:transit": "exit 0",
|
|
84
|
-
"typecheck": "tsc --noEmit"
|
|
83
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
84
|
+
"prepare": "npm run build"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
|