@openrouter/sdk 0.5.1 → 0.9.11
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/FUNCTIONS.md +5 -1
- package/esm/funcs/analyticsGetUserActivity.d.ts +1 -1
- package/esm/funcs/analyticsGetUserActivity.js +4 -2
- package/esm/funcs/apiKeysCreate.d.ts +1 -1
- package/esm/funcs/apiKeysCreate.js +5 -3
- package/esm/funcs/apiKeysDelete.d.ts +1 -1
- package/esm/funcs/apiKeysDelete.js +3 -1
- package/esm/funcs/apiKeysGet.d.ts +1 -1
- package/esm/funcs/apiKeysGet.js +3 -1
- package/esm/funcs/apiKeysGetCurrentKeyMetadata.d.ts +1 -1
- package/esm/funcs/apiKeysGetCurrentKeyMetadata.js +14 -3
- package/esm/funcs/apiKeysList.d.ts +1 -1
- package/esm/funcs/apiKeysList.js +4 -2
- package/esm/funcs/apiKeysUpdate.d.ts +1 -1
- package/esm/funcs/apiKeysUpdate.js +3 -1
- package/esm/funcs/betaResponsesSend.d.ts +9 -5
- package/esm/funcs/betaResponsesSend.js +10 -5
- package/esm/funcs/chatSend.d.ts +11 -7
- package/esm/funcs/chatSend.js +28 -7
- package/esm/funcs/creditsCreateCoinbaseCharge.d.ts +1 -2
- package/esm/funcs/creditsCreateCoinbaseCharge.js +7 -4
- package/esm/funcs/creditsGetCredits.d.ts +2 -2
- package/esm/funcs/creditsGetCredits.js +15 -4
- package/esm/funcs/embeddingsGenerate.js +4 -2
- package/esm/funcs/embeddingsListModels.d.ts +2 -1
- package/esm/funcs/embeddingsListModels.js +15 -3
- package/esm/funcs/endpointsList.js +2 -0
- package/esm/funcs/endpointsListZdrEndpoints.d.ts +1 -1
- package/esm/funcs/endpointsListZdrEndpoints.js +14 -3
- package/esm/funcs/generationsGetGeneration.js +3 -1
- package/esm/funcs/guardrailsBulkAssignKeys.d.ts +1 -1
- package/esm/funcs/guardrailsBulkAssignKeys.js +3 -1
- package/esm/funcs/guardrailsBulkAssignMembers.d.ts +1 -1
- package/esm/funcs/guardrailsBulkAssignMembers.js +3 -1
- package/esm/funcs/guardrailsBulkUnassignKeys.d.ts +1 -1
- package/esm/funcs/guardrailsBulkUnassignKeys.js +3 -1
- package/esm/funcs/guardrailsBulkUnassignMembers.d.ts +1 -1
- package/esm/funcs/guardrailsBulkUnassignMembers.js +3 -1
- package/esm/funcs/guardrailsCreate.d.ts +1 -1
- package/esm/funcs/guardrailsCreate.js +5 -3
- package/esm/funcs/guardrailsDelete.d.ts +1 -1
- package/esm/funcs/guardrailsDelete.js +3 -1
- package/esm/funcs/guardrailsGet.d.ts +1 -1
- package/esm/funcs/guardrailsGet.js +3 -1
- package/esm/funcs/guardrailsList.d.ts +1 -1
- package/esm/funcs/guardrailsList.js +4 -2
- package/esm/funcs/guardrailsListGuardrailKeyAssignments.d.ts +1 -1
- package/esm/funcs/guardrailsListGuardrailKeyAssignments.js +3 -1
- package/esm/funcs/guardrailsListGuardrailMemberAssignments.d.ts +1 -1
- package/esm/funcs/guardrailsListGuardrailMemberAssignments.js +3 -1
- package/esm/funcs/guardrailsListKeyAssignments.d.ts +1 -1
- package/esm/funcs/guardrailsListKeyAssignments.js +4 -2
- package/esm/funcs/guardrailsListMemberAssignments.d.ts +1 -1
- package/esm/funcs/guardrailsListMemberAssignments.js +4 -2
- package/esm/funcs/guardrailsUpdate.d.ts +1 -1
- package/esm/funcs/guardrailsUpdate.js +3 -1
- package/esm/funcs/modelsCount.d.ts +2 -1
- package/esm/funcs/modelsCount.js +15 -3
- package/esm/funcs/modelsList.js +3 -1
- package/esm/funcs/modelsListForUser.d.ts +1 -1
- package/esm/funcs/modelsListForUser.js +15 -3
- package/esm/funcs/oAuthCreateAuthCode.js +4 -2
- package/esm/funcs/oAuthExchangeAuthCodeForAPIKey.js +4 -2
- package/esm/funcs/providersList.d.ts +1 -1
- package/esm/funcs/providersList.js +14 -3
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/lib/model-result.d.ts +3 -5
- package/esm/lib/model-result.js +98 -46
- package/esm/models/assistantmessage.d.ts +47 -36
- package/esm/models/assistantmessage.js +35 -47
- package/esm/models/assistantmessageimages.d.ts +33 -0
- package/esm/models/assistantmessageimages.js +44 -0
- package/esm/models/chatgenerationparams.d.ts +318 -182
- package/esm/models/chatgenerationparams.js +157 -143
- package/esm/models/chatgenerationtokenusage.d.ts +48 -0
- package/esm/models/chatmessagecontentitem.d.ts +15 -10
- package/esm/models/chatmessagecontentitem.js +25 -4
- package/esm/models/chatmessagecontentitemaudio.d.ts +20 -2
- package/esm/models/chatmessagecontentitemaudio.js +9 -2
- package/esm/models/chatmessagecontentitemcachecontrol.d.ts +14 -3
- package/esm/models/chatmessagecontentitemcachecontrol.js +9 -2
- package/esm/models/chatmessagecontentitemimage.d.ts +26 -3
- package/esm/models/chatmessagecontentitemimage.js +12 -2
- package/esm/models/chatmessagecontentitemtext.d.ts +17 -2
- package/esm/models/chatmessagecontentitemtext.js +9 -2
- package/esm/models/chatmessagecontentitemvideo.d.ts +12 -55
- package/esm/models/chatmessagecontentitemvideo.js +5 -72
- package/esm/models/chatmessagecontentitemvideolegacy.d.ts +28 -0
- package/esm/models/chatmessagecontentitemvideolegacy.js +33 -0
- package/esm/models/chatmessagetokenlogprob.d.ts +15 -0
- package/esm/models/chatmessagetokenlogprobs.d.ts +9 -0
- package/esm/models/chatmessagetoolcall.d.ts +23 -2
- package/esm/models/chatmessagetoolcall.js +9 -2
- package/esm/models/chatresponse.d.ts +29 -1
- package/esm/models/chatresponse.js +6 -1
- package/esm/models/chatresponsechoice.d.ts +13 -2
- package/esm/models/chatresponsechoice.js +1 -2
- package/esm/models/chatstreamingchoice.d.ts +13 -2
- package/esm/models/chatstreamingchoice.js +1 -2
- package/esm/models/chatstreamingmessagechunk.d.ts +29 -2
- package/esm/models/chatstreamingmessagechunk.js +5 -2
- package/esm/models/chatstreamingmessagetoolcall.d.ts +38 -1
- package/esm/models/chatstreamingmessagetoolcall.js +9 -1
- package/esm/models/chatstreamingresponsechunk.d.ts +45 -11
- package/esm/models/chatstreamingresponsechunk.js +11 -25
- package/esm/models/chatstreamoptions.d.ts +8 -0
- package/esm/models/debugoptions.d.ts +18 -0
- package/esm/models/debugoptions.js +18 -0
- package/esm/models/developermessage.d.ts +35 -0
- package/esm/models/developermessage.js +24 -0
- package/esm/models/errors/index.d.ts +0 -1
- package/esm/models/errors/index.js +0 -1
- package/esm/models/index.d.ts +13 -5
- package/esm/models/index.js +13 -5
- package/esm/models/jsonschemaconfig.d.ts +17 -2
- package/esm/models/jsonschemaconfig.js +1 -1
- package/esm/models/message.d.ts +10 -23
- package/esm/models/message.js +3 -20
- package/esm/models/modelscountresponse.d.ts +4 -4
- package/esm/models/modelscountresponse.js +4 -4
- package/esm/models/namedtoolchoice.d.ts +15 -2
- package/esm/models/namedtoolchoice.js +6 -1
- package/esm/models/openairesponsesreasoningconfig.d.ts +1 -1
- package/esm/models/openairesponsesreasoningconfig.js +1 -1
- package/esm/models/openresponsesnonstreamingresponse.d.ts +4 -4
- package/esm/models/openresponsesnonstreamingresponse.js +3 -3
- package/esm/models/openresponsesreasoning.d.ts +2 -2
- package/esm/models/openresponsesreasoning.js +1 -1
- package/esm/models/openresponsesreasoningconfig.d.ts +2 -2
- package/esm/models/openresponsesreasoningconfig.js +1 -1
- package/esm/models/openresponsesrequest.d.ts +31 -13
- package/esm/models/openresponsesrequest.js +25 -0
- package/esm/models/operations/bulkassignkeystoguardrail.d.ts +30 -0
- package/esm/models/operations/bulkassignkeystoguardrail.js +4 -0
- package/esm/models/operations/bulkassignmemberstoguardrail.d.ts +30 -0
- package/esm/models/operations/bulkassignmemberstoguardrail.js +4 -0
- package/esm/models/operations/bulkunassignkeysfromguardrail.d.ts +30 -0
- package/esm/models/operations/bulkunassignkeysfromguardrail.js +4 -0
- package/esm/models/operations/bulkunassignmembersfromguardrail.d.ts +30 -0
- package/esm/models/operations/bulkunassignmembersfromguardrail.js +4 -0
- package/esm/models/operations/createauthkeyscode.d.ts +66 -2
- package/esm/models/operations/createauthkeyscode.js +30 -1
- package/esm/models/operations/createcoinbasecharge.d.ts +41 -0
- package/esm/models/operations/createcoinbasecharge.js +16 -0
- package/esm/models/operations/createembeddings.d.ts +42 -2
- package/esm/models/operations/createembeddings.js +16 -1
- package/esm/models/operations/createguardrail.d.ts +42 -2
- package/esm/models/operations/createguardrail.js +16 -1
- package/esm/models/operations/createkeys.d.ts +42 -2
- package/esm/models/operations/createkeys.js +16 -1
- package/esm/models/operations/createresponses.d.ts +40 -0
- package/esm/models/operations/createresponses.js +16 -0
- package/esm/models/operations/deleteguardrail.d.ts +30 -0
- package/esm/models/operations/deleteguardrail.js +8 -0
- package/esm/models/operations/deletekeys.d.ts +30 -0
- package/esm/models/operations/deletekeys.js +8 -0
- package/esm/models/operations/exchangeauthcodeforapikey.d.ts +42 -2
- package/esm/models/operations/exchangeauthcodeforapikey.js +16 -1
- package/esm/models/operations/getcredits.d.ts +38 -0
- package/esm/models/operations/getcredits.js +13 -0
- package/esm/models/operations/getcurrentkey.d.ts +45 -1
- package/esm/models/operations/getcurrentkey.js +15 -0
- package/esm/models/operations/getgeneration.d.ts +153 -0
- package/esm/models/operations/getgeneration.js +135 -0
- package/esm/models/operations/getguardrail.d.ts +30 -0
- package/esm/models/operations/getguardrail.js +7 -0
- package/esm/models/operations/getkey.d.ts +30 -0
- package/esm/models/operations/getkey.js +7 -0
- package/esm/models/operations/getmodels.d.ts +30 -0
- package/esm/models/operations/getmodels.js +4 -0
- package/esm/models/operations/getuseractivity.d.ts +30 -0
- package/esm/models/operations/getuseractivity.js +8 -0
- package/esm/models/operations/index.d.ts +2 -0
- package/esm/models/operations/index.js +2 -0
- package/esm/models/operations/list.d.ts +30 -0
- package/esm/models/operations/list.js +4 -0
- package/esm/models/operations/listembeddingsmodels.d.ts +40 -0
- package/esm/models/operations/listembeddingsmodels.js +20 -0
- package/esm/models/operations/listendpoints.d.ts +30 -0
- package/esm/models/operations/listendpoints.js +8 -0
- package/esm/models/operations/listendpointszdr.d.ts +38 -0
- package/esm/models/operations/listendpointszdr.js +14 -0
- package/esm/models/operations/listguardrailkeyassignments.d.ts +30 -0
- package/esm/models/operations/listguardrailkeyassignments.js +7 -0
- package/esm/models/operations/listguardrailmemberassignments.d.ts +30 -0
- package/esm/models/operations/listguardrailmemberassignments.js +7 -0
- package/esm/models/operations/listguardrails.d.ts +30 -0
- package/esm/models/operations/listguardrails.js +7 -0
- package/esm/models/operations/listkeyassignments.d.ts +30 -0
- package/esm/models/operations/listkeyassignments.js +7 -0
- package/esm/models/operations/listmemberassignments.d.ts +30 -0
- package/esm/models/operations/listmemberassignments.js +7 -0
- package/esm/models/operations/listmodelscount.d.ts +40 -0
- package/esm/models/operations/listmodelscount.js +20 -0
- package/esm/models/operations/listmodelsuser.d.ts +38 -0
- package/esm/models/operations/listmodelsuser.js +14 -0
- package/esm/models/operations/listproviders.d.ts +38 -0
- package/esm/models/operations/listproviders.js +13 -0
- package/esm/models/operations/sendchatcompletionrequest.d.ts +53 -1
- package/esm/models/operations/sendchatcompletionrequest.js +36 -2
- package/esm/models/operations/updateguardrail.d.ts +30 -0
- package/esm/models/operations/updateguardrail.js +4 -0
- package/esm/models/operations/updatekeys.d.ts +30 -0
- package/esm/models/operations/updatekeys.js +4 -0
- package/esm/models/providername.d.ts +4 -0
- package/esm/models/providername.js +4 -0
- package/esm/models/providerpreferences.d.ts +46 -27
- package/esm/models/providerpreferences.js +29 -15
- package/esm/models/providersort.d.ts +6 -0
- package/esm/models/providersort.js +3 -0
- package/esm/models/providersortconfig.d.ts +30 -2
- package/esm/models/providersortconfig.js +15 -2
- package/esm/models/publicendpoint.d.ts +0 -39
- package/esm/models/publicpricing.d.ts +0 -39
- package/esm/models/reasoningdetailencrypted.d.ts +42 -0
- package/esm/models/reasoningdetailencrypted.js +42 -0
- package/esm/models/reasoningdetailsummary.d.ts +42 -0
- package/esm/models/reasoningdetailsummary.js +42 -0
- package/esm/models/reasoningdetailtext.d.ts +44 -0
- package/esm/models/reasoningdetailtext.js +44 -0
- package/esm/models/reasoningdetailunion.d.ts +19 -0
- package/esm/models/reasoningdetailunion.js +28 -0
- package/esm/models/responseformatjsonobject.d.ts +20 -0
- package/esm/models/responseformatjsonobject.js +21 -0
- package/esm/models/responseformatjsonschema.d.ts +6 -0
- package/esm/models/responseformattext.d.ts +15 -0
- package/esm/models/responseformattext.js +13 -0
- package/esm/models/responseformattextconfig.d.ts +3 -3
- package/esm/models/responseformattextconfig.js +3 -3
- package/esm/models/responseformattextgrammar.d.ts +6 -0
- package/esm/models/responseformattextpython.d.ts +15 -0
- package/esm/models/responseformattextpython.js +13 -0
- package/esm/models/responseserrorfield.d.ts +4 -4
- package/esm/models/responseserrorfield.js +4 -4
- package/esm/models/responsesoutputitemreasoning.d.ts +2 -2
- package/esm/models/responsesoutputitemreasoning.js +2 -2
- package/esm/models/systemmessage.d.ts +12 -0
- package/esm/models/toolchoiceoption.d.ts +31 -0
- package/esm/models/toolchoiceoption.js +32 -0
- package/esm/models/tooldefinitionjson.d.ts +38 -4
- package/esm/models/tooldefinitionjson.js +14 -2
- package/esm/models/toolresponsemessage.d.ts +12 -0
- package/esm/models/usermessage.d.ts +12 -0
- package/esm/models/videoinput.d.ts +23 -0
- package/esm/models/videoinput.js +22 -0
- package/esm/sdk/analytics.d.ts +1 -1
- package/esm/sdk/analytics.js +1 -1
- package/esm/sdk/apikeys.d.ts +6 -6
- package/esm/sdk/apikeys.js +7 -7
- package/esm/sdk/chat.d.ts +10 -6
- package/esm/sdk/credits.d.ts +3 -4
- package/esm/sdk/credits.js +3 -3
- package/esm/sdk/embeddings.d.ts +1 -1
- package/esm/sdk/embeddings.js +2 -2
- package/esm/sdk/endpoints.d.ts +1 -1
- package/esm/sdk/endpoints.js +2 -2
- package/esm/sdk/guardrails.d.ts +13 -13
- package/esm/sdk/guardrails.js +13 -13
- package/esm/sdk/models.d.ts +2 -2
- package/esm/sdk/models.js +4 -4
- package/esm/sdk/providers.d.ts +1 -1
- package/esm/sdk/providers.js +2 -2
- package/esm/sdk/responses.d.ts +9 -5
- package/esm/sdk/sdk.d.ts +2 -2
- package/esm/sdk/sdk.js +3 -3
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/esm/models/chaterror.d.ts +0 -17
- package/esm/models/chaterror.js +0 -25
- package/esm/models/errors/chaterror.d.ts +0 -19
- package/esm/models/errors/chaterror.js +0 -32
- package/esm/models/providersortunion.d.ts +0 -10
- package/esm/models/providersortunion.js +0 -13
- package/esm/models/responsesformatjsonobject.d.ts +0 -20
- package/esm/models/responsesformatjsonobject.js +0 -21
- package/esm/models/schema0.d.ts +0 -84
- package/esm/models/schema0.js +0 -87
- package/esm/models/schema2.d.ts +0 -92
- package/esm/models/schema2.js +0 -109
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
* @generated-id: dbe9751f8369
|
|
4
4
|
*/
|
|
5
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
5
6
|
import * as M from "../lib/matchers.js";
|
|
6
7
|
import { compactMap } from "../lib/primitives.js";
|
|
8
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
9
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
8
10
|
import { pathToFunc } from "../lib/url.js";
|
|
9
11
|
import * as errors from "../models/errors/index.js";
|
|
10
12
|
import * as models from "../models/index.js";
|
|
13
|
+
import * as operations from "../models/operations/index.js";
|
|
11
14
|
import { APIPromise } from "../types/async.js";
|
|
12
15
|
/**
|
|
13
16
|
* List all embeddings models
|
|
@@ -15,13 +18,21 @@ import { APIPromise } from "../types/async.js";
|
|
|
15
18
|
* @remarks
|
|
16
19
|
* Returns a list of all available embeddings models and their properties
|
|
17
20
|
*/
|
|
18
|
-
export function embeddingsListModels(client, options) {
|
|
19
|
-
return new APIPromise($do(client, options));
|
|
21
|
+
export function embeddingsListModels(client, request, options) {
|
|
22
|
+
return new APIPromise($do(client, request, options));
|
|
20
23
|
}
|
|
21
|
-
async function $do(client, options) {
|
|
24
|
+
async function $do(client, request, options) {
|
|
25
|
+
const parsed = safeParse(request, (value) => operations.ListEmbeddingsModelsRequest$outboundSchema.optional().parse(value), "Input validation failed");
|
|
26
|
+
if (!parsed.ok) {
|
|
27
|
+
return [parsed, { status: "invalid" }];
|
|
28
|
+
}
|
|
29
|
+
const payload = parsed.value;
|
|
30
|
+
const body = null;
|
|
22
31
|
const path = pathToFunc("/embeddings/models")();
|
|
23
32
|
const headers = new Headers(compactMap({
|
|
24
33
|
Accept: "application/json",
|
|
34
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload?.["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
35
|
+
"X-Title": encodeSimple("X-Title", payload?.["X-Title"] ?? client._options.xTitle, { explode: false, charEncoding: "none" }),
|
|
25
36
|
}));
|
|
26
37
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
27
38
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -44,6 +55,7 @@ async function $do(client, options) {
|
|
|
44
55
|
baseURL: options?.serverURL,
|
|
45
56
|
path: path,
|
|
46
57
|
headers: headers,
|
|
58
|
+
body: body,
|
|
47
59
|
userAgent: client._options.userAgent,
|
|
48
60
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
49
61
|
}, options);
|
|
@@ -37,6 +37,8 @@ async function $do(client, request, options) {
|
|
|
37
37
|
const path = pathToFunc("/models/{author}/{slug}/endpoints")(pathParams);
|
|
38
38
|
const headers = new Headers(compactMap({
|
|
39
39
|
Accept: "application/json",
|
|
40
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
41
|
+
"X-Title": encodeSimple("X-Title", payload["X-Title"] ?? client._options.xTitle, { explode: false, charEncoding: "none" }),
|
|
40
42
|
}));
|
|
41
43
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
42
44
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -11,5 +11,5 @@ import { Result } from "../types/fp.js";
|
|
|
11
11
|
/**
|
|
12
12
|
* Preview the impact of ZDR on the available endpoints
|
|
13
13
|
*/
|
|
14
|
-
export declare function endpointsListZdrEndpoints(client: OpenRouterCore, options?: RequestOptions): APIPromise<Result<operations.ListEndpointsZdrResponse, errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
14
|
+
export declare function endpointsListZdrEndpoints(client: OpenRouterCore, request?: operations.ListEndpointsZdrRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.ListEndpointsZdrResponse, errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
15
15
|
//# sourceMappingURL=endpointsListZdrEndpoints.d.ts.map
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
* @generated-id: 4efb7ea3e48f
|
|
4
4
|
*/
|
|
5
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
5
6
|
import * as M from "../lib/matchers.js";
|
|
6
7
|
import { compactMap } from "../lib/primitives.js";
|
|
8
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
9
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
8
10
|
import { pathToFunc } from "../lib/url.js";
|
|
9
11
|
import * as errors from "../models/errors/index.js";
|
|
@@ -12,13 +14,21 @@ import { APIPromise } from "../types/async.js";
|
|
|
12
14
|
/**
|
|
13
15
|
* Preview the impact of ZDR on the available endpoints
|
|
14
16
|
*/
|
|
15
|
-
export function endpointsListZdrEndpoints(client, options) {
|
|
16
|
-
return new APIPromise($do(client, options));
|
|
17
|
+
export function endpointsListZdrEndpoints(client, request, options) {
|
|
18
|
+
return new APIPromise($do(client, request, options));
|
|
17
19
|
}
|
|
18
|
-
async function $do(client, options) {
|
|
20
|
+
async function $do(client, request, options) {
|
|
21
|
+
const parsed = safeParse(request, (value) => operations.ListEndpointsZdrRequest$outboundSchema.optional().parse(value), "Input validation failed");
|
|
22
|
+
if (!parsed.ok) {
|
|
23
|
+
return [parsed, { status: "invalid" }];
|
|
24
|
+
}
|
|
25
|
+
const payload = parsed.value;
|
|
26
|
+
const body = null;
|
|
19
27
|
const path = pathToFunc("/endpoints/zdr")();
|
|
20
28
|
const headers = new Headers(compactMap({
|
|
21
29
|
Accept: "application/json",
|
|
30
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload?.["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
31
|
+
"X-Title": encodeSimple("X-Title", payload?.["X-Title"] ?? client._options.xTitle, { explode: false, charEncoding: "none" }),
|
|
22
32
|
}));
|
|
23
33
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
24
34
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -41,6 +51,7 @@ async function $do(client, options) {
|
|
|
41
51
|
baseURL: options?.serverURL,
|
|
42
52
|
path: path,
|
|
43
53
|
headers: headers,
|
|
54
|
+
body: body,
|
|
44
55
|
userAgent: client._options.userAgent,
|
|
45
56
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
46
57
|
}, options);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
* @generated-id: dac2d205a08d
|
|
4
4
|
*/
|
|
5
|
-
import { encodeFormQuery } from "../lib/encodings.js";
|
|
5
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
6
6
|
import * as M from "../lib/matchers.js";
|
|
7
7
|
import { compactMap } from "../lib/primitives.js";
|
|
8
8
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -30,6 +30,8 @@ async function $do(client, request, options) {
|
|
|
30
30
|
});
|
|
31
31
|
const headers = new Headers(compactMap({
|
|
32
32
|
Accept: "application/json",
|
|
33
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
34
|
+
"X-Title": encodeSimple("X-Title", payload["X-Title"] ?? client._options.xTitle, { explode: false, charEncoding: "none" }),
|
|
33
35
|
}));
|
|
34
36
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
35
37
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
|
|
|
12
12
|
* Bulk assign keys to a guardrail
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* Assign multiple API keys to a specific guardrail. [
|
|
15
|
+
* Assign multiple API keys to a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
16
|
*/
|
|
17
17
|
export declare function guardrailsBulkAssignKeys(client: OpenRouterCore, request: operations.BulkAssignKeysToGuardrailRequest, options?: RequestOptions): APIPromise<Result<operations.BulkAssignKeysToGuardrailResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
18
|
//# sourceMappingURL=guardrailsBulkAssignKeys.d.ts.map
|
|
@@ -15,7 +15,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
15
15
|
* Bulk assign keys to a guardrail
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
|
-
* Assign multiple API keys to a specific guardrail. [
|
|
18
|
+
* Assign multiple API keys to a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
19
19
|
*/
|
|
20
20
|
export function guardrailsBulkAssignKeys(client, request, options) {
|
|
21
21
|
return new APIPromise($do(client, request, options));
|
|
@@ -37,6 +37,8 @@ async function $do(client, request, options) {
|
|
|
37
37
|
const headers = new Headers(compactMap({
|
|
38
38
|
"Content-Type": "application/json",
|
|
39
39
|
Accept: "application/json",
|
|
40
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
41
|
+
"X-Title": encodeSimple("X-Title", payload["X-Title"] ?? client._options.xTitle, { explode: false, charEncoding: "none" }),
|
|
40
42
|
}));
|
|
41
43
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
42
44
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
|
|
|
12
12
|
* Bulk assign members to a guardrail
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* Assign multiple organization members to a specific guardrail. [
|
|
15
|
+
* Assign multiple organization members to a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
16
|
*/
|
|
17
17
|
export declare function guardrailsBulkAssignMembers(client: OpenRouterCore, request: operations.BulkAssignMembersToGuardrailRequest, options?: RequestOptions): APIPromise<Result<operations.BulkAssignMembersToGuardrailResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
18
|
//# sourceMappingURL=guardrailsBulkAssignMembers.d.ts.map
|
|
@@ -15,7 +15,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
15
15
|
* Bulk assign members to a guardrail
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
|
-
* Assign multiple organization members to a specific guardrail. [
|
|
18
|
+
* Assign multiple organization members to a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
19
19
|
*/
|
|
20
20
|
export function guardrailsBulkAssignMembers(client, request, options) {
|
|
21
21
|
return new APIPromise($do(client, request, options));
|
|
@@ -37,6 +37,8 @@ async function $do(client, request, options) {
|
|
|
37
37
|
const headers = new Headers(compactMap({
|
|
38
38
|
"Content-Type": "application/json",
|
|
39
39
|
Accept: "application/json",
|
|
40
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
41
|
+
"X-Title": encodeSimple("X-Title", payload["X-Title"] ?? client._options.xTitle, { explode: false, charEncoding: "none" }),
|
|
40
42
|
}));
|
|
41
43
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
42
44
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
|
|
|
12
12
|
* Bulk unassign keys from a guardrail
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* Unassign multiple API keys from a specific guardrail. [
|
|
15
|
+
* Unassign multiple API keys from a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
16
|
*/
|
|
17
17
|
export declare function guardrailsBulkUnassignKeys(client: OpenRouterCore, request: operations.BulkUnassignKeysFromGuardrailRequest, options?: RequestOptions): APIPromise<Result<operations.BulkUnassignKeysFromGuardrailResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
18
|
//# sourceMappingURL=guardrailsBulkUnassignKeys.d.ts.map
|
|
@@ -15,7 +15,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
15
15
|
* Bulk unassign keys from a guardrail
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
|
-
* Unassign multiple API keys from a specific guardrail. [
|
|
18
|
+
* Unassign multiple API keys from a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
19
19
|
*/
|
|
20
20
|
export function guardrailsBulkUnassignKeys(client, request, options) {
|
|
21
21
|
return new APIPromise($do(client, request, options));
|
|
@@ -37,6 +37,8 @@ async function $do(client, request, options) {
|
|
|
37
37
|
const headers = new Headers(compactMap({
|
|
38
38
|
"Content-Type": "application/json",
|
|
39
39
|
Accept: "application/json",
|
|
40
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
41
|
+
"X-Title": encodeSimple("X-Title", payload["X-Title"] ?? client._options.xTitle, { explode: false, charEncoding: "none" }),
|
|
40
42
|
}));
|
|
41
43
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
42
44
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
|
|
|
12
12
|
* Bulk unassign members from a guardrail
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* Unassign multiple organization members from a specific guardrail. [
|
|
15
|
+
* Unassign multiple organization members from a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
16
|
*/
|
|
17
17
|
export declare function guardrailsBulkUnassignMembers(client: OpenRouterCore, request: operations.BulkUnassignMembersFromGuardrailRequest, options?: RequestOptions): APIPromise<Result<operations.BulkUnassignMembersFromGuardrailResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
18
|
//# sourceMappingURL=guardrailsBulkUnassignMembers.d.ts.map
|
|
@@ -15,7 +15,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
15
15
|
* Bulk unassign members from a guardrail
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
|
-
* Unassign multiple organization members from a specific guardrail. [
|
|
18
|
+
* Unassign multiple organization members from a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
19
19
|
*/
|
|
20
20
|
export function guardrailsBulkUnassignMembers(client, request, options) {
|
|
21
21
|
return new APIPromise($do(client, request, options));
|
|
@@ -37,6 +37,8 @@ async function $do(client, request, options) {
|
|
|
37
37
|
const headers = new Headers(compactMap({
|
|
38
38
|
"Content-Type": "application/json",
|
|
39
39
|
Accept: "application/json",
|
|
40
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
41
|
+
"X-Title": encodeSimple("X-Title", payload["X-Title"] ?? client._options.xTitle, { explode: false, charEncoding: "none" }),
|
|
40
42
|
}));
|
|
41
43
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
42
44
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
|
|
|
12
12
|
* Create a guardrail
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* Create a new guardrail for the authenticated user. [
|
|
15
|
+
* Create a new guardrail for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
16
|
*/
|
|
17
17
|
export declare function guardrailsCreate(client: OpenRouterCore, request: operations.CreateGuardrailRequest, options?: RequestOptions): APIPromise<Result<operations.CreateGuardrailResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
18
|
//# sourceMappingURL=guardrailsCreate.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
* @generated-id: 5878dd40f5cd
|
|
4
4
|
*/
|
|
5
|
-
import { encodeJSON } from "../lib/encodings.js";
|
|
5
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
6
6
|
import * as M from "../lib/matchers.js";
|
|
7
7
|
import { compactMap } from "../lib/primitives.js";
|
|
8
8
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -15,7 +15,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
15
15
|
* Create a guardrail
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
|
-
* Create a new guardrail for the authenticated user. [
|
|
18
|
+
* Create a new guardrail for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
19
19
|
*/
|
|
20
20
|
export function guardrailsCreate(client, request, options) {
|
|
21
21
|
return new APIPromise($do(client, request, options));
|
|
@@ -26,11 +26,13 @@ async function $do(client, request, options) {
|
|
|
26
26
|
return [parsed, { status: "invalid" }];
|
|
27
27
|
}
|
|
28
28
|
const payload = parsed.value;
|
|
29
|
-
const body = encodeJSON("body", payload, { explode: true });
|
|
29
|
+
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
30
30
|
const path = pathToFunc("/guardrails")();
|
|
31
31
|
const headers = new Headers(compactMap({
|
|
32
32
|
"Content-Type": "application/json",
|
|
33
33
|
Accept: "application/json",
|
|
34
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
35
|
+
"X-Title": encodeSimple("X-Title", payload["X-Title"] ?? client._options.xTitle, { explode: false, charEncoding: "none" }),
|
|
34
36
|
}));
|
|
35
37
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
36
38
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
|
|
|
12
12
|
* Delete a guardrail
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* Delete an existing guardrail. [
|
|
15
|
+
* Delete an existing guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
16
|
*/
|
|
17
17
|
export declare function guardrailsDelete(client: OpenRouterCore, request: operations.DeleteGuardrailRequest, options?: RequestOptions): APIPromise<Result<operations.DeleteGuardrailResponse, errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
18
|
//# sourceMappingURL=guardrailsDelete.d.ts.map
|
|
@@ -15,7 +15,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
15
15
|
* Delete a guardrail
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
|
-
* Delete an existing guardrail. [
|
|
18
|
+
* Delete an existing guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
19
19
|
*/
|
|
20
20
|
export function guardrailsDelete(client, request, options) {
|
|
21
21
|
return new APIPromise($do(client, request, options));
|
|
@@ -36,6 +36,8 @@ async function $do(client, request, options) {
|
|
|
36
36
|
const path = pathToFunc("/guardrails/{id}")(pathParams);
|
|
37
37
|
const headers = new Headers(compactMap({
|
|
38
38
|
Accept: "application/json",
|
|
39
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
40
|
+
"X-Title": encodeSimple("X-Title", payload["X-Title"] ?? client._options.xTitle, { explode: false, charEncoding: "none" }),
|
|
39
41
|
}));
|
|
40
42
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
41
43
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
|
|
|
12
12
|
* Get a guardrail
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* Get a single guardrail by ID. [
|
|
15
|
+
* Get a single guardrail by ID. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
16
|
*/
|
|
17
17
|
export declare function guardrailsGet(client: OpenRouterCore, request: operations.GetGuardrailRequest, options?: RequestOptions): APIPromise<Result<operations.GetGuardrailResponse, errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
18
|
//# sourceMappingURL=guardrailsGet.d.ts.map
|
|
@@ -15,7 +15,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
15
15
|
* Get a guardrail
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
|
-
* Get a single guardrail by ID. [
|
|
18
|
+
* Get a single guardrail by ID. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
19
19
|
*/
|
|
20
20
|
export function guardrailsGet(client, request, options) {
|
|
21
21
|
return new APIPromise($do(client, request, options));
|
|
@@ -36,6 +36,8 @@ async function $do(client, request, options) {
|
|
|
36
36
|
const path = pathToFunc("/guardrails/{id}")(pathParams);
|
|
37
37
|
const headers = new Headers(compactMap({
|
|
38
38
|
Accept: "application/json",
|
|
39
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
40
|
+
"X-Title": encodeSimple("X-Title", payload["X-Title"] ?? client._options.xTitle, { explode: false, charEncoding: "none" }),
|
|
39
41
|
}));
|
|
40
42
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
41
43
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
|
|
|
12
12
|
* List guardrails
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* List all guardrails for the authenticated user. [
|
|
15
|
+
* List all guardrails for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
16
|
*/
|
|
17
17
|
export declare function guardrailsList(client: OpenRouterCore, request?: operations.ListGuardrailsRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.ListGuardrailsResponse, errors.UnauthorizedResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
18
|
//# sourceMappingURL=guardrailsList.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
* @generated-id: 4c066e741cd8
|
|
4
4
|
*/
|
|
5
|
-
import { encodeFormQuery } from "../lib/encodings.js";
|
|
5
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
6
6
|
import * as M from "../lib/matchers.js";
|
|
7
7
|
import { compactMap } from "../lib/primitives.js";
|
|
8
8
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -15,7 +15,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
15
15
|
* List guardrails
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
|
-
* List all guardrails for the authenticated user. [
|
|
18
|
+
* List all guardrails for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
19
19
|
*/
|
|
20
20
|
export function guardrailsList(client, request, options) {
|
|
21
21
|
return new APIPromise($do(client, request, options));
|
|
@@ -34,6 +34,8 @@ async function $do(client, request, options) {
|
|
|
34
34
|
});
|
|
35
35
|
const headers = new Headers(compactMap({
|
|
36
36
|
Accept: "application/json",
|
|
37
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload?.["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
38
|
+
"X-Title": encodeSimple("X-Title", payload?.["X-Title"] ?? client._options.xTitle, { explode: false, charEncoding: "none" }),
|
|
37
39
|
}));
|
|
38
40
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
39
41
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
|
|
|
12
12
|
* List key assignments for a guardrail
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* List all API key assignments for a specific guardrail. [
|
|
15
|
+
* List all API key assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
16
|
*/
|
|
17
17
|
export declare function guardrailsListGuardrailKeyAssignments(client: OpenRouterCore, request: operations.ListGuardrailKeyAssignmentsRequest, options?: RequestOptions): APIPromise<Result<operations.ListGuardrailKeyAssignmentsResponse, errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
18
|
//# sourceMappingURL=guardrailsListGuardrailKeyAssignments.d.ts.map
|
|
@@ -15,7 +15,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
15
15
|
* List key assignments for a guardrail
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
|
-
* List all API key assignments for a specific guardrail. [
|
|
18
|
+
* List all API key assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
19
19
|
*/
|
|
20
20
|
export function guardrailsListGuardrailKeyAssignments(client, request, options) {
|
|
21
21
|
return new APIPromise($do(client, request, options));
|
|
@@ -40,6 +40,8 @@ async function $do(client, request, options) {
|
|
|
40
40
|
});
|
|
41
41
|
const headers = new Headers(compactMap({
|
|
42
42
|
Accept: "application/json",
|
|
43
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
44
|
+
"X-Title": encodeSimple("X-Title", payload["X-Title"] ?? client._options.xTitle, { explode: false, charEncoding: "none" }),
|
|
43
45
|
}));
|
|
44
46
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
45
47
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
|
|
|
12
12
|
* List member assignments for a guardrail
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* List all organization member assignments for a specific guardrail. [
|
|
15
|
+
* List all organization member assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
16
|
*/
|
|
17
17
|
export declare function guardrailsListGuardrailMemberAssignments(client: OpenRouterCore, request: operations.ListGuardrailMemberAssignmentsRequest, options?: RequestOptions): APIPromise<Result<operations.ListGuardrailMemberAssignmentsResponse, errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
18
|
//# sourceMappingURL=guardrailsListGuardrailMemberAssignments.d.ts.map
|
|
@@ -15,7 +15,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
15
15
|
* List member assignments for a guardrail
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
|
-
* List all organization member assignments for a specific guardrail. [
|
|
18
|
+
* List all organization member assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
19
19
|
*/
|
|
20
20
|
export function guardrailsListGuardrailMemberAssignments(client, request, options) {
|
|
21
21
|
return new APIPromise($do(client, request, options));
|
|
@@ -40,6 +40,8 @@ async function $do(client, request, options) {
|
|
|
40
40
|
});
|
|
41
41
|
const headers = new Headers(compactMap({
|
|
42
42
|
Accept: "application/json",
|
|
43
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
44
|
+
"X-Title": encodeSimple("X-Title", payload["X-Title"] ?? client._options.xTitle, { explode: false, charEncoding: "none" }),
|
|
43
45
|
}));
|
|
44
46
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
45
47
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
|
|
|
12
12
|
* List all key assignments
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* List all API key guardrail assignments for the authenticated user. [
|
|
15
|
+
* List all API key guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
16
|
*/
|
|
17
17
|
export declare function guardrailsListKeyAssignments(client: OpenRouterCore, request?: operations.ListKeyAssignmentsRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.ListKeyAssignmentsResponse, errors.UnauthorizedResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
18
|
//# sourceMappingURL=guardrailsListKeyAssignments.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
* @generated-id: 09465ee2cc6d
|
|
4
4
|
*/
|
|
5
|
-
import { encodeFormQuery } from "../lib/encodings.js";
|
|
5
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
6
6
|
import * as M from "../lib/matchers.js";
|
|
7
7
|
import { compactMap } from "../lib/primitives.js";
|
|
8
8
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -15,7 +15,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
15
15
|
* List all key assignments
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
|
-
* List all API key guardrail assignments for the authenticated user. [
|
|
18
|
+
* List all API key guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
19
19
|
*/
|
|
20
20
|
export function guardrailsListKeyAssignments(client, request, options) {
|
|
21
21
|
return new APIPromise($do(client, request, options));
|
|
@@ -34,6 +34,8 @@ async function $do(client, request, options) {
|
|
|
34
34
|
});
|
|
35
35
|
const headers = new Headers(compactMap({
|
|
36
36
|
Accept: "application/json",
|
|
37
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload?.["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
38
|
+
"X-Title": encodeSimple("X-Title", payload?.["X-Title"] ?? client._options.xTitle, { explode: false, charEncoding: "none" }),
|
|
37
39
|
}));
|
|
38
40
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
39
41
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
|
|
|
12
12
|
* List all member assignments
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* List all organization member guardrail assignments for the authenticated user. [
|
|
15
|
+
* List all organization member guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
16
|
*/
|
|
17
17
|
export declare function guardrailsListMemberAssignments(client: OpenRouterCore, request?: operations.ListMemberAssignmentsRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.ListMemberAssignmentsResponse, errors.UnauthorizedResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
18
|
//# sourceMappingURL=guardrailsListMemberAssignments.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
* @generated-id: f4359f4c7ba4
|
|
4
4
|
*/
|
|
5
|
-
import { encodeFormQuery } from "../lib/encodings.js";
|
|
5
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
6
6
|
import * as M from "../lib/matchers.js";
|
|
7
7
|
import { compactMap } from "../lib/primitives.js";
|
|
8
8
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -15,7 +15,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
15
15
|
* List all member assignments
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
|
-
* List all organization member guardrail assignments for the authenticated user. [
|
|
18
|
+
* List all organization member guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
19
19
|
*/
|
|
20
20
|
export function guardrailsListMemberAssignments(client, request, options) {
|
|
21
21
|
return new APIPromise($do(client, request, options));
|
|
@@ -34,6 +34,8 @@ async function $do(client, request, options) {
|
|
|
34
34
|
});
|
|
35
35
|
const headers = new Headers(compactMap({
|
|
36
36
|
Accept: "application/json",
|
|
37
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload?.["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
38
|
+
"X-Title": encodeSimple("X-Title", payload?.["X-Title"] ?? client._options.xTitle, { explode: false, charEncoding: "none" }),
|
|
37
39
|
}));
|
|
38
40
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
39
41
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
|
|
|
12
12
|
* Update a guardrail
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* Update an existing guardrail. [
|
|
15
|
+
* Update an existing guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
16
|
*/
|
|
17
17
|
export declare function guardrailsUpdate(client: OpenRouterCore, request: operations.UpdateGuardrailRequest, options?: RequestOptions): APIPromise<Result<operations.UpdateGuardrailResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
18
|
//# sourceMappingURL=guardrailsUpdate.d.ts.map
|
|
@@ -15,7 +15,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
15
15
|
* Update a guardrail
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
|
-
* Update an existing guardrail. [
|
|
18
|
+
* Update an existing guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
19
19
|
*/
|
|
20
20
|
export function guardrailsUpdate(client, request, options) {
|
|
21
21
|
return new APIPromise($do(client, request, options));
|
|
@@ -37,6 +37,8 @@ async function $do(client, request, options) {
|
|
|
37
37
|
const headers = new Headers(compactMap({
|
|
38
38
|
"Content-Type": "application/json",
|
|
39
39
|
Accept: "application/json",
|
|
40
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
41
|
+
"X-Title": encodeSimple("X-Title", payload["X-Title"] ?? client._options.xTitle, { explode: false, charEncoding: "none" }),
|
|
40
42
|
}));
|
|
41
43
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
42
44
|
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
@@ -6,10 +6,11 @@ import { OpenRouterError } from "../models/errors/openroutererror.js";
|
|
|
6
6
|
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
7
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
8
|
import * as models from "../models/index.js";
|
|
9
|
+
import * as operations from "../models/operations/index.js";
|
|
9
10
|
import { APIPromise } from "../types/async.js";
|
|
10
11
|
import { Result } from "../types/fp.js";
|
|
11
12
|
/**
|
|
12
13
|
* Get total count of available models
|
|
13
14
|
*/
|
|
14
|
-
export declare function modelsCount(client: OpenRouterCore, options?: RequestOptions): APIPromise<Result<models.ModelsCountResponse, errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
15
|
+
export declare function modelsCount(client: OpenRouterCore, request?: operations.ListModelsCountRequest | undefined, options?: RequestOptions): APIPromise<Result<models.ModelsCountResponse, errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
15
16
|
//# sourceMappingURL=modelsCount.d.ts.map
|