@openrouter/sdk 1.5.11 → 1.5.13
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/privateEndpointsUpdateParameters.d.ts +19 -0
- package/esm/funcs/privateEndpointsUpdateParameters.js +104 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/createprivateendpointrequest.d.ts +11 -0
- package/esm/models/createprivateendpointrequest.js +6 -0
- package/esm/models/decisionsimageasset.d.ts +34 -0
- package/esm/models/decisionsimageasset.js +33 -0
- package/esm/models/decisionsrequest.d.ts +10 -0
- package/esm/models/decisionsrequest.js +2 -0
- package/esm/models/index.d.ts +4 -0
- package/esm/models/index.js +4 -0
- package/esm/models/inputaudio.d.ts +5 -5
- package/esm/models/inputaudio.js +5 -5
- package/esm/models/managedprivateendpoint.d.ts +4 -0
- package/esm/models/managedprivateendpoint.js +2 -0
- package/esm/models/operations/createprivateendpoint.d.ts +1 -1
- package/esm/models/operations/index.d.ts +1 -0
- package/esm/models/operations/index.js +1 -0
- package/esm/models/operations/updateprivateendpointparameters.d.ts +61 -0
- package/esm/models/operations/updateprivateendpointparameters.js +24 -0
- package/esm/models/privateendpoint.d.ts +12 -0
- package/esm/models/privateendpoint.js +6 -0
- package/esm/models/privateendpointdeclaredparameter.d.ts +39 -0
- package/esm/models/privateendpointdeclaredparameter.js +38 -0
- package/esm/models/privateendpointparametercheck.d.ts +11 -0
- package/esm/models/privateendpointparametercheck.js +15 -0
- package/esm/models/privateendpointvalidation.d.ts +5 -0
- package/esm/models/privateendpointvalidation.js +2 -0
- package/esm/models/privateendpointvalidationnullable.d.ts +5 -0
- package/esm/models/privateendpointvalidationnullable.js +2 -0
- package/esm/models/updateprivateendpointparametersrequest.d.ts +16 -0
- package/esm/models/updateprivateendpointparametersrequest.js +19 -0
- package/esm/sdk/privateendpoints.d.ts +7 -0
- package/esm/sdk/privateendpoints.js +10 -0
- package/jsr.json +1 -1
- package/package.json +7 -7
|
@@ -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
|
+
* Set private endpoint supported parameters
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* Declare which request parameters the upstream supports beyond the ones validation proved. Applies to drafts and active endpoints; routing picks the change up for subsequent requests. The body replaces the earlier declaration and is read as a set: order and repeated names do not matter, but the list holds at most as many entries as there are declarable parameters, repeats included. `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
17
|
+
*/
|
|
18
|
+
export declare function privateEndpointsUpdateParameters(client: OpenRouterCore, request: operations.UpdatePrivateEndpointParametersRequest, 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
|
+
//# sourceMappingURL=privateEndpointsUpdateParameters.d.ts.map
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: a541ac958e3d
|
|
4
|
+
*/
|
|
5
|
+
import { encodeJSON, 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 { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import { BadGatewayResponseError$inboundSchema as errors_BadGatewayResponseError$inboundSchema } from "../models/errors/badgatewayresponseerror.js"; import { BadRequestResponseError$inboundSchema as errors_BadRequestResponseError$inboundSchema } from "../models/errors/badrequestresponseerror.js"; import { ConflictResponseError$inboundSchema as errors_ConflictResponseError$inboundSchema } from "../models/errors/conflictresponseerror.js"; 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 { RequestTimeoutResponseError$inboundSchema as errors_RequestTimeoutResponseError$inboundSchema } from "../models/errors/requesttimeoutresponseerror.js"; import { UnauthorizedResponseError$inboundSchema as errors_UnauthorizedResponseError$inboundSchema } from "../models/errors/unauthorizedresponseerror.js"; import { UnprocessableEntityResponseError$inboundSchema as errors_UnprocessableEntityResponseError$inboundSchema } from "../models/errors/unprocessableentityresponseerror.js";
|
|
13
|
+
import { PrivateEndpointResponse$inboundSchema as models_PrivateEndpointResponse$inboundSchema } from "../models/privateendpointresponse.js";
|
|
14
|
+
import { UpdatePrivateEndpointParametersRequest$outboundSchema as operations_UpdatePrivateEndpointParametersRequest$outboundSchema } from "../models/operations/updateprivateendpointparameters.js";
|
|
15
|
+
import { APIPromise } from "../types/async.js";
|
|
16
|
+
/**
|
|
17
|
+
* Set private endpoint supported parameters
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Declare which request parameters the upstream supports beyond the ones validation proved. Applies to drafts and active endpoints; routing picks the change up for subsequent requests. The body replaces the earlier declaration and is read as a set: order and repeated names do not matter, but the list holds at most as many entries as there are declarable parameters, repeats included. `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
21
|
+
*/
|
|
22
|
+
export function privateEndpointsUpdateParameters(client, request, options) {
|
|
23
|
+
return new APIPromise($do(client, request, options));
|
|
24
|
+
}
|
|
25
|
+
async function $do(client, request, options) {
|
|
26
|
+
const parsed = safeParse(request, (value) => operations_UpdatePrivateEndpointParametersRequest$outboundSchema.parse(value), "Input validation failed");
|
|
27
|
+
if (!parsed.ok) {
|
|
28
|
+
return [parsed, { status: "invalid" }];
|
|
29
|
+
}
|
|
30
|
+
const payload = parsed.value;
|
|
31
|
+
const body = encodeJSON("body", payload.UpdatePrivateEndpointParametersRequest, { explode: true });
|
|
32
|
+
const pathParams = {
|
|
33
|
+
id: encodeSimple("id", payload.id, {
|
|
34
|
+
explode: false,
|
|
35
|
+
charEncoding: "percent",
|
|
36
|
+
}),
|
|
37
|
+
};
|
|
38
|
+
const path = pathToFunc("/private-endpoints/{id}/parameters")(pathParams);
|
|
39
|
+
const headers = new Headers(compactMap({
|
|
40
|
+
"Content-Type": "application/json",
|
|
41
|
+
Accept: "application/json",
|
|
42
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
43
|
+
"X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
|
|
44
|
+
"X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
|
|
45
|
+
}));
|
|
46
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
47
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
48
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
49
|
+
const context = {
|
|
50
|
+
options: client._options,
|
|
51
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
52
|
+
operationID: "updatePrivateEndpointParameters",
|
|
53
|
+
oAuth2Scopes: null,
|
|
54
|
+
resolvedSecurity: requestSecurity,
|
|
55
|
+
securitySource: client._options.apiKey,
|
|
56
|
+
retryConfig: options?.retries
|
|
57
|
+
|| client._options.retryConfig
|
|
58
|
+
|| {
|
|
59
|
+
strategy: "backoff",
|
|
60
|
+
backoff: {
|
|
61
|
+
initialInterval: 500,
|
|
62
|
+
maxInterval: 60000,
|
|
63
|
+
exponent: 1.5,
|
|
64
|
+
maxElapsedTime: 3600000,
|
|
65
|
+
},
|
|
66
|
+
retryConnectionErrors: true,
|
|
67
|
+
}
|
|
68
|
+
|| { strategy: "none" },
|
|
69
|
+
retryCodes: options?.retryCodes || ["5XX"],
|
|
70
|
+
};
|
|
71
|
+
const requestRes = client._createRequest(context, {
|
|
72
|
+
security: requestSecurity,
|
|
73
|
+
method: "PUT",
|
|
74
|
+
baseURL: options?.serverURL,
|
|
75
|
+
path: path,
|
|
76
|
+
headers: headers,
|
|
77
|
+
body: body,
|
|
78
|
+
userAgent: client._options.userAgent,
|
|
79
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
80
|
+
}, options);
|
|
81
|
+
if (!requestRes.ok) {
|
|
82
|
+
return [requestRes, { status: "invalid" }];
|
|
83
|
+
}
|
|
84
|
+
const req = requestRes.value;
|
|
85
|
+
const doResult = await client._do(req, {
|
|
86
|
+
context,
|
|
87
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
88
|
+
retryConfig: context.retryConfig,
|
|
89
|
+
retryCodes: context.retryCodes,
|
|
90
|
+
});
|
|
91
|
+
if (!doResult.ok) {
|
|
92
|
+
return [doResult, { status: "request-error", request: req }];
|
|
93
|
+
}
|
|
94
|
+
const response = doResult.value;
|
|
95
|
+
const responseFields = {
|
|
96
|
+
HttpMeta: { Response: response, Request: req },
|
|
97
|
+
};
|
|
98
|
+
const [result] = await M.match(M.json(200, models_PrivateEndpointResponse$inboundSchema), M.jsonErr(400, errors_BadRequestResponseError$inboundSchema), M.jsonErr(401, errors_UnauthorizedResponseError$inboundSchema), M.jsonErr(403, errors_ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors_NotFoundResponseError$inboundSchema), M.jsonErr(408, errors_RequestTimeoutResponseError$inboundSchema), M.jsonErr(409, errors_ConflictResponseError$inboundSchema), M.jsonErr(422, errors_UnprocessableEntityResponseError$inboundSchema), M.jsonErr(500, errors_InternalServerResponseError$inboundSchema), M.jsonErr(502, errors_BadGatewayResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
99
|
+
if (!result.ok) {
|
|
100
|
+
return [result, { status: "complete", request: req, response }];
|
|
101
|
+
}
|
|
102
|
+
return [result, { status: "complete", request: req, response }];
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=privateEndpointsUpdateParameters.js.map
|
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.13";
|
|
54
54
|
readonly genVersion: "2.948.4";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.5.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.5.13 2.948.4 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.13",
|
|
33
33
|
genVersion: "2.948.4",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.5.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.5.13 2.948.4 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { PrivateEndpointActivation, PrivateEndpointActivation$Outbound } from "./privateendpointactivation.js";
|
|
4
|
+
import { PrivateEndpointDeclaredParameter } from "./privateendpointdeclaredparameter.js";
|
|
4
5
|
import { PrivateEndpointPricing, PrivateEndpointPricing$Outbound } from "./privateendpointpricing.js";
|
|
5
6
|
/**
|
|
6
7
|
* Attest where this deployment processes data.
|
|
@@ -23,6 +24,10 @@ export type CreatePrivateEndpointRequest = {
|
|
|
23
24
|
* HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex).
|
|
24
25
|
*/
|
|
25
26
|
baseUrl?: string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared.
|
|
29
|
+
*/
|
|
30
|
+
declaredParameters?: Array<PrivateEndpointDeclaredParameter> | undefined;
|
|
26
31
|
/**
|
|
27
32
|
* Attest where this deployment processes data.
|
|
28
33
|
*/
|
|
@@ -31,6 +36,10 @@ export type CreatePrivateEndpointRequest = {
|
|
|
31
36
|
* Attest that this deployment retains no prompt or completion data.
|
|
32
37
|
*/
|
|
33
38
|
declaredZdr?: boolean | null | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one.
|
|
41
|
+
*/
|
|
42
|
+
maxCompletionTokens?: number | undefined;
|
|
34
43
|
/**
|
|
35
44
|
* Permanent slug of the model this endpoint serves.
|
|
36
45
|
*/
|
|
@@ -54,8 +63,10 @@ export declare const CreatePrivateEndpointRequestDeclaredRegion$outboundSchema:
|
|
|
54
63
|
export type CreatePrivateEndpointRequest$Outbound = {
|
|
55
64
|
activate?: PrivateEndpointActivation$Outbound | undefined;
|
|
56
65
|
base_url?: string | undefined;
|
|
66
|
+
declared_parameters?: Array<string> | undefined;
|
|
57
67
|
declared_region?: string | null | undefined;
|
|
58
68
|
declared_zdr?: boolean | null | undefined;
|
|
69
|
+
max_completion_tokens?: number | undefined;
|
|
59
70
|
model_permaslug: string;
|
|
60
71
|
pricing?: PrivateEndpointPricing$Outbound | undefined;
|
|
61
72
|
provider_slug: string;
|
|
@@ -6,6 +6,7 @@ import * as z from "zod/v4";
|
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import * as openEnums from "../types/enums.js";
|
|
8
8
|
import { PrivateEndpointActivation$outboundSchema, } from "./privateendpointactivation.js";
|
|
9
|
+
import { PrivateEndpointDeclaredParameter$outboundSchema, } from "./privateendpointdeclaredparameter.js";
|
|
9
10
|
import { PrivateEndpointPricing$outboundSchema, } from "./privateendpointpricing.js";
|
|
10
11
|
/**
|
|
11
12
|
* Attest where this deployment processes data.
|
|
@@ -22,8 +23,11 @@ export const CreatePrivateEndpointRequestDeclaredRegion$outboundSchema = openEnu
|
|
|
22
23
|
export const CreatePrivateEndpointRequest$outboundSchema = z.object({
|
|
23
24
|
activate: PrivateEndpointActivation$outboundSchema.optional(),
|
|
24
25
|
baseUrl: z.string().optional(),
|
|
26
|
+
declaredParameters: z.array(PrivateEndpointDeclaredParameter$outboundSchema)
|
|
27
|
+
.optional(),
|
|
25
28
|
declaredRegion: z.nullable(CreatePrivateEndpointRequestDeclaredRegion$outboundSchema).optional(),
|
|
26
29
|
declaredZdr: z.nullable(z.boolean()).optional(),
|
|
30
|
+
maxCompletionTokens: z.int().optional(),
|
|
27
31
|
modelPermaslug: z.string(),
|
|
28
32
|
pricing: PrivateEndpointPricing$outboundSchema.optional(),
|
|
29
33
|
providerSlug: z.string(),
|
|
@@ -31,8 +35,10 @@ export const CreatePrivateEndpointRequest$outboundSchema = z.object({
|
|
|
31
35
|
}).transform((v) => {
|
|
32
36
|
return remap$(v, {
|
|
33
37
|
baseUrl: "base_url",
|
|
38
|
+
declaredParameters: "declared_parameters",
|
|
34
39
|
declaredRegion: "declared_region",
|
|
35
40
|
declaredZdr: "declared_zdr",
|
|
41
|
+
maxCompletionTokens: "max_completion_tokens",
|
|
36
42
|
modelPermaslug: "model_permaslug",
|
|
37
43
|
providerSlug: "provider_slug",
|
|
38
44
|
upstreamModelId: "upstream_model_id",
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
3
|
+
export declare const DecisionsImageAssetFormat: {
|
|
4
|
+
readonly Png: "png";
|
|
5
|
+
readonly Jpg: "jpg";
|
|
6
|
+
readonly Jpeg: "jpeg";
|
|
7
|
+
};
|
|
8
|
+
export type DecisionsImageAssetFormat = OpenEnum<typeof DecisionsImageAssetFormat>;
|
|
9
|
+
export declare const DecisionsImageAssetType: {
|
|
10
|
+
readonly Image: "image";
|
|
11
|
+
};
|
|
12
|
+
export type DecisionsImageAssetType = ClosedEnum<typeof DecisionsImageAssetType>;
|
|
13
|
+
/**
|
|
14
|
+
* An image sent once and referenced by its key in the `assets` map. `data_base64` is the PNG or JPEG file in standard base64 with no `data:` prefix. The multipart `part` field of TypeSafe's API is not accepted.
|
|
15
|
+
*/
|
|
16
|
+
export type DecisionsImageAsset = {
|
|
17
|
+
dataBase64: string;
|
|
18
|
+
format: DecisionsImageAssetFormat;
|
|
19
|
+
type?: DecisionsImageAssetType | undefined;
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const DecisionsImageAssetFormat$outboundSchema: z.ZodType<string, DecisionsImageAssetFormat>;
|
|
23
|
+
/** @internal */
|
|
24
|
+
export declare const DecisionsImageAssetType$outboundSchema: z.ZodEnum<typeof DecisionsImageAssetType>;
|
|
25
|
+
/** @internal */
|
|
26
|
+
export type DecisionsImageAsset$Outbound = {
|
|
27
|
+
data_base64: string;
|
|
28
|
+
format: string;
|
|
29
|
+
type?: string | undefined;
|
|
30
|
+
};
|
|
31
|
+
/** @internal */
|
|
32
|
+
export declare const DecisionsImageAsset$outboundSchema: z.ZodType<DecisionsImageAsset$Outbound, DecisionsImageAsset>;
|
|
33
|
+
export declare function decisionsImageAssetToJSON(decisionsImageAsset: DecisionsImageAsset): string;
|
|
34
|
+
//# sourceMappingURL=decisionsimageasset.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 4869a6173b1c
|
|
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
|
+
export const DecisionsImageAssetFormat = {
|
|
9
|
+
Png: "png",
|
|
10
|
+
Jpg: "jpg",
|
|
11
|
+
Jpeg: "jpeg",
|
|
12
|
+
};
|
|
13
|
+
export const DecisionsImageAssetType = {
|
|
14
|
+
Image: "image",
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const DecisionsImageAssetFormat$outboundSchema = openEnums.outboundSchema(DecisionsImageAssetFormat);
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const DecisionsImageAssetType$outboundSchema = z.enum(DecisionsImageAssetType);
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const DecisionsImageAsset$outboundSchema = z.object({
|
|
22
|
+
dataBase64: z.string(),
|
|
23
|
+
format: DecisionsImageAssetFormat$outboundSchema,
|
|
24
|
+
type: DecisionsImageAssetType$outboundSchema.optional(),
|
|
25
|
+
}).transform((v) => {
|
|
26
|
+
return remap$(v, {
|
|
27
|
+
dataBase64: "data_base64",
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
export function decisionsImageAssetToJSON(decisionsImageAsset) {
|
|
31
|
+
return JSON.stringify(DecisionsImageAsset$outboundSchema.parse(decisionsImageAsset));
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=decisionsimageasset.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { DecisionsBoxQuestion, DecisionsBoxQuestion$Outbound } from "./decisionsboxquestion.js";
|
|
3
3
|
import { DecisionsChoiceQuestion, DecisionsChoiceQuestion$Outbound } from "./decisionschoicequestion.js";
|
|
4
|
+
import { DecisionsImageAsset, DecisionsImageAsset$Outbound } from "./decisionsimageasset.js";
|
|
4
5
|
import { DecisionsNoulQuestion, DecisionsNoulQuestion$Outbound } from "./decisionsnoulquestion.js";
|
|
5
6
|
import { DecisionsScoreQuestion, DecisionsScoreQuestion$Outbound } from "./decisionsscorequestion.js";
|
|
6
7
|
import { ProviderPreferences, ProviderPreferences$Outbound } from "./providerpreferences.js";
|
|
@@ -16,6 +17,12 @@ export type State = string | {
|
|
|
16
17
|
[k: string]: any;
|
|
17
18
|
} | Array<any>;
|
|
18
19
|
export type DecisionsRequest = {
|
|
20
|
+
/**
|
|
21
|
+
* Images keyed by reference string, as in TypeSafe's API. Write a reference wherever the image belongs in `state`, `instructions`, or `criteria`; every asset must be referenced at least once. Jev reads a reference as a whole string value or inside longer text. Other Decisions models read a whole-string reference wherever they read an `image_url` part and reject a reference inside longer text.
|
|
22
|
+
*/
|
|
23
|
+
assets?: {
|
|
24
|
+
[k: string]: DecisionsImageAsset;
|
|
25
|
+
} | undefined;
|
|
19
26
|
model: string;
|
|
20
27
|
provider?: ProviderPreferences | null | undefined;
|
|
21
28
|
questions: {
|
|
@@ -51,6 +58,9 @@ export declare const State$outboundSchema: z.ZodType<State$Outbound, State>;
|
|
|
51
58
|
export declare function stateToJSON(state: State): string;
|
|
52
59
|
/** @internal */
|
|
53
60
|
export type DecisionsRequest$Outbound = {
|
|
61
|
+
assets?: {
|
|
62
|
+
[k: string]: DecisionsImageAsset$Outbound;
|
|
63
|
+
} | undefined;
|
|
54
64
|
model: string;
|
|
55
65
|
provider?: ProviderPreferences$Outbound | null | undefined;
|
|
56
66
|
questions: {
|
|
@@ -6,6 +6,7 @@ import * as z from "zod/v4";
|
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { DecisionsBoxQuestion$outboundSchema, } from "./decisionsboxquestion.js";
|
|
8
8
|
import { DecisionsChoiceQuestion$outboundSchema, } from "./decisionschoicequestion.js";
|
|
9
|
+
import { DecisionsImageAsset$outboundSchema, } from "./decisionsimageasset.js";
|
|
9
10
|
import { DecisionsNoulQuestion$outboundSchema, } from "./decisionsnoulquestion.js";
|
|
10
11
|
import { DecisionsScoreQuestion$outboundSchema, } from "./decisionsscorequestion.js";
|
|
11
12
|
import { ProviderPreferences$outboundSchema, } from "./providerpreferences.js";
|
|
@@ -31,6 +32,7 @@ export function stateToJSON(state) {
|
|
|
31
32
|
}
|
|
32
33
|
/** @internal */
|
|
33
34
|
export const DecisionsRequest$outboundSchema = z.object({
|
|
35
|
+
assets: z.record(z.string(), DecisionsImageAsset$outboundSchema).optional(),
|
|
34
36
|
model: z.string(),
|
|
35
37
|
provider: z.nullable(ProviderPreferences$outboundSchema).optional(),
|
|
36
38
|
questions: z.record(z.string(), z.union([
|
package/esm/models/index.d.ts
CHANGED
|
@@ -295,6 +295,7 @@ export * from "./decisionsboxanswer.js";
|
|
|
295
295
|
export * from "./decisionsboxquestion.js";
|
|
296
296
|
export * from "./decisionschoiceanswer.js";
|
|
297
297
|
export * from "./decisionschoicequestion.js";
|
|
298
|
+
export * from "./decisionsimageasset.js";
|
|
298
299
|
export * from "./decisionsnoulanswer.js";
|
|
299
300
|
export * from "./decisionsnoulquestion.js";
|
|
300
301
|
export * from "./decisionsrequest.js";
|
|
@@ -612,7 +613,9 @@ export * from "./privateendpoint.js";
|
|
|
612
613
|
export * from "./privateendpointactivation.js";
|
|
613
614
|
export * from "./privateendpointcheck.js";
|
|
614
615
|
export * from "./privateendpointcheckreason.js";
|
|
616
|
+
export * from "./privateendpointdeclaredparameter.js";
|
|
615
617
|
export * from "./privateendpointdeclaredregion.js";
|
|
618
|
+
export * from "./privateendpointparametercheck.js";
|
|
616
619
|
export * from "./privateendpointpricing.js";
|
|
617
620
|
export * from "./privateendpointresponse.js";
|
|
618
621
|
export * from "./privateendpointstatus.js";
|
|
@@ -778,6 +781,7 @@ export * from "./updateguardrailresponse.js";
|
|
|
778
781
|
export * from "./updateobservabilitydestinationrequest.js";
|
|
779
782
|
export * from "./updateobservabilitydestinationresponse.js";
|
|
780
783
|
export * from "./updateorganizationsettingsrequest.js";
|
|
784
|
+
export * from "./updateprivateendpointparametersrequest.js";
|
|
781
785
|
export * from "./updateprivateendpointpricingrequest.js";
|
|
782
786
|
export * from "./updateprivateendpointrequest.js";
|
|
783
787
|
export * from "./updatescimgroupmappingrequest.js";
|
package/esm/models/index.js
CHANGED
|
@@ -299,6 +299,7 @@ export * from "./decisionsboxanswer.js";
|
|
|
299
299
|
export * from "./decisionsboxquestion.js";
|
|
300
300
|
export * from "./decisionschoiceanswer.js";
|
|
301
301
|
export * from "./decisionschoicequestion.js";
|
|
302
|
+
export * from "./decisionsimageasset.js";
|
|
302
303
|
export * from "./decisionsnoulanswer.js";
|
|
303
304
|
export * from "./decisionsnoulquestion.js";
|
|
304
305
|
export * from "./decisionsrequest.js";
|
|
@@ -616,7 +617,9 @@ export * from "./privateendpoint.js";
|
|
|
616
617
|
export * from "./privateendpointactivation.js";
|
|
617
618
|
export * from "./privateendpointcheck.js";
|
|
618
619
|
export * from "./privateendpointcheckreason.js";
|
|
620
|
+
export * from "./privateendpointdeclaredparameter.js";
|
|
619
621
|
export * from "./privateendpointdeclaredregion.js";
|
|
622
|
+
export * from "./privateendpointparametercheck.js";
|
|
620
623
|
export * from "./privateendpointpricing.js";
|
|
621
624
|
export * from "./privateendpointresponse.js";
|
|
622
625
|
export * from "./privateendpointstatus.js";
|
|
@@ -782,6 +785,7 @@ export * from "./updateguardrailresponse.js";
|
|
|
782
785
|
export * from "./updateobservabilitydestinationrequest.js";
|
|
783
786
|
export * from "./updateobservabilitydestinationresponse.js";
|
|
784
787
|
export * from "./updateorganizationsettingsrequest.js";
|
|
788
|
+
export * from "./updateprivateendpointparametersrequest.js";
|
|
785
789
|
export * from "./updateprivateendpointpricingrequest.js";
|
|
786
790
|
export * from "./updateprivateendpointrequest.js";
|
|
787
791
|
export * from "./updatescimgroupmappingrequest.js";
|
|
@@ -2,14 +2,14 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const InputAudioFormat: {
|
|
6
6
|
readonly Mp3: "mp3";
|
|
7
7
|
readonly Wav: "wav";
|
|
8
8
|
};
|
|
9
|
-
export type
|
|
9
|
+
export type InputAudioFormat = OpenEnum<typeof InputAudioFormat>;
|
|
10
10
|
export type InputAudioInputAudio = {
|
|
11
11
|
data: string;
|
|
12
|
-
format:
|
|
12
|
+
format: InputAudioFormat;
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
15
|
* Audio input content item
|
|
@@ -19,9 +19,9 @@ export type InputAudio = {
|
|
|
19
19
|
type: "input_audio";
|
|
20
20
|
};
|
|
21
21
|
/** @internal */
|
|
22
|
-
export declare const
|
|
22
|
+
export declare const InputAudioFormat$inboundSchema: z.ZodType<InputAudioFormat, unknown>;
|
|
23
23
|
/** @internal */
|
|
24
|
-
export declare const
|
|
24
|
+
export declare const InputAudioFormat$outboundSchema: z.ZodType<string, InputAudioFormat>;
|
|
25
25
|
/** @internal */
|
|
26
26
|
export declare const InputAudioInputAudio$inboundSchema: z.ZodType<InputAudioInputAudio, unknown>;
|
|
27
27
|
/** @internal */
|
package/esm/models/inputaudio.js
CHANGED
|
@@ -6,23 +6,23 @@ import * as z from "zod/v4";
|
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import * as openEnums from "../types/enums.js";
|
|
9
|
-
export const
|
|
9
|
+
export const InputAudioFormat = {
|
|
10
10
|
Mp3: "mp3",
|
|
11
11
|
Wav: "wav",
|
|
12
12
|
};
|
|
13
13
|
/** @internal */
|
|
14
|
-
export const
|
|
14
|
+
export const InputAudioFormat$inboundSchema = openEnums.inboundSchema(InputAudioFormat);
|
|
15
15
|
/** @internal */
|
|
16
|
-
export const
|
|
16
|
+
export const InputAudioFormat$outboundSchema = openEnums.outboundSchema(InputAudioFormat);
|
|
17
17
|
/** @internal */
|
|
18
18
|
export const InputAudioInputAudio$inboundSchema = z.object({
|
|
19
19
|
data: z.string(),
|
|
20
|
-
format:
|
|
20
|
+
format: InputAudioFormat$inboundSchema,
|
|
21
21
|
});
|
|
22
22
|
/** @internal */
|
|
23
23
|
export const InputAudioInputAudio$outboundSchema = z.object({
|
|
24
24
|
data: z.string(),
|
|
25
|
-
format:
|
|
25
|
+
format: InputAudioFormat$outboundSchema,
|
|
26
26
|
});
|
|
27
27
|
export function inputAudioInputAudioToJSON(inputAudioInputAudio) {
|
|
28
28
|
return JSON.stringify(InputAudioInputAudio$outboundSchema.parse(inputAudioInputAudio));
|
|
@@ -40,6 +40,10 @@ export type ManagedPrivateEndpoint = {
|
|
|
40
40
|
* Whether you attest this deployment retains no prompt or completion data. `null` means undeclared.
|
|
41
41
|
*/
|
|
42
42
|
declaredZdr: boolean | null;
|
|
43
|
+
/**
|
|
44
|
+
* Most completion tokens a request routed to this endpoint can produce, or `null` when the endpoint sets no cap beyond the model context length.
|
|
45
|
+
*/
|
|
46
|
+
maxCompletionTokens?: number | null | undefined;
|
|
43
47
|
};
|
|
44
48
|
/** @internal */
|
|
45
49
|
export declare const ManagedPrivateEndpoint$inboundSchema: z.ZodType<ManagedPrivateEndpoint, unknown>;
|
|
@@ -18,6 +18,7 @@ export const ManagedPrivateEndpoint$inboundSchema = z.object({
|
|
|
18
18
|
status: PrivateEndpointStatus$inboundSchema,
|
|
19
19
|
declared_region: z.nullable(PrivateEndpointDeclaredRegion$inboundSchema),
|
|
20
20
|
declared_zdr: z.nullable(z.boolean()),
|
|
21
|
+
max_completion_tokens: z.nullable(z.int()).optional(),
|
|
21
22
|
}).transform((v) => {
|
|
22
23
|
return remap$(v, {
|
|
23
24
|
"created_at": "createdAt",
|
|
@@ -27,6 +28,7 @@ export const ManagedPrivateEndpoint$inboundSchema = z.object({
|
|
|
27
28
|
"provider_name": "providerName",
|
|
28
29
|
"declared_region": "declaredRegion",
|
|
29
30
|
"declared_zdr": "declaredZdr",
|
|
31
|
+
"max_completion_tokens": "maxCompletionTokens",
|
|
30
32
|
});
|
|
31
33
|
});
|
|
32
34
|
export function managedPrivateEndpointFromJSON(jsonString) {
|
|
@@ -42,7 +42,7 @@ export type CreatePrivateEndpointRequest = {
|
|
|
42
42
|
*/
|
|
43
43
|
appCategories?: string | undefined;
|
|
44
44
|
/**
|
|
45
|
-
* Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, or
|
|
45
|
+
* Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison.
|
|
46
46
|
*/
|
|
47
47
|
idempotencyKey?: string | undefined;
|
|
48
48
|
createPrivateEndpointRequest: models.CreatePrivateEndpointRequest;
|
|
@@ -130,6 +130,7 @@ export * from "./updatekeys.js";
|
|
|
130
130
|
export * from "./updateobservabilitydestination.js";
|
|
131
131
|
export * from "./updateorganizationsettings.js";
|
|
132
132
|
export * from "./updateprivateendpoint.js";
|
|
133
|
+
export * from "./updateprivateendpointparameters.js";
|
|
133
134
|
export * from "./updateprivateendpointpricing.js";
|
|
134
135
|
export * from "./updatescimgroupmapping.js";
|
|
135
136
|
export * from "./updateworkspace.js";
|
|
@@ -134,6 +134,7 @@ export * from "./updatekeys.js";
|
|
|
134
134
|
export * from "./updateobservabilitydestination.js";
|
|
135
135
|
export * from "./updateorganizationsettings.js";
|
|
136
136
|
export * from "./updateprivateendpoint.js";
|
|
137
|
+
export * from "./updateprivateendpointparameters.js";
|
|
137
138
|
export * from "./updateprivateendpointpricing.js";
|
|
138
139
|
export * from "./updatescimgroupmapping.js";
|
|
139
140
|
export * from "./updateworkspace.js";
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import * as models from "../index.js";
|
|
3
|
+
export type UpdatePrivateEndpointParametersGlobals = {
|
|
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 UpdatePrivateEndpointParametersRequest = {
|
|
25
|
+
/**
|
|
26
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* This is used to track API usage per application.
|
|
30
|
+
*/
|
|
31
|
+
httpReferer?: string | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
*/
|
|
37
|
+
appTitle?: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
*/
|
|
43
|
+
appCategories?: string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Stable identifier of the private endpoint.
|
|
46
|
+
*/
|
|
47
|
+
id: string;
|
|
48
|
+
updatePrivateEndpointParametersRequest: models.UpdatePrivateEndpointParametersRequest;
|
|
49
|
+
};
|
|
50
|
+
/** @internal */
|
|
51
|
+
export type UpdatePrivateEndpointParametersRequest$Outbound = {
|
|
52
|
+
"HTTP-Referer"?: string | undefined;
|
|
53
|
+
appTitle?: string | undefined;
|
|
54
|
+
appCategories?: string | undefined;
|
|
55
|
+
id: string;
|
|
56
|
+
UpdatePrivateEndpointParametersRequest: models.UpdatePrivateEndpointParametersRequest$Outbound;
|
|
57
|
+
};
|
|
58
|
+
/** @internal */
|
|
59
|
+
export declare const UpdatePrivateEndpointParametersRequest$outboundSchema: z.ZodType<UpdatePrivateEndpointParametersRequest$Outbound, UpdatePrivateEndpointParametersRequest>;
|
|
60
|
+
export declare function updatePrivateEndpointParametersRequestToJSON(updatePrivateEndpointParametersRequest: UpdatePrivateEndpointParametersRequest): string;
|
|
61
|
+
//# sourceMappingURL=updateprivateendpointparameters.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 7665d9dbe783
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { UpdatePrivateEndpointParametersRequest$outboundSchema as models_UpdatePrivateEndpointParametersRequest$outboundSchema } from "../updateprivateendpointparametersrequest.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const UpdatePrivateEndpointParametersRequest$outboundSchema = z.object({
|
|
10
|
+
httpReferer: z.string().optional(),
|
|
11
|
+
appTitle: z.string().optional(),
|
|
12
|
+
appCategories: z.string().optional(),
|
|
13
|
+
id: z.string(),
|
|
14
|
+
updatePrivateEndpointParametersRequest: models_UpdatePrivateEndpointParametersRequest$outboundSchema,
|
|
15
|
+
}).transform((v) => {
|
|
16
|
+
return remap$(v, {
|
|
17
|
+
httpReferer: "HTTP-Referer",
|
|
18
|
+
updatePrivateEndpointParametersRequest: "UpdatePrivateEndpointParametersRequest",
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
export function updatePrivateEndpointParametersRequestToJSON(updatePrivateEndpointParametersRequest) {
|
|
22
|
+
return JSON.stringify(UpdatePrivateEndpointParametersRequest$outboundSchema.parse(updatePrivateEndpointParametersRequest));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=updateprivateendpointparameters.js.map
|
|
@@ -9,6 +9,10 @@ export type PrivateEndpoint = {
|
|
|
9
9
|
* HTTPS base URL of your deployment, or `null` for providers whose URL is derived from the BYOK credential (Azure, Amazon Bedrock, Google Vertex).
|
|
10
10
|
*/
|
|
11
11
|
baseUrl: string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Parameters you declared the upstream supports. Requests that use a parameter only route to this endpoint when it is tested or declared.
|
|
14
|
+
*/
|
|
15
|
+
declaredParameters: Array<string>;
|
|
12
16
|
/**
|
|
13
17
|
* Where you attest this deployment processes data. `global` means not regional; `null` means undeclared.
|
|
14
18
|
*/
|
|
@@ -21,6 +25,10 @@ export type PrivateEndpoint = {
|
|
|
21
25
|
* Stable identifier of the private endpoint.
|
|
22
26
|
*/
|
|
23
27
|
id: string;
|
|
28
|
+
/**
|
|
29
|
+
* Most completion tokens a request routed to this endpoint can produce, or `null` when the endpoint sets no cap beyond the model context length.
|
|
30
|
+
*/
|
|
31
|
+
maxCompletionTokens?: number | null | undefined;
|
|
24
32
|
/**
|
|
25
33
|
* Display name of the model, or `null` when the model is no longer listed.
|
|
26
34
|
*/
|
|
@@ -49,6 +57,10 @@ export type PrivateEndpoint = {
|
|
|
49
57
|
* Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable.
|
|
50
58
|
*/
|
|
51
59
|
status: PrivateEndpointStatus;
|
|
60
|
+
/**
|
|
61
|
+
* Parameters a validation run proved the upstream honors (`tools`, `tool_choice`, `response_format`, `structured_outputs`, `stop`). Read-only; cleared when the upstream configuration changes.
|
|
62
|
+
*/
|
|
63
|
+
testedParameters: Array<string>;
|
|
52
64
|
/**
|
|
53
65
|
* Model or deployment identifier sent to the upstream provider.
|
|
54
66
|
*/
|
|
@@ -11,9 +11,11 @@ import { PrivateEndpointStatus$inboundSchema, } from "./privateendpointstatus.js
|
|
|
11
11
|
/** @internal */
|
|
12
12
|
export const PrivateEndpoint$inboundSchema = z.object({
|
|
13
13
|
base_url: z.nullable(z.string()),
|
|
14
|
+
declared_parameters: z.array(z.string()),
|
|
14
15
|
declared_region: z.nullable(PrivateEndpointDeclaredRegion$inboundSchema),
|
|
15
16
|
declared_zdr: z.nullable(z.boolean()),
|
|
16
17
|
id: z.string(),
|
|
18
|
+
max_completion_tokens: z.nullable(z.int()).optional(),
|
|
17
19
|
model_name: z.nullable(z.string()),
|
|
18
20
|
model_permaslug: z.string(),
|
|
19
21
|
model_slug: z.nullable(z.string()),
|
|
@@ -21,17 +23,21 @@ export const PrivateEndpoint$inboundSchema = z.object({
|
|
|
21
23
|
provider_name: z.string(),
|
|
22
24
|
provider_slug: z.nullable(z.string()),
|
|
23
25
|
status: PrivateEndpointStatus$inboundSchema,
|
|
26
|
+
tested_parameters: z.array(z.string()),
|
|
24
27
|
upstream_model_id: z.string(),
|
|
25
28
|
}).transform((v) => {
|
|
26
29
|
return remap$(v, {
|
|
27
30
|
"base_url": "baseUrl",
|
|
31
|
+
"declared_parameters": "declaredParameters",
|
|
28
32
|
"declared_region": "declaredRegion",
|
|
29
33
|
"declared_zdr": "declaredZdr",
|
|
34
|
+
"max_completion_tokens": "maxCompletionTokens",
|
|
30
35
|
"model_name": "modelName",
|
|
31
36
|
"model_permaslug": "modelPermaslug",
|
|
32
37
|
"model_slug": "modelSlug",
|
|
33
38
|
"provider_name": "providerName",
|
|
34
39
|
"provider_slug": "providerSlug",
|
|
40
|
+
"tested_parameters": "testedParameters",
|
|
35
41
|
"upstream_model_id": "upstreamModelId",
|
|
36
42
|
});
|
|
37
43
|
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
/**
|
|
4
|
+
* A chat request parameter the endpoint accepts.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PrivateEndpointDeclaredParameter: {
|
|
7
|
+
readonly Temperature: "temperature";
|
|
8
|
+
readonly TopP: "top_p";
|
|
9
|
+
readonly TopK: "top_k";
|
|
10
|
+
readonly MinP: "min_p";
|
|
11
|
+
readonly TopA: "top_a";
|
|
12
|
+
readonly FrequencyPenalty: "frequency_penalty";
|
|
13
|
+
readonly PresencePenalty: "presence_penalty";
|
|
14
|
+
readonly RepetitionPenalty: "repetition_penalty";
|
|
15
|
+
readonly MaxTokens: "max_tokens";
|
|
16
|
+
readonly MaxCompletionTokens: "max_completion_tokens";
|
|
17
|
+
readonly LogitBias: "logit_bias";
|
|
18
|
+
readonly Logprobs: "logprobs";
|
|
19
|
+
readonly TopLogprobs: "top_logprobs";
|
|
20
|
+
readonly Prediction: "prediction";
|
|
21
|
+
readonly Seed: "seed";
|
|
22
|
+
readonly ResponseFormat: "response_format";
|
|
23
|
+
readonly StructuredOutputs: "structured_outputs";
|
|
24
|
+
readonly Stop: "stop";
|
|
25
|
+
readonly Tools: "tools";
|
|
26
|
+
readonly ToolChoice: "tool_choice";
|
|
27
|
+
readonly ParallelToolCalls: "parallel_tool_calls";
|
|
28
|
+
readonly Reasoning: "reasoning";
|
|
29
|
+
readonly ReasoningEffort: "reasoning_effort";
|
|
30
|
+
readonly WebSearchOptions: "web_search_options";
|
|
31
|
+
readonly Verbosity: "verbosity";
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* A chat request parameter the endpoint accepts.
|
|
35
|
+
*/
|
|
36
|
+
export type PrivateEndpointDeclaredParameter = OpenEnum<typeof PrivateEndpointDeclaredParameter>;
|
|
37
|
+
/** @internal */
|
|
38
|
+
export declare const PrivateEndpointDeclaredParameter$outboundSchema: z.ZodType<string, PrivateEndpointDeclaredParameter>;
|
|
39
|
+
//# sourceMappingURL=privateendpointdeclaredparameter.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 590fecd9a965
|
|
4
|
+
*/
|
|
5
|
+
import * as openEnums from "../types/enums.js";
|
|
6
|
+
/**
|
|
7
|
+
* A chat request parameter the endpoint accepts.
|
|
8
|
+
*/
|
|
9
|
+
export const PrivateEndpointDeclaredParameter = {
|
|
10
|
+
Temperature: "temperature",
|
|
11
|
+
TopP: "top_p",
|
|
12
|
+
TopK: "top_k",
|
|
13
|
+
MinP: "min_p",
|
|
14
|
+
TopA: "top_a",
|
|
15
|
+
FrequencyPenalty: "frequency_penalty",
|
|
16
|
+
PresencePenalty: "presence_penalty",
|
|
17
|
+
RepetitionPenalty: "repetition_penalty",
|
|
18
|
+
MaxTokens: "max_tokens",
|
|
19
|
+
MaxCompletionTokens: "max_completion_tokens",
|
|
20
|
+
LogitBias: "logit_bias",
|
|
21
|
+
Logprobs: "logprobs",
|
|
22
|
+
TopLogprobs: "top_logprobs",
|
|
23
|
+
Prediction: "prediction",
|
|
24
|
+
Seed: "seed",
|
|
25
|
+
ResponseFormat: "response_format",
|
|
26
|
+
StructuredOutputs: "structured_outputs",
|
|
27
|
+
Stop: "stop",
|
|
28
|
+
Tools: "tools",
|
|
29
|
+
ToolChoice: "tool_choice",
|
|
30
|
+
ParallelToolCalls: "parallel_tool_calls",
|
|
31
|
+
Reasoning: "reasoning",
|
|
32
|
+
ReasoningEffort: "reasoning_effort",
|
|
33
|
+
WebSearchOptions: "web_search_options",
|
|
34
|
+
Verbosity: "verbosity",
|
|
35
|
+
};
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const PrivateEndpointDeclaredParameter$outboundSchema = openEnums.outboundSchema(PrivateEndpointDeclaredParameter);
|
|
38
|
+
//# sourceMappingURL=privateendpointdeclaredparameter.js.map
|
|
@@ -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
|
+
export type PrivateEndpointParameterCheck = {
|
|
5
|
+
parameter: string;
|
|
6
|
+
supported: boolean;
|
|
7
|
+
};
|
|
8
|
+
/** @internal */
|
|
9
|
+
export declare const PrivateEndpointParameterCheck$inboundSchema: z.ZodType<PrivateEndpointParameterCheck, unknown>;
|
|
10
|
+
export declare function privateEndpointParameterCheckFromJSON(jsonString: string): SafeParseResult<PrivateEndpointParameterCheck, SDKValidationError>;
|
|
11
|
+
//# sourceMappingURL=privateendpointparametercheck.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 8f6f1479ff31
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const PrivateEndpointParameterCheck$inboundSchema = z.object({
|
|
9
|
+
parameter: z.string(),
|
|
10
|
+
supported: z.boolean(),
|
|
11
|
+
});
|
|
12
|
+
export function privateEndpointParameterCheckFromJSON(jsonString) {
|
|
13
|
+
return safeParse(jsonString, (x) => PrivateEndpointParameterCheck$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PrivateEndpointParameterCheck' from JSON`);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=privateendpointparametercheck.js.map
|
|
@@ -2,8 +2,13 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
4
|
import { PrivateEndpointCheck } from "./privateendpointcheck.js";
|
|
5
|
+
import { PrivateEndpointParameterCheck } from "./privateendpointparametercheck.js";
|
|
5
6
|
export type PrivateEndpointValidation = {
|
|
6
7
|
checks: Array<PrivateEndpointCheck>;
|
|
8
|
+
/**
|
|
9
|
+
* Request parameters probed after the checks passed, each with whether the upstream honored it. Supported ones are recorded in `tested_parameters`. Absent on a failed run and for providers that run no parameter probes; empty when every probe group was already proven.
|
|
10
|
+
*/
|
|
11
|
+
parameters?: Array<PrivateEndpointParameterCheck> | undefined;
|
|
7
12
|
/**
|
|
8
13
|
* Whether every check passed.
|
|
9
14
|
*/
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import { PrivateEndpointCheck$inboundSchema, } from "./privateendpointcheck.js";
|
|
8
|
+
import { PrivateEndpointParameterCheck$inboundSchema, } from "./privateendpointparametercheck.js";
|
|
8
9
|
/** @internal */
|
|
9
10
|
export const PrivateEndpointValidation$inboundSchema = z.object({
|
|
10
11
|
checks: z.array(PrivateEndpointCheck$inboundSchema),
|
|
12
|
+
parameters: z.array(PrivateEndpointParameterCheck$inboundSchema).optional(),
|
|
11
13
|
passed: z.boolean(),
|
|
12
14
|
});
|
|
13
15
|
export function privateEndpointValidationFromJSON(jsonString) {
|
|
@@ -2,8 +2,13 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
4
|
import { PrivateEndpointCheck } from "./privateendpointcheck.js";
|
|
5
|
+
import { PrivateEndpointParameterCheck } from "./privateendpointparametercheck.js";
|
|
5
6
|
export type PrivateEndpointValidationNullable = {
|
|
6
7
|
checks: Array<PrivateEndpointCheck>;
|
|
8
|
+
/**
|
|
9
|
+
* Request parameters probed after the checks passed, each with whether the upstream honored it. Supported ones are recorded in `tested_parameters`. Absent on a failed run and for providers that run no parameter probes; empty when every probe group was already proven.
|
|
10
|
+
*/
|
|
11
|
+
parameters?: Array<PrivateEndpointParameterCheck> | undefined;
|
|
7
12
|
/**
|
|
8
13
|
* Whether every check passed.
|
|
9
14
|
*/
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import { PrivateEndpointCheck$inboundSchema, } from "./privateendpointcheck.js";
|
|
8
|
+
import { PrivateEndpointParameterCheck$inboundSchema, } from "./privateendpointparametercheck.js";
|
|
8
9
|
/** @internal */
|
|
9
10
|
export const PrivateEndpointValidationNullable$inboundSchema = z.object({
|
|
10
11
|
checks: z.array(PrivateEndpointCheck$inboundSchema),
|
|
12
|
+
parameters: z.array(PrivateEndpointParameterCheck$inboundSchema).optional(),
|
|
11
13
|
passed: z.boolean(),
|
|
12
14
|
});
|
|
13
15
|
export function privateEndpointValidationNullableFromJSON(jsonString) {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { PrivateEndpointDeclaredParameter } from "./privateendpointdeclaredparameter.js";
|
|
3
|
+
export type UpdatePrivateEndpointParametersRequest = {
|
|
4
|
+
/**
|
|
5
|
+
* Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared.
|
|
6
|
+
*/
|
|
7
|
+
declaredParameters: Array<PrivateEndpointDeclaredParameter>;
|
|
8
|
+
};
|
|
9
|
+
/** @internal */
|
|
10
|
+
export type UpdatePrivateEndpointParametersRequest$Outbound = {
|
|
11
|
+
declared_parameters: Array<string>;
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export declare const UpdatePrivateEndpointParametersRequest$outboundSchema: z.ZodType<UpdatePrivateEndpointParametersRequest$Outbound, UpdatePrivateEndpointParametersRequest>;
|
|
15
|
+
export declare function updatePrivateEndpointParametersRequestToJSON(updatePrivateEndpointParametersRequest: UpdatePrivateEndpointParametersRequest): string;
|
|
16
|
+
//# sourceMappingURL=updateprivateendpointparametersrequest.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 07aff12e19d4
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { PrivateEndpointDeclaredParameter$outboundSchema, } from "./privateendpointdeclaredparameter.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const UpdatePrivateEndpointParametersRequest$outboundSchema = z.object({
|
|
10
|
+
declaredParameters: z.array(PrivateEndpointDeclaredParameter$outboundSchema),
|
|
11
|
+
}).transform((v) => {
|
|
12
|
+
return remap$(v, {
|
|
13
|
+
declaredParameters: "declared_parameters",
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
export function updatePrivateEndpointParametersRequestToJSON(updatePrivateEndpointParametersRequest) {
|
|
17
|
+
return JSON.stringify(UpdatePrivateEndpointParametersRequest$outboundSchema.parse(updatePrivateEndpointParametersRequest));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=updateprivateendpointparametersrequest.js.map
|
|
@@ -58,6 +58,13 @@ export declare class PrivateEndpoints extends ClientSDK {
|
|
|
58
58
|
* Resume routing to a disabled endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
59
59
|
*/
|
|
60
60
|
enable(request: operations.EnablePrivateEndpointRequest, options?: RequestOptions): Promise<models.ManagedPrivateEndpointResponse>;
|
|
61
|
+
/**
|
|
62
|
+
* Set private endpoint supported parameters
|
|
63
|
+
*
|
|
64
|
+
* @remarks
|
|
65
|
+
* Declare which request parameters the upstream supports beyond the ones validation proved. Applies to drafts and active endpoints; routing picks the change up for subsequent requests. The body replaces the earlier declaration and is read as a set: order and repeated names do not matter, but the list holds at most as many entries as there are declarable parameters, repeats included. `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
66
|
+
*/
|
|
67
|
+
updateParameters(request: operations.UpdatePrivateEndpointParametersRequest, options?: RequestOptions): Promise<models.PrivateEndpointResponse>;
|
|
61
68
|
/**
|
|
62
69
|
* Set private endpoint pricing
|
|
63
70
|
*
|
|
@@ -10,6 +10,7 @@ import { privateEndpointsEnable } from "../funcs/privateEndpointsEnable.js";
|
|
|
10
10
|
import { privateEndpointsGet } from "../funcs/privateEndpointsGet.js";
|
|
11
11
|
import { privateEndpointsList } from "../funcs/privateEndpointsList.js";
|
|
12
12
|
import { privateEndpointsUpdate } from "../funcs/privateEndpointsUpdate.js";
|
|
13
|
+
import { privateEndpointsUpdateParameters } from "../funcs/privateEndpointsUpdateParameters.js";
|
|
13
14
|
import { privateEndpointsUpdatePricing } from "../funcs/privateEndpointsUpdatePricing.js";
|
|
14
15
|
import { privateEndpointsValidate } from "../funcs/privateEndpointsValidate.js";
|
|
15
16
|
import { ClientSDK } from "../lib/sdks.js";
|
|
@@ -87,6 +88,15 @@ export class PrivateEndpoints extends ClientSDK {
|
|
|
87
88
|
async enable(request, options) {
|
|
88
89
|
return unwrapAsync(privateEndpointsEnable(this, request, options));
|
|
89
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Set private endpoint supported parameters
|
|
93
|
+
*
|
|
94
|
+
* @remarks
|
|
95
|
+
* Declare which request parameters the upstream supports beyond the ones validation proved. Applies to drafts and active endpoints; routing picks the change up for subsequent requests. The body replaces the earlier declaration and is read as a set: order and repeated names do not matter, but the list holds at most as many entries as there are declarable parameters, repeats included. `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
96
|
+
*/
|
|
97
|
+
async updateParameters(request, options) {
|
|
98
|
+
return unwrapAsync(privateEndpointsUpdateParameters(this, request, options));
|
|
99
|
+
}
|
|
90
100
|
/**
|
|
91
101
|
* Set private endpoint pricing
|
|
92
102
|
*
|
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.13",
|
|
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
|
-
"
|
|
77
|
-
"test": "
|
|
78
|
-
"test:e2e": "vitest --run --project e2e",
|
|
76
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
77
|
+
"test:transit": "exit 0",
|
|
79
78
|
"test:watch": "vitest --watch --project unit",
|
|
80
79
|
"typecheck": "tsc --noEmit",
|
|
81
|
-
"typecheck:transit": "exit 0",
|
|
82
80
|
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
83
|
-
"
|
|
84
|
-
"test
|
|
81
|
+
"prepare": "npm run build",
|
|
82
|
+
"test": "vitest --run --project unit",
|
|
83
|
+
"test:e2e": "vitest --run --project e2e",
|
|
84
|
+
"typecheck:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
|