@openrouter/sdk 1.5.60 → 1.5.62
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/.devcontainer/devcontainer.json +1 -1
- package/esm/funcs/privateEndpointsUpdate.d.ts +1 -1
- package/esm/funcs/privateEndpointsUpdate.js +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/deferredtoolscontrol.d.ts +36 -0
- package/esm/models/deferredtoolscontrol.js +21 -0
- package/esm/models/updateprivateendpointrequest.d.ts +1 -1
- package/esm/sdk/privateendpoints.d.ts +1 -1
- package/esm/sdk/privateendpoints.js +1 -1
- package/jsr.json +1 -1
- package/package.json +6 -6
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// README at: https://github.com/devcontainers/images/tree/main/src/typescript-node
|
|
3
3
|
{
|
|
4
4
|
"name": "TypeScript",
|
|
5
|
-
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-
|
|
5
|
+
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-24-bookworm",
|
|
6
6
|
// Features to add to the dev container. More info: https://containers.dev/features.
|
|
7
7
|
// "features": {},
|
|
8
8
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
|
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
|
|
|
13
13
|
* Update a private endpoint
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
|
-
* Change any of the endpoint fields you own in one call; only the fields present change, and the response is the whole endpoint. `pricing` and `declared_parameters` replace their stored value, `settings` changes only the fields it names (`null` clears a limit or restores the provider default); routing picks these up for subsequent requests on drafts and active endpoints alike. `
|
|
16
|
+
* Change any of the endpoint fields you own in one call; only the fields present change, and the response is the whole endpoint. `pricing` and `declared_parameters` replace their stored value, `settings` changes only the fields it names (`null` clears a limit or restores the provider default); routing picks these up for subsequent requests on drafts and active endpoints alike. `declared_zdr` and `declared_region` change on drafts and active endpoints alike; on an active endpoint the change keeps its validation and tested parameters, and routing applies it to subsequent requests. `upstream_model_id` and `base_url` re-point a draft: an omitted `upstream_model_id` or `base_url` keeps the stored one, omitted data-policy declarations are kept while the upstream is unchanged and cleared when it changes, and any change to the upstream or declarations of a draft clears earlier validation. Naming `upstream_model_id` or `base_url` on an active endpoint returns 409 `already_active` and writes nothing, even alongside other fields; delete and re-create instead. Every group is checked before anything is written: 400 `parameters_invalid` when `tool_choice` is declared without `tools` tested or declared, 400 `settings_invalid` when `max_prompt_tokens` exceeds the context length, both completion APIs are off, or `excluded_parameters` names a tested parameter, 422 `pricing_invalid` for rates the provider strategy cannot represent. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
17
17
|
*/
|
|
18
18
|
export declare function privateEndpointsUpdate(client: OpenRouterCore, request: operations.UpdatePrivateEndpointRequest, options?: RequestOptions): APIPromise<Result<models.PrivateEndpointResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.RequestTimeoutResponseError | errors.ConflictResponseError | errors.UnprocessableEntityResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
19
19
|
//# sourceMappingURL=privateEndpointsUpdate.d.ts.map
|
|
@@ -17,7 +17,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
17
17
|
* Update a private endpoint
|
|
18
18
|
*
|
|
19
19
|
* @remarks
|
|
20
|
-
* Change any of the endpoint fields you own in one call; only the fields present change, and the response is the whole endpoint. `pricing` and `declared_parameters` replace their stored value, `settings` changes only the fields it names (`null` clears a limit or restores the provider default); routing picks these up for subsequent requests on drafts and active endpoints alike. `
|
|
20
|
+
* Change any of the endpoint fields you own in one call; only the fields present change, and the response is the whole endpoint. `pricing` and `declared_parameters` replace their stored value, `settings` changes only the fields it names (`null` clears a limit or restores the provider default); routing picks these up for subsequent requests on drafts and active endpoints alike. `declared_zdr` and `declared_region` change on drafts and active endpoints alike; on an active endpoint the change keeps its validation and tested parameters, and routing applies it to subsequent requests. `upstream_model_id` and `base_url` re-point a draft: an omitted `upstream_model_id` or `base_url` keeps the stored one, omitted data-policy declarations are kept while the upstream is unchanged and cleared when it changes, and any change to the upstream or declarations of a draft clears earlier validation. Naming `upstream_model_id` or `base_url` on an active endpoint returns 409 `already_active` and writes nothing, even alongside other fields; delete and re-create instead. Every group is checked before anything is written: 400 `parameters_invalid` when `tool_choice` is declared without `tools` tested or declared, 400 `settings_invalid` when `max_prompt_tokens` exceeds the context length, both completion APIs are off, or `excluded_parameters` names a tested parameter, 422 `pricing_invalid` for rates the provider strategy cannot represent. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
21
21
|
*/
|
|
22
22
|
export function privateEndpointsUpdate(client, request, options) {
|
|
23
23
|
return new APIPromise($do(client, request, options));
|
package/esm/lib/config.d.ts
CHANGED
|
@@ -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.5.
|
|
53
|
+
readonly sdkVersion: "1.5.62";
|
|
54
54
|
readonly genVersion: "2.950.13";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.5.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.5.62 2.950.13 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.5.
|
|
32
|
+
sdkVersion: "1.5.62",
|
|
33
33
|
genVersion: "2.950.13",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.5.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.5.62 2.950.13 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { DeferredToolsSearchStrategy, DeferredToolsSearchStrategy$Outbound } from "./deferredtoolssearchstrategy.js";
|
|
4
|
+
/**
|
|
5
|
+
* How the universal profile exposes the hidden catalog to the provider. Absent or `wrappers`: the `tool_search` and `tool_exec` tools. `code_mode`: one `tool_code` tool that runs a short JavaScript program in which `search()` and `call()` reach the catalog, so several searches and calls complete in one tool result. Experimental.
|
|
6
|
+
*/
|
|
7
|
+
export declare const Interface: {
|
|
8
|
+
readonly Wrappers: "wrappers";
|
|
9
|
+
readonly CodeMode: "code_mode";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* How the universal profile exposes the hidden catalog to the provider. Absent or `wrappers`: the `tool_search` and `tool_exec` tools. `code_mode`: one `tool_code` tool that runs a short JavaScript program in which `search()` and `call()` reach the catalog, so several searches and calls complete in one tool result. Experimental.
|
|
13
|
+
*/
|
|
14
|
+
export type Interface = OpenEnum<typeof Interface>;
|
|
4
15
|
/**
|
|
5
16
|
* Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes, and rebuilds the catalog from each request so tools can be added or removed mid-conversation.
|
|
6
17
|
*/
|
|
@@ -16,6 +27,17 @@ export declare const Protocol: {
|
|
|
16
27
|
readonly V1: "v1";
|
|
17
28
|
};
|
|
18
29
|
export type Protocol = ClosedEnum<typeof Protocol>;
|
|
30
|
+
/**
|
|
31
|
+
* Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. Experimental.
|
|
32
|
+
*/
|
|
33
|
+
export declare const DeferredToolsControlScope: {
|
|
34
|
+
readonly All: "all";
|
|
35
|
+
readonly Mcp: "mcp";
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. Experimental.
|
|
39
|
+
*/
|
|
40
|
+
export type DeferredToolsControlScope = OpenEnum<typeof DeferredToolsControlScope>;
|
|
19
41
|
/**
|
|
20
42
|
* Where tool-call arguments are checked against the original schema. Only `runtime` (in OpenRouter) is available in this release.
|
|
21
43
|
*/
|
|
@@ -30,11 +52,19 @@ export type Validation = ClosedEnum<typeof Validation>;
|
|
|
30
52
|
* Opt-in versioned router-level deferred-tool protocol. Replay assistant reasoning unchanged on continuation; keep the catalog unchanged.
|
|
31
53
|
*/
|
|
32
54
|
export type DeferredToolsControl = {
|
|
55
|
+
/**
|
|
56
|
+
* How the universal profile exposes the hidden catalog to the provider. Absent or `wrappers`: the `tool_search` and `tool_exec` tools. `code_mode`: one `tool_code` tool that runs a short JavaScript program in which `search()` and `call()` reach the catalog, so several searches and calls complete in one tool result. Experimental.
|
|
57
|
+
*/
|
|
58
|
+
interface?: Interface | undefined;
|
|
33
59
|
/**
|
|
34
60
|
* Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes, and rebuilds the catalog from each request so tools can be added or removed mid-conversation.
|
|
35
61
|
*/
|
|
36
62
|
profile: Profile;
|
|
37
63
|
protocol: Protocol;
|
|
64
|
+
/**
|
|
65
|
+
* Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. Experimental.
|
|
66
|
+
*/
|
|
67
|
+
scope?: DeferredToolsControlScope | undefined;
|
|
38
68
|
/**
|
|
39
69
|
* Router-local regex/BM25 or caller-owned custom search.
|
|
40
70
|
*/
|
|
@@ -45,15 +75,21 @@ export type DeferredToolsControl = {
|
|
|
45
75
|
validation: Validation;
|
|
46
76
|
};
|
|
47
77
|
/** @internal */
|
|
78
|
+
export declare const Interface$outboundSchema: z.ZodType<string, Interface>;
|
|
79
|
+
/** @internal */
|
|
48
80
|
export declare const Profile$outboundSchema: z.ZodType<string, Profile>;
|
|
49
81
|
/** @internal */
|
|
50
82
|
export declare const Protocol$outboundSchema: z.ZodEnum<typeof Protocol>;
|
|
51
83
|
/** @internal */
|
|
84
|
+
export declare const DeferredToolsControlScope$outboundSchema: z.ZodType<string, DeferredToolsControlScope>;
|
|
85
|
+
/** @internal */
|
|
52
86
|
export declare const Validation$outboundSchema: z.ZodEnum<typeof Validation>;
|
|
53
87
|
/** @internal */
|
|
54
88
|
export type DeferredToolsControl$Outbound = {
|
|
89
|
+
interface?: string | undefined;
|
|
55
90
|
profile: string;
|
|
56
91
|
protocol: string;
|
|
92
|
+
scope?: string | undefined;
|
|
57
93
|
search: DeferredToolsSearchStrategy$Outbound;
|
|
58
94
|
validation: string;
|
|
59
95
|
};
|
|
@@ -5,6 +5,13 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import * as openEnums from "../types/enums.js";
|
|
7
7
|
import { DeferredToolsSearchStrategy$outboundSchema, } from "./deferredtoolssearchstrategy.js";
|
|
8
|
+
/**
|
|
9
|
+
* How the universal profile exposes the hidden catalog to the provider. Absent or `wrappers`: the `tool_search` and `tool_exec` tools. `code_mode`: one `tool_code` tool that runs a short JavaScript program in which `search()` and `call()` reach the catalog, so several searches and calls complete in one tool result. Experimental.
|
|
10
|
+
*/
|
|
11
|
+
export const Interface = {
|
|
12
|
+
Wrappers: "wrappers",
|
|
13
|
+
CodeMode: "code_mode",
|
|
14
|
+
};
|
|
8
15
|
/**
|
|
9
16
|
* Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes, and rebuilds the catalog from each request so tools can be added or removed mid-conversation.
|
|
10
17
|
*/
|
|
@@ -15,6 +22,13 @@ export const Profile = {
|
|
|
15
22
|
export const Protocol = {
|
|
16
23
|
V1: "v1",
|
|
17
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. Experimental.
|
|
27
|
+
*/
|
|
28
|
+
export const DeferredToolsControlScope = {
|
|
29
|
+
All: "all",
|
|
30
|
+
Mcp: "mcp",
|
|
31
|
+
};
|
|
18
32
|
/**
|
|
19
33
|
* Where tool-call arguments are checked against the original schema. Only `runtime` (in OpenRouter) is available in this release.
|
|
20
34
|
*/
|
|
@@ -22,16 +36,23 @@ export const Validation = {
|
|
|
22
36
|
Runtime: "runtime",
|
|
23
37
|
};
|
|
24
38
|
/** @internal */
|
|
39
|
+
export const Interface$outboundSchema = openEnums
|
|
40
|
+
.outboundSchema(Interface);
|
|
41
|
+
/** @internal */
|
|
25
42
|
export const Profile$outboundSchema = openEnums
|
|
26
43
|
.outboundSchema(Profile);
|
|
27
44
|
/** @internal */
|
|
28
45
|
export const Protocol$outboundSchema = z.enum(Protocol);
|
|
29
46
|
/** @internal */
|
|
47
|
+
export const DeferredToolsControlScope$outboundSchema = openEnums.outboundSchema(DeferredToolsControlScope);
|
|
48
|
+
/** @internal */
|
|
30
49
|
export const Validation$outboundSchema = z.enum(Validation);
|
|
31
50
|
/** @internal */
|
|
32
51
|
export const DeferredToolsControl$outboundSchema = z.object({
|
|
52
|
+
interface: Interface$outboundSchema.optional(),
|
|
33
53
|
profile: Profile$outboundSchema,
|
|
34
54
|
protocol: Protocol$outboundSchema,
|
|
55
|
+
scope: DeferredToolsControlScope$outboundSchema.optional(),
|
|
35
56
|
search: DeferredToolsSearchStrategy$outboundSchema,
|
|
36
57
|
validation: Validation$outboundSchema,
|
|
37
58
|
});
|
|
@@ -16,7 +16,7 @@ export declare const UpdatePrivateEndpointRequestDeclaredRegion: {
|
|
|
16
16
|
*/
|
|
17
17
|
export type UpdatePrivateEndpointRequestDeclaredRegion = OpenEnum<typeof UpdatePrivateEndpointRequestDeclaredRegion>;
|
|
18
18
|
/**
|
|
19
|
-
* Only the fields present change. `base_url
|
|
19
|
+
* Only the fields present change. `base_url` and `upstream_model_id` are accepted on a draft only; `declared_zdr` and `declared_region` on drafts and active endpoints; `pricing` and `declared_parameters` replace their value; `settings` is itself a partial update where `null` clears a limit or restores the provider default.
|
|
20
20
|
*/
|
|
21
21
|
export type UpdatePrivateEndpointRequest = {
|
|
22
22
|
/**
|
|
@@ -34,7 +34,7 @@ export declare class PrivateEndpoints extends ClientSDK {
|
|
|
34
34
|
* Update a private endpoint
|
|
35
35
|
*
|
|
36
36
|
* @remarks
|
|
37
|
-
* Change any of the endpoint fields you own in one call; only the fields present change, and the response is the whole endpoint. `pricing` and `declared_parameters` replace their stored value, `settings` changes only the fields it names (`null` clears a limit or restores the provider default); routing picks these up for subsequent requests on drafts and active endpoints alike. `
|
|
37
|
+
* Change any of the endpoint fields you own in one call; only the fields present change, and the response is the whole endpoint. `pricing` and `declared_parameters` replace their stored value, `settings` changes only the fields it names (`null` clears a limit or restores the provider default); routing picks these up for subsequent requests on drafts and active endpoints alike. `declared_zdr` and `declared_region` change on drafts and active endpoints alike; on an active endpoint the change keeps its validation and tested parameters, and routing applies it to subsequent requests. `upstream_model_id` and `base_url` re-point a draft: an omitted `upstream_model_id` or `base_url` keeps the stored one, omitted data-policy declarations are kept while the upstream is unchanged and cleared when it changes, and any change to the upstream or declarations of a draft clears earlier validation. Naming `upstream_model_id` or `base_url` on an active endpoint returns 409 `already_active` and writes nothing, even alongside other fields; delete and re-create instead. Every group is checked before anything is written: 400 `parameters_invalid` when `tool_choice` is declared without `tools` tested or declared, 400 `settings_invalid` when `max_prompt_tokens` exceeds the context length, both completion APIs are off, or `excluded_parameters` names a tested parameter, 422 `pricing_invalid` for rates the provider strategy cannot represent. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
38
38
|
*/
|
|
39
39
|
update(request: operations.UpdatePrivateEndpointRequest, options?: RequestOptions): Promise<models.PrivateEndpointResponse>;
|
|
40
40
|
/**
|
|
@@ -54,7 +54,7 @@ export class PrivateEndpoints extends ClientSDK {
|
|
|
54
54
|
* Update a private endpoint
|
|
55
55
|
*
|
|
56
56
|
* @remarks
|
|
57
|
-
* Change any of the endpoint fields you own in one call; only the fields present change, and the response is the whole endpoint. `pricing` and `declared_parameters` replace their stored value, `settings` changes only the fields it names (`null` clears a limit or restores the provider default); routing picks these up for subsequent requests on drafts and active endpoints alike. `
|
|
57
|
+
* Change any of the endpoint fields you own in one call; only the fields present change, and the response is the whole endpoint. `pricing` and `declared_parameters` replace their stored value, `settings` changes only the fields it names (`null` clears a limit or restores the provider default); routing picks these up for subsequent requests on drafts and active endpoints alike. `declared_zdr` and `declared_region` change on drafts and active endpoints alike; on an active endpoint the change keeps its validation and tested parameters, and routing applies it to subsequent requests. `upstream_model_id` and `base_url` re-point a draft: an omitted `upstream_model_id` or `base_url` keeps the stored one, omitted data-policy declarations are kept while the upstream is unchanged and cleared when it changes, and any change to the upstream or declarations of a draft clears earlier validation. Naming `upstream_model_id` or `base_url` on an active endpoint returns 409 `already_active` and writes nothing, even alongside other fields; delete and re-create instead. Every group is checked before anything is written: 400 `parameters_invalid` when `tool_choice` is declared without `tools` tested or declared, 400 `settings_invalid` when `max_prompt_tokens` exceeds the context length, both completion APIs are off, or `excluded_parameters` names a tested parameter, 422 `pricing_invalid` for rates the provider strategy cannot represent. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
58
58
|
*/
|
|
59
59
|
async update(request, options) {
|
|
60
60
|
return unwrapAsync(privateEndpointsUpdate(this, request, options));
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.62",
|
|
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
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"access": "public",
|
|
25
|
+
"provenance": true
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"main": "./esm/index.js",
|
|
@@ -73,14 +73,14 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
77
76
|
"postinstall": "node scripts/check-types.js || true",
|
|
77
|
+
"prepare": "npm run build",
|
|
78
78
|
"test": "vitest --run --project unit",
|
|
79
|
-
"test:e2e": "vitest --run --project e2e",
|
|
80
79
|
"test:transit": "exit 0",
|
|
80
|
+
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
81
|
+
"test:e2e": "vitest --run --project e2e",
|
|
81
82
|
"test:watch": "vitest --watch --project unit",
|
|
82
83
|
"typecheck": "tsc --noEmit",
|
|
83
|
-
"prepare": "npm run build",
|
|
84
84
|
"typecheck:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|