@openrouter/sdk 0.13.21 → 0.13.23

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.
@@ -0,0 +1,21 @@
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 operations from "../models/operations/index.js";
9
+ import { APIPromise } from "../types/async.js";
10
+ import { Result } from "../types/fp.js";
11
+ import { PageIterator } from "../types/operations.js";
12
+ /**
13
+ * List workspace members
14
+ *
15
+ * @remarks
16
+ * List all members of a workspace. Returns paginated results. For the default workspace, returns all organization members (implicit membership). [Management key](/docs/guides/overview/auth/management-api-keys) required.
17
+ */
18
+ export declare function workspacesListMembers(client: OpenRouterCore, request: operations.ListWorkspaceMembersRequest, options?: RequestOptions): APIPromise<PageIterator<Result<operations.ListWorkspaceMembersResponse, errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
19
+ offset: number;
20
+ }>>;
21
+ //# sourceMappingURL=workspacesListMembers.d.ts.map
@@ -0,0 +1,140 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 52e1d4037081
4
+ */
5
+ import { dlv } from "../lib/dlv.js";
6
+ import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import * as errors from "../models/errors/index.js";
14
+ import * as operations from "../models/operations/index.js";
15
+ import { APIPromise } from "../types/async.js";
16
+ import { createPageIterator, haltIterator, } from "../types/operations.js";
17
+ /**
18
+ * List workspace members
19
+ *
20
+ * @remarks
21
+ * List all members of a workspace. Returns paginated results. For the default workspace, returns all organization members (implicit membership). [Management key](/docs/guides/overview/auth/management-api-keys) required.
22
+ */
23
+ export function workspacesListMembers(client, request, options) {
24
+ return new APIPromise($do(client, request, options));
25
+ }
26
+ async function $do(client, request, options) {
27
+ const parsed = safeParse(request, (value) => operations.ListWorkspaceMembersRequest$outboundSchema.parse(value), "Input validation failed");
28
+ if (!parsed.ok) {
29
+ return [haltIterator(parsed), { status: "invalid" }];
30
+ }
31
+ const payload = parsed.value;
32
+ const body = null;
33
+ const pathParams = {
34
+ id: encodeSimple("id", payload.id, {
35
+ explode: false,
36
+ charEncoding: "percent",
37
+ }),
38
+ };
39
+ const path = pathToFunc("/workspaces/{id}/members")(pathParams);
40
+ const query = encodeFormQuery({
41
+ "limit": payload.limit,
42
+ "offset": payload.offset,
43
+ });
44
+ const headers = new Headers(compactMap({
45
+ Accept: "application/json",
46
+ "HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
47
+ "X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
48
+ "X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
49
+ }));
50
+ const secConfig = await extractSecurity(client._options.apiKey);
51
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
52
+ const requestSecurity = resolveGlobalSecurity(securityInput);
53
+ const context = {
54
+ options: client._options,
55
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
56
+ operationID: "listWorkspaceMembers",
57
+ oAuth2Scopes: null,
58
+ resolvedSecurity: requestSecurity,
59
+ securitySource: client._options.apiKey,
60
+ retryConfig: options?.retries
61
+ || client._options.retryConfig
62
+ || {
63
+ strategy: "backoff",
64
+ backoff: {
65
+ initialInterval: 500,
66
+ maxInterval: 60000,
67
+ exponent: 1.5,
68
+ maxElapsedTime: 3600000,
69
+ },
70
+ retryConnectionErrors: true,
71
+ }
72
+ || { strategy: "none" },
73
+ retryCodes: options?.retryCodes || ["5XX"],
74
+ };
75
+ const requestRes = client._createRequest(context, {
76
+ security: requestSecurity,
77
+ method: "GET",
78
+ baseURL: options?.serverURL,
79
+ path: path,
80
+ headers: headers,
81
+ query: query,
82
+ body: body,
83
+ userAgent: client._options.userAgent,
84
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
85
+ }, options);
86
+ if (!requestRes.ok) {
87
+ return [haltIterator(requestRes), { status: "invalid" }];
88
+ }
89
+ const req = requestRes.value;
90
+ const doResult = await client._do(req, {
91
+ context,
92
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
93
+ retryConfig: context.retryConfig,
94
+ retryCodes: context.retryCodes,
95
+ });
96
+ if (!doResult.ok) {
97
+ return [haltIterator(doResult), { status: "request-error", request: req }];
98
+ }
99
+ const response = doResult.value;
100
+ const responseFields = {
101
+ HttpMeta: { Response: response, Request: req },
102
+ };
103
+ const [result, raw] = await M.match(M.json(200, operations.ListWorkspaceMembersResponse$inboundSchema, {
104
+ key: "Result",
105
+ }), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(403, errors.ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
106
+ if (!result.ok) {
107
+ return [haltIterator(result), {
108
+ status: "complete",
109
+ request: req,
110
+ response,
111
+ }];
112
+ }
113
+ const nextFunc = (responseData) => {
114
+ const offset = request?.offset ?? 0;
115
+ if (!responseData) {
116
+ return { next: () => null };
117
+ }
118
+ const results = dlv(responseData, "data");
119
+ if (!Array.isArray(results) || !results.length) {
120
+ return { next: () => null };
121
+ }
122
+ const limit = request?.limit ?? 0;
123
+ if (results.length < limit) {
124
+ return { next: () => null };
125
+ }
126
+ const nextOffset = offset + results.length;
127
+ const nextVal = () => workspacesListMembers(client, {
128
+ ...request,
129
+ offset: nextOffset,
130
+ }, options);
131
+ return { next: nextVal, "~next": { offset: nextOffset } };
132
+ };
133
+ const page = { ...result, ...nextFunc(raw) };
134
+ return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, {
135
+ status: "complete",
136
+ request: req,
137
+ response,
138
+ }];
139
+ }
140
+ //# sourceMappingURL=workspacesListMembers.js.map
@@ -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: "0.13.21";
52
+ readonly sdkVersion: "0.13.23";
53
53
  readonly genVersion: "2.884.4";
54
- readonly userAgent: "speakeasy-sdk/typescript 0.13.21 2.884.4 1.0.0 @openrouter/sdk";
54
+ readonly userAgent: "speakeasy-sdk/typescript 0.13.23 2.884.4 1.0.0 @openrouter/sdk";
55
55
  };
56
56
  //# sourceMappingURL=config.d.ts.map
package/esm/lib/config.js CHANGED
@@ -26,8 +26,8 @@ export function serverURLFromOptions(options) {
26
26
  export const SDK_METADATA = {
27
27
  language: "typescript",
28
28
  openapiDocVersion: "1.0.0",
29
- sdkVersion: "0.13.21",
29
+ sdkVersion: "0.13.23",
30
30
  genVersion: "2.884.4",
31
- userAgent: "speakeasy-sdk/typescript 0.13.21 2.884.4 1.0.0 @openrouter/sdk",
31
+ userAgent: "speakeasy-sdk/typescript 0.13.23 2.884.4 1.0.0 @openrouter/sdk",
32
32
  };
33
33
  //# sourceMappingURL=config.js.map
@@ -6,6 +6,7 @@ import { ChatContentCacheControl, ChatContentCacheControl$Outbound } from "./cha
6
6
  import { ChatSearchModelsServerTool, ChatSearchModelsServerTool$Outbound } from "./chatsearchmodelsservertool.js";
7
7
  import { ChatWebSearchShorthand, ChatWebSearchShorthand$Outbound } from "./chatwebsearchshorthand.js";
8
8
  import { DatetimeServerTool, DatetimeServerTool$Outbound } from "./datetimeservertool.js";
9
+ import { FilesServerTool, FilesServerTool$Outbound } from "./filesservertool.js";
9
10
  import { ImageGenerationServerToolOpenRouter, ImageGenerationServerToolOpenRouter$Outbound } from "./imagegenerationservertoolopenrouter.js";
10
11
  import { OpenRouterWebSearchServerTool, OpenRouterWebSearchServerTool$Outbound } from "./openrouterwebsearchservertool.js";
11
12
  import { SubagentServerToolOpenRouter, SubagentServerToolOpenRouter$Outbound } from "./subagentservertoolopenrouter.js";
@@ -51,7 +52,7 @@ export type ChatFunctionToolFunction = {
51
52
  /**
52
53
  * Tool definition for function calling (regular function or OpenRouter built-in server tool)
53
54
  */
54
- export type ChatFunctionTool = ChatFunctionToolFunction | AdvisorServerToolOpenRouter | BashServerTool | DatetimeServerTool | ImageGenerationServerToolOpenRouter | ChatSearchModelsServerTool | SubagentServerToolOpenRouter | WebFetchServerTool | OpenRouterWebSearchServerTool | ChatWebSearchShorthand;
55
+ export type ChatFunctionTool = ChatFunctionToolFunction | AdvisorServerToolOpenRouter | BashServerTool | DatetimeServerTool | FilesServerTool | ImageGenerationServerToolOpenRouter | ChatSearchModelsServerTool | SubagentServerToolOpenRouter | WebFetchServerTool | OpenRouterWebSearchServerTool | ChatWebSearchShorthand;
55
56
  /** @internal */
56
57
  export type ChatFunctionToolFunctionFunction$Outbound = {
57
58
  description?: string | undefined;
@@ -76,7 +77,7 @@ export type ChatFunctionToolFunction$Outbound = {
76
77
  export declare const ChatFunctionToolFunction$outboundSchema: z.ZodType<ChatFunctionToolFunction$Outbound, ChatFunctionToolFunction>;
77
78
  export declare function chatFunctionToolFunctionToJSON(chatFunctionToolFunction: ChatFunctionToolFunction): string;
78
79
  /** @internal */
79
- export type ChatFunctionTool$Outbound = ChatFunctionToolFunction$Outbound | AdvisorServerToolOpenRouter$Outbound | BashServerTool$Outbound | DatetimeServerTool$Outbound | ImageGenerationServerToolOpenRouter$Outbound | ChatSearchModelsServerTool$Outbound | SubagentServerToolOpenRouter$Outbound | WebFetchServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | ChatWebSearchShorthand$Outbound;
80
+ export type ChatFunctionTool$Outbound = ChatFunctionToolFunction$Outbound | AdvisorServerToolOpenRouter$Outbound | BashServerTool$Outbound | DatetimeServerTool$Outbound | FilesServerTool$Outbound | ImageGenerationServerToolOpenRouter$Outbound | ChatSearchModelsServerTool$Outbound | SubagentServerToolOpenRouter$Outbound | WebFetchServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | ChatWebSearchShorthand$Outbound;
80
81
  /** @internal */
81
82
  export declare const ChatFunctionTool$outboundSchema: z.ZodType<ChatFunctionTool$Outbound, ChatFunctionTool>;
82
83
  export declare function chatFunctionToolToJSON(chatFunctionTool: ChatFunctionTool): string;
@@ -10,6 +10,7 @@ import { ChatContentCacheControl$outboundSchema, } from "./chatcontentcachecontr
10
10
  import { ChatSearchModelsServerTool$outboundSchema, } from "./chatsearchmodelsservertool.js";
11
11
  import { ChatWebSearchShorthand$outboundSchema, } from "./chatwebsearchshorthand.js";
12
12
  import { DatetimeServerTool$outboundSchema, } from "./datetimeservertool.js";
13
+ import { FilesServerTool$outboundSchema, } from "./filesservertool.js";
13
14
  import { ImageGenerationServerToolOpenRouter$outboundSchema, } from "./imagegenerationservertoolopenrouter.js";
14
15
  import { OpenRouterWebSearchServerTool$outboundSchema, } from "./openrouterwebsearchservertool.js";
15
16
  import { SubagentServerToolOpenRouter$outboundSchema, } from "./subagentservertoolopenrouter.js";
@@ -48,6 +49,7 @@ export const ChatFunctionTool$outboundSchema = z.union([
48
49
  AdvisorServerToolOpenRouter$outboundSchema,
49
50
  BashServerTool$outboundSchema,
50
51
  DatetimeServerTool$outboundSchema,
52
+ FilesServerTool$outboundSchema,
51
53
  ImageGenerationServerToolOpenRouter$outboundSchema,
52
54
  ChatSearchModelsServerTool$outboundSchema,
53
55
  SubagentServerToolOpenRouter$outboundSchema,
@@ -0,0 +1,28 @@
1
+ import * as z from "zod/v4";
2
+ import { ClosedEnum } from "../types/enums.js";
3
+ import { FilesServerToolConfig, FilesServerToolConfig$Outbound } from "./filesservertoolconfig.js";
4
+ export declare const FilesServerToolType: {
5
+ readonly OpenrouterFiles: "openrouter:files";
6
+ };
7
+ export type FilesServerToolType = ClosedEnum<typeof FilesServerToolType>;
8
+ /**
9
+ * OpenRouter built-in server tool: read, write, edit, and list workspace files via the Files API. Requires the `x-openrouter-file-ids: openrouter` request header.
10
+ */
11
+ export type FilesServerTool = {
12
+ /**
13
+ * Configuration for the openrouter:files server tool
14
+ */
15
+ parameters?: FilesServerToolConfig | undefined;
16
+ type: FilesServerToolType;
17
+ };
18
+ /** @internal */
19
+ export declare const FilesServerToolType$outboundSchema: z.ZodEnum<typeof FilesServerToolType>;
20
+ /** @internal */
21
+ export type FilesServerTool$Outbound = {
22
+ parameters?: FilesServerToolConfig$Outbound | undefined;
23
+ type: string;
24
+ };
25
+ /** @internal */
26
+ export declare const FilesServerTool$outboundSchema: z.ZodType<FilesServerTool$Outbound, FilesServerTool>;
27
+ export declare function filesServerToolToJSON(filesServerTool: FilesServerTool): string;
28
+ //# sourceMappingURL=filesservertool.d.ts.map
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 3e85b948793d
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { FilesServerToolConfig$outboundSchema, } from "./filesservertoolconfig.js";
7
+ export const FilesServerToolType = {
8
+ OpenrouterFiles: "openrouter:files",
9
+ };
10
+ /** @internal */
11
+ export const FilesServerToolType$outboundSchema = z.enum(FilesServerToolType);
12
+ /** @internal */
13
+ export const FilesServerTool$outboundSchema = z.object({
14
+ parameters: FilesServerToolConfig$outboundSchema.optional(),
15
+ type: FilesServerToolType$outboundSchema,
16
+ });
17
+ export function filesServerToolToJSON(filesServerTool) {
18
+ return JSON.stringify(FilesServerTool$outboundSchema.parse(filesServerTool));
19
+ }
20
+ //# sourceMappingURL=filesservertool.js.map
@@ -0,0 +1,11 @@
1
+ import * as z from "zod/v4";
2
+ /**
3
+ * Configuration for the openrouter:files server tool
4
+ */
5
+ export type FilesServerToolConfig = {};
6
+ /** @internal */
7
+ export type FilesServerToolConfig$Outbound = {};
8
+ /** @internal */
9
+ export declare const FilesServerToolConfig$outboundSchema: z.ZodType<FilesServerToolConfig$Outbound, FilesServerToolConfig>;
10
+ export declare function filesServerToolConfigToJSON(filesServerToolConfig: FilesServerToolConfig): string;
11
+ //# sourceMappingURL=filesservertoolconfig.d.ts.map
@@ -0,0 +1,11 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 9e169d1b0b62
4
+ */
5
+ import * as z from "zod/v4";
6
+ /** @internal */
7
+ export const FilesServerToolConfig$outboundSchema = z.object({});
8
+ export function filesServerToolConfigToJSON(filesServerToolConfig) {
9
+ return JSON.stringify(FilesServerToolConfig$outboundSchema.parse(filesServerToolConfig));
10
+ }
11
+ //# sourceMappingURL=filesservertoolconfig.js.map
@@ -187,6 +187,8 @@ export * from "./filemetadata.js";
187
187
  export * from "./fileparserplugin.js";
188
188
  export * from "./filepath.js";
189
189
  export * from "./filesearchservertool.js";
190
+ export * from "./filesservertool.js";
191
+ export * from "./filesservertoolconfig.js";
190
192
  export * from "./forbiddenresponseerrordata.js";
191
193
  export * from "./formatjsonobjectconfig.js";
192
194
  export * from "./formatjsonschemaconfig.js";
@@ -271,6 +273,7 @@ export * from "./listobservabilitydestinationsresponse.js";
271
273
  export * from "./listpresetsresponse.js";
272
274
  export * from "./listpresetversionsresponse.js";
273
275
  export * from "./listworkspacebudgetsresponse.js";
276
+ export * from "./listworkspacemembersresponse.js";
274
277
  export * from "./listworkspacesresponse.js";
275
278
  export * from "./localshellcallitem.js";
276
279
  export * from "./localshellcalloutputitem.js";
@@ -191,6 +191,8 @@ export * from "./filemetadata.js";
191
191
  export * from "./fileparserplugin.js";
192
192
  export * from "./filepath.js";
193
193
  export * from "./filesearchservertool.js";
194
+ export * from "./filesservertool.js";
195
+ export * from "./filesservertoolconfig.js";
194
196
  export * from "./forbiddenresponseerrordata.js";
195
197
  export * from "./formatjsonobjectconfig.js";
196
198
  export * from "./formatjsonschemaconfig.js";
@@ -275,6 +277,7 @@ export * from "./listobservabilitydestinationsresponse.js";
275
277
  export * from "./listpresetsresponse.js";
276
278
  export * from "./listpresetversionsresponse.js";
277
279
  export * from "./listworkspacebudgetsresponse.js";
280
+ export * from "./listworkspacemembersresponse.js";
278
281
  export * from "./listworkspacesresponse.js";
279
282
  export * from "./localshellcallitem.js";
280
283
  export * from "./localshellcalloutputitem.js";
@@ -0,0 +1,18 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ import { WorkspaceMember } from "./workspacemember.js";
5
+ export type ListWorkspaceMembersResponse = {
6
+ /**
7
+ * List of workspace members
8
+ */
9
+ data: Array<WorkspaceMember>;
10
+ /**
11
+ * Total number of members in the workspace
12
+ */
13
+ totalCount: number;
14
+ };
15
+ /** @internal */
16
+ export declare const ListWorkspaceMembersResponse$inboundSchema: z.ZodType<ListWorkspaceMembersResponse, unknown>;
17
+ export declare function listWorkspaceMembersResponseFromJSON(jsonString: string): SafeParseResult<ListWorkspaceMembersResponse, SDKValidationError>;
18
+ //# sourceMappingURL=listworkspacemembersresponse.d.ts.map
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: b6bc81be6e23
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 { WorkspaceMember$inboundSchema, } from "./workspacemember.js";
9
+ /** @internal */
10
+ export const ListWorkspaceMembersResponse$inboundSchema = z.object({
11
+ data: z.array(WorkspaceMember$inboundSchema),
12
+ total_count: z.int(),
13
+ }).transform((v) => {
14
+ return remap$(v, {
15
+ "total_count": "totalCount",
16
+ });
17
+ });
18
+ export function listWorkspaceMembersResponseFromJSON(jsonString) {
19
+ return safeParse(jsonString, (x) => ListWorkspaceMembersResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListWorkspaceMembersResponse' from JSON`);
20
+ }
21
+ //# sourceMappingURL=listworkspacemembersresponse.js.map
@@ -73,6 +73,7 @@ export * from "./listproviders.js";
73
73
  export * from "./listvideoscontent.js";
74
74
  export * from "./listvideosmodels.js";
75
75
  export * from "./listworkspacebudgets.js";
76
+ export * from "./listworkspacemembers.js";
76
77
  export * from "./listworkspaces.js";
77
78
  export * from "./queryanalytics.js";
78
79
  export * from "./sendchatcompletionrequest.js";
@@ -77,6 +77,7 @@ export * from "./listproviders.js";
77
77
  export * from "./listvideoscontent.js";
78
78
  export * from "./listvideosmodels.js";
79
79
  export * from "./listworkspacebudgets.js";
80
+ export * from "./listworkspacemembers.js";
80
81
  export * from "./listworkspaces.js";
81
82
  export * from "./queryanalytics.js";
82
83
  export * from "./sendchatcompletionrequest.js";
@@ -0,0 +1,77 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../../types/fp.js";
3
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
4
+ import * as models from "../index.js";
5
+ export type ListWorkspaceMembersGlobals = {
6
+ /**
7
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
8
+ *
9
+ * @remarks
10
+ * This is used to track API usage per application.
11
+ */
12
+ httpReferer?: string | undefined;
13
+ /**
14
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
15
+ *
16
+ * @remarks
17
+ */
18
+ appTitle?: string | undefined;
19
+ /**
20
+ * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
21
+ *
22
+ * @remarks
23
+ */
24
+ appCategories?: string | undefined;
25
+ };
26
+ export type ListWorkspaceMembersRequest = {
27
+ /**
28
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
29
+ *
30
+ * @remarks
31
+ * This is used to track API usage per application.
32
+ */
33
+ httpReferer?: string | undefined;
34
+ /**
35
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
36
+ *
37
+ * @remarks
38
+ */
39
+ appTitle?: string | undefined;
40
+ /**
41
+ * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
42
+ *
43
+ * @remarks
44
+ */
45
+ appCategories?: string | undefined;
46
+ /**
47
+ * The workspace ID (UUID) or slug
48
+ */
49
+ id: string;
50
+ /**
51
+ * Number of records to skip for pagination
52
+ */
53
+ offset?: number | null | undefined;
54
+ /**
55
+ * Maximum number of records to return (max 100)
56
+ */
57
+ limit?: number | undefined;
58
+ };
59
+ export type ListWorkspaceMembersResponse = {
60
+ result: models.ListWorkspaceMembersResponse;
61
+ };
62
+ /** @internal */
63
+ export type ListWorkspaceMembersRequest$Outbound = {
64
+ "HTTP-Referer"?: string | undefined;
65
+ appTitle?: string | undefined;
66
+ appCategories?: string | undefined;
67
+ id: string;
68
+ offset?: number | null | undefined;
69
+ limit?: number | undefined;
70
+ };
71
+ /** @internal */
72
+ export declare const ListWorkspaceMembersRequest$outboundSchema: z.ZodType<ListWorkspaceMembersRequest$Outbound, ListWorkspaceMembersRequest>;
73
+ export declare function listWorkspaceMembersRequestToJSON(listWorkspaceMembersRequest: ListWorkspaceMembersRequest): string;
74
+ /** @internal */
75
+ export declare const ListWorkspaceMembersResponse$inboundSchema: z.ZodType<ListWorkspaceMembersResponse, unknown>;
76
+ export declare function listWorkspaceMembersResponseFromJSON(jsonString: string): SafeParseResult<ListWorkspaceMembersResponse, SDKValidationError>;
77
+ //# sourceMappingURL=listworkspacemembers.d.ts.map
@@ -0,0 +1,36 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 009ed1f62eb4
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 models from "../index.js";
9
+ /** @internal */
10
+ export const ListWorkspaceMembersRequest$outboundSchema = z.object({
11
+ httpReferer: z.string().optional(),
12
+ appTitle: z.string().optional(),
13
+ appCategories: z.string().optional(),
14
+ id: z.string(),
15
+ offset: z.nullable(z.int()).optional(),
16
+ limit: z.int().optional(),
17
+ }).transform((v) => {
18
+ return remap$(v, {
19
+ httpReferer: "HTTP-Referer",
20
+ });
21
+ });
22
+ export function listWorkspaceMembersRequestToJSON(listWorkspaceMembersRequest) {
23
+ return JSON.stringify(ListWorkspaceMembersRequest$outboundSchema.parse(listWorkspaceMembersRequest));
24
+ }
25
+ /** @internal */
26
+ export const ListWorkspaceMembersResponse$inboundSchema = z.object({
27
+ Result: models.ListWorkspaceMembersResponse$inboundSchema,
28
+ }).transform((v) => {
29
+ return remap$(v, {
30
+ "Result": "result",
31
+ });
32
+ });
33
+ export function listWorkspaceMembersResponseFromJSON(jsonString) {
34
+ return safeParse(jsonString, (x) => ListWorkspaceMembersResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListWorkspaceMembersResponse' from JSON`);
35
+ }
36
+ //# sourceMappingURL=listworkspacemembers.js.map
@@ -16,6 +16,7 @@ import { CustomTool, CustomTool$Outbound } from "./customtool.js";
16
16
  import { DatetimeServerTool, DatetimeServerTool$Outbound } from "./datetimeservertool.js";
17
17
  import { FileParserPlugin, FileParserPlugin$Outbound } from "./fileparserplugin.js";
18
18
  import { FileSearchServerTool, FileSearchServerTool$Outbound } from "./filesearchservertool.js";
19
+ import { FilesServerTool, FilesServerTool$Outbound } from "./filesservertool.js";
19
20
  import { FusionPlugin, FusionPlugin$Outbound } from "./fusionplugin.js";
20
21
  import { FusionServerToolOpenRouter, FusionServerToolOpenRouter$Outbound } from "./fusionservertoolopenrouter.js";
21
22
  import { ImageConfig, ImageConfig$Outbound } from "./imageconfig.js";
@@ -74,6 +75,8 @@ export type ResponsesRequestToolUnion = ResponsesRequestToolFunction | PreviewWe
74
75
  type: "openrouter:subagent";
75
76
  }) | (DatetimeServerTool & {
76
77
  type: "openrouter:datetime";
78
+ }) | (FilesServerTool & {
79
+ type: "openrouter:files";
77
80
  }) | FusionServerToolOpenRouter | (ImageGenerationServerToolOpenRouter & {
78
81
  type: "openrouter:image_generation";
79
82
  }) | (ChatSearchModelsServerTool & {
@@ -164,6 +167,8 @@ export type ResponsesRequest = {
164
167
  type: "openrouter:subagent";
165
168
  }) | (DatetimeServerTool & {
166
169
  type: "openrouter:datetime";
170
+ }) | (FilesServerTool & {
171
+ type: "openrouter:files";
167
172
  }) | FusionServerToolOpenRouter | (ImageGenerationServerToolOpenRouter & {
168
173
  type: "openrouter:image_generation";
169
174
  }) | (ChatSearchModelsServerTool & {
@@ -213,6 +218,8 @@ export type ResponsesRequestToolUnion$Outbound = ResponsesRequestToolFunction$Ou
213
218
  type: "openrouter:subagent";
214
219
  }) | (DatetimeServerTool$Outbound & {
215
220
  type: "openrouter:datetime";
221
+ }) | (FilesServerTool$Outbound & {
222
+ type: "openrouter:files";
216
223
  }) | FusionServerToolOpenRouter$Outbound | (ImageGenerationServerToolOpenRouter$Outbound & {
217
224
  type: "openrouter:image_generation";
218
225
  }) | (ChatSearchModelsServerTool$Outbound & {
@@ -268,6 +275,8 @@ export type ResponsesRequest$Outbound = {
268
275
  type: "openrouter:subagent";
269
276
  }) | (DatetimeServerTool$Outbound & {
270
277
  type: "openrouter:datetime";
278
+ }) | (FilesServerTool$Outbound & {
279
+ type: "openrouter:files";
271
280
  }) | FusionServerToolOpenRouter$Outbound | (ImageGenerationServerToolOpenRouter$Outbound & {
272
281
  type: "openrouter:image_generation";
273
282
  }) | (ChatSearchModelsServerTool$Outbound & {
@@ -21,6 +21,7 @@ import { CustomTool$outboundSchema, } from "./customtool.js";
21
21
  import { DatetimeServerTool$outboundSchema, } from "./datetimeservertool.js";
22
22
  import { FileParserPlugin$outboundSchema, } from "./fileparserplugin.js";
23
23
  import { FileSearchServerTool$outboundSchema, } from "./filesearchservertool.js";
24
+ import { FilesServerTool$outboundSchema, } from "./filesservertool.js";
24
25
  import { FusionPlugin$outboundSchema, } from "./fusionplugin.js";
25
26
  import { FusionServerToolOpenRouter$outboundSchema, } from "./fusionservertoolopenrouter.js";
26
27
  import { ImageConfig$outboundSchema, } from "./imageconfig.js";
@@ -106,6 +107,7 @@ export const ResponsesRequestToolUnion$outboundSchema = z.union([
106
107
  AdvisorServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:advisor") })),
107
108
  SubagentServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:subagent") })),
108
109
  DatetimeServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:datetime") })),
110
+ FilesServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:files") })),
109
111
  FusionServerToolOpenRouter$outboundSchema,
110
112
  ImageGenerationServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:image_generation") })),
111
113
  ChatSearchModelsServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:experimental__search_models") })),
@@ -180,6 +182,7 @@ export const ResponsesRequest$outboundSchema = z.object({
180
182
  AdvisorServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:advisor") })),
181
183
  SubagentServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:subagent") })),
182
184
  DatetimeServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:datetime") })),
185
+ FilesServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:files") })),
183
186
  FusionServerToolOpenRouter$outboundSchema,
184
187
  ImageGenerationServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:image_generation") })),
185
188
  ChatSearchModelsServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:experimental__search_models") })),
@@ -61,6 +61,15 @@ export declare class Workspaces extends ClientSDK {
61
61
  * Create or update the budget for a given interval. Budget limits must strictly decrease as the interval narrows (lifetime > monthly > weekly > daily). [Management key](/docs/guides/overview/auth/management-api-keys) required.
62
62
  */
63
63
  setBudget(request: operations.UpsertWorkspaceBudgetRequest, options?: RequestOptions): Promise<models.UpsertWorkspaceBudgetResponse>;
64
+ /**
65
+ * List workspace members
66
+ *
67
+ * @remarks
68
+ * List all members of a workspace. Returns paginated results. For the default workspace, returns all organization members (implicit membership). [Management key](/docs/guides/overview/auth/management-api-keys) required.
69
+ */
70
+ listMembers(request: operations.ListWorkspaceMembersRequest, options?: RequestOptions): Promise<PageIterator<operations.ListWorkspaceMembersResponse, {
71
+ offset: number;
72
+ }>>;
64
73
  /**
65
74
  * Bulk add members to a workspace
66
75
  *
@@ -10,6 +10,7 @@ import { workspacesDeleteBudget } from "../funcs/workspacesDeleteBudget.js";
10
10
  import { workspacesGet } from "../funcs/workspacesGet.js";
11
11
  import { workspacesList } from "../funcs/workspacesList.js";
12
12
  import { workspacesListBudgets } from "../funcs/workspacesListBudgets.js";
13
+ import { workspacesListMembers } from "../funcs/workspacesListMembers.js";
13
14
  import { workspacesSetBudget } from "../funcs/workspacesSetBudget.js";
14
15
  import { workspacesUpdate } from "../funcs/workspacesUpdate.js";
15
16
  import { ClientSDK } from "../lib/sdks.js";
@@ -88,6 +89,15 @@ export class Workspaces extends ClientSDK {
88
89
  async setBudget(request, options) {
89
90
  return unwrapAsync(workspacesSetBudget(this, request, options));
90
91
  }
92
+ /**
93
+ * List workspace members
94
+ *
95
+ * @remarks
96
+ * List all members of a workspace. Returns paginated results. For the default workspace, returns all organization members (implicit membership). [Management key](/docs/guides/overview/auth/management-api-keys) required.
97
+ */
98
+ async listMembers(request, options) {
99
+ return unwrapResultIterator(workspacesListMembers(this, request, options));
100
+ }
91
101
  /**
92
102
  * Bulk add members to a workspace
93
103
  *
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "0.13.21",
5
+ "version": "0.13.23",
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": "0.13.21",
3
+ "version": "0.13.23",
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,13 +73,13 @@
73
73
  "lint": "eslint --cache --max-warnings=0 src",
74
74
  "build": "tsc",
75
75
  "prepublishOnly": "npm run build",
76
- "postinstall": "node scripts/check-types.js || true",
77
76
  "test": "vitest --run --project unit",
77
+ "postinstall": "node scripts/check-types.js || true",
78
+ "prepare": "npm run build",
78
79
  "test:e2e": "vitest --run --project e2e",
79
80
  "test:transit": "exit 0",
80
81
  "test:watch": "vitest --watch --project unit",
81
82
  "typecheck": "tsc --noEmit",
82
- "prepare": "npm run build",
83
83
  "typecheck:transit": "exit 0",
84
84
  "compile": "tsc"
85
85
  },