@openrouter/sdk 0.4.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +9 -5
- package/esm/funcs/chatSend.js +10 -5
- 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 +8 -2
- package/esm/lib/config.js +2 -2
- package/esm/lib/model-result.d.ts +7 -8
- package/esm/lib/model-result.js +155 -44
- package/esm/lib/sdks.d.ts +1 -1
- package/esm/lib/sdks.js +28 -8
- package/esm/lib/stream-transformers.js +7 -7
- package/esm/lib/stream-type-guards.d.ts +1 -1
- package/esm/lib/stream-type-guards.js +1 -1
- package/esm/lib/tool-executor.js +11 -14
- package/esm/lib/tool-orchestrator.js +2 -2
- package/esm/lib/tool-types.d.ts +1 -1
- package/esm/models/assistantmessage.d.ts +3 -3
- package/esm/models/assistantmessage.js +3 -3
- package/esm/models/chatgenerationparams.d.ts +43 -234
- package/esm/models/chatgenerationparams.js +32 -159
- package/esm/models/chatstreamingmessagechunk.d.ts +2 -2
- package/esm/models/chatstreamingmessagechunk.js +2 -2
- package/esm/models/developermessage.d.ts +23 -0
- package/esm/models/developermessage.js +24 -0
- package/esm/models/index.d.ts +6 -2
- package/esm/models/index.js +6 -2
- package/esm/models/message.d.ts +3 -23
- package/esm/models/message.js +2 -19
- package/esm/models/openresponsesrequest.d.ts +33 -45
- package/esm/models/openresponsesrequest.js +36 -36
- 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 +42 -2
- package/esm/models/operations/createauthkeyscode.js +16 -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 +151 -0
- package/esm/models/operations/getgeneration.js +133 -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 +43 -0
- package/esm/models/operations/sendchatcompletionrequest.js +16 -0
- 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 +2 -0
- package/esm/models/providername.js +2 -0
- package/esm/models/providerpreferences.d.ts +1 -13
- package/esm/models/publicendpoint.d.ts +0 -39
- package/esm/models/publicpricing.d.ts +0 -39
- package/esm/models/schema10.d.ts +33 -0
- package/esm/models/schema10.js +30 -0
- package/esm/models/schema14.d.ts +8 -0
- package/esm/models/schema14.js +12 -0
- package/esm/models/schema17.d.ts +102 -0
- package/esm/models/schema17.js +95 -0
- package/esm/models/schema19.d.ts +92 -0
- package/esm/models/schema19.js +109 -0
- package/esm/models/{schema0.d.ts → schema5.d.ts} +10 -8
- package/esm/models/{schema0.js → schema5.js} +10 -8
- 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 +9 -5
- 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/jsr.json +1 -1
- package/package.json +2 -2
- package/esm/models/schema2.d.ts +0 -92
- package/esm/models/schema2.js +0 -109
|
@@ -55,30 +55,18 @@ export type OpenResponsesRequestSort = ProviderSort | ProviderSortConfig | any;
|
|
|
55
55
|
*/
|
|
56
56
|
export type OpenResponsesRequestMaxPrice = {
|
|
57
57
|
/**
|
|
58
|
-
*
|
|
58
|
+
* Price per million prompt tokens
|
|
59
59
|
*/
|
|
60
60
|
prompt?: string | undefined;
|
|
61
|
-
/**
|
|
62
|
-
* A value in string format that is a large number
|
|
63
|
-
*/
|
|
64
61
|
completion?: string | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* A value in string format that is a large number
|
|
67
|
-
*/
|
|
68
62
|
image?: string | undefined;
|
|
69
|
-
/**
|
|
70
|
-
* A value in string format that is a large number
|
|
71
|
-
*/
|
|
72
63
|
audio?: string | undefined;
|
|
73
|
-
/**
|
|
74
|
-
* A value in string format that is a large number
|
|
75
|
-
*/
|
|
76
64
|
request?: string | undefined;
|
|
77
65
|
};
|
|
78
66
|
/**
|
|
79
67
|
* When multiple model providers are available, optionally indicate your routing preference.
|
|
80
68
|
*/
|
|
81
|
-
export type
|
|
69
|
+
export type Provider = {
|
|
82
70
|
/**
|
|
83
71
|
* Whether to allow backup providers to serve requests
|
|
84
72
|
*
|
|
@@ -141,14 +129,14 @@ export type OpenResponsesRequestProvider = {
|
|
|
141
129
|
*/
|
|
142
130
|
preferredMaxLatency?: PreferredMaxLatency | null | undefined;
|
|
143
131
|
};
|
|
144
|
-
export type
|
|
132
|
+
export type PluginResponseHealing = {
|
|
145
133
|
id: "response-healing";
|
|
146
134
|
/**
|
|
147
135
|
* Set to false to disable the response-healing plugin for this request. Defaults to true.
|
|
148
136
|
*/
|
|
149
137
|
enabled?: boolean | undefined;
|
|
150
138
|
};
|
|
151
|
-
export type
|
|
139
|
+
export type PluginFileParser = {
|
|
152
140
|
id: "file-parser";
|
|
153
141
|
/**
|
|
154
142
|
* Set to false to disable the file-parser plugin for this request. Defaults to true.
|
|
@@ -159,7 +147,7 @@ export type OpenResponsesRequestPluginFileParser = {
|
|
|
159
147
|
*/
|
|
160
148
|
pdf?: PDFParserOptions | undefined;
|
|
161
149
|
};
|
|
162
|
-
export type
|
|
150
|
+
export type PluginWeb = {
|
|
163
151
|
id: "web";
|
|
164
152
|
/**
|
|
165
153
|
* Set to false to disable the web-search plugin for this request. Defaults to true.
|
|
@@ -172,10 +160,10 @@ export type OpenResponsesRequestPluginWeb = {
|
|
|
172
160
|
*/
|
|
173
161
|
engine?: WebSearchEngine | undefined;
|
|
174
162
|
};
|
|
175
|
-
export type
|
|
163
|
+
export type PluginModeration = {
|
|
176
164
|
id: "moderation";
|
|
177
165
|
};
|
|
178
|
-
export type
|
|
166
|
+
export type PluginAutoRouter = {
|
|
179
167
|
id: "auto-router";
|
|
180
168
|
/**
|
|
181
169
|
* Set to false to disable the auto-router plugin for this request. Defaults to true.
|
|
@@ -186,7 +174,7 @@ export type OpenResponsesRequestPluginAutoRouter = {
|
|
|
186
174
|
*/
|
|
187
175
|
allowedModels?: Array<string> | undefined;
|
|
188
176
|
};
|
|
189
|
-
export type
|
|
177
|
+
export type Plugin = PluginAutoRouter | PluginModeration | PluginWeb | PluginFileParser | PluginResponseHealing;
|
|
190
178
|
/**
|
|
191
179
|
* Request schema for Responses endpoint
|
|
192
180
|
*/
|
|
@@ -246,11 +234,11 @@ export type OpenResponsesRequest = {
|
|
|
246
234
|
/**
|
|
247
235
|
* When multiple model providers are available, optionally indicate your routing preference.
|
|
248
236
|
*/
|
|
249
|
-
provider?:
|
|
237
|
+
provider?: Provider | null | undefined;
|
|
250
238
|
/**
|
|
251
239
|
* Plugins you want to enable for this request, including their settings.
|
|
252
240
|
*/
|
|
253
|
-
plugins?: Array<
|
|
241
|
+
plugins?: Array<PluginAutoRouter | PluginModeration | PluginWeb | PluginFileParser | PluginResponseHealing> | undefined;
|
|
254
242
|
/**
|
|
255
243
|
* A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters.
|
|
256
244
|
*/
|
|
@@ -319,7 +307,7 @@ export type OpenResponsesRequestMaxPrice$Outbound = {
|
|
|
319
307
|
export declare const OpenResponsesRequestMaxPrice$outboundSchema: z.ZodType<OpenResponsesRequestMaxPrice$Outbound, OpenResponsesRequestMaxPrice>;
|
|
320
308
|
export declare function openResponsesRequestMaxPriceToJSON(openResponsesRequestMaxPrice: OpenResponsesRequestMaxPrice): string;
|
|
321
309
|
/** @internal */
|
|
322
|
-
export type
|
|
310
|
+
export type Provider$Outbound = {
|
|
323
311
|
allow_fallbacks?: boolean | null | undefined;
|
|
324
312
|
require_parameters?: boolean | null | undefined;
|
|
325
313
|
data_collection?: string | null | undefined;
|
|
@@ -335,27 +323,27 @@ export type OpenResponsesRequestProvider$Outbound = {
|
|
|
335
323
|
preferred_max_latency?: PreferredMaxLatency$Outbound | null | undefined;
|
|
336
324
|
};
|
|
337
325
|
/** @internal */
|
|
338
|
-
export declare const
|
|
339
|
-
export declare function
|
|
326
|
+
export declare const Provider$outboundSchema: z.ZodType<Provider$Outbound, Provider>;
|
|
327
|
+
export declare function providerToJSON(provider: Provider): string;
|
|
340
328
|
/** @internal */
|
|
341
|
-
export type
|
|
329
|
+
export type PluginResponseHealing$Outbound = {
|
|
342
330
|
id: "response-healing";
|
|
343
331
|
enabled?: boolean | undefined;
|
|
344
332
|
};
|
|
345
333
|
/** @internal */
|
|
346
|
-
export declare const
|
|
347
|
-
export declare function
|
|
334
|
+
export declare const PluginResponseHealing$outboundSchema: z.ZodType<PluginResponseHealing$Outbound, PluginResponseHealing>;
|
|
335
|
+
export declare function pluginResponseHealingToJSON(pluginResponseHealing: PluginResponseHealing): string;
|
|
348
336
|
/** @internal */
|
|
349
|
-
export type
|
|
337
|
+
export type PluginFileParser$Outbound = {
|
|
350
338
|
id: "file-parser";
|
|
351
339
|
enabled?: boolean | undefined;
|
|
352
340
|
pdf?: PDFParserOptions$Outbound | undefined;
|
|
353
341
|
};
|
|
354
342
|
/** @internal */
|
|
355
|
-
export declare const
|
|
356
|
-
export declare function
|
|
343
|
+
export declare const PluginFileParser$outboundSchema: z.ZodType<PluginFileParser$Outbound, PluginFileParser>;
|
|
344
|
+
export declare function pluginFileParserToJSON(pluginFileParser: PluginFileParser): string;
|
|
357
345
|
/** @internal */
|
|
358
|
-
export type
|
|
346
|
+
export type PluginWeb$Outbound = {
|
|
359
347
|
id: "web";
|
|
360
348
|
enabled?: boolean | undefined;
|
|
361
349
|
max_results?: number | undefined;
|
|
@@ -363,29 +351,29 @@ export type OpenResponsesRequestPluginWeb$Outbound = {
|
|
|
363
351
|
engine?: string | undefined;
|
|
364
352
|
};
|
|
365
353
|
/** @internal */
|
|
366
|
-
export declare const
|
|
367
|
-
export declare function
|
|
354
|
+
export declare const PluginWeb$outboundSchema: z.ZodType<PluginWeb$Outbound, PluginWeb>;
|
|
355
|
+
export declare function pluginWebToJSON(pluginWeb: PluginWeb): string;
|
|
368
356
|
/** @internal */
|
|
369
|
-
export type
|
|
357
|
+
export type PluginModeration$Outbound = {
|
|
370
358
|
id: "moderation";
|
|
371
359
|
};
|
|
372
360
|
/** @internal */
|
|
373
|
-
export declare const
|
|
374
|
-
export declare function
|
|
361
|
+
export declare const PluginModeration$outboundSchema: z.ZodType<PluginModeration$Outbound, PluginModeration>;
|
|
362
|
+
export declare function pluginModerationToJSON(pluginModeration: PluginModeration): string;
|
|
375
363
|
/** @internal */
|
|
376
|
-
export type
|
|
364
|
+
export type PluginAutoRouter$Outbound = {
|
|
377
365
|
id: "auto-router";
|
|
378
366
|
enabled?: boolean | undefined;
|
|
379
367
|
allowed_models?: Array<string> | undefined;
|
|
380
368
|
};
|
|
381
369
|
/** @internal */
|
|
382
|
-
export declare const
|
|
383
|
-
export declare function
|
|
370
|
+
export declare const PluginAutoRouter$outboundSchema: z.ZodType<PluginAutoRouter$Outbound, PluginAutoRouter>;
|
|
371
|
+
export declare function pluginAutoRouterToJSON(pluginAutoRouter: PluginAutoRouter): string;
|
|
384
372
|
/** @internal */
|
|
385
|
-
export type
|
|
373
|
+
export type Plugin$Outbound = PluginAutoRouter$Outbound | PluginModeration$Outbound | PluginWeb$Outbound | PluginFileParser$Outbound | PluginResponseHealing$Outbound;
|
|
386
374
|
/** @internal */
|
|
387
|
-
export declare const
|
|
388
|
-
export declare function
|
|
375
|
+
export declare const Plugin$outboundSchema: z.ZodType<Plugin$Outbound, Plugin>;
|
|
376
|
+
export declare function pluginToJSON(plugin: Plugin): string;
|
|
389
377
|
/** @internal */
|
|
390
378
|
export type OpenResponsesRequest$Outbound = {
|
|
391
379
|
input?: OpenResponsesInput$Outbound | undefined;
|
|
@@ -422,8 +410,8 @@ export type OpenResponsesRequest$Outbound = {
|
|
|
422
410
|
service_tier: string;
|
|
423
411
|
truncation?: string | null | undefined;
|
|
424
412
|
stream: boolean;
|
|
425
|
-
provider?:
|
|
426
|
-
plugins?: Array<
|
|
413
|
+
provider?: Provider$Outbound | null | undefined;
|
|
414
|
+
plugins?: Array<PluginAutoRouter$Outbound | PluginModeration$Outbound | PluginWeb$Outbound | PluginFileParser$Outbound | PluginResponseHealing$Outbound> | undefined;
|
|
427
415
|
user?: string | undefined;
|
|
428
416
|
session_id?: string | undefined;
|
|
429
417
|
};
|
|
@@ -99,16 +99,15 @@ export function openResponsesRequestMaxPriceToJSON(openResponsesRequestMaxPrice)
|
|
|
99
99
|
return JSON.stringify(OpenResponsesRequestMaxPrice$outboundSchema.parse(openResponsesRequestMaxPrice));
|
|
100
100
|
}
|
|
101
101
|
/** @internal */
|
|
102
|
-
export const
|
|
102
|
+
export const Provider$outboundSchema = z
|
|
103
|
+
.object({
|
|
103
104
|
allowFallbacks: z.nullable(z.boolean()).optional(),
|
|
104
105
|
requireParameters: z.nullable(z.boolean()).optional(),
|
|
105
106
|
dataCollection: z.nullable(DataCollection$outboundSchema).optional(),
|
|
106
107
|
zdr: z.nullable(z.boolean()).optional(),
|
|
107
108
|
enforceDistillableText: z.nullable(z.boolean()).optional(),
|
|
108
|
-
order: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()])))
|
|
109
|
-
|
|
110
|
-
only: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()])))
|
|
111
|
-
.optional(),
|
|
109
|
+
order: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()]))).optional(),
|
|
110
|
+
only: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()]))).optional(),
|
|
112
111
|
ignore: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()]))).optional(),
|
|
113
112
|
quantizations: z.nullable(z.array(Quantization$outboundSchema)).optional(),
|
|
114
113
|
sort: z.nullable(z.union([
|
|
@@ -133,28 +132,28 @@ export const OpenResponsesRequestProvider$outboundSchema = z.object({
|
|
|
133
132
|
preferredMaxLatency: "preferred_max_latency",
|
|
134
133
|
});
|
|
135
134
|
});
|
|
136
|
-
export function
|
|
137
|
-
return JSON.stringify(
|
|
135
|
+
export function providerToJSON(provider) {
|
|
136
|
+
return JSON.stringify(Provider$outboundSchema.parse(provider));
|
|
138
137
|
}
|
|
139
138
|
/** @internal */
|
|
140
|
-
export const
|
|
139
|
+
export const PluginResponseHealing$outboundSchema = z.object({
|
|
141
140
|
id: z.literal("response-healing"),
|
|
142
141
|
enabled: z.boolean().optional(),
|
|
143
142
|
});
|
|
144
|
-
export function
|
|
145
|
-
return JSON.stringify(
|
|
143
|
+
export function pluginResponseHealingToJSON(pluginResponseHealing) {
|
|
144
|
+
return JSON.stringify(PluginResponseHealing$outboundSchema.parse(pluginResponseHealing));
|
|
146
145
|
}
|
|
147
146
|
/** @internal */
|
|
148
|
-
export const
|
|
147
|
+
export const PluginFileParser$outboundSchema = z.object({
|
|
149
148
|
id: z.literal("file-parser"),
|
|
150
149
|
enabled: z.boolean().optional(),
|
|
151
150
|
pdf: PDFParserOptions$outboundSchema.optional(),
|
|
152
151
|
});
|
|
153
|
-
export function
|
|
154
|
-
return JSON.stringify(
|
|
152
|
+
export function pluginFileParserToJSON(pluginFileParser) {
|
|
153
|
+
return JSON.stringify(PluginFileParser$outboundSchema.parse(pluginFileParser));
|
|
155
154
|
}
|
|
156
155
|
/** @internal */
|
|
157
|
-
export const
|
|
156
|
+
export const PluginWeb$outboundSchema = z.object({
|
|
158
157
|
id: z.literal("web"),
|
|
159
158
|
enabled: z.boolean().optional(),
|
|
160
159
|
maxResults: z.number().optional(),
|
|
@@ -166,18 +165,18 @@ export const OpenResponsesRequestPluginWeb$outboundSchema = z.object({
|
|
|
166
165
|
searchPrompt: "search_prompt",
|
|
167
166
|
});
|
|
168
167
|
});
|
|
169
|
-
export function
|
|
170
|
-
return JSON.stringify(
|
|
168
|
+
export function pluginWebToJSON(pluginWeb) {
|
|
169
|
+
return JSON.stringify(PluginWeb$outboundSchema.parse(pluginWeb));
|
|
171
170
|
}
|
|
172
171
|
/** @internal */
|
|
173
|
-
export const
|
|
172
|
+
export const PluginModeration$outboundSchema = z.object({
|
|
174
173
|
id: z.literal("moderation"),
|
|
175
174
|
});
|
|
176
|
-
export function
|
|
177
|
-
return JSON.stringify(
|
|
175
|
+
export function pluginModerationToJSON(pluginModeration) {
|
|
176
|
+
return JSON.stringify(PluginModeration$outboundSchema.parse(pluginModeration));
|
|
178
177
|
}
|
|
179
178
|
/** @internal */
|
|
180
|
-
export const
|
|
179
|
+
export const PluginAutoRouter$outboundSchema = z.object({
|
|
181
180
|
id: z.literal("auto-router"),
|
|
182
181
|
enabled: z.boolean().optional(),
|
|
183
182
|
allowedModels: z.array(z.string()).optional(),
|
|
@@ -186,19 +185,20 @@ export const OpenResponsesRequestPluginAutoRouter$outboundSchema = z.object({
|
|
|
186
185
|
allowedModels: "allowed_models",
|
|
187
186
|
});
|
|
188
187
|
});
|
|
189
|
-
export function
|
|
190
|
-
return JSON.stringify(
|
|
188
|
+
export function pluginAutoRouterToJSON(pluginAutoRouter) {
|
|
189
|
+
return JSON.stringify(PluginAutoRouter$outboundSchema.parse(pluginAutoRouter));
|
|
191
190
|
}
|
|
192
191
|
/** @internal */
|
|
193
|
-
export const
|
|
194
|
-
|
|
195
|
-
z.lazy(() =>
|
|
196
|
-
z.lazy(() =>
|
|
197
|
-
z.lazy(() =>
|
|
198
|
-
z.lazy(() =>
|
|
192
|
+
export const Plugin$outboundSchema = z
|
|
193
|
+
.union([
|
|
194
|
+
z.lazy(() => PluginAutoRouter$outboundSchema),
|
|
195
|
+
z.lazy(() => PluginModeration$outboundSchema),
|
|
196
|
+
z.lazy(() => PluginWeb$outboundSchema),
|
|
197
|
+
z.lazy(() => PluginFileParser$outboundSchema),
|
|
198
|
+
z.lazy(() => PluginResponseHealing$outboundSchema),
|
|
199
199
|
]);
|
|
200
|
-
export function
|
|
201
|
-
return JSON.stringify(
|
|
200
|
+
export function pluginToJSON(plugin) {
|
|
201
|
+
return JSON.stringify(Plugin$outboundSchema.parse(plugin));
|
|
202
202
|
}
|
|
203
203
|
/** @internal */
|
|
204
204
|
export const OpenResponsesRequest$outboundSchema = z.object({
|
|
@@ -240,13 +240,13 @@ export const OpenResponsesRequest$outboundSchema = z.object({
|
|
|
240
240
|
serviceTier: ServiceTier$outboundSchema.default("auto"),
|
|
241
241
|
truncation: z.nullable(Truncation$outboundSchema).optional(),
|
|
242
242
|
stream: z.boolean().default(false),
|
|
243
|
-
provider: z.nullable(z.lazy(() =>
|
|
243
|
+
provider: z.nullable(z.lazy(() => Provider$outboundSchema)).optional(),
|
|
244
244
|
plugins: z.array(z.union([
|
|
245
|
-
z.lazy(() =>
|
|
246
|
-
z.lazy(() =>
|
|
247
|
-
z.lazy(() =>
|
|
248
|
-
z.lazy(() =>
|
|
249
|
-
z.lazy(() =>
|
|
245
|
+
z.lazy(() => PluginAutoRouter$outboundSchema),
|
|
246
|
+
z.lazy(() => PluginModeration$outboundSchema),
|
|
247
|
+
z.lazy(() => PluginWeb$outboundSchema),
|
|
248
|
+
z.lazy(() => PluginFileParser$outboundSchema),
|
|
249
|
+
z.lazy(() => PluginResponseHealing$outboundSchema),
|
|
250
250
|
])).optional(),
|
|
251
251
|
user: z.string().optional(),
|
|
252
252
|
sessionId: z.string().optional(),
|
|
@@ -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 BulkAssignKeysToGuardrailGlobals = {
|
|
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 BulkAssignKeysToGuardrailRequestBody = {
|
|
5
20
|
/**
|
|
6
21
|
* Array of API key hashes to assign to the guardrail
|
|
@@ -8,6 +23,19 @@ export type BulkAssignKeysToGuardrailRequestBody = {
|
|
|
8
23
|
keyHashes: Array<string>;
|
|
9
24
|
};
|
|
10
25
|
export type BulkAssignKeysToGuardrailRequest = {
|
|
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 BulkAssignKeysToGuardrailRequestBody$outboundSchema: z.ZodT
|
|
|
32
60
|
export declare function bulkAssignKeysToGuardrailRequestBodyToJSON(bulkAssignKeysToGuardrailRequestBody: BulkAssignKeysToGuardrailRequestBody): string;
|
|
33
61
|
/** @internal */
|
|
34
62
|
export type BulkAssignKeysToGuardrailRequest$Outbound = {
|
|
63
|
+
"HTTP-Referer"?: string | undefined;
|
|
64
|
+
"X-Title"?: string | undefined;
|
|
35
65
|
id: string;
|
|
36
66
|
RequestBody: BulkAssignKeysToGuardrailRequestBody$Outbound;
|
|
37
67
|
};
|
|
@@ -18,10 +18,14 @@ export function bulkAssignKeysToGuardrailRequestBodyToJSON(bulkAssignKeysToGuard
|
|
|
18
18
|
}
|
|
19
19
|
/** @internal */
|
|
20
20
|
export const BulkAssignKeysToGuardrailRequest$outboundSchema = z.object({
|
|
21
|
+
httpReferer: z.string().optional(),
|
|
22
|
+
xTitle: z.string().optional(),
|
|
21
23
|
id: z.string(),
|
|
22
24
|
requestBody: z.lazy(() => BulkAssignKeysToGuardrailRequestBody$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 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
|
});
|