@openrouter/sdk 1.4.6 → 1.4.8
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/toolsGetTool.d.ts +18 -0
- package/esm/funcs/toolsGetTool.js +110 -0
- package/esm/funcs/toolsListTools.d.ts +19 -0
- package/esm/funcs/toolsListTools.js +107 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/generationresponse.d.ts +4 -4
- package/esm/models/generationresponse.js +3 -3
- package/esm/models/gettoolresponse.d.ts +11 -0
- package/esm/models/gettoolresponse.js +15 -0
- package/esm/models/index.d.ts +11 -0
- package/esm/models/index.js +11 -0
- package/esm/models/listtoolsresponse.d.ts +25 -0
- package/esm/models/listtoolsresponse.js +29 -0
- package/esm/models/modelslistresponse.d.ts +4 -4
- package/esm/models/modelslistresponse.js +4 -4
- package/esm/models/operations/gettool.d.ts +80 -0
- package/esm/models/operations/gettool.js +43 -0
- package/esm/models/operations/index.d.ts +2 -0
- package/esm/models/operations/index.js +2 -0
- package/esm/models/operations/listtools.d.ts +93 -0
- package/esm/models/operations/listtools.js +43 -0
- package/esm/models/servertool.d.ts +79 -0
- package/esm/models/servertool.js +59 -0
- package/esm/models/servertooldetails.d.ts +90 -0
- package/esm/models/servertooldetails.js +73 -0
- package/esm/models/servertoolengine.d.ts +82 -0
- package/esm/models/servertoolengine.js +63 -0
- package/esm/models/servertoolexecutedby.d.ts +17 -0
- package/esm/models/servertoolexecutedby.js +16 -0
- package/esm/models/servertoolinputname.d.ts +28 -0
- package/esm/models/servertoolinputname.js +31 -0
- package/esm/models/servertoolnativemodel.d.ts +11 -0
- package/esm/models/servertoolnativemodel.js +15 -0
- package/esm/models/servertoolnativesupport.d.ts +14 -0
- package/esm/models/servertoolnativesupport.js +21 -0
- package/esm/models/servertooloutputname.d.ts +27 -0
- package/esm/models/servertooloutputname.js +29 -0
- package/esm/models/servertoolprice.d.ts +19 -0
- package/esm/models/servertoolprice.js +22 -0
- package/esm/models/speechrequest.d.ts +1 -1
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.js +4 -0
- package/esm/sdk/tools.d.ts +20 -0
- package/esm/sdk/tools.js +29 -0
- package/jsr.json +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 643b31a6a57a
|
|
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 { GetToolResponse$inboundSchema as models_GetToolResponse$inboundSchema } from "../gettoolresponse.js";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const GetToolSecurity$outboundSchema = z.object({
|
|
11
|
+
bearer: z.string(),
|
|
12
|
+
});
|
|
13
|
+
export function getToolSecurityToJSON(getToolSecurity) {
|
|
14
|
+
return JSON.stringify(GetToolSecurity$outboundSchema.parse(getToolSecurity));
|
|
15
|
+
}
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const GetToolRequest$outboundSchema = z.object({
|
|
18
|
+
httpReferer: z.string().optional(),
|
|
19
|
+
appTitle: z.string().optional(),
|
|
20
|
+
appCategories: z.string().optional(),
|
|
21
|
+
name: z.string(),
|
|
22
|
+
}).transform((v) => {
|
|
23
|
+
return remap$(v, {
|
|
24
|
+
httpReferer: "HTTP-Referer",
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
export function getToolRequestToJSON(getToolRequest) {
|
|
28
|
+
return JSON.stringify(GetToolRequest$outboundSchema.parse(getToolRequest));
|
|
29
|
+
}
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const GetToolResponse$inboundSchema = z.object({
|
|
32
|
+
Headers: z.record(z.string(), z.array(z.string())).default({}),
|
|
33
|
+
Result: models_GetToolResponse$inboundSchema.optional(),
|
|
34
|
+
}).transform((v) => {
|
|
35
|
+
return remap$(v, {
|
|
36
|
+
"Headers": "headers",
|
|
37
|
+
"Result": "result",
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
export function getToolResponseFromJSON(jsonString) {
|
|
41
|
+
return safeParse(jsonString, (x) => GetToolResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetToolResponse' from JSON`);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=gettool.js.map
|
|
@@ -76,6 +76,7 @@ export * from "./getscimgroupmapping.js";
|
|
|
76
76
|
export * from "./getscimsyncjob.js";
|
|
77
77
|
export * from "./getsessioncost.js";
|
|
78
78
|
export * from "./gettaskclassifications.js";
|
|
79
|
+
export * from "./gettool.js";
|
|
79
80
|
export * from "./getuseractivity.js";
|
|
80
81
|
export * from "./getvideos.js";
|
|
81
82
|
export * from "./getworkspace.js";
|
|
@@ -111,6 +112,7 @@ export * from "./listprivateendpoints.js";
|
|
|
111
112
|
export * from "./listproviders.js";
|
|
112
113
|
export * from "./listscimgroupmappings.js";
|
|
113
114
|
export * from "./listscimgroups.js";
|
|
115
|
+
export * from "./listtools.js";
|
|
114
116
|
export * from "./listvaultsecrets.js";
|
|
115
117
|
export * from "./listvideoscontent.js";
|
|
116
118
|
export * from "./listvideosmodels.js";
|
|
@@ -80,6 +80,7 @@ export * from "./getscimgroupmapping.js";
|
|
|
80
80
|
export * from "./getscimsyncjob.js";
|
|
81
81
|
export * from "./getsessioncost.js";
|
|
82
82
|
export * from "./gettaskclassifications.js";
|
|
83
|
+
export * from "./gettool.js";
|
|
83
84
|
export * from "./getuseractivity.js";
|
|
84
85
|
export * from "./getvideos.js";
|
|
85
86
|
export * from "./getworkspace.js";
|
|
@@ -115,6 +116,7 @@ export * from "./listprivateendpoints.js";
|
|
|
115
116
|
export * from "./listproviders.js";
|
|
116
117
|
export * from "./listscimgroupmappings.js";
|
|
117
118
|
export * from "./listscimgroups.js";
|
|
119
|
+
export * from "./listtools.js";
|
|
118
120
|
export * from "./listvaultsecrets.js";
|
|
119
121
|
export * from "./listvideoscontent.js";
|
|
120
122
|
export * from "./listvideosmodels.js";
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
3
|
+
export type ListToolsGlobals = {
|
|
4
|
+
/**
|
|
5
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* This is used to track API usage per application.
|
|
9
|
+
*/
|
|
10
|
+
httpReferer?: string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
*/
|
|
16
|
+
appTitle?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
*/
|
|
22
|
+
appCategories?: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
export type ListToolsSecurity = {
|
|
25
|
+
bearer: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Only tools usable on this API format
|
|
29
|
+
*/
|
|
30
|
+
export declare const ApiFormat: {
|
|
31
|
+
readonly Responses: "responses";
|
|
32
|
+
readonly ChatCompletions: "chat-completions";
|
|
33
|
+
readonly AnthropicMessages: "anthropic-messages";
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Only tools usable on this API format
|
|
37
|
+
*/
|
|
38
|
+
export type ApiFormat = OpenEnum<typeof ApiFormat>;
|
|
39
|
+
export type ListToolsRequest = {
|
|
40
|
+
/**
|
|
41
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* This is used to track API usage per application.
|
|
45
|
+
*/
|
|
46
|
+
httpReferer?: string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
49
|
+
*
|
|
50
|
+
* @remarks
|
|
51
|
+
*/
|
|
52
|
+
appTitle?: string | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
|
|
55
|
+
*
|
|
56
|
+
* @remarks
|
|
57
|
+
*/
|
|
58
|
+
appCategories?: string | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned
|
|
61
|
+
*/
|
|
62
|
+
offset?: number | null | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned
|
|
65
|
+
*/
|
|
66
|
+
limit?: number | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Only tools usable on this API format
|
|
69
|
+
*/
|
|
70
|
+
apiFormat?: ApiFormat | undefined;
|
|
71
|
+
};
|
|
72
|
+
/** @internal */
|
|
73
|
+
export type ListToolsSecurity$Outbound = {
|
|
74
|
+
bearer: string;
|
|
75
|
+
};
|
|
76
|
+
/** @internal */
|
|
77
|
+
export declare const ListToolsSecurity$outboundSchema: z.ZodType<ListToolsSecurity$Outbound, ListToolsSecurity>;
|
|
78
|
+
export declare function listToolsSecurityToJSON(listToolsSecurity: ListToolsSecurity): string;
|
|
79
|
+
/** @internal */
|
|
80
|
+
export declare const ApiFormat$outboundSchema: z.ZodType<string, ApiFormat>;
|
|
81
|
+
/** @internal */
|
|
82
|
+
export type ListToolsRequest$Outbound = {
|
|
83
|
+
"HTTP-Referer"?: string | undefined;
|
|
84
|
+
appTitle?: string | undefined;
|
|
85
|
+
appCategories?: string | undefined;
|
|
86
|
+
offset: number | null;
|
|
87
|
+
limit: number;
|
|
88
|
+
api_format?: string | undefined;
|
|
89
|
+
};
|
|
90
|
+
/** @internal */
|
|
91
|
+
export declare const ListToolsRequest$outboundSchema: z.ZodType<ListToolsRequest$Outbound, ListToolsRequest>;
|
|
92
|
+
export declare function listToolsRequestToJSON(listToolsRequest: ListToolsRequest): string;
|
|
93
|
+
//# sourceMappingURL=listtools.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 42a61de0bc0f
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import * as openEnums from "../../types/enums.js";
|
|
8
|
+
/**
|
|
9
|
+
* Only tools usable on this API format
|
|
10
|
+
*/
|
|
11
|
+
export const ApiFormat = {
|
|
12
|
+
Responses: "responses",
|
|
13
|
+
ChatCompletions: "chat-completions",
|
|
14
|
+
AnthropicMessages: "anthropic-messages",
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const ListToolsSecurity$outboundSchema = z.object({
|
|
18
|
+
bearer: z.string(),
|
|
19
|
+
});
|
|
20
|
+
export function listToolsSecurityToJSON(listToolsSecurity) {
|
|
21
|
+
return JSON.stringify(ListToolsSecurity$outboundSchema.parse(listToolsSecurity));
|
|
22
|
+
}
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const ApiFormat$outboundSchema = openEnums
|
|
25
|
+
.outboundSchema(ApiFormat);
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const ListToolsRequest$outboundSchema = z.object({
|
|
28
|
+
httpReferer: z.string().optional(),
|
|
29
|
+
appTitle: z.string().optional(),
|
|
30
|
+
appCategories: z.string().optional(),
|
|
31
|
+
offset: z.nullable(z.int().default(0)),
|
|
32
|
+
limit: z.int().default(50),
|
|
33
|
+
apiFormat: ApiFormat$outboundSchema.optional(),
|
|
34
|
+
}).transform((v) => {
|
|
35
|
+
return remap$(v, {
|
|
36
|
+
httpReferer: "HTTP-Referer",
|
|
37
|
+
apiFormat: "api_format",
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
export function listToolsRequestToJSON(listToolsRequest) {
|
|
41
|
+
return JSON.stringify(ListToolsRequest$outboundSchema.parse(listToolsRequest));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=listtools.js.map
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { ServerToolEngine } from "./servertoolengine.js";
|
|
6
|
+
import { ServerToolInputName } from "./servertoolinputname.js";
|
|
7
|
+
import { ServerToolNativeSupport } from "./servertoolnativesupport.js";
|
|
8
|
+
export declare const ServerToolStatus: {
|
|
9
|
+
readonly Active: "active";
|
|
10
|
+
readonly Deprecated: "deprecated";
|
|
11
|
+
};
|
|
12
|
+
export type ServerToolStatus = OpenEnum<typeof ServerToolStatus>;
|
|
13
|
+
export declare const ServerToolSupportedApiFormat: {
|
|
14
|
+
readonly Responses: "responses";
|
|
15
|
+
readonly ChatCompletions: "chat-completions";
|
|
16
|
+
readonly AnthropicMessages: "anthropic-messages";
|
|
17
|
+
};
|
|
18
|
+
export type ServerToolSupportedApiFormat = OpenEnum<typeof ServerToolSupportedApiFormat>;
|
|
19
|
+
export type ServerTool = {
|
|
20
|
+
/**
|
|
21
|
+
* Every spelling accepted in `tools[].type` for this tool, including the canonical `id`, and what the call surfaces as under each
|
|
22
|
+
*/
|
|
23
|
+
aliases: Array<ServerToolInputName>;
|
|
24
|
+
/**
|
|
25
|
+
* The engine a request without `parameters.engine` (or with `engine: "auto"`) runs on; `native` applies where the endpoint runs the tool itself, otherwise `fallback_engine`. A request pinned to a data region skips either engine when its `data_regions` does not list that region. Null for a tool without an engine parameter
|
|
26
|
+
*/
|
|
27
|
+
defaultEngine: string | null;
|
|
28
|
+
docsUrl: string;
|
|
29
|
+
engines: Array<ServerToolEngine>;
|
|
30
|
+
/**
|
|
31
|
+
* The engine an unpinned request runs on when `default_engine` is `native` and the endpoint does not run the tool itself; null when there is no fallback
|
|
32
|
+
*/
|
|
33
|
+
fallbackEngine: string | null;
|
|
34
|
+
/**
|
|
35
|
+
* Canonical `openrouter:*` name; the stable `tools[].type` on every API format in `supported_api_formats`
|
|
36
|
+
*/
|
|
37
|
+
id: string;
|
|
38
|
+
/**
|
|
39
|
+
* JSON Schema of the arguments the model emits when calling the tool
|
|
40
|
+
*/
|
|
41
|
+
inputSchema: {
|
|
42
|
+
[k: string]: any;
|
|
43
|
+
};
|
|
44
|
+
name: string;
|
|
45
|
+
/**
|
|
46
|
+
* Endpoints whose provider runs this tool itself during inference. Zero for tools no provider runs natively.
|
|
47
|
+
*/
|
|
48
|
+
nativeSupport: ServerToolNativeSupport;
|
|
49
|
+
/**
|
|
50
|
+
* JSON Schema of the result returned to the model; null when undeclared
|
|
51
|
+
*/
|
|
52
|
+
outputSchema: {
|
|
53
|
+
[k: string]: any;
|
|
54
|
+
} | null;
|
|
55
|
+
/**
|
|
56
|
+
* JSON Schema for the caller-side `tools[].parameters` object
|
|
57
|
+
*/
|
|
58
|
+
parametersSchema: {
|
|
59
|
+
[k: string]: any;
|
|
60
|
+
};
|
|
61
|
+
status: ServerToolStatus;
|
|
62
|
+
/**
|
|
63
|
+
* One sentence for cards and search results; never sent to a model
|
|
64
|
+
*/
|
|
65
|
+
summary: string;
|
|
66
|
+
supportedApiFormats: Array<ServerToolSupportedApiFormat>;
|
|
67
|
+
/**
|
|
68
|
+
* The description sent upstream as the function tool description
|
|
69
|
+
*/
|
|
70
|
+
toolDescription: string;
|
|
71
|
+
};
|
|
72
|
+
/** @internal */
|
|
73
|
+
export declare const ServerToolStatus$inboundSchema: z.ZodType<ServerToolStatus, unknown>;
|
|
74
|
+
/** @internal */
|
|
75
|
+
export declare const ServerToolSupportedApiFormat$inboundSchema: z.ZodType<ServerToolSupportedApiFormat, unknown>;
|
|
76
|
+
/** @internal */
|
|
77
|
+
export declare const ServerTool$inboundSchema: z.ZodType<ServerTool, unknown>;
|
|
78
|
+
export declare function serverToolFromJSON(jsonString: string): SafeParseResult<ServerTool, SDKValidationError>;
|
|
79
|
+
//# sourceMappingURL=servertool.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 51581c50c8ce
|
|
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 openEnums from "../types/enums.js";
|
|
9
|
+
import { ServerToolEngine$inboundSchema, } from "./servertoolengine.js";
|
|
10
|
+
import { ServerToolInputName$inboundSchema, } from "./servertoolinputname.js";
|
|
11
|
+
import { ServerToolNativeSupport$inboundSchema, } from "./servertoolnativesupport.js";
|
|
12
|
+
export const ServerToolStatus = {
|
|
13
|
+
Active: "active",
|
|
14
|
+
Deprecated: "deprecated",
|
|
15
|
+
};
|
|
16
|
+
export const ServerToolSupportedApiFormat = {
|
|
17
|
+
Responses: "responses",
|
|
18
|
+
ChatCompletions: "chat-completions",
|
|
19
|
+
AnthropicMessages: "anthropic-messages",
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const ServerToolStatus$inboundSchema = openEnums.inboundSchema(ServerToolStatus);
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const ServerToolSupportedApiFormat$inboundSchema = openEnums.inboundSchema(ServerToolSupportedApiFormat);
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const ServerTool$inboundSchema = z
|
|
27
|
+
.object({
|
|
28
|
+
aliases: z.array(ServerToolInputName$inboundSchema),
|
|
29
|
+
default_engine: z.nullable(z.string()),
|
|
30
|
+
docs_url: z.string(),
|
|
31
|
+
engines: z.array(ServerToolEngine$inboundSchema),
|
|
32
|
+
fallback_engine: z.nullable(z.string()),
|
|
33
|
+
id: z.string(),
|
|
34
|
+
input_schema: z.record(z.string(), z.any()),
|
|
35
|
+
name: z.string(),
|
|
36
|
+
native_support: ServerToolNativeSupport$inboundSchema,
|
|
37
|
+
output_schema: z.nullable(z.record(z.string(), z.any())),
|
|
38
|
+
parameters_schema: z.record(z.string(), z.any()),
|
|
39
|
+
status: ServerToolStatus$inboundSchema,
|
|
40
|
+
summary: z.string(),
|
|
41
|
+
supported_api_formats: z.array(ServerToolSupportedApiFormat$inboundSchema),
|
|
42
|
+
tool_description: z.string(),
|
|
43
|
+
}).transform((v) => {
|
|
44
|
+
return remap$(v, {
|
|
45
|
+
"default_engine": "defaultEngine",
|
|
46
|
+
"docs_url": "docsUrl",
|
|
47
|
+
"fallback_engine": "fallbackEngine",
|
|
48
|
+
"input_schema": "inputSchema",
|
|
49
|
+
"native_support": "nativeSupport",
|
|
50
|
+
"output_schema": "outputSchema",
|
|
51
|
+
"parameters_schema": "parametersSchema",
|
|
52
|
+
"supported_api_formats": "supportedApiFormats",
|
|
53
|
+
"tool_description": "toolDescription",
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
export function serverToolFromJSON(jsonString) {
|
|
57
|
+
return safeParse(jsonString, (x) => ServerTool$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ServerTool' from JSON`);
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=servertool.js.map
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { ServerToolEngine } from "./servertoolengine.js";
|
|
6
|
+
import { ServerToolInputName } from "./servertoolinputname.js";
|
|
7
|
+
import { ServerToolNativeModel } from "./servertoolnativemodel.js";
|
|
8
|
+
/**
|
|
9
|
+
* Endpoints whose provider runs this tool itself during inference. Zero for tools no provider runs natively.
|
|
10
|
+
*/
|
|
11
|
+
export type NativeSupport = {
|
|
12
|
+
endpointCount: number;
|
|
13
|
+
modelCount: number;
|
|
14
|
+
models: Array<ServerToolNativeModel>;
|
|
15
|
+
};
|
|
16
|
+
export declare const ServerToolDetailsStatus: {
|
|
17
|
+
readonly Active: "active";
|
|
18
|
+
readonly Deprecated: "deprecated";
|
|
19
|
+
};
|
|
20
|
+
export type ServerToolDetailsStatus = OpenEnum<typeof ServerToolDetailsStatus>;
|
|
21
|
+
export declare const ServerToolDetailsSupportedApiFormat: {
|
|
22
|
+
readonly Responses: "responses";
|
|
23
|
+
readonly ChatCompletions: "chat-completions";
|
|
24
|
+
readonly AnthropicMessages: "anthropic-messages";
|
|
25
|
+
};
|
|
26
|
+
export type ServerToolDetailsSupportedApiFormat = OpenEnum<typeof ServerToolDetailsSupportedApiFormat>;
|
|
27
|
+
export type ServerToolDetails = {
|
|
28
|
+
/**
|
|
29
|
+
* Every spelling accepted in `tools[].type` for this tool, including the canonical `id`, and what the call surfaces as under each
|
|
30
|
+
*/
|
|
31
|
+
aliases: Array<ServerToolInputName>;
|
|
32
|
+
/**
|
|
33
|
+
* The engine a request without `parameters.engine` (or with `engine: "auto"`) runs on; `native` applies where the endpoint runs the tool itself, otherwise `fallback_engine`. A request pinned to a data region skips either engine when its `data_regions` does not list that region. Null for a tool without an engine parameter
|
|
34
|
+
*/
|
|
35
|
+
defaultEngine: string | null;
|
|
36
|
+
docsUrl: string;
|
|
37
|
+
engines: Array<ServerToolEngine>;
|
|
38
|
+
/**
|
|
39
|
+
* The engine an unpinned request runs on when `default_engine` is `native` and the endpoint does not run the tool itself; null when there is no fallback
|
|
40
|
+
*/
|
|
41
|
+
fallbackEngine: string | null;
|
|
42
|
+
/**
|
|
43
|
+
* Canonical `openrouter:*` name; the stable `tools[].type` on every API format in `supported_api_formats`
|
|
44
|
+
*/
|
|
45
|
+
id: string;
|
|
46
|
+
/**
|
|
47
|
+
* JSON Schema of the arguments the model emits when calling the tool
|
|
48
|
+
*/
|
|
49
|
+
inputSchema: {
|
|
50
|
+
[k: string]: any;
|
|
51
|
+
};
|
|
52
|
+
name: string;
|
|
53
|
+
/**
|
|
54
|
+
* Endpoints whose provider runs this tool itself during inference. Zero for tools no provider runs natively.
|
|
55
|
+
*/
|
|
56
|
+
nativeSupport: NativeSupport;
|
|
57
|
+
/**
|
|
58
|
+
* JSON Schema of the result returned to the model; null when undeclared
|
|
59
|
+
*/
|
|
60
|
+
outputSchema: {
|
|
61
|
+
[k: string]: any;
|
|
62
|
+
} | null;
|
|
63
|
+
/**
|
|
64
|
+
* JSON Schema for the caller-side `tools[].parameters` object
|
|
65
|
+
*/
|
|
66
|
+
parametersSchema: {
|
|
67
|
+
[k: string]: any;
|
|
68
|
+
};
|
|
69
|
+
status: ServerToolDetailsStatus;
|
|
70
|
+
/**
|
|
71
|
+
* One sentence for cards and search results; never sent to a model
|
|
72
|
+
*/
|
|
73
|
+
summary: string;
|
|
74
|
+
supportedApiFormats: Array<ServerToolDetailsSupportedApiFormat>;
|
|
75
|
+
/**
|
|
76
|
+
* The description sent upstream as the function tool description
|
|
77
|
+
*/
|
|
78
|
+
toolDescription: string;
|
|
79
|
+
};
|
|
80
|
+
/** @internal */
|
|
81
|
+
export declare const NativeSupport$inboundSchema: z.ZodType<NativeSupport, unknown>;
|
|
82
|
+
export declare function nativeSupportFromJSON(jsonString: string): SafeParseResult<NativeSupport, SDKValidationError>;
|
|
83
|
+
/** @internal */
|
|
84
|
+
export declare const ServerToolDetailsStatus$inboundSchema: z.ZodType<ServerToolDetailsStatus, unknown>;
|
|
85
|
+
/** @internal */
|
|
86
|
+
export declare const ServerToolDetailsSupportedApiFormat$inboundSchema: z.ZodType<ServerToolDetailsSupportedApiFormat, unknown>;
|
|
87
|
+
/** @internal */
|
|
88
|
+
export declare const ServerToolDetails$inboundSchema: z.ZodType<ServerToolDetails, unknown>;
|
|
89
|
+
export declare function serverToolDetailsFromJSON(jsonString: string): SafeParseResult<ServerToolDetails, SDKValidationError>;
|
|
90
|
+
//# sourceMappingURL=servertooldetails.d.ts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: f94cb5399ef7
|
|
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 openEnums from "../types/enums.js";
|
|
9
|
+
import { ServerToolEngine$inboundSchema, } from "./servertoolengine.js";
|
|
10
|
+
import { ServerToolInputName$inboundSchema, } from "./servertoolinputname.js";
|
|
11
|
+
import { ServerToolNativeModel$inboundSchema, } from "./servertoolnativemodel.js";
|
|
12
|
+
export const ServerToolDetailsStatus = {
|
|
13
|
+
Active: "active",
|
|
14
|
+
Deprecated: "deprecated",
|
|
15
|
+
};
|
|
16
|
+
export const ServerToolDetailsSupportedApiFormat = {
|
|
17
|
+
Responses: "responses",
|
|
18
|
+
ChatCompletions: "chat-completions",
|
|
19
|
+
AnthropicMessages: "anthropic-messages",
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const NativeSupport$inboundSchema = z
|
|
23
|
+
.object({
|
|
24
|
+
endpoint_count: z.int(),
|
|
25
|
+
model_count: z.int(),
|
|
26
|
+
models: z.array(ServerToolNativeModel$inboundSchema),
|
|
27
|
+
}).transform((v) => {
|
|
28
|
+
return remap$(v, {
|
|
29
|
+
"endpoint_count": "endpointCount",
|
|
30
|
+
"model_count": "modelCount",
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
export function nativeSupportFromJSON(jsonString) {
|
|
34
|
+
return safeParse(jsonString, (x) => NativeSupport$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NativeSupport' from JSON`);
|
|
35
|
+
}
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const ServerToolDetailsStatus$inboundSchema = openEnums.inboundSchema(ServerToolDetailsStatus);
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const ServerToolDetailsSupportedApiFormat$inboundSchema = openEnums.inboundSchema(ServerToolDetailsSupportedApiFormat);
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const ServerToolDetails$inboundSchema = z.object({
|
|
42
|
+
aliases: z.array(ServerToolInputName$inboundSchema),
|
|
43
|
+
default_engine: z.nullable(z.string()),
|
|
44
|
+
docs_url: z.string(),
|
|
45
|
+
engines: z.array(ServerToolEngine$inboundSchema),
|
|
46
|
+
fallback_engine: z.nullable(z.string()),
|
|
47
|
+
id: z.string(),
|
|
48
|
+
input_schema: z.record(z.string(), z.any()),
|
|
49
|
+
name: z.string(),
|
|
50
|
+
native_support: z.lazy(() => NativeSupport$inboundSchema),
|
|
51
|
+
output_schema: z.nullable(z.record(z.string(), z.any())),
|
|
52
|
+
parameters_schema: z.record(z.string(), z.any()),
|
|
53
|
+
status: ServerToolDetailsStatus$inboundSchema,
|
|
54
|
+
summary: z.string(),
|
|
55
|
+
supported_api_formats: z.array(ServerToolDetailsSupportedApiFormat$inboundSchema),
|
|
56
|
+
tool_description: z.string(),
|
|
57
|
+
}).transform((v) => {
|
|
58
|
+
return remap$(v, {
|
|
59
|
+
"default_engine": "defaultEngine",
|
|
60
|
+
"docs_url": "docsUrl",
|
|
61
|
+
"fallback_engine": "fallbackEngine",
|
|
62
|
+
"input_schema": "inputSchema",
|
|
63
|
+
"native_support": "nativeSupport",
|
|
64
|
+
"output_schema": "outputSchema",
|
|
65
|
+
"parameters_schema": "parametersSchema",
|
|
66
|
+
"supported_api_formats": "supportedApiFormats",
|
|
67
|
+
"tool_description": "toolDescription",
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
export function serverToolDetailsFromJSON(jsonString) {
|
|
71
|
+
return safeParse(jsonString, (x) => ServerToolDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ServerToolDetails' from JSON`);
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=servertooldetails.js.map
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { ServerToolExecutedBy } from "./servertoolexecutedby.js";
|
|
6
|
+
import { ServerToolPrice } from "./servertoolprice.js";
|
|
7
|
+
/**
|
|
8
|
+
* Whether the engine needs the caller's own key, saved in plugin settings: `required` (OpenRouter holds none), `optional` (OpenRouter's key is used unless the caller saved one), or `none`
|
|
9
|
+
*/
|
|
10
|
+
export declare const BYOK: {
|
|
11
|
+
readonly Required: "required";
|
|
12
|
+
readonly Optional: "optional";
|
|
13
|
+
readonly None: "none";
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Whether the engine needs the caller's own key, saved in plugin settings: `required` (OpenRouter holds none), `optional` (OpenRouter's key is used unless the caller saved one), or `none`
|
|
17
|
+
*/
|
|
18
|
+
export type BYOK = OpenEnum<typeof BYOK>;
|
|
19
|
+
export declare const ServerToolEngineDataRegion: {
|
|
20
|
+
readonly Global: "global";
|
|
21
|
+
readonly Europe: "europe";
|
|
22
|
+
readonly Us: "us";
|
|
23
|
+
};
|
|
24
|
+
export type ServerToolEngineDataRegion = OpenEnum<typeof ServerToolEngineDataRegion>;
|
|
25
|
+
/**
|
|
26
|
+
* Who bills the engine's calls beyond the model's tokens: `openrouter` (the `pricing` rows, from the caller's credits), `provider` (a per-call tool fee from the model's provider on the inference call, at its own rates), `byok` (the engine's vendor, against the caller's own key), or `none` (no charge)
|
|
27
|
+
*/
|
|
28
|
+
export declare const PricingSource: {
|
|
29
|
+
readonly Openrouter: "openrouter";
|
|
30
|
+
readonly Provider: "provider";
|
|
31
|
+
readonly BYOK: "byok";
|
|
32
|
+
readonly None: "none";
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Who bills the engine's calls beyond the model's tokens: `openrouter` (the `pricing` rows, from the caller's credits), `provider` (a per-call tool fee from the model's provider on the inference call, at its own rates), `byok` (the engine's vendor, against the caller's own key), or `none` (no charge)
|
|
36
|
+
*/
|
|
37
|
+
export type PricingSource = OpenEnum<typeof PricingSource>;
|
|
38
|
+
export type ServerToolEngine = {
|
|
39
|
+
/**
|
|
40
|
+
* Whether the engine needs the caller's own key, saved in plugin settings: `required` (OpenRouter holds none), `optional` (OpenRouter's key is used unless the caller saved one), or `none`
|
|
41
|
+
*/
|
|
42
|
+
byok: BYOK;
|
|
43
|
+
/**
|
|
44
|
+
* The data regions whose requests this engine serves without leaving the region. A request pinned to a region can only use engines that list it; `global` is always listed.
|
|
45
|
+
*/
|
|
46
|
+
dataRegions: Array<ServerToolEngineDataRegion>;
|
|
47
|
+
/**
|
|
48
|
+
* The `parameters.mode` a request without one runs and bills as; null for engines without modes. The `pricing[]` row with this `mode` is what an unmoded request bills
|
|
49
|
+
*/
|
|
50
|
+
defaultMode: string | null;
|
|
51
|
+
/**
|
|
52
|
+
* Who runs the tool call: the model provider during inference (`provider`), OpenRouter (`openrouter`), or the caller's application after the call is returned (`client`).
|
|
53
|
+
*/
|
|
54
|
+
executedBy: ServerToolExecutedBy;
|
|
55
|
+
/**
|
|
56
|
+
* The `parameters.engine` value that selects this engine; null for the single engine of a tool without an engine parameter
|
|
57
|
+
*/
|
|
58
|
+
id: string | null;
|
|
59
|
+
name: string;
|
|
60
|
+
/**
|
|
61
|
+
* The rows OpenRouter bills; non-empty exactly when `pricing_source` is `openrouter`
|
|
62
|
+
*/
|
|
63
|
+
pricing: Array<ServerToolPrice>;
|
|
64
|
+
/**
|
|
65
|
+
* Where the rates are documented when `pricing_source` is `provider` or `byok`; null otherwise
|
|
66
|
+
*/
|
|
67
|
+
pricingDocUrl: string | null;
|
|
68
|
+
/**
|
|
69
|
+
* Who bills the engine's calls beyond the model's tokens: `openrouter` (the `pricing` rows, from the caller's credits), `provider` (a per-call tool fee from the model's provider on the inference call, at its own rates), `byok` (the engine's vendor, against the caller's own key), or `none` (no charge)
|
|
70
|
+
*/
|
|
71
|
+
pricingSource: PricingSource;
|
|
72
|
+
};
|
|
73
|
+
/** @internal */
|
|
74
|
+
export declare const BYOK$inboundSchema: z.ZodType<BYOK, unknown>;
|
|
75
|
+
/** @internal */
|
|
76
|
+
export declare const ServerToolEngineDataRegion$inboundSchema: z.ZodType<ServerToolEngineDataRegion, unknown>;
|
|
77
|
+
/** @internal */
|
|
78
|
+
export declare const PricingSource$inboundSchema: z.ZodType<PricingSource, unknown>;
|
|
79
|
+
/** @internal */
|
|
80
|
+
export declare const ServerToolEngine$inboundSchema: z.ZodType<ServerToolEngine, unknown>;
|
|
81
|
+
export declare function serverToolEngineFromJSON(jsonString: string): SafeParseResult<ServerToolEngine, SDKValidationError>;
|
|
82
|
+
//# sourceMappingURL=servertoolengine.d.ts.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 0ee547bdca50
|
|
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 openEnums from "../types/enums.js";
|
|
9
|
+
import { ServerToolExecutedBy$inboundSchema, } from "./servertoolexecutedby.js";
|
|
10
|
+
import { ServerToolPrice$inboundSchema, } from "./servertoolprice.js";
|
|
11
|
+
/**
|
|
12
|
+
* Whether the engine needs the caller's own key, saved in plugin settings: `required` (OpenRouter holds none), `optional` (OpenRouter's key is used unless the caller saved one), or `none`
|
|
13
|
+
*/
|
|
14
|
+
export const BYOK = {
|
|
15
|
+
Required: "required",
|
|
16
|
+
Optional: "optional",
|
|
17
|
+
None: "none",
|
|
18
|
+
};
|
|
19
|
+
export const ServerToolEngineDataRegion = {
|
|
20
|
+
Global: "global",
|
|
21
|
+
Europe: "europe",
|
|
22
|
+
Us: "us",
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Who bills the engine's calls beyond the model's tokens: `openrouter` (the `pricing` rows, from the caller's credits), `provider` (a per-call tool fee from the model's provider on the inference call, at its own rates), `byok` (the engine's vendor, against the caller's own key), or `none` (no charge)
|
|
26
|
+
*/
|
|
27
|
+
export const PricingSource = {
|
|
28
|
+
Openrouter: "openrouter",
|
|
29
|
+
Provider: "provider",
|
|
30
|
+
BYOK: "byok",
|
|
31
|
+
None: "none",
|
|
32
|
+
};
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const BYOK$inboundSchema = openEnums
|
|
35
|
+
.inboundSchema(BYOK);
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const ServerToolEngineDataRegion$inboundSchema = openEnums.inboundSchema(ServerToolEngineDataRegion);
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const PricingSource$inboundSchema = openEnums.inboundSchema(PricingSource);
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const ServerToolEngine$inboundSchema = z.object({
|
|
42
|
+
byok: BYOK$inboundSchema,
|
|
43
|
+
data_regions: z.array(ServerToolEngineDataRegion$inboundSchema),
|
|
44
|
+
default_mode: z.nullable(z.string()),
|
|
45
|
+
executed_by: ServerToolExecutedBy$inboundSchema,
|
|
46
|
+
id: z.nullable(z.string()),
|
|
47
|
+
name: z.string(),
|
|
48
|
+
pricing: z.array(ServerToolPrice$inboundSchema),
|
|
49
|
+
pricing_doc_url: z.nullable(z.string()),
|
|
50
|
+
pricing_source: PricingSource$inboundSchema,
|
|
51
|
+
}).transform((v) => {
|
|
52
|
+
return remap$(v, {
|
|
53
|
+
"data_regions": "dataRegions",
|
|
54
|
+
"default_mode": "defaultMode",
|
|
55
|
+
"executed_by": "executedBy",
|
|
56
|
+
"pricing_doc_url": "pricingDocUrl",
|
|
57
|
+
"pricing_source": "pricingSource",
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
export function serverToolEngineFromJSON(jsonString) {
|
|
61
|
+
return safeParse(jsonString, (x) => ServerToolEngine$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ServerToolEngine' from JSON`);
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=servertoolengine.js.map
|