@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
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
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
|
+
export type BulkAssignMembersToGuardrailGlobals = {
|
|
5
|
+
/**
|
|
6
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* This is used to track API usage per application.
|
|
10
|
+
*/
|
|
11
|
+
httpReferer?: string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
*/
|
|
17
|
+
xTitle?: string | undefined;
|
|
18
|
+
};
|
|
4
19
|
export type BulkAssignMembersToGuardrailRequestBody = {
|
|
5
20
|
/**
|
|
6
21
|
* Array of member user IDs to assign to the guardrail
|
|
@@ -8,6 +23,19 @@ export type BulkAssignMembersToGuardrailRequestBody = {
|
|
|
8
23
|
memberUserIds: Array<string>;
|
|
9
24
|
};
|
|
10
25
|
export type BulkAssignMembersToGuardrailRequest = {
|
|
26
|
+
/**
|
|
27
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* This is used to track API usage per application.
|
|
31
|
+
*/
|
|
32
|
+
httpReferer?: string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
*/
|
|
38
|
+
xTitle?: string | undefined;
|
|
11
39
|
/**
|
|
12
40
|
* The unique identifier of the guardrail
|
|
13
41
|
*/
|
|
@@ -32,6 +60,8 @@ export declare const BulkAssignMembersToGuardrailRequestBody$outboundSchema: z.Z
|
|
|
32
60
|
export declare function bulkAssignMembersToGuardrailRequestBodyToJSON(bulkAssignMembersToGuardrailRequestBody: BulkAssignMembersToGuardrailRequestBody): string;
|
|
33
61
|
/** @internal */
|
|
34
62
|
export type BulkAssignMembersToGuardrailRequest$Outbound = {
|
|
63
|
+
"HTTP-Referer"?: string | undefined;
|
|
64
|
+
"X-Title"?: string | undefined;
|
|
35
65
|
id: string;
|
|
36
66
|
RequestBody: BulkAssignMembersToGuardrailRequestBody$Outbound;
|
|
37
67
|
};
|
|
@@ -18,10 +18,14 @@ export function bulkAssignMembersToGuardrailRequestBodyToJSON(bulkAssignMembersT
|
|
|
18
18
|
}
|
|
19
19
|
/** @internal */
|
|
20
20
|
export const BulkAssignMembersToGuardrailRequest$outboundSchema = z.object({
|
|
21
|
+
httpReferer: z.string().optional(),
|
|
22
|
+
xTitle: z.string().optional(),
|
|
21
23
|
id: z.string(),
|
|
22
24
|
requestBody: z.lazy(() => BulkAssignMembersToGuardrailRequestBody$outboundSchema),
|
|
23
25
|
}).transform((v) => {
|
|
24
26
|
return remap$(v, {
|
|
27
|
+
httpReferer: "HTTP-Referer",
|
|
28
|
+
xTitle: "X-Title",
|
|
25
29
|
requestBody: "RequestBody",
|
|
26
30
|
});
|
|
27
31
|
});
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
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
|
+
export type BulkUnassignKeysFromGuardrailGlobals = {
|
|
5
|
+
/**
|
|
6
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* This is used to track API usage per application.
|
|
10
|
+
*/
|
|
11
|
+
httpReferer?: string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
*/
|
|
17
|
+
xTitle?: string | undefined;
|
|
18
|
+
};
|
|
4
19
|
export type BulkUnassignKeysFromGuardrailRequestBody = {
|
|
5
20
|
/**
|
|
6
21
|
* Array of API key hashes to unassign from the guardrail
|
|
@@ -8,6 +23,19 @@ export type BulkUnassignKeysFromGuardrailRequestBody = {
|
|
|
8
23
|
keyHashes: Array<string>;
|
|
9
24
|
};
|
|
10
25
|
export type BulkUnassignKeysFromGuardrailRequest = {
|
|
26
|
+
/**
|
|
27
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* This is used to track API usage per application.
|
|
31
|
+
*/
|
|
32
|
+
httpReferer?: string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
*/
|
|
38
|
+
xTitle?: string | undefined;
|
|
11
39
|
/**
|
|
12
40
|
* The unique identifier of the guardrail
|
|
13
41
|
*/
|
|
@@ -32,6 +60,8 @@ export declare const BulkUnassignKeysFromGuardrailRequestBody$outboundSchema: z.
|
|
|
32
60
|
export declare function bulkUnassignKeysFromGuardrailRequestBodyToJSON(bulkUnassignKeysFromGuardrailRequestBody: BulkUnassignKeysFromGuardrailRequestBody): string;
|
|
33
61
|
/** @internal */
|
|
34
62
|
export type BulkUnassignKeysFromGuardrailRequest$Outbound = {
|
|
63
|
+
"HTTP-Referer"?: string | undefined;
|
|
64
|
+
"X-Title"?: string | undefined;
|
|
35
65
|
id: string;
|
|
36
66
|
RequestBody: BulkUnassignKeysFromGuardrailRequestBody$Outbound;
|
|
37
67
|
};
|
|
@@ -18,10 +18,14 @@ export function bulkUnassignKeysFromGuardrailRequestBodyToJSON(bulkUnassignKeysF
|
|
|
18
18
|
}
|
|
19
19
|
/** @internal */
|
|
20
20
|
export const BulkUnassignKeysFromGuardrailRequest$outboundSchema = z.object({
|
|
21
|
+
httpReferer: z.string().optional(),
|
|
22
|
+
xTitle: z.string().optional(),
|
|
21
23
|
id: z.string(),
|
|
22
24
|
requestBody: z.lazy(() => BulkUnassignKeysFromGuardrailRequestBody$outboundSchema),
|
|
23
25
|
}).transform((v) => {
|
|
24
26
|
return remap$(v, {
|
|
27
|
+
httpReferer: "HTTP-Referer",
|
|
28
|
+
xTitle: "X-Title",
|
|
25
29
|
requestBody: "RequestBody",
|
|
26
30
|
});
|
|
27
31
|
});
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
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
|
+
export type BulkUnassignMembersFromGuardrailGlobals = {
|
|
5
|
+
/**
|
|
6
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* This is used to track API usage per application.
|
|
10
|
+
*/
|
|
11
|
+
httpReferer?: string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
*/
|
|
17
|
+
xTitle?: string | undefined;
|
|
18
|
+
};
|
|
4
19
|
export type BulkUnassignMembersFromGuardrailRequestBody = {
|
|
5
20
|
/**
|
|
6
21
|
* Array of member user IDs to unassign from the guardrail
|
|
@@ -8,6 +23,19 @@ export type BulkUnassignMembersFromGuardrailRequestBody = {
|
|
|
8
23
|
memberUserIds: Array<string>;
|
|
9
24
|
};
|
|
10
25
|
export type BulkUnassignMembersFromGuardrailRequest = {
|
|
26
|
+
/**
|
|
27
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* This is used to track API usage per application.
|
|
31
|
+
*/
|
|
32
|
+
httpReferer?: string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
*/
|
|
38
|
+
xTitle?: string | undefined;
|
|
11
39
|
/**
|
|
12
40
|
* The unique identifier of the guardrail
|
|
13
41
|
*/
|
|
@@ -32,6 +60,8 @@ export declare const BulkUnassignMembersFromGuardrailRequestBody$outboundSchema:
|
|
|
32
60
|
export declare function bulkUnassignMembersFromGuardrailRequestBodyToJSON(bulkUnassignMembersFromGuardrailRequestBody: BulkUnassignMembersFromGuardrailRequestBody): string;
|
|
33
61
|
/** @internal */
|
|
34
62
|
export type BulkUnassignMembersFromGuardrailRequest$Outbound = {
|
|
63
|
+
"HTTP-Referer"?: string | undefined;
|
|
64
|
+
"X-Title"?: string | undefined;
|
|
35
65
|
id: string;
|
|
36
66
|
RequestBody: BulkUnassignMembersFromGuardrailRequestBody$Outbound;
|
|
37
67
|
};
|
|
@@ -18,10 +18,14 @@ export function bulkUnassignMembersFromGuardrailRequestBodyToJSON(bulkUnassignMe
|
|
|
18
18
|
}
|
|
19
19
|
/** @internal */
|
|
20
20
|
export const BulkUnassignMembersFromGuardrailRequest$outboundSchema = z.object({
|
|
21
|
+
httpReferer: z.string().optional(),
|
|
22
|
+
xTitle: z.string().optional(),
|
|
21
23
|
id: z.string(),
|
|
22
24
|
requestBody: z.lazy(() => BulkUnassignMembersFromGuardrailRequestBody$outboundSchema),
|
|
23
25
|
}).transform((v) => {
|
|
24
26
|
return remap$(v, {
|
|
27
|
+
httpReferer: "HTTP-Referer",
|
|
28
|
+
xTitle: "X-Title",
|
|
25
29
|
requestBody: "RequestBody",
|
|
26
30
|
});
|
|
27
31
|
});
|
|
@@ -2,6 +2,21 @@ 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 type CreateAuthKeysCodeGlobals = {
|
|
6
|
+
/**
|
|
7
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* This is used to track API usage per application.
|
|
11
|
+
*/
|
|
12
|
+
httpReferer?: string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
*/
|
|
18
|
+
xTitle?: string | undefined;
|
|
19
|
+
};
|
|
5
20
|
/**
|
|
6
21
|
* The method used to generate the code challenge
|
|
7
22
|
*/
|
|
@@ -13,7 +28,19 @@ export declare const CreateAuthKeysCodeCodeChallengeMethod: {
|
|
|
13
28
|
* The method used to generate the code challenge
|
|
14
29
|
*/
|
|
15
30
|
export type CreateAuthKeysCodeCodeChallengeMethod = OpenEnum<typeof CreateAuthKeysCodeCodeChallengeMethod>;
|
|
16
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Optional credit limit reset interval. When set, the credit limit resets on this interval.
|
|
33
|
+
*/
|
|
34
|
+
export declare const UsageLimitType: {
|
|
35
|
+
readonly Daily: "daily";
|
|
36
|
+
readonly Weekly: "weekly";
|
|
37
|
+
readonly Monthly: "monthly";
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Optional credit limit reset interval. When set, the credit limit resets on this interval.
|
|
41
|
+
*/
|
|
42
|
+
export type UsageLimitType = OpenEnum<typeof UsageLimitType>;
|
|
43
|
+
export type CreateAuthKeysCodeRequestBody = {
|
|
17
44
|
/**
|
|
18
45
|
* The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are allowed.
|
|
19
46
|
*/
|
|
@@ -34,6 +61,30 @@ export type CreateAuthKeysCodeRequest = {
|
|
|
34
61
|
* Optional expiration time for the API key to be created
|
|
35
62
|
*/
|
|
36
63
|
expiresAt?: Date | null | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Optional custom label for the API key. Defaults to the app name if not provided.
|
|
66
|
+
*/
|
|
67
|
+
keyLabel?: string | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Optional credit limit reset interval. When set, the credit limit resets on this interval.
|
|
70
|
+
*/
|
|
71
|
+
usageLimitType?: UsageLimitType | undefined;
|
|
72
|
+
};
|
|
73
|
+
export type CreateAuthKeysCodeRequest = {
|
|
74
|
+
/**
|
|
75
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
76
|
+
*
|
|
77
|
+
* @remarks
|
|
78
|
+
* This is used to track API usage per application.
|
|
79
|
+
*/
|
|
80
|
+
httpReferer?: string | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
83
|
+
*
|
|
84
|
+
* @remarks
|
|
85
|
+
*/
|
|
86
|
+
xTitle?: string | undefined;
|
|
87
|
+
requestBody: CreateAuthKeysCodeRequestBody;
|
|
37
88
|
};
|
|
38
89
|
/**
|
|
39
90
|
* Auth code data
|
|
@@ -64,12 +115,25 @@ export type CreateAuthKeysCodeResponse = {
|
|
|
64
115
|
/** @internal */
|
|
65
116
|
export declare const CreateAuthKeysCodeCodeChallengeMethod$outboundSchema: z.ZodType<string, CreateAuthKeysCodeCodeChallengeMethod>;
|
|
66
117
|
/** @internal */
|
|
67
|
-
export
|
|
118
|
+
export declare const UsageLimitType$outboundSchema: z.ZodType<string, UsageLimitType>;
|
|
119
|
+
/** @internal */
|
|
120
|
+
export type CreateAuthKeysCodeRequestBody$Outbound = {
|
|
68
121
|
callback_url: string;
|
|
69
122
|
code_challenge?: string | undefined;
|
|
70
123
|
code_challenge_method?: string | undefined;
|
|
71
124
|
limit?: number | undefined;
|
|
72
125
|
expires_at?: string | null | undefined;
|
|
126
|
+
key_label?: string | undefined;
|
|
127
|
+
usage_limit_type?: string | undefined;
|
|
128
|
+
};
|
|
129
|
+
/** @internal */
|
|
130
|
+
export declare const CreateAuthKeysCodeRequestBody$outboundSchema: z.ZodType<CreateAuthKeysCodeRequestBody$Outbound, CreateAuthKeysCodeRequestBody>;
|
|
131
|
+
export declare function createAuthKeysCodeRequestBodyToJSON(createAuthKeysCodeRequestBody: CreateAuthKeysCodeRequestBody): string;
|
|
132
|
+
/** @internal */
|
|
133
|
+
export type CreateAuthKeysCodeRequest$Outbound = {
|
|
134
|
+
"HTTP-Referer"?: string | undefined;
|
|
135
|
+
"X-Title"?: string | undefined;
|
|
136
|
+
RequestBody: CreateAuthKeysCodeRequestBody$Outbound;
|
|
73
137
|
};
|
|
74
138
|
/** @internal */
|
|
75
139
|
export declare const CreateAuthKeysCodeRequest$outboundSchema: z.ZodType<CreateAuthKeysCodeRequest$Outbound, CreateAuthKeysCodeRequest>;
|
|
@@ -13,22 +13,51 @@ export const CreateAuthKeysCodeCodeChallengeMethod = {
|
|
|
13
13
|
S256: "S256",
|
|
14
14
|
Plain: "plain",
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Optional credit limit reset interval. When set, the credit limit resets on this interval.
|
|
18
|
+
*/
|
|
19
|
+
export const UsageLimitType = {
|
|
20
|
+
Daily: "daily",
|
|
21
|
+
Weekly: "weekly",
|
|
22
|
+
Monthly: "monthly",
|
|
23
|
+
};
|
|
16
24
|
/** @internal */
|
|
17
25
|
export const CreateAuthKeysCodeCodeChallengeMethod$outboundSchema = openEnums.outboundSchema(CreateAuthKeysCodeCodeChallengeMethod);
|
|
18
26
|
/** @internal */
|
|
19
|
-
export const
|
|
27
|
+
export const UsageLimitType$outboundSchema = openEnums.outboundSchema(UsageLimitType);
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const CreateAuthKeysCodeRequestBody$outboundSchema = z.object({
|
|
20
30
|
callbackUrl: z.string(),
|
|
21
31
|
codeChallenge: z.string().optional(),
|
|
22
32
|
codeChallengeMethod: CreateAuthKeysCodeCodeChallengeMethod$outboundSchema
|
|
23
33
|
.optional(),
|
|
24
34
|
limit: z.number().optional(),
|
|
25
35
|
expiresAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
|
|
36
|
+
keyLabel: z.string().optional(),
|
|
37
|
+
usageLimitType: UsageLimitType$outboundSchema.optional(),
|
|
26
38
|
}).transform((v) => {
|
|
27
39
|
return remap$(v, {
|
|
28
40
|
callbackUrl: "callback_url",
|
|
29
41
|
codeChallenge: "code_challenge",
|
|
30
42
|
codeChallengeMethod: "code_challenge_method",
|
|
31
43
|
expiresAt: "expires_at",
|
|
44
|
+
keyLabel: "key_label",
|
|
45
|
+
usageLimitType: "usage_limit_type",
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
export function createAuthKeysCodeRequestBodyToJSON(createAuthKeysCodeRequestBody) {
|
|
49
|
+
return JSON.stringify(CreateAuthKeysCodeRequestBody$outboundSchema.parse(createAuthKeysCodeRequestBody));
|
|
50
|
+
}
|
|
51
|
+
/** @internal */
|
|
52
|
+
export const CreateAuthKeysCodeRequest$outboundSchema = z.object({
|
|
53
|
+
httpReferer: z.string().optional(),
|
|
54
|
+
xTitle: z.string().optional(),
|
|
55
|
+
requestBody: z.lazy(() => CreateAuthKeysCodeRequestBody$outboundSchema),
|
|
56
|
+
}).transform((v) => {
|
|
57
|
+
return remap$(v, {
|
|
58
|
+
httpReferer: "HTTP-Referer",
|
|
59
|
+
xTitle: "X-Title",
|
|
60
|
+
requestBody: "RequestBody",
|
|
32
61
|
});
|
|
33
62
|
});
|
|
34
63
|
export function createAuthKeysCodeRequestToJSON(createAuthKeysCodeRequest) {
|
|
@@ -1,9 +1,41 @@
|
|
|
1
1
|
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
|
+
import * as models from "../index.js";
|
|
5
|
+
export type CreateCoinbaseChargeGlobals = {
|
|
6
|
+
/**
|
|
7
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* This is used to track API usage per application.
|
|
11
|
+
*/
|
|
12
|
+
httpReferer?: string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
*/
|
|
18
|
+
xTitle?: string | undefined;
|
|
19
|
+
};
|
|
4
20
|
export type CreateCoinbaseChargeSecurity = {
|
|
5
21
|
bearer: string;
|
|
6
22
|
};
|
|
23
|
+
export type CreateCoinbaseChargeRequest = {
|
|
24
|
+
/**
|
|
25
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* This is used to track API usage per application.
|
|
29
|
+
*/
|
|
30
|
+
httpReferer?: string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
*/
|
|
36
|
+
xTitle?: string | undefined;
|
|
37
|
+
createChargeRequest: models.CreateChargeRequest;
|
|
38
|
+
};
|
|
7
39
|
export type CallData = {
|
|
8
40
|
deadline: string;
|
|
9
41
|
feeAmount: string;
|
|
@@ -48,6 +80,15 @@ export type CreateCoinbaseChargeSecurity$Outbound = {
|
|
|
48
80
|
export declare const CreateCoinbaseChargeSecurity$outboundSchema: z.ZodType<CreateCoinbaseChargeSecurity$Outbound, CreateCoinbaseChargeSecurity>;
|
|
49
81
|
export declare function createCoinbaseChargeSecurityToJSON(createCoinbaseChargeSecurity: CreateCoinbaseChargeSecurity): string;
|
|
50
82
|
/** @internal */
|
|
83
|
+
export type CreateCoinbaseChargeRequest$Outbound = {
|
|
84
|
+
"HTTP-Referer"?: string | undefined;
|
|
85
|
+
"X-Title"?: string | undefined;
|
|
86
|
+
CreateChargeRequest: models.CreateChargeRequest$Outbound;
|
|
87
|
+
};
|
|
88
|
+
/** @internal */
|
|
89
|
+
export declare const CreateCoinbaseChargeRequest$outboundSchema: z.ZodType<CreateCoinbaseChargeRequest$Outbound, CreateCoinbaseChargeRequest>;
|
|
90
|
+
export declare function createCoinbaseChargeRequestToJSON(createCoinbaseChargeRequest: CreateCoinbaseChargeRequest): string;
|
|
91
|
+
/** @internal */
|
|
51
92
|
export declare const CallData$inboundSchema: z.ZodType<CallData, unknown>;
|
|
52
93
|
export declare function callDataFromJSON(jsonString: string): SafeParseResult<CallData, SDKValidationError>;
|
|
53
94
|
/** @internal */
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
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
|
+
import * as models from "../index.js";
|
|
8
9
|
/** @internal */
|
|
9
10
|
export const CreateCoinbaseChargeSecurity$outboundSchema = z.object({
|
|
10
11
|
bearer: z.string(),
|
|
@@ -13,6 +14,21 @@ export function createCoinbaseChargeSecurityToJSON(createCoinbaseChargeSecurity)
|
|
|
13
14
|
return JSON.stringify(CreateCoinbaseChargeSecurity$outboundSchema.parse(createCoinbaseChargeSecurity));
|
|
14
15
|
}
|
|
15
16
|
/** @internal */
|
|
17
|
+
export const CreateCoinbaseChargeRequest$outboundSchema = z.object({
|
|
18
|
+
httpReferer: z.string().optional(),
|
|
19
|
+
xTitle: z.string().optional(),
|
|
20
|
+
createChargeRequest: models.CreateChargeRequest$outboundSchema,
|
|
21
|
+
}).transform((v) => {
|
|
22
|
+
return remap$(v, {
|
|
23
|
+
httpReferer: "HTTP-Referer",
|
|
24
|
+
xTitle: "X-Title",
|
|
25
|
+
createChargeRequest: "CreateChargeRequest",
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
export function createCoinbaseChargeRequestToJSON(createCoinbaseChargeRequest) {
|
|
29
|
+
return JSON.stringify(CreateCoinbaseChargeRequest$outboundSchema.parse(createCoinbaseChargeRequest));
|
|
30
|
+
}
|
|
31
|
+
/** @internal */
|
|
16
32
|
export const CallData$inboundSchema = z.object({
|
|
17
33
|
deadline: z.string(),
|
|
18
34
|
fee_amount: z.string(),
|
|
@@ -3,6 +3,21 @@ import { ClosedEnum, OpenEnum } from "../../types/enums.js";
|
|
|
3
3
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
5
5
|
import * as models from "../index.js";
|
|
6
|
+
export type CreateEmbeddingsGlobals = {
|
|
7
|
+
/**
|
|
8
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* This is used to track API usage per application.
|
|
12
|
+
*/
|
|
13
|
+
httpReferer?: string | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
*/
|
|
19
|
+
xTitle?: string | undefined;
|
|
20
|
+
};
|
|
6
21
|
export type ImageUrl = {
|
|
7
22
|
url: string;
|
|
8
23
|
};
|
|
@@ -24,7 +39,7 @@ export declare const EncodingFormat: {
|
|
|
24
39
|
readonly Base64: "base64";
|
|
25
40
|
};
|
|
26
41
|
export type EncodingFormat = OpenEnum<typeof EncodingFormat>;
|
|
27
|
-
export type
|
|
42
|
+
export type CreateEmbeddingsRequestBody = {
|
|
28
43
|
input: string | Array<string> | Array<number> | Array<Array<number>> | Array<Input>;
|
|
29
44
|
model: string;
|
|
30
45
|
encodingFormat?: EncodingFormat | undefined;
|
|
@@ -36,6 +51,22 @@ export type CreateEmbeddingsRequest = {
|
|
|
36
51
|
provider?: models.ProviderPreferences | undefined;
|
|
37
52
|
inputType?: string | undefined;
|
|
38
53
|
};
|
|
54
|
+
export type CreateEmbeddingsRequest = {
|
|
55
|
+
/**
|
|
56
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* This is used to track API usage per application.
|
|
60
|
+
*/
|
|
61
|
+
httpReferer?: string | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
64
|
+
*
|
|
65
|
+
* @remarks
|
|
66
|
+
*/
|
|
67
|
+
xTitle?: string | undefined;
|
|
68
|
+
requestBody: CreateEmbeddingsRequestBody;
|
|
69
|
+
};
|
|
39
70
|
export declare const ObjectT: {
|
|
40
71
|
readonly List: "list";
|
|
41
72
|
};
|
|
@@ -109,7 +140,7 @@ export declare function inputUnionToJSON(inputUnion: InputUnion): string;
|
|
|
109
140
|
/** @internal */
|
|
110
141
|
export declare const EncodingFormat$outboundSchema: z.ZodType<string, EncodingFormat>;
|
|
111
142
|
/** @internal */
|
|
112
|
-
export type
|
|
143
|
+
export type CreateEmbeddingsRequestBody$Outbound = {
|
|
113
144
|
input: string | Array<string> | Array<number> | Array<Array<number>> | Array<Input$Outbound>;
|
|
114
145
|
model: string;
|
|
115
146
|
encoding_format?: string | undefined;
|
|
@@ -119,6 +150,15 @@ export type CreateEmbeddingsRequest$Outbound = {
|
|
|
119
150
|
input_type?: string | undefined;
|
|
120
151
|
};
|
|
121
152
|
/** @internal */
|
|
153
|
+
export declare const CreateEmbeddingsRequestBody$outboundSchema: z.ZodType<CreateEmbeddingsRequestBody$Outbound, CreateEmbeddingsRequestBody>;
|
|
154
|
+
export declare function createEmbeddingsRequestBodyToJSON(createEmbeddingsRequestBody: CreateEmbeddingsRequestBody): string;
|
|
155
|
+
/** @internal */
|
|
156
|
+
export type CreateEmbeddingsRequest$Outbound = {
|
|
157
|
+
"HTTP-Referer"?: string | undefined;
|
|
158
|
+
"X-Title"?: string | undefined;
|
|
159
|
+
RequestBody: CreateEmbeddingsRequestBody$Outbound;
|
|
160
|
+
};
|
|
161
|
+
/** @internal */
|
|
122
162
|
export declare const CreateEmbeddingsRequest$outboundSchema: z.ZodType<CreateEmbeddingsRequest$Outbound, CreateEmbeddingsRequest>;
|
|
123
163
|
export declare function createEmbeddingsRequestToJSON(createEmbeddingsRequest: CreateEmbeddingsRequest): string;
|
|
124
164
|
/** @internal */
|
|
@@ -78,7 +78,7 @@ export function inputUnionToJSON(inputUnion) {
|
|
|
78
78
|
/** @internal */
|
|
79
79
|
export const EncodingFormat$outboundSchema = openEnums.outboundSchema(EncodingFormat);
|
|
80
80
|
/** @internal */
|
|
81
|
-
export const
|
|
81
|
+
export const CreateEmbeddingsRequestBody$outboundSchema = z.object({
|
|
82
82
|
input: z.union([
|
|
83
83
|
z.string(),
|
|
84
84
|
z.array(z.string()),
|
|
@@ -98,6 +98,21 @@ export const CreateEmbeddingsRequest$outboundSchema = z.object({
|
|
|
98
98
|
inputType: "input_type",
|
|
99
99
|
});
|
|
100
100
|
});
|
|
101
|
+
export function createEmbeddingsRequestBodyToJSON(createEmbeddingsRequestBody) {
|
|
102
|
+
return JSON.stringify(CreateEmbeddingsRequestBody$outboundSchema.parse(createEmbeddingsRequestBody));
|
|
103
|
+
}
|
|
104
|
+
/** @internal */
|
|
105
|
+
export const CreateEmbeddingsRequest$outboundSchema = z.object({
|
|
106
|
+
httpReferer: z.string().optional(),
|
|
107
|
+
xTitle: z.string().optional(),
|
|
108
|
+
requestBody: z.lazy(() => CreateEmbeddingsRequestBody$outboundSchema),
|
|
109
|
+
}).transform((v) => {
|
|
110
|
+
return remap$(v, {
|
|
111
|
+
httpReferer: "HTTP-Referer",
|
|
112
|
+
xTitle: "X-Title",
|
|
113
|
+
requestBody: "RequestBody",
|
|
114
|
+
});
|
|
115
|
+
});
|
|
101
116
|
export function createEmbeddingsRequestToJSON(createEmbeddingsRequest) {
|
|
102
117
|
return JSON.stringify(CreateEmbeddingsRequest$outboundSchema.parse(createEmbeddingsRequest));
|
|
103
118
|
}
|
|
@@ -2,6 +2,21 @@ 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 type CreateGuardrailGlobals = {
|
|
6
|
+
/**
|
|
7
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* This is used to track API usage per application.
|
|
11
|
+
*/
|
|
12
|
+
httpReferer?: string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
*/
|
|
18
|
+
xTitle?: string | undefined;
|
|
19
|
+
};
|
|
5
20
|
/**
|
|
6
21
|
* Interval at which the limit resets (daily, weekly, monthly)
|
|
7
22
|
*/
|
|
@@ -14,7 +29,7 @@ export declare const CreateGuardrailResetIntervalRequest: {
|
|
|
14
29
|
* Interval at which the limit resets (daily, weekly, monthly)
|
|
15
30
|
*/
|
|
16
31
|
export type CreateGuardrailResetIntervalRequest = OpenEnum<typeof CreateGuardrailResetIntervalRequest>;
|
|
17
|
-
export type
|
|
32
|
+
export type CreateGuardrailRequestBody = {
|
|
18
33
|
/**
|
|
19
34
|
* Name for the new guardrail
|
|
20
35
|
*/
|
|
@@ -44,6 +59,22 @@ export type CreateGuardrailRequest = {
|
|
|
44
59
|
*/
|
|
45
60
|
enforceZdr?: boolean | null | undefined;
|
|
46
61
|
};
|
|
62
|
+
export type CreateGuardrailRequest = {
|
|
63
|
+
/**
|
|
64
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
65
|
+
*
|
|
66
|
+
* @remarks
|
|
67
|
+
* This is used to track API usage per application.
|
|
68
|
+
*/
|
|
69
|
+
httpReferer?: string | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
72
|
+
*
|
|
73
|
+
* @remarks
|
|
74
|
+
*/
|
|
75
|
+
xTitle?: string | undefined;
|
|
76
|
+
requestBody: CreateGuardrailRequestBody;
|
|
77
|
+
};
|
|
47
78
|
/**
|
|
48
79
|
* Interval at which the limit resets (daily, weekly, monthly)
|
|
49
80
|
*/
|
|
@@ -113,7 +144,7 @@ export type CreateGuardrailResponse = {
|
|
|
113
144
|
/** @internal */
|
|
114
145
|
export declare const CreateGuardrailResetIntervalRequest$outboundSchema: z.ZodType<string, CreateGuardrailResetIntervalRequest>;
|
|
115
146
|
/** @internal */
|
|
116
|
-
export type
|
|
147
|
+
export type CreateGuardrailRequestBody$Outbound = {
|
|
117
148
|
name: string;
|
|
118
149
|
description?: string | null | undefined;
|
|
119
150
|
limit_usd?: number | null | undefined;
|
|
@@ -123,6 +154,15 @@ export type CreateGuardrailRequest$Outbound = {
|
|
|
123
154
|
enforce_zdr?: boolean | null | undefined;
|
|
124
155
|
};
|
|
125
156
|
/** @internal */
|
|
157
|
+
export declare const CreateGuardrailRequestBody$outboundSchema: z.ZodType<CreateGuardrailRequestBody$Outbound, CreateGuardrailRequestBody>;
|
|
158
|
+
export declare function createGuardrailRequestBodyToJSON(createGuardrailRequestBody: CreateGuardrailRequestBody): string;
|
|
159
|
+
/** @internal */
|
|
160
|
+
export type CreateGuardrailRequest$Outbound = {
|
|
161
|
+
"HTTP-Referer"?: string | undefined;
|
|
162
|
+
"X-Title"?: string | undefined;
|
|
163
|
+
RequestBody: CreateGuardrailRequestBody$Outbound;
|
|
164
|
+
};
|
|
165
|
+
/** @internal */
|
|
126
166
|
export declare const CreateGuardrailRequest$outboundSchema: z.ZodType<CreateGuardrailRequest$Outbound, CreateGuardrailRequest>;
|
|
127
167
|
export declare function createGuardrailRequestToJSON(createGuardrailRequest: CreateGuardrailRequest): string;
|
|
128
168
|
/** @internal */
|
|
@@ -25,7 +25,7 @@ export const CreateGuardrailResetIntervalResponse = {
|
|
|
25
25
|
/** @internal */
|
|
26
26
|
export const CreateGuardrailResetIntervalRequest$outboundSchema = openEnums.outboundSchema(CreateGuardrailResetIntervalRequest);
|
|
27
27
|
/** @internal */
|
|
28
|
-
export const
|
|
28
|
+
export const CreateGuardrailRequestBody$outboundSchema = z.object({
|
|
29
29
|
name: z.string(),
|
|
30
30
|
description: z.nullable(z.string()).optional(),
|
|
31
31
|
limitUsd: z.nullable(z.number()).optional(),
|
|
@@ -43,6 +43,21 @@ export const CreateGuardrailRequest$outboundSchema = z.object({
|
|
|
43
43
|
enforceZdr: "enforce_zdr",
|
|
44
44
|
});
|
|
45
45
|
});
|
|
46
|
+
export function createGuardrailRequestBodyToJSON(createGuardrailRequestBody) {
|
|
47
|
+
return JSON.stringify(CreateGuardrailRequestBody$outboundSchema.parse(createGuardrailRequestBody));
|
|
48
|
+
}
|
|
49
|
+
/** @internal */
|
|
50
|
+
export const CreateGuardrailRequest$outboundSchema = z.object({
|
|
51
|
+
httpReferer: z.string().optional(),
|
|
52
|
+
xTitle: z.string().optional(),
|
|
53
|
+
requestBody: z.lazy(() => CreateGuardrailRequestBody$outboundSchema),
|
|
54
|
+
}).transform((v) => {
|
|
55
|
+
return remap$(v, {
|
|
56
|
+
httpReferer: "HTTP-Referer",
|
|
57
|
+
xTitle: "X-Title",
|
|
58
|
+
requestBody: "RequestBody",
|
|
59
|
+
});
|
|
60
|
+
});
|
|
46
61
|
export function createGuardrailRequestToJSON(createGuardrailRequest) {
|
|
47
62
|
return JSON.stringify(CreateGuardrailRequest$outboundSchema.parse(createGuardrailRequest));
|
|
48
63
|
}
|