@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,7 +2,35 @@ 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 GetGenerationGlobals = {
|
|
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
|
export type GetGenerationRequest = {
|
|
21
|
+
/**
|
|
22
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* This is used to track API usage per application.
|
|
26
|
+
*/
|
|
27
|
+
httpReferer?: string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
*/
|
|
33
|
+
xTitle?: string | undefined;
|
|
6
34
|
id: string;
|
|
7
35
|
};
|
|
8
36
|
/**
|
|
@@ -16,6 +44,120 @@ export declare const ApiType: {
|
|
|
16
44
|
* Type of API used for the generation
|
|
17
45
|
*/
|
|
18
46
|
export type ApiType = OpenEnum<typeof ApiType>;
|
|
47
|
+
export declare const ProviderName: {
|
|
48
|
+
readonly AnyScale: "AnyScale";
|
|
49
|
+
readonly Atoma: "Atoma";
|
|
50
|
+
readonly CentML: "Cent-ML";
|
|
51
|
+
readonly CrofAI: "CrofAI";
|
|
52
|
+
readonly Enfer: "Enfer";
|
|
53
|
+
readonly GoPomelo: "GoPomelo";
|
|
54
|
+
readonly HuggingFace: "HuggingFace";
|
|
55
|
+
readonly Hyperbolic2: "Hyperbolic 2";
|
|
56
|
+
readonly InoCloud: "InoCloud";
|
|
57
|
+
readonly Kluster: "Kluster";
|
|
58
|
+
readonly Lambda: "Lambda";
|
|
59
|
+
readonly Lepton: "Lepton";
|
|
60
|
+
readonly Lynn2: "Lynn 2";
|
|
61
|
+
readonly Lynn: "Lynn";
|
|
62
|
+
readonly Mancer: "Mancer";
|
|
63
|
+
readonly Meta: "Meta";
|
|
64
|
+
readonly Modal: "Modal";
|
|
65
|
+
readonly Nineteen: "Nineteen";
|
|
66
|
+
readonly OctoAI: "OctoAI";
|
|
67
|
+
readonly Recursal: "Recursal";
|
|
68
|
+
readonly Reflection: "Reflection";
|
|
69
|
+
readonly Replicate: "Replicate";
|
|
70
|
+
readonly SambaNova2: "SambaNova 2";
|
|
71
|
+
readonly SFCompute: "SF Compute";
|
|
72
|
+
readonly Targon: "Targon";
|
|
73
|
+
readonly Together2: "Together 2";
|
|
74
|
+
readonly Ubicloud: "Ubicloud";
|
|
75
|
+
readonly OneDotAI: "01.AI";
|
|
76
|
+
readonly Ai21: "AI21";
|
|
77
|
+
readonly AionLabs: "AionLabs";
|
|
78
|
+
readonly Alibaba: "Alibaba";
|
|
79
|
+
readonly Ambient: "Ambient";
|
|
80
|
+
readonly AmazonBedrock: "Amazon Bedrock";
|
|
81
|
+
readonly AmazonNova: "Amazon Nova";
|
|
82
|
+
readonly Anthropic: "Anthropic";
|
|
83
|
+
readonly ArceeAI: "Arcee AI";
|
|
84
|
+
readonly AtlasCloud: "AtlasCloud";
|
|
85
|
+
readonly Avian: "Avian";
|
|
86
|
+
readonly Azure: "Azure";
|
|
87
|
+
readonly BaseTen: "BaseTen";
|
|
88
|
+
readonly BytePlus: "BytePlus";
|
|
89
|
+
readonly BlackForestLabs: "Black Forest Labs";
|
|
90
|
+
readonly Cerebras: "Cerebras";
|
|
91
|
+
readonly Chutes: "Chutes";
|
|
92
|
+
readonly Cirrascale: "Cirrascale";
|
|
93
|
+
readonly Clarifai: "Clarifai";
|
|
94
|
+
readonly Cloudflare: "Cloudflare";
|
|
95
|
+
readonly Cohere: "Cohere";
|
|
96
|
+
readonly Crusoe: "Crusoe";
|
|
97
|
+
readonly DeepInfra: "DeepInfra";
|
|
98
|
+
readonly DeepSeek: "DeepSeek";
|
|
99
|
+
readonly Featherless: "Featherless";
|
|
100
|
+
readonly Fireworks: "Fireworks";
|
|
101
|
+
readonly Friendli: "Friendli";
|
|
102
|
+
readonly GMICloud: "GMICloud";
|
|
103
|
+
readonly Google: "Google";
|
|
104
|
+
readonly GoogleAIStudio: "Google AI Studio";
|
|
105
|
+
readonly Groq: "Groq";
|
|
106
|
+
readonly Hyperbolic: "Hyperbolic";
|
|
107
|
+
readonly Inception: "Inception";
|
|
108
|
+
readonly Inceptron: "Inceptron";
|
|
109
|
+
readonly InferenceNet: "InferenceNet";
|
|
110
|
+
readonly Ionstream: "Ionstream";
|
|
111
|
+
readonly Infermatic: "Infermatic";
|
|
112
|
+
readonly IoNet: "Io Net";
|
|
113
|
+
readonly Inflection: "Inflection";
|
|
114
|
+
readonly Liquid: "Liquid";
|
|
115
|
+
readonly Mara: "Mara";
|
|
116
|
+
readonly Mancer2: "Mancer 2";
|
|
117
|
+
readonly Minimax: "Minimax";
|
|
118
|
+
readonly ModelRun: "ModelRun";
|
|
119
|
+
readonly Mistral: "Mistral";
|
|
120
|
+
readonly Modular: "Modular";
|
|
121
|
+
readonly MoonshotAI: "Moonshot AI";
|
|
122
|
+
readonly Morph: "Morph";
|
|
123
|
+
readonly NCompass: "NCompass";
|
|
124
|
+
readonly Nebius: "Nebius";
|
|
125
|
+
readonly NextBit: "NextBit";
|
|
126
|
+
readonly Novita: "Novita";
|
|
127
|
+
readonly Nvidia: "Nvidia";
|
|
128
|
+
readonly OpenAI: "OpenAI";
|
|
129
|
+
readonly OpenInference: "OpenInference";
|
|
130
|
+
readonly Parasail: "Parasail";
|
|
131
|
+
readonly Perplexity: "Perplexity";
|
|
132
|
+
readonly Phala: "Phala";
|
|
133
|
+
readonly Relace: "Relace";
|
|
134
|
+
readonly SambaNova: "SambaNova";
|
|
135
|
+
readonly Seed: "Seed";
|
|
136
|
+
readonly SiliconFlow: "SiliconFlow";
|
|
137
|
+
readonly Sourceful: "Sourceful";
|
|
138
|
+
readonly StepFun: "StepFun";
|
|
139
|
+
readonly Stealth: "Stealth";
|
|
140
|
+
readonly StreamLake: "StreamLake";
|
|
141
|
+
readonly Switchpoint: "Switchpoint";
|
|
142
|
+
readonly Together: "Together";
|
|
143
|
+
readonly Upstage: "Upstage";
|
|
144
|
+
readonly Venice: "Venice";
|
|
145
|
+
readonly WandB: "WandB";
|
|
146
|
+
readonly Xiaomi: "Xiaomi";
|
|
147
|
+
readonly XAI: "xAI";
|
|
148
|
+
readonly ZAi: "Z.AI";
|
|
149
|
+
readonly FakeProvider: "FakeProvider";
|
|
150
|
+
};
|
|
151
|
+
export type ProviderName = OpenEnum<typeof ProviderName>;
|
|
152
|
+
export type ProviderResponse = {
|
|
153
|
+
id?: string | undefined;
|
|
154
|
+
endpointId?: string | undefined;
|
|
155
|
+
modelPermaslug?: string | undefined;
|
|
156
|
+
providerName?: ProviderName | undefined;
|
|
157
|
+
status: number | null;
|
|
158
|
+
latency?: number | undefined;
|
|
159
|
+
isByok?: boolean | undefined;
|
|
160
|
+
};
|
|
19
161
|
/**
|
|
20
162
|
* Generation data
|
|
21
163
|
*/
|
|
@@ -152,6 +294,10 @@ export type GetGenerationData = {
|
|
|
152
294
|
* Router used for the request (e.g., openrouter/auto)
|
|
153
295
|
*/
|
|
154
296
|
router: string | null;
|
|
297
|
+
/**
|
|
298
|
+
* List of provider responses for this generation, including fallback attempts
|
|
299
|
+
*/
|
|
300
|
+
providerResponses: Array<ProviderResponse> | null;
|
|
155
301
|
};
|
|
156
302
|
/**
|
|
157
303
|
* Generation response
|
|
@@ -164,6 +310,8 @@ export type GetGenerationResponse = {
|
|
|
164
310
|
};
|
|
165
311
|
/** @internal */
|
|
166
312
|
export type GetGenerationRequest$Outbound = {
|
|
313
|
+
"HTTP-Referer"?: string | undefined;
|
|
314
|
+
"X-Title"?: string | undefined;
|
|
167
315
|
id: string;
|
|
168
316
|
};
|
|
169
317
|
/** @internal */
|
|
@@ -172,6 +320,11 @@ export declare function getGenerationRequestToJSON(getGenerationRequest: GetGene
|
|
|
172
320
|
/** @internal */
|
|
173
321
|
export declare const ApiType$inboundSchema: z.ZodType<ApiType, unknown>;
|
|
174
322
|
/** @internal */
|
|
323
|
+
export declare const ProviderName$inboundSchema: z.ZodType<ProviderName, unknown>;
|
|
324
|
+
/** @internal */
|
|
325
|
+
export declare const ProviderResponse$inboundSchema: z.ZodType<ProviderResponse, unknown>;
|
|
326
|
+
export declare function providerResponseFromJSON(jsonString: string): SafeParseResult<ProviderResponse, SDKValidationError>;
|
|
327
|
+
/** @internal */
|
|
175
328
|
export declare const GetGenerationData$inboundSchema: z.ZodType<GetGenerationData, unknown>;
|
|
176
329
|
export declare function getGenerationDataFromJSON(jsonString: string): SafeParseResult<GetGenerationData, SDKValidationError>;
|
|
177
330
|
/** @internal */
|
|
@@ -13,9 +13,120 @@ export const ApiType = {
|
|
|
13
13
|
Completions: "completions",
|
|
14
14
|
Embeddings: "embeddings",
|
|
15
15
|
};
|
|
16
|
+
export const ProviderName = {
|
|
17
|
+
AnyScale: "AnyScale",
|
|
18
|
+
Atoma: "Atoma",
|
|
19
|
+
CentML: "Cent-ML",
|
|
20
|
+
CrofAI: "CrofAI",
|
|
21
|
+
Enfer: "Enfer",
|
|
22
|
+
GoPomelo: "GoPomelo",
|
|
23
|
+
HuggingFace: "HuggingFace",
|
|
24
|
+
Hyperbolic2: "Hyperbolic 2",
|
|
25
|
+
InoCloud: "InoCloud",
|
|
26
|
+
Kluster: "Kluster",
|
|
27
|
+
Lambda: "Lambda",
|
|
28
|
+
Lepton: "Lepton",
|
|
29
|
+
Lynn2: "Lynn 2",
|
|
30
|
+
Lynn: "Lynn",
|
|
31
|
+
Mancer: "Mancer",
|
|
32
|
+
Meta: "Meta",
|
|
33
|
+
Modal: "Modal",
|
|
34
|
+
Nineteen: "Nineteen",
|
|
35
|
+
OctoAI: "OctoAI",
|
|
36
|
+
Recursal: "Recursal",
|
|
37
|
+
Reflection: "Reflection",
|
|
38
|
+
Replicate: "Replicate",
|
|
39
|
+
SambaNova2: "SambaNova 2",
|
|
40
|
+
SFCompute: "SF Compute",
|
|
41
|
+
Targon: "Targon",
|
|
42
|
+
Together2: "Together 2",
|
|
43
|
+
Ubicloud: "Ubicloud",
|
|
44
|
+
OneDotAI: "01.AI",
|
|
45
|
+
Ai21: "AI21",
|
|
46
|
+
AionLabs: "AionLabs",
|
|
47
|
+
Alibaba: "Alibaba",
|
|
48
|
+
Ambient: "Ambient",
|
|
49
|
+
AmazonBedrock: "Amazon Bedrock",
|
|
50
|
+
AmazonNova: "Amazon Nova",
|
|
51
|
+
Anthropic: "Anthropic",
|
|
52
|
+
ArceeAI: "Arcee AI",
|
|
53
|
+
AtlasCloud: "AtlasCloud",
|
|
54
|
+
Avian: "Avian",
|
|
55
|
+
Azure: "Azure",
|
|
56
|
+
BaseTen: "BaseTen",
|
|
57
|
+
BytePlus: "BytePlus",
|
|
58
|
+
BlackForestLabs: "Black Forest Labs",
|
|
59
|
+
Cerebras: "Cerebras",
|
|
60
|
+
Chutes: "Chutes",
|
|
61
|
+
Cirrascale: "Cirrascale",
|
|
62
|
+
Clarifai: "Clarifai",
|
|
63
|
+
Cloudflare: "Cloudflare",
|
|
64
|
+
Cohere: "Cohere",
|
|
65
|
+
Crusoe: "Crusoe",
|
|
66
|
+
DeepInfra: "DeepInfra",
|
|
67
|
+
DeepSeek: "DeepSeek",
|
|
68
|
+
Featherless: "Featherless",
|
|
69
|
+
Fireworks: "Fireworks",
|
|
70
|
+
Friendli: "Friendli",
|
|
71
|
+
GMICloud: "GMICloud",
|
|
72
|
+
Google: "Google",
|
|
73
|
+
GoogleAIStudio: "Google AI Studio",
|
|
74
|
+
Groq: "Groq",
|
|
75
|
+
Hyperbolic: "Hyperbolic",
|
|
76
|
+
Inception: "Inception",
|
|
77
|
+
Inceptron: "Inceptron",
|
|
78
|
+
InferenceNet: "InferenceNet",
|
|
79
|
+
Ionstream: "Ionstream",
|
|
80
|
+
Infermatic: "Infermatic",
|
|
81
|
+
IoNet: "Io Net",
|
|
82
|
+
Inflection: "Inflection",
|
|
83
|
+
Liquid: "Liquid",
|
|
84
|
+
Mara: "Mara",
|
|
85
|
+
Mancer2: "Mancer 2",
|
|
86
|
+
Minimax: "Minimax",
|
|
87
|
+
ModelRun: "ModelRun",
|
|
88
|
+
Mistral: "Mistral",
|
|
89
|
+
Modular: "Modular",
|
|
90
|
+
MoonshotAI: "Moonshot AI",
|
|
91
|
+
Morph: "Morph",
|
|
92
|
+
NCompass: "NCompass",
|
|
93
|
+
Nebius: "Nebius",
|
|
94
|
+
NextBit: "NextBit",
|
|
95
|
+
Novita: "Novita",
|
|
96
|
+
Nvidia: "Nvidia",
|
|
97
|
+
OpenAI: "OpenAI",
|
|
98
|
+
OpenInference: "OpenInference",
|
|
99
|
+
Parasail: "Parasail",
|
|
100
|
+
Perplexity: "Perplexity",
|
|
101
|
+
Phala: "Phala",
|
|
102
|
+
Relace: "Relace",
|
|
103
|
+
SambaNova: "SambaNova",
|
|
104
|
+
Seed: "Seed",
|
|
105
|
+
SiliconFlow: "SiliconFlow",
|
|
106
|
+
Sourceful: "Sourceful",
|
|
107
|
+
StepFun: "StepFun",
|
|
108
|
+
Stealth: "Stealth",
|
|
109
|
+
StreamLake: "StreamLake",
|
|
110
|
+
Switchpoint: "Switchpoint",
|
|
111
|
+
Together: "Together",
|
|
112
|
+
Upstage: "Upstage",
|
|
113
|
+
Venice: "Venice",
|
|
114
|
+
WandB: "WandB",
|
|
115
|
+
Xiaomi: "Xiaomi",
|
|
116
|
+
XAI: "xAI",
|
|
117
|
+
ZAi: "Z.AI",
|
|
118
|
+
FakeProvider: "FakeProvider",
|
|
119
|
+
};
|
|
16
120
|
/** @internal */
|
|
17
121
|
export const GetGenerationRequest$outboundSchema = z.object({
|
|
122
|
+
httpReferer: z.string().optional(),
|
|
123
|
+
xTitle: z.string().optional(),
|
|
18
124
|
id: z.string(),
|
|
125
|
+
}).transform((v) => {
|
|
126
|
+
return remap$(v, {
|
|
127
|
+
httpReferer: "HTTP-Referer",
|
|
128
|
+
xTitle: "X-Title",
|
|
129
|
+
});
|
|
19
130
|
});
|
|
20
131
|
export function getGenerationRequestToJSON(getGenerationRequest) {
|
|
21
132
|
return JSON.stringify(GetGenerationRequest$outboundSchema.parse(getGenerationRequest));
|
|
@@ -24,6 +135,28 @@ export function getGenerationRequestToJSON(getGenerationRequest) {
|
|
|
24
135
|
export const ApiType$inboundSchema = openEnums
|
|
25
136
|
.inboundSchema(ApiType);
|
|
26
137
|
/** @internal */
|
|
138
|
+
export const ProviderName$inboundSchema = openEnums.inboundSchema(ProviderName);
|
|
139
|
+
/** @internal */
|
|
140
|
+
export const ProviderResponse$inboundSchema = z.object({
|
|
141
|
+
id: z.string().optional(),
|
|
142
|
+
endpoint_id: z.string().optional(),
|
|
143
|
+
model_permaslug: z.string().optional(),
|
|
144
|
+
provider_name: ProviderName$inboundSchema.optional(),
|
|
145
|
+
status: z.nullable(z.number()),
|
|
146
|
+
latency: z.number().optional(),
|
|
147
|
+
is_byok: z.boolean().optional(),
|
|
148
|
+
}).transform((v) => {
|
|
149
|
+
return remap$(v, {
|
|
150
|
+
"endpoint_id": "endpointId",
|
|
151
|
+
"model_permaslug": "modelPermaslug",
|
|
152
|
+
"provider_name": "providerName",
|
|
153
|
+
"is_byok": "isByok",
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
export function providerResponseFromJSON(jsonString) {
|
|
157
|
+
return safeParse(jsonString, (x) => ProviderResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProviderResponse' from JSON`);
|
|
158
|
+
}
|
|
159
|
+
/** @internal */
|
|
27
160
|
export const GetGenerationData$inboundSchema = z.object({
|
|
28
161
|
id: z.string(),
|
|
29
162
|
upstream_id: z.nullable(z.string()),
|
|
@@ -58,6 +191,7 @@ export const GetGenerationData$inboundSchema = z.object({
|
|
|
58
191
|
external_user: z.nullable(z.string()),
|
|
59
192
|
api_type: z.nullable(ApiType$inboundSchema),
|
|
60
193
|
router: z.nullable(z.string()),
|
|
194
|
+
provider_responses: z.nullable(z.array(z.lazy(() => ProviderResponse$inboundSchema))),
|
|
61
195
|
}).transform((v) => {
|
|
62
196
|
return remap$(v, {
|
|
63
197
|
"upstream_id": "upstreamId",
|
|
@@ -85,6 +219,7 @@ export const GetGenerationData$inboundSchema = z.object({
|
|
|
85
219
|
"native_finish_reason": "nativeFinishReason",
|
|
86
220
|
"external_user": "externalUser",
|
|
87
221
|
"api_type": "apiType",
|
|
222
|
+
"provider_responses": "providerResponses",
|
|
88
223
|
});
|
|
89
224
|
});
|
|
90
225
|
export function getGenerationDataFromJSON(jsonString) {
|
|
@@ -2,7 +2,35 @@ 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 GetGuardrailGlobals = {
|
|
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
|
export type GetGuardrailRequest = {
|
|
21
|
+
/**
|
|
22
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* This is used to track API usage per application.
|
|
26
|
+
*/
|
|
27
|
+
httpReferer?: string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
*/
|
|
33
|
+
xTitle?: string | undefined;
|
|
6
34
|
/**
|
|
7
35
|
* The unique identifier of the guardrail to retrieve
|
|
8
36
|
*/
|
|
@@ -76,6 +104,8 @@ export type GetGuardrailResponse = {
|
|
|
76
104
|
};
|
|
77
105
|
/** @internal */
|
|
78
106
|
export type GetGuardrailRequest$Outbound = {
|
|
107
|
+
"HTTP-Referer"?: string | undefined;
|
|
108
|
+
"X-Title"?: string | undefined;
|
|
79
109
|
id: string;
|
|
80
110
|
};
|
|
81
111
|
/** @internal */
|
|
@@ -16,7 +16,14 @@ export const GetGuardrailResetInterval = {
|
|
|
16
16
|
};
|
|
17
17
|
/** @internal */
|
|
18
18
|
export const GetGuardrailRequest$outboundSchema = z.object({
|
|
19
|
+
httpReferer: z.string().optional(),
|
|
20
|
+
xTitle: z.string().optional(),
|
|
19
21
|
id: z.string(),
|
|
22
|
+
}).transform((v) => {
|
|
23
|
+
return remap$(v, {
|
|
24
|
+
httpReferer: "HTTP-Referer",
|
|
25
|
+
xTitle: "X-Title",
|
|
26
|
+
});
|
|
20
27
|
});
|
|
21
28
|
export function getGuardrailRequestToJSON(getGuardrailRequest) {
|
|
22
29
|
return JSON.stringify(GetGuardrailRequest$outboundSchema.parse(getGuardrailRequest));
|
|
@@ -1,7 +1,35 @@
|
|
|
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 GetKeyGlobals = {
|
|
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 GetKeyRequest = {
|
|
20
|
+
/**
|
|
21
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* This is used to track API usage per application.
|
|
25
|
+
*/
|
|
26
|
+
httpReferer?: string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
*/
|
|
32
|
+
xTitle?: string | undefined;
|
|
5
33
|
/**
|
|
6
34
|
* The hash identifier of the API key to retrieve
|
|
7
35
|
*/
|
|
@@ -99,6 +127,8 @@ export type GetKeyResponse = {
|
|
|
99
127
|
};
|
|
100
128
|
/** @internal */
|
|
101
129
|
export type GetKeyRequest$Outbound = {
|
|
130
|
+
"HTTP-Referer"?: string | undefined;
|
|
131
|
+
"X-Title"?: string | undefined;
|
|
102
132
|
hash: string;
|
|
103
133
|
};
|
|
104
134
|
/** @internal */
|
|
@@ -7,7 +7,14 @@ import { remap as remap$ } from "../../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
8
|
/** @internal */
|
|
9
9
|
export const GetKeyRequest$outboundSchema = z.object({
|
|
10
|
+
httpReferer: z.string().optional(),
|
|
11
|
+
xTitle: z.string().optional(),
|
|
10
12
|
hash: z.string(),
|
|
13
|
+
}).transform((v) => {
|
|
14
|
+
return remap$(v, {
|
|
15
|
+
httpReferer: "HTTP-Referer",
|
|
16
|
+
xTitle: "X-Title",
|
|
17
|
+
});
|
|
11
18
|
});
|
|
12
19
|
export function getKeyRequestToJSON(getKeyRequest) {
|
|
13
20
|
return JSON.stringify(GetKeyRequest$outboundSchema.parse(getKeyRequest));
|
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { OpenEnum } from "../../types/enums.js";
|
|
3
|
+
export type GetModelsGlobals = {
|
|
4
|
+
/**
|
|
5
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* This is used to track API usage per application.
|
|
9
|
+
*/
|
|
10
|
+
httpReferer?: string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
*/
|
|
16
|
+
xTitle?: string | undefined;
|
|
17
|
+
};
|
|
3
18
|
/**
|
|
4
19
|
* Filter models by use case category
|
|
5
20
|
*/
|
|
@@ -22,6 +37,19 @@ export declare const Category: {
|
|
|
22
37
|
*/
|
|
23
38
|
export type Category = OpenEnum<typeof Category>;
|
|
24
39
|
export type GetModelsRequest = {
|
|
40
|
+
/**
|
|
41
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* This is used to track API usage per application.
|
|
45
|
+
*/
|
|
46
|
+
httpReferer?: string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
49
|
+
*
|
|
50
|
+
* @remarks
|
|
51
|
+
*/
|
|
52
|
+
xTitle?: string | undefined;
|
|
25
53
|
/**
|
|
26
54
|
* Filter models by use case category
|
|
27
55
|
*/
|
|
@@ -32,6 +60,8 @@ export type GetModelsRequest = {
|
|
|
32
60
|
export declare const Category$outboundSchema: z.ZodType<string, Category>;
|
|
33
61
|
/** @internal */
|
|
34
62
|
export type GetModelsRequest$Outbound = {
|
|
63
|
+
"HTTP-Referer"?: string | undefined;
|
|
64
|
+
"X-Title"?: string | undefined;
|
|
35
65
|
category?: string | undefined;
|
|
36
66
|
supported_parameters?: string | undefined;
|
|
37
67
|
};
|
|
@@ -27,10 +27,14 @@ export const Category$outboundSchema = openEnums
|
|
|
27
27
|
.outboundSchema(Category);
|
|
28
28
|
/** @internal */
|
|
29
29
|
export const GetModelsRequest$outboundSchema = z.object({
|
|
30
|
+
httpReferer: z.string().optional(),
|
|
31
|
+
xTitle: z.string().optional(),
|
|
30
32
|
category: Category$outboundSchema.optional(),
|
|
31
33
|
supportedParameters: z.string().optional(),
|
|
32
34
|
}).transform((v) => {
|
|
33
35
|
return remap$(v, {
|
|
36
|
+
httpReferer: "HTTP-Referer",
|
|
37
|
+
xTitle: "X-Title",
|
|
34
38
|
supportedParameters: "supported_parameters",
|
|
35
39
|
});
|
|
36
40
|
});
|
|
@@ -2,7 +2,35 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
3
3
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
4
4
|
import * as models from "../index.js";
|
|
5
|
+
export type GetUserActivityGlobals = {
|
|
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
|
export type GetUserActivityRequest = {
|
|
21
|
+
/**
|
|
22
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* This is used to track API usage per application.
|
|
26
|
+
*/
|
|
27
|
+
httpReferer?: string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
*/
|
|
33
|
+
xTitle?: string | undefined;
|
|
6
34
|
/**
|
|
7
35
|
* Filter by a single UTC date in the last 30 days (YYYY-MM-DD format).
|
|
8
36
|
*/
|
|
@@ -19,6 +47,8 @@ export type GetUserActivityResponse = {
|
|
|
19
47
|
};
|
|
20
48
|
/** @internal */
|
|
21
49
|
export type GetUserActivityRequest$Outbound = {
|
|
50
|
+
"HTTP-Referer"?: string | undefined;
|
|
51
|
+
"X-Title"?: string | undefined;
|
|
22
52
|
date?: string | undefined;
|
|
23
53
|
};
|
|
24
54
|
/** @internal */
|
|
@@ -3,11 +3,19 @@
|
|
|
3
3
|
* @generated-id: 19535b4511a4
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
8
|
import * as models from "../index.js";
|
|
8
9
|
/** @internal */
|
|
9
10
|
export const GetUserActivityRequest$outboundSchema = z.object({
|
|
11
|
+
httpReferer: z.string().optional(),
|
|
12
|
+
xTitle: z.string().optional(),
|
|
10
13
|
date: z.string().optional(),
|
|
14
|
+
}).transform((v) => {
|
|
15
|
+
return remap$(v, {
|
|
16
|
+
httpReferer: "HTTP-Referer",
|
|
17
|
+
xTitle: "X-Title",
|
|
18
|
+
});
|
|
11
19
|
});
|
|
12
20
|
export function getUserActivityRequestToJSON(getUserActivityRequest) {
|
|
13
21
|
return JSON.stringify(GetUserActivityRequest$outboundSchema.parse(getUserActivityRequest));
|
|
@@ -19,6 +19,7 @@ export * from "./getkey.js";
|
|
|
19
19
|
export * from "./getmodels.js";
|
|
20
20
|
export * from "./getuseractivity.js";
|
|
21
21
|
export * from "./list.js";
|
|
22
|
+
export * from "./listembeddingsmodels.js";
|
|
22
23
|
export * from "./listendpoints.js";
|
|
23
24
|
export * from "./listendpointszdr.js";
|
|
24
25
|
export * from "./listguardrailkeyassignments.js";
|
|
@@ -26,6 +27,7 @@ export * from "./listguardrailmemberassignments.js";
|
|
|
26
27
|
export * from "./listguardrails.js";
|
|
27
28
|
export * from "./listkeyassignments.js";
|
|
28
29
|
export * from "./listmemberassignments.js";
|
|
30
|
+
export * from "./listmodelscount.js";
|
|
29
31
|
export * from "./listmodelsuser.js";
|
|
30
32
|
export * from "./listproviders.js";
|
|
31
33
|
export * from "./sendchatcompletionrequest.js";
|
|
@@ -23,6 +23,7 @@ export * from "./getkey.js";
|
|
|
23
23
|
export * from "./getmodels.js";
|
|
24
24
|
export * from "./getuseractivity.js";
|
|
25
25
|
export * from "./list.js";
|
|
26
|
+
export * from "./listembeddingsmodels.js";
|
|
26
27
|
export * from "./listendpoints.js";
|
|
27
28
|
export * from "./listendpointszdr.js";
|
|
28
29
|
export * from "./listguardrailkeyassignments.js";
|
|
@@ -30,6 +31,7 @@ export * from "./listguardrailmemberassignments.js";
|
|
|
30
31
|
export * from "./listguardrails.js";
|
|
31
32
|
export * from "./listkeyassignments.js";
|
|
32
33
|
export * from "./listmemberassignments.js";
|
|
34
|
+
export * from "./listmodelscount.js";
|
|
33
35
|
export * from "./listmodelsuser.js";
|
|
34
36
|
export * from "./listproviders.js";
|
|
35
37
|
export * from "./sendchatcompletionrequest.js";
|
|
@@ -1,7 +1,35 @@
|
|
|
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 ListGlobals = {
|
|
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 ListRequest = {
|
|
20
|
+
/**
|
|
21
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* This is used to track API usage per application.
|
|
25
|
+
*/
|
|
26
|
+
httpReferer?: string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
*/
|
|
32
|
+
xTitle?: string | undefined;
|
|
5
33
|
/**
|
|
6
34
|
* Whether to include disabled API keys in the response
|
|
7
35
|
*/
|
|
@@ -100,6 +128,8 @@ export type ListResponse = {
|
|
|
100
128
|
};
|
|
101
129
|
/** @internal */
|
|
102
130
|
export type ListRequest$Outbound = {
|
|
131
|
+
"HTTP-Referer"?: string | undefined;
|
|
132
|
+
"X-Title"?: string | undefined;
|
|
103
133
|
include_disabled?: string | undefined;
|
|
104
134
|
offset?: string | undefined;
|
|
105
135
|
};
|