@openrouter/sdk 1.4.6 → 1.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/esm/funcs/toolsGetTool.d.ts +18 -0
  2. package/esm/funcs/toolsGetTool.js +110 -0
  3. package/esm/funcs/toolsListTools.d.ts +19 -0
  4. package/esm/funcs/toolsListTools.js +107 -0
  5. package/esm/lib/config.d.ts +2 -2
  6. package/esm/lib/config.js +2 -2
  7. package/esm/models/generationresponse.d.ts +4 -4
  8. package/esm/models/generationresponse.js +3 -3
  9. package/esm/models/gettoolresponse.d.ts +11 -0
  10. package/esm/models/gettoolresponse.js +15 -0
  11. package/esm/models/index.d.ts +11 -0
  12. package/esm/models/index.js +11 -0
  13. package/esm/models/listtoolsresponse.d.ts +25 -0
  14. package/esm/models/listtoolsresponse.js +29 -0
  15. package/esm/models/modelslistresponse.d.ts +4 -4
  16. package/esm/models/modelslistresponse.js +4 -4
  17. package/esm/models/operations/gettool.d.ts +80 -0
  18. package/esm/models/operations/gettool.js +43 -0
  19. package/esm/models/operations/index.d.ts +2 -0
  20. package/esm/models/operations/index.js +2 -0
  21. package/esm/models/operations/listtools.d.ts +93 -0
  22. package/esm/models/operations/listtools.js +43 -0
  23. package/esm/models/servertool.d.ts +79 -0
  24. package/esm/models/servertool.js +59 -0
  25. package/esm/models/servertooldetails.d.ts +90 -0
  26. package/esm/models/servertooldetails.js +73 -0
  27. package/esm/models/servertoolengine.d.ts +82 -0
  28. package/esm/models/servertoolengine.js +63 -0
  29. package/esm/models/servertoolexecutedby.d.ts +17 -0
  30. package/esm/models/servertoolexecutedby.js +16 -0
  31. package/esm/models/servertoolinputname.d.ts +28 -0
  32. package/esm/models/servertoolinputname.js +31 -0
  33. package/esm/models/servertoolnativemodel.d.ts +11 -0
  34. package/esm/models/servertoolnativemodel.js +15 -0
  35. package/esm/models/servertoolnativesupport.d.ts +14 -0
  36. package/esm/models/servertoolnativesupport.js +21 -0
  37. package/esm/models/servertooloutputname.d.ts +27 -0
  38. package/esm/models/servertooloutputname.js +29 -0
  39. package/esm/models/servertoolprice.d.ts +19 -0
  40. package/esm/models/servertoolprice.js +22 -0
  41. package/esm/sdk/sdk.d.ts +3 -0
  42. package/esm/sdk/sdk.js +4 -0
  43. package/esm/sdk/tools.d.ts +20 -0
  44. package/esm/sdk/tools.js +29 -0
  45. package/jsr.json +1 -1
  46. package/package.json +6 -6
@@ -0,0 +1,18 @@
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
+ /**
12
+ * Get a server tool
13
+ *
14
+ * @remarks
15
+ * One server tool by canonical name or any accepted alias, with the models that run it natively.
16
+ */
17
+ export declare function toolsGetTool(client: OpenRouterCore, security: operations.GetToolSecurity, request: operations.GetToolRequest, options?: RequestOptions): APIPromise<Result<operations.GetToolResponse | undefined, errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
18
+ //# sourceMappingURL=toolsGetTool.d.ts.map
@@ -0,0 +1,110 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 4234ef4b0718
4
+ */
5
+ import { encodeSimple } from "../lib/encodings.js";
6
+ import { matchStatusCode } from "../lib/http.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { resolveSecurity } from "../lib/security.js";
11
+ import { pathToFunc } from "../lib/url.js";
12
+ import { ForbiddenResponseError$inboundSchema as errors_ForbiddenResponseError$inboundSchema } from "../models/errors/forbiddenresponseerror.js"; import { InternalServerResponseError$inboundSchema as errors_InternalServerResponseError$inboundSchema } from "../models/errors/internalserverresponseerror.js"; import { NotFoundResponseError$inboundSchema as errors_NotFoundResponseError$inboundSchema } from "../models/errors/notfoundresponseerror.js"; import { UnauthorizedResponseError$inboundSchema as errors_UnauthorizedResponseError$inboundSchema } from "../models/errors/unauthorizedresponseerror.js";
13
+ import { GetToolRequest$outboundSchema as operations_GetToolRequest$outboundSchema, GetToolResponse$inboundSchema as operations_GetToolResponse$inboundSchema } from "../models/operations/gettool.js";
14
+ import { APIPromise } from "../types/async.js";
15
+ /**
16
+ * Get a server tool
17
+ *
18
+ * @remarks
19
+ * One server tool by canonical name or any accepted alias, with the models that run it natively.
20
+ */
21
+ export function toolsGetTool(client, security, request, options) {
22
+ return new APIPromise($do(client, security, request, options));
23
+ }
24
+ async function $do(client, security, request, options) {
25
+ const parsed = safeParse(request, (value) => operations_GetToolRequest$outboundSchema.parse(value), "Input validation failed");
26
+ if (!parsed.ok) {
27
+ return [parsed, { status: "invalid" }];
28
+ }
29
+ const payload = parsed.value;
30
+ const body = null;
31
+ const pathParams = {
32
+ name: encodeSimple("name", payload.name, {
33
+ explode: false,
34
+ charEncoding: "percent",
35
+ }),
36
+ };
37
+ const path = pathToFunc("/tools/{name}")(pathParams);
38
+ const headers = new Headers(compactMap({
39
+ Accept: "application/json",
40
+ "HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
41
+ "X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
42
+ "X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
43
+ }));
44
+ const requestSecurity = resolveSecurity([
45
+ {
46
+ fieldName: "Authorization",
47
+ type: "http:bearer",
48
+ value: security?.bearer,
49
+ },
50
+ ]);
51
+ const context = {
52
+ options: client._options,
53
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
54
+ operationID: "getTool",
55
+ oAuth2Scopes: null,
56
+ resolvedSecurity: requestSecurity,
57
+ securitySource: security,
58
+ retryConfig: options?.retries
59
+ || client._options.retryConfig
60
+ || {
61
+ strategy: "backoff",
62
+ backoff: {
63
+ initialInterval: 500,
64
+ maxInterval: 60000,
65
+ exponent: 1.5,
66
+ maxElapsedTime: 3600000,
67
+ },
68
+ retryConnectionErrors: true,
69
+ }
70
+ || { strategy: "none" },
71
+ retryCodes: options?.retryCodes || ["5XX"],
72
+ };
73
+ const requestRes = client._createRequest(context, {
74
+ security: requestSecurity,
75
+ method: "GET",
76
+ baseURL: options?.serverURL,
77
+ path: path,
78
+ headers: headers,
79
+ body: body,
80
+ userAgent: client._options.userAgent,
81
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
82
+ }, options);
83
+ if (!requestRes.ok) {
84
+ return [requestRes, { status: "invalid" }];
85
+ }
86
+ const req = requestRes.value;
87
+ const doResult = await client._do(req, {
88
+ context,
89
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
90
+ retryConfig: context.retryConfig,
91
+ retryCodes: context.retryCodes,
92
+ });
93
+ if (!doResult.ok) {
94
+ return [doResult, { status: "request-error", request: req }];
95
+ }
96
+ const response = doResult.value;
97
+ const responseFields = {
98
+ HttpMeta: { Response: response, Request: req },
99
+ };
100
+ const [result] = await M.match(M.json(200, operations_GetToolResponse$inboundSchema.optional(), {
101
+ key: "Result",
102
+ }), M.nil(308, operations_GetToolResponse$inboundSchema.optional(), {
103
+ hdrs: true,
104
+ }), 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 });
105
+ if (!result.ok) {
106
+ return [result, { status: "complete", request: req, response }];
107
+ }
108
+ return [result, { status: "complete", request: req, response }];
109
+ }
110
+ //# sourceMappingURL=toolsGetTool.js.map
@@ -0,0 +1,19 @@
1
+ import { OpenRouterCore } from "../core.js";
2
+ import { RequestOptions } from "../lib/sdks.js";
3
+ import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
4
+ import * as errors from "../models/errors/index.js";
5
+ import { OpenRouterError } from "../models/errors/openroutererror.js";
6
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
7
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
8
+ import * as models from "../models/index.js";
9
+ import * as operations from "../models/operations/index.js";
10
+ import { APIPromise } from "../types/async.js";
11
+ import { Result } from "../types/fp.js";
12
+ /**
13
+ * List server tools
14
+ *
15
+ * @remarks
16
+ * Lists every server tool OpenRouter can run on behalf of a model: accepted `tools[].type` spellings per API format, the engines behind it with their pricing, and how many endpoints run it natively.
17
+ */
18
+ export declare function toolsListTools(client: OpenRouterCore, security: operations.ListToolsSecurity, request?: operations.ListToolsRequest | undefined, options?: RequestOptions): APIPromise<Result<models.ListToolsResponse, errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
19
+ //# sourceMappingURL=toolsListTools.d.ts.map
@@ -0,0 +1,107 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: c07da22ec653
4
+ */
5
+ import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
6
+ import { matchStatusCode } from "../lib/http.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { resolveSecurity } from "../lib/security.js";
11
+ import { pathToFunc } from "../lib/url.js";
12
+ import { ForbiddenResponseError$inboundSchema as errors_ForbiddenResponseError$inboundSchema } from "../models/errors/forbiddenresponseerror.js"; import { InternalServerResponseError$inboundSchema as errors_InternalServerResponseError$inboundSchema } from "../models/errors/internalserverresponseerror.js"; import { NotFoundResponseError$inboundSchema as errors_NotFoundResponseError$inboundSchema } from "../models/errors/notfoundresponseerror.js"; import { UnauthorizedResponseError$inboundSchema as errors_UnauthorizedResponseError$inboundSchema } from "../models/errors/unauthorizedresponseerror.js";
13
+ import { ListToolsResponse$inboundSchema as models_ListToolsResponse$inboundSchema } from "../models/listtoolsresponse.js";
14
+ import { ListToolsRequest$outboundSchema as operations_ListToolsRequest$outboundSchema } from "../models/operations/listtools.js";
15
+ import { APIPromise } from "../types/async.js";
16
+ /**
17
+ * List server tools
18
+ *
19
+ * @remarks
20
+ * Lists every server tool OpenRouter can run on behalf of a model: accepted `tools[].type` spellings per API format, the engines behind it with their pricing, and how many endpoints run it natively.
21
+ */
22
+ export function toolsListTools(client, security, request, options) {
23
+ return new APIPromise($do(client, security, request, options));
24
+ }
25
+ async function $do(client, security, request, options) {
26
+ const parsed = safeParse(request, (value) => operations_ListToolsRequest$outboundSchema.optional().parse(value), "Input validation failed");
27
+ if (!parsed.ok) {
28
+ return [parsed, { status: "invalid" }];
29
+ }
30
+ const payload = parsed.value;
31
+ const body = null;
32
+ const path = pathToFunc("/tools")();
33
+ const query = encodeFormQuery({
34
+ "api_format": payload?.api_format,
35
+ "limit": payload?.limit,
36
+ "offset": payload?.offset,
37
+ });
38
+ const headers = new Headers(compactMap({
39
+ Accept: "application/json",
40
+ "HTTP-Referer": encodeSimple("HTTP-Referer", payload?.["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
41
+ "X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload?.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
42
+ "X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload?.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
43
+ }));
44
+ const requestSecurity = resolveSecurity([
45
+ {
46
+ fieldName: "Authorization",
47
+ type: "http:bearer",
48
+ value: security?.bearer,
49
+ },
50
+ ]);
51
+ const context = {
52
+ options: client._options,
53
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
54
+ operationID: "listTools",
55
+ oAuth2Scopes: null,
56
+ resolvedSecurity: requestSecurity,
57
+ securitySource: security,
58
+ retryConfig: options?.retries
59
+ || client._options.retryConfig
60
+ || {
61
+ strategy: "backoff",
62
+ backoff: {
63
+ initialInterval: 500,
64
+ maxInterval: 60000,
65
+ exponent: 1.5,
66
+ maxElapsedTime: 3600000,
67
+ },
68
+ retryConnectionErrors: true,
69
+ }
70
+ || { strategy: "none" },
71
+ retryCodes: options?.retryCodes || ["5XX"],
72
+ };
73
+ const requestRes = client._createRequest(context, {
74
+ security: requestSecurity,
75
+ method: "GET",
76
+ baseURL: options?.serverURL,
77
+ path: path,
78
+ headers: headers,
79
+ query: query,
80
+ body: body,
81
+ userAgent: client._options.userAgent,
82
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
83
+ }, options);
84
+ if (!requestRes.ok) {
85
+ return [requestRes, { status: "invalid" }];
86
+ }
87
+ const req = requestRes.value;
88
+ const doResult = await client._do(req, {
89
+ context,
90
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
91
+ retryConfig: context.retryConfig,
92
+ retryCodes: context.retryCodes,
93
+ });
94
+ if (!doResult.ok) {
95
+ return [doResult, { status: "request-error", request: req }];
96
+ }
97
+ const response = doResult.value;
98
+ const responseFields = {
99
+ HttpMeta: { Response: response, Request: req },
100
+ };
101
+ const [result] = await M.match(M.json(200, models_ListToolsResponse$inboundSchema), 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 });
102
+ if (!result.ok) {
103
+ return [result, { status: "complete", request: req, response }];
104
+ }
105
+ return [result, { status: "complete", request: req, response }];
106
+ }
107
+ //# sourceMappingURL=toolsListTools.js.map
@@ -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.4.6";
53
+ readonly sdkVersion: "1.4.7";
54
54
  readonly genVersion: "2.914.0";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.4.6 2.914.0 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.4.7 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.4.6",
32
+ sdkVersion: "1.4.7",
33
33
  genVersion: "2.914.0",
34
- userAgent: "speakeasy-sdk/typescript 1.4.6 2.914.0 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.4.7 2.914.0 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -23,7 +23,7 @@ export type ApiType = OpenEnum<typeof ApiType>;
23
23
  /**
24
24
  * The data region this generation was routed through: 'global', 'europe', or 'us'.
25
25
  */
26
- export declare const DataRegion: {
26
+ export declare const GenerationResponseDataRegion: {
27
27
  readonly Global: "global";
28
28
  readonly Europe: "europe";
29
29
  readonly Us: "us";
@@ -31,7 +31,7 @@ export declare const DataRegion: {
31
31
  /**
32
32
  * The data region this generation was routed through: 'global', 'europe', or 'us'.
33
33
  */
34
- export type DataRegion = OpenEnum<typeof DataRegion>;
34
+ export type GenerationResponseDataRegion = OpenEnum<typeof GenerationResponseDataRegion>;
35
35
  /**
36
36
  * Generation data
37
37
  */
@@ -59,7 +59,7 @@ export type GenerationResponseData = {
59
59
  /**
60
60
  * The data region this generation was routed through: 'global', 'europe', or 'us'.
61
61
  */
62
- dataRegion: DataRegion;
62
+ dataRegion: GenerationResponseDataRegion;
63
63
  /**
64
64
  * External user identifier
65
65
  */
@@ -229,7 +229,7 @@ export type GenerationResponse = {
229
229
  /** @internal */
230
230
  export declare const ApiType$inboundSchema: z.ZodType<ApiType, unknown>;
231
231
  /** @internal */
232
- export declare const DataRegion$inboundSchema: z.ZodType<DataRegion, unknown>;
232
+ export declare const GenerationResponseDataRegion$inboundSchema: z.ZodType<GenerationResponseDataRegion, unknown>;
233
233
  /** @internal */
234
234
  export declare const GenerationResponseData$inboundSchema: z.ZodType<GenerationResponseData, unknown>;
235
235
  export declare function generationResponseDataFromJSON(jsonString: string): SafeParseResult<GenerationResponseData, SDKValidationError>;
@@ -23,7 +23,7 @@ export const ApiType = {
23
23
  /**
24
24
  * The data region this generation was routed through: 'global', 'europe', or 'us'.
25
25
  */
26
- export const DataRegion = {
26
+ export const GenerationResponseDataRegion = {
27
27
  Global: "global",
28
28
  Europe: "europe",
29
29
  Us: "us",
@@ -32,7 +32,7 @@ export const DataRegion = {
32
32
  export const ApiType$inboundSchema = openEnums
33
33
  .inboundSchema(ApiType);
34
34
  /** @internal */
35
- export const DataRegion$inboundSchema = openEnums.inboundSchema(DataRegion);
35
+ export const GenerationResponseDataRegion$inboundSchema = openEnums.inboundSchema(GenerationResponseDataRegion);
36
36
  /** @internal */
37
37
  export const GenerationResponseData$inboundSchema = z.object({
38
38
  api_type: z.nullable(ApiType$inboundSchema),
@@ -40,7 +40,7 @@ export const GenerationResponseData$inboundSchema = z.object({
40
40
  cache_discount: z.nullable(z.number()),
41
41
  cancelled: z.nullable(z.boolean()),
42
42
  created_at: z.string(),
43
- data_region: DataRegion$inboundSchema,
43
+ data_region: GenerationResponseDataRegion$inboundSchema,
44
44
  external_user: z.nullable(z.string()),
45
45
  finish_reason: z.nullable(z.string()),
46
46
  generation_time: z.nullable(z.number()),
@@ -0,0 +1,11 @@
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 { ServerToolDetails } from "./servertooldetails.js";
5
+ export type GetToolResponse = {
6
+ data: ServerToolDetails;
7
+ };
8
+ /** @internal */
9
+ export declare const GetToolResponse$inboundSchema: z.ZodType<GetToolResponse, unknown>;
10
+ export declare function getToolResponseFromJSON(jsonString: string): SafeParseResult<GetToolResponse, SDKValidationError>;
11
+ //# sourceMappingURL=gettoolresponse.d.ts.map
@@ -0,0 +1,15 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: ef3123a53743
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ import { ServerToolDetails$inboundSchema, } from "./servertooldetails.js";
8
+ /** @internal */
9
+ export const GetToolResponse$inboundSchema = z.object({
10
+ data: ServerToolDetails$inboundSchema,
11
+ });
12
+ export function getToolResponseFromJSON(jsonString) {
13
+ return safeParse(jsonString, (x) => GetToolResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetToolResponse' from JSON`);
14
+ }
15
+ //# sourceMappingURL=gettoolresponse.js.map
@@ -344,6 +344,7 @@ export * from "./getpresetresponse.js";
344
344
  export * from "./getpresetversionresponse.js";
345
345
  export * from "./getscimgroupmappingresponse.js";
346
346
  export * from "./getscimsyncjobresponse.js";
347
+ export * from "./gettoolresponse.js";
347
348
  export * from "./getworkspacebudgetresponse.js";
348
349
  export * from "./getworkspaceresponse.js";
349
350
  export * from "./goneresponseerrordata.js";
@@ -436,6 +437,7 @@ export * from "./listpresetversionsresponse.js";
436
437
  export * from "./listprivateendpointsresponse.js";
437
438
  export * from "./listscimgroupmappingsresponse.js";
438
439
  export * from "./listscimgroupsresponse.js";
440
+ export * from "./listtoolsresponse.js";
439
441
  export * from "./listworkspacebudgetsresponse.js";
440
442
  export * from "./listworkspacemembersresponse.js";
441
443
  export * from "./listworkspacesresponse.js";
@@ -660,6 +662,15 @@ export * from "./searchmodelsservertoolconfig.js";
660
662
  export * from "./searchmodelsservertoolopenrouter.js";
661
663
  export * from "./searchqualitylevel.js";
662
664
  export * from "./security.js";
665
+ export * from "./servertool.js";
666
+ export * from "./servertooldetails.js";
667
+ export * from "./servertoolengine.js";
668
+ export * from "./servertoolexecutedby.js";
669
+ export * from "./servertoolinputname.js";
670
+ export * from "./servertoolnativemodel.js";
671
+ export * from "./servertoolnativesupport.js";
672
+ export * from "./servertooloutputname.js";
673
+ export * from "./servertoolprice.js";
663
674
  export * from "./servertoolusedetails.js";
664
675
  export * from "./serviceunavailableresponseerrordata.js";
665
676
  export * from "./sessioncostitem.js";
@@ -348,6 +348,7 @@ export * from "./getpresetresponse.js";
348
348
  export * from "./getpresetversionresponse.js";
349
349
  export * from "./getscimgroupmappingresponse.js";
350
350
  export * from "./getscimsyncjobresponse.js";
351
+ export * from "./gettoolresponse.js";
351
352
  export * from "./getworkspacebudgetresponse.js";
352
353
  export * from "./getworkspaceresponse.js";
353
354
  export * from "./goneresponseerrordata.js";
@@ -440,6 +441,7 @@ export * from "./listpresetversionsresponse.js";
440
441
  export * from "./listprivateendpointsresponse.js";
441
442
  export * from "./listscimgroupmappingsresponse.js";
442
443
  export * from "./listscimgroupsresponse.js";
444
+ export * from "./listtoolsresponse.js";
443
445
  export * from "./listworkspacebudgetsresponse.js";
444
446
  export * from "./listworkspacemembersresponse.js";
445
447
  export * from "./listworkspacesresponse.js";
@@ -664,6 +666,15 @@ export * from "./searchmodelsservertoolconfig.js";
664
666
  export * from "./searchmodelsservertoolopenrouter.js";
665
667
  export * from "./searchqualitylevel.js";
666
668
  export * from "./security.js";
669
+ export * from "./servertool.js";
670
+ export * from "./servertooldetails.js";
671
+ export * from "./servertoolengine.js";
672
+ export * from "./servertoolexecutedby.js";
673
+ export * from "./servertoolinputname.js";
674
+ export * from "./servertoolnativemodel.js";
675
+ export * from "./servertoolnativesupport.js";
676
+ export * from "./servertooloutputname.js";
677
+ export * from "./servertoolprice.js";
667
678
  export * from "./servertoolusedetails.js";
668
679
  export * from "./serviceunavailableresponseerrordata.js";
669
680
  export * from "./sessioncostitem.js";
@@ -0,0 +1,25 @@
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 { ServerTool } from "./servertool.js";
5
+ export type ListToolsResponseLinks = {
6
+ /**
7
+ * URL for the next page of results, or null if this is the last page
8
+ */
9
+ next: string | null;
10
+ };
11
+ export type ListToolsResponse = {
12
+ data: Array<ServerTool>;
13
+ links: ListToolsResponseLinks;
14
+ /**
15
+ * Total number of tools
16
+ */
17
+ totalCount: number;
18
+ };
19
+ /** @internal */
20
+ export declare const ListToolsResponseLinks$inboundSchema: z.ZodType<ListToolsResponseLinks, unknown>;
21
+ export declare function listToolsResponseLinksFromJSON(jsonString: string): SafeParseResult<ListToolsResponseLinks, SDKValidationError>;
22
+ /** @internal */
23
+ export declare const ListToolsResponse$inboundSchema: z.ZodType<ListToolsResponse, unknown>;
24
+ export declare function listToolsResponseFromJSON(jsonString: string): SafeParseResult<ListToolsResponse, SDKValidationError>;
25
+ //# sourceMappingURL=listtoolsresponse.d.ts.map
@@ -0,0 +1,29 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: d36b0fe12aa7
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 { ServerTool$inboundSchema } from "./servertool.js";
9
+ /** @internal */
10
+ export const ListToolsResponseLinks$inboundSchema = z.object({
11
+ next: z.nullable(z.string()),
12
+ });
13
+ export function listToolsResponseLinksFromJSON(jsonString) {
14
+ return safeParse(jsonString, (x) => ListToolsResponseLinks$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListToolsResponseLinks' from JSON`);
15
+ }
16
+ /** @internal */
17
+ export const ListToolsResponse$inboundSchema = z.object({
18
+ data: z.array(ServerTool$inboundSchema),
19
+ links: z.lazy(() => ListToolsResponseLinks$inboundSchema),
20
+ total_count: z.int(),
21
+ }).transform((v) => {
22
+ return remap$(v, {
23
+ "total_count": "totalCount",
24
+ });
25
+ });
26
+ export function listToolsResponseFromJSON(jsonString) {
27
+ return safeParse(jsonString, (x) => ListToolsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListToolsResponse' from JSON`);
28
+ }
29
+ //# sourceMappingURL=listtoolsresponse.js.map
@@ -5,7 +5,7 @@ import { Model } from "./model.js";
5
5
  /**
6
6
  * Pagination links
7
7
  */
8
- export type Links = {
8
+ export type ModelsListResponseLinks = {
9
9
  /**
10
10
  * URL for the next page of results, or null if this is the last page
11
11
  */
@@ -22,15 +22,15 @@ export type ModelsListResponse = {
22
22
  /**
23
23
  * Pagination links
24
24
  */
25
- links: Links;
25
+ links: ModelsListResponseLinks;
26
26
  /**
27
27
  * Total number of models matching the query
28
28
  */
29
29
  totalCount: number;
30
30
  };
31
31
  /** @internal */
32
- export declare const Links$inboundSchema: z.ZodType<Links, unknown>;
33
- export declare function linksFromJSON(jsonString: string): SafeParseResult<Links, SDKValidationError>;
32
+ export declare const ModelsListResponseLinks$inboundSchema: z.ZodType<ModelsListResponseLinks, unknown>;
33
+ export declare function modelsListResponseLinksFromJSON(jsonString: string): SafeParseResult<ModelsListResponseLinks, SDKValidationError>;
34
34
  /** @internal */
35
35
  export declare const ModelsListResponse$inboundSchema: z.ZodType<ModelsListResponse, unknown>;
36
36
  export declare function modelsListResponseFromJSON(jsonString: string): SafeParseResult<ModelsListResponse, SDKValidationError>;
@@ -7,16 +7,16 @@ import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { safeParse } from "../lib/schemas.js";
8
8
  import { Model$inboundSchema } from "./model.js";
9
9
  /** @internal */
10
- export const Links$inboundSchema = z.object({
10
+ export const ModelsListResponseLinks$inboundSchema = z.object({
11
11
  next: z.nullable(z.string()),
12
12
  });
13
- export function linksFromJSON(jsonString) {
14
- return safeParse(jsonString, (x) => Links$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Links' from JSON`);
13
+ export function modelsListResponseLinksFromJSON(jsonString) {
14
+ return safeParse(jsonString, (x) => ModelsListResponseLinks$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ModelsListResponseLinks' from JSON`);
15
15
  }
16
16
  /** @internal */
17
17
  export const ModelsListResponse$inboundSchema = z.object({
18
18
  data: z.array(Model$inboundSchema),
19
- links: z.lazy(() => Links$inboundSchema),
19
+ links: z.lazy(() => ModelsListResponseLinks$inboundSchema),
20
20
  total_count: z.int(),
21
21
  }).transform((v) => {
22
22
  return remap$(v, {
@@ -0,0 +1,80 @@
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 GetToolGlobals = {
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 GetToolSecurity = {
27
+ bearer: string;
28
+ };
29
+ export type GetToolRequest = {
30
+ /**
31
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
32
+ *
33
+ * @remarks
34
+ * This is used to track API usage per application.
35
+ */
36
+ httpReferer?: string | undefined;
37
+ /**
38
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
39
+ *
40
+ * @remarks
41
+ */
42
+ appTitle?: string | undefined;
43
+ /**
44
+ * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
45
+ *
46
+ * @remarks
47
+ */
48
+ appCategories?: string | undefined;
49
+ /**
50
+ * Canonical `openrouter:*` name or any accepted `tools[].type` alias
51
+ */
52
+ name: string;
53
+ };
54
+ export type GetToolResponse = {
55
+ headers: {
56
+ [k: string]: Array<string>;
57
+ };
58
+ result?: models.GetToolResponse | undefined;
59
+ };
60
+ /** @internal */
61
+ export type GetToolSecurity$Outbound = {
62
+ bearer: string;
63
+ };
64
+ /** @internal */
65
+ export declare const GetToolSecurity$outboundSchema: z.ZodType<GetToolSecurity$Outbound, GetToolSecurity>;
66
+ export declare function getToolSecurityToJSON(getToolSecurity: GetToolSecurity): string;
67
+ /** @internal */
68
+ export type GetToolRequest$Outbound = {
69
+ "HTTP-Referer"?: string | undefined;
70
+ appTitle?: string | undefined;
71
+ appCategories?: string | undefined;
72
+ name: string;
73
+ };
74
+ /** @internal */
75
+ export declare const GetToolRequest$outboundSchema: z.ZodType<GetToolRequest$Outbound, GetToolRequest>;
76
+ export declare function getToolRequestToJSON(getToolRequest: GetToolRequest): string;
77
+ /** @internal */
78
+ export declare const GetToolResponse$inboundSchema: z.ZodType<GetToolResponse, unknown>;
79
+ export declare function getToolResponseFromJSON(jsonString: string): SafeParseResult<GetToolResponse, SDKValidationError>;
80
+ //# sourceMappingURL=gettool.d.ts.map