@openrouter/sdk 1.3.35 → 1.4.0
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/privateEndpointsActivate.d.ts +19 -0
- package/esm/funcs/privateEndpointsActivate.js +103 -0
- package/esm/funcs/privateEndpointsCreate.d.ts +19 -0
- package/esm/funcs/privateEndpointsCreate.js +101 -0
- package/esm/funcs/privateEndpointsDelete.d.ts +19 -0
- package/esm/funcs/privateEndpointsDelete.js +107 -0
- package/esm/funcs/privateEndpointsDisable.d.ts +19 -0
- package/esm/funcs/privateEndpointsDisable.js +103 -0
- package/esm/funcs/privateEndpointsEnable.d.ts +19 -0
- package/esm/funcs/privateEndpointsEnable.js +103 -0
- package/esm/funcs/privateEndpointsGet.d.ts +19 -0
- package/esm/funcs/privateEndpointsGet.js +103 -0
- package/esm/funcs/privateEndpointsList.d.ts +19 -0
- package/esm/funcs/privateEndpointsList.js +97 -0
- package/esm/funcs/privateEndpointsUpdate.d.ts +19 -0
- package/esm/funcs/privateEndpointsUpdate.js +106 -0
- package/esm/funcs/privateEndpointsUpdatePricing.d.ts +19 -0
- package/esm/funcs/privateEndpointsUpdatePricing.js +106 -0
- package/esm/funcs/privateEndpointsValidate.d.ts +19 -0
- package/esm/funcs/privateEndpointsValidate.js +106 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/anthropicwebfetchtoolresulterror.d.ts +1 -0
- package/esm/models/anthropicwebfetchtoolresulterror.js +1 -0
- package/esm/models/createprivateendpointrequest.d.ts +67 -0
- package/esm/models/createprivateendpointrequest.js +44 -0
- package/esm/models/createprivateendpointvalidationfailedresponseerror.d.ts +20 -0
- package/esm/models/createprivateendpointvalidationfailedresponseerror.js +27 -0
- package/esm/models/deleteprivateendpointresponse.d.ts +19 -0
- package/esm/models/deleteprivateendpointresponse.js +21 -0
- package/esm/models/errors/createprivateendpoint.d.ts +45 -0
- package/esm/models/errors/createprivateendpoint.js +53 -0
- package/esm/models/errors/createprivateendpointvalidationfailedresponseerror.d.ts +21 -0
- package/esm/models/errors/createprivateendpointvalidationfailedresponseerror.js +35 -0
- package/esm/models/errors/index.d.ts +2 -0
- package/esm/models/errors/index.js +2 -0
- package/esm/models/index.d.ts +21 -0
- package/esm/models/index.js +21 -0
- package/esm/models/listprivateendpointsresponse.d.ts +11 -0
- package/esm/models/listprivateendpointsresponse.js +15 -0
- package/esm/models/managedprivateendpoint.d.ts +47 -0
- package/esm/models/managedprivateendpoint.js +35 -0
- package/esm/models/managedprivateendpointresponse.d.ts +11 -0
- package/esm/models/managedprivateendpointresponse.js +15 -0
- package/esm/models/operations/activateprivateendpoint.d.ts +58 -0
- package/esm/models/operations/activateprivateendpoint.js +21 -0
- package/esm/models/operations/createprivateendpoint.d.ts +61 -0
- package/esm/models/operations/createprivateendpoint.js +25 -0
- package/esm/models/operations/deleteprivateendpoint.d.ts +77 -0
- package/esm/models/operations/deleteprivateendpoint.js +34 -0
- package/esm/models/operations/disableprivateendpoint.d.ts +58 -0
- package/esm/models/operations/disableprivateendpoint.js +21 -0
- package/esm/models/operations/enableprivateendpoint.d.ts +58 -0
- package/esm/models/operations/enableprivateendpoint.js +21 -0
- package/esm/models/operations/getprivateendpoint.d.ts +58 -0
- package/esm/models/operations/getprivateendpoint.js +21 -0
- package/esm/models/operations/index.d.ts +10 -0
- package/esm/models/operations/index.js +10 -0
- package/esm/models/operations/listprivateendpoints.d.ts +53 -0
- package/esm/models/operations/listprivateendpoints.js +20 -0
- package/esm/models/operations/updateprivateendpoint.d.ts +61 -0
- package/esm/models/operations/updateprivateendpoint.js +24 -0
- package/esm/models/operations/updateprivateendpointpricing.d.ts +61 -0
- package/esm/models/operations/updateprivateendpointpricing.js +24 -0
- package/esm/models/operations/validateprivateendpoint.d.ts +61 -0
- package/esm/models/operations/validateprivateendpoint.js +24 -0
- package/esm/models/privateendpoint.d.ts +60 -0
- package/esm/models/privateendpoint.js +41 -0
- package/esm/models/privateendpointactivation.d.ts +18 -0
- package/esm/models/privateendpointactivation.js +18 -0
- package/esm/models/privateendpointcheck.d.ts +31 -0
- package/esm/models/privateendpointcheck.js +27 -0
- package/esm/models/privateendpointcheckreason.d.ts +30 -0
- package/esm/models/privateendpointcheckreason.js +29 -0
- package/esm/models/privateendpointdeclaredregion.d.ts +17 -0
- package/esm/models/privateendpointdeclaredregion.js +16 -0
- package/esm/models/privateendpointpricing.d.ts +28 -0
- package/esm/models/privateendpointpricing.js +23 -0
- package/esm/models/privateendpointresponse.d.ts +11 -0
- package/esm/models/privateendpointresponse.js +15 -0
- package/esm/models/privateendpointstatus.d.ts +17 -0
- package/esm/models/privateendpointstatus.js +16 -0
- package/esm/models/privateendpointsummary.d.ts +38 -0
- package/esm/models/privateendpointsummary.js +30 -0
- package/esm/models/privateendpointvalidation.d.ts +15 -0
- package/esm/models/privateendpointvalidation.js +16 -0
- package/esm/models/privateendpointvalidationnullable.d.ts +15 -0
- package/esm/models/privateendpointvalidationnullable.js +16 -0
- package/esm/models/privateendpointvalidationresponse.d.ts +11 -0
- package/esm/models/privateendpointvalidationresponse.js +15 -0
- package/esm/models/updateprivateendpointpricingrequest.d.ts +16 -0
- package/esm/models/updateprivateendpointpricingrequest.js +14 -0
- package/esm/models/updateprivateendpointrequest.d.ts +45 -0
- package/esm/models/updateprivateendpointrequest.js +36 -0
- package/esm/models/validateprivateendpointrequest.d.ts +15 -0
- package/esm/models/validateprivateendpointrequest.js +18 -0
- package/esm/sdk/privateendpoints.d.ts +76 -0
- package/esm/sdk/privateendpoints.js +109 -0
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.js +4 -0
- package/jsr.json +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: ed31ec182fa7
|
|
4
|
+
*/
|
|
5
|
+
import { privateEndpointsActivate } from "../funcs/privateEndpointsActivate.js";
|
|
6
|
+
import { privateEndpointsCreate } from "../funcs/privateEndpointsCreate.js";
|
|
7
|
+
import { privateEndpointsDelete } from "../funcs/privateEndpointsDelete.js";
|
|
8
|
+
import { privateEndpointsDisable } from "../funcs/privateEndpointsDisable.js";
|
|
9
|
+
import { privateEndpointsEnable } from "../funcs/privateEndpointsEnable.js";
|
|
10
|
+
import { privateEndpointsGet } from "../funcs/privateEndpointsGet.js";
|
|
11
|
+
import { privateEndpointsList } from "../funcs/privateEndpointsList.js";
|
|
12
|
+
import { privateEndpointsUpdate } from "../funcs/privateEndpointsUpdate.js";
|
|
13
|
+
import { privateEndpointsUpdatePricing } from "../funcs/privateEndpointsUpdatePricing.js";
|
|
14
|
+
import { privateEndpointsValidate } from "../funcs/privateEndpointsValidate.js";
|
|
15
|
+
import { ClientSDK } from "../lib/sdks.js";
|
|
16
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
17
|
+
export class PrivateEndpoints extends ClientSDK {
|
|
18
|
+
/**
|
|
19
|
+
* List private endpoints
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* List the organization's private endpoints, including drafts. Requires the private endpoints entitlement. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
23
|
+
*/
|
|
24
|
+
async list(request, options) {
|
|
25
|
+
return unwrapAsync(privateEndpointsList(this, request, options));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Create a private endpoint
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Create a private endpoint as a draft. Drafts are not routable: validate one with `POST /private-endpoints/{id}/validate`, then activate it with `POST /private-endpoints/{id}/activate`. Pass `activate` to do all three in one call; if validation fails the draft is kept and returned with the failed checks. Send an `Idempotency-Key` header to make retries safe: a repeated key with the same request returns the endpoint the first request created; reusing it with different fields returns 422 `idempotency_key_reused`. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
32
|
+
*/
|
|
33
|
+
async create(request, options) {
|
|
34
|
+
return unwrapAsync(privateEndpointsCreate(this, request, options));
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Delete a private endpoint
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* Delete a private endpoint and stop routing to it. Pass `draft_only=true` to refuse (409) when the endpoint has been activated. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
41
|
+
*/
|
|
42
|
+
async delete(request, options) {
|
|
43
|
+
return unwrapAsync(privateEndpointsDelete(this, request, options));
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Get a private endpoint
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
* Get one private endpoint with its upstream configuration and current pricing. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
50
|
+
*/
|
|
51
|
+
async get(request, options) {
|
|
52
|
+
return unwrapAsync(privateEndpointsGet(this, request, options));
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Update a draft private endpoint
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* Replace a draft endpoint's upstream configuration: send `upstream_model_id`, and `base_url` to change it (an omitted `base_url` keeps the stored one). Omitted data-policy declarations are kept while the upstream is unchanged and cleared when it changes. Any change clears earlier validation. Active endpoints return 409; delete and re-create them instead. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
59
|
+
*/
|
|
60
|
+
async update(request, options) {
|
|
61
|
+
return unwrapAsync(privateEndpointsUpdate(this, request, options));
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Activate a validated private endpoint
|
|
65
|
+
*
|
|
66
|
+
* @remarks
|
|
67
|
+
* Make a validated draft routable. Returns 409 when the endpoint was never validated, the validation is stale, or it is already active. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
68
|
+
*/
|
|
69
|
+
async activate(request, options) {
|
|
70
|
+
return unwrapAsync(privateEndpointsActivate(this, request, options));
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Disable a private endpoint
|
|
74
|
+
*
|
|
75
|
+
* @remarks
|
|
76
|
+
* Stop routing to an active endpoint without deleting it. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
77
|
+
*/
|
|
78
|
+
async disable(request, options) {
|
|
79
|
+
return unwrapAsync(privateEndpointsDisable(this, request, options));
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Enable a private endpoint
|
|
83
|
+
*
|
|
84
|
+
* @remarks
|
|
85
|
+
* Resume routing to a disabled endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
86
|
+
*/
|
|
87
|
+
async enable(request, options) {
|
|
88
|
+
return unwrapAsync(privateEndpointsEnable(this, request, options));
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Set private endpoint pricing
|
|
92
|
+
*
|
|
93
|
+
* @remarks
|
|
94
|
+
* Set the negotiated per-token rates reported for requests routed to this endpoint. Applies to drafts and active endpoints; new rates take effect for subsequent requests. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
95
|
+
*/
|
|
96
|
+
async updatePricing(request, options) {
|
|
97
|
+
return unwrapAsync(privateEndpointsUpdatePricing(this, request, options));
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Validate a draft private endpoint
|
|
101
|
+
*
|
|
102
|
+
* @remarks
|
|
103
|
+
* Send a live test request to the draft endpoint using the given workspace's BYOK credential for its provider. A passing validation is required before activation. Failed checks return 200 with `passed: false`. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
104
|
+
*/
|
|
105
|
+
async validate(request, options) {
|
|
106
|
+
return unwrapAsync(privateEndpointsValidate(this, request, options));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=privateendpoints.js.map
|
package/esm/sdk/sdk.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ import { OAuth } from "./oauth.js";
|
|
|
23
23
|
import { Observability } from "./observability.js";
|
|
24
24
|
import { Organization } from "./organization.js";
|
|
25
25
|
import { Presets } from "./presets.js";
|
|
26
|
+
import { PrivateEndpoints } from "./privateendpoints.js";
|
|
26
27
|
import { Providers } from "./providers.js";
|
|
27
28
|
import { Rerank } from "./rerank.js";
|
|
28
29
|
import { Responses } from "./responses.js";
|
|
@@ -90,6 +91,8 @@ export declare class OpenRouter extends ClientSDK {
|
|
|
90
91
|
get organization(): Organization;
|
|
91
92
|
private _presets?;
|
|
92
93
|
get presets(): Presets;
|
|
94
|
+
private _privateEndpoints?;
|
|
95
|
+
get privateEndpoints(): PrivateEndpoints;
|
|
93
96
|
private _providers?;
|
|
94
97
|
get providers(): Providers;
|
|
95
98
|
private _rerank?;
|
package/esm/sdk/sdk.js
CHANGED
|
@@ -27,6 +27,7 @@ import { OAuth } from "./oauth.js";
|
|
|
27
27
|
import { Observability } from "./observability.js";
|
|
28
28
|
import { Organization } from "./organization.js";
|
|
29
29
|
import { Presets } from "./presets.js";
|
|
30
|
+
import { PrivateEndpoints } from "./privateendpoints.js";
|
|
30
31
|
import { Providers } from "./providers.js";
|
|
31
32
|
import { Rerank } from "./rerank.js";
|
|
32
33
|
import { Responses } from "./responses.js";
|
|
@@ -117,6 +118,9 @@ export class OpenRouter extends ClientSDK {
|
|
|
117
118
|
get presets() {
|
|
118
119
|
return (this._presets ?? (this._presets = new Presets(this._options)));
|
|
119
120
|
}
|
|
121
|
+
get privateEndpoints() {
|
|
122
|
+
return (this._privateEndpoints ?? (this._privateEndpoints = new PrivateEndpoints(this._options)));
|
|
123
|
+
}
|
|
120
124
|
get providers() {
|
|
121
125
|
return (this._providers ?? (this._providers = new Providers(this._options)));
|
|
122
126
|
}
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"author": "OpenRouter",
|
|
5
5
|
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.",
|
|
6
6
|
"keywords": [
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"prepare": "npm run build",
|
|
77
76
|
"typecheck": "tsc --noEmit",
|
|
78
77
|
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
79
78
|
"postinstall": "node scripts/check-types.js || true",
|
|
79
|
+
"prepare": "npm run build",
|
|
80
|
+
"test:watch": "vitest --watch --project unit",
|
|
81
|
+
"typecheck:transit": "exit 0",
|
|
80
82
|
"test": "vitest --run --project unit",
|
|
81
83
|
"test:e2e": "vitest --run --project e2e",
|
|
82
|
-
"test:transit": "exit 0"
|
|
83
|
-
"test:watch": "vitest --watch --project unit",
|
|
84
|
-
"typecheck:transit": "exit 0"
|
|
84
|
+
"test:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
|