@openrouter/sdk 0.5.1 → 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 +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 +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 +1 -1
- package/esm/models/schema2.d.ts +0 -92
- package/esm/models/schema2.js +0 -109
|
@@ -4,9 +4,25 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { EventStream } from "../../lib/event-streams.js";
|
|
7
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
8
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
9
|
import * as models from "../index.js";
|
|
9
10
|
/** @internal */
|
|
11
|
+
export const SendChatCompletionRequestRequest$outboundSchema = z.object({
|
|
12
|
+
httpReferer: z.string().optional(),
|
|
13
|
+
xTitle: z.string().optional(),
|
|
14
|
+
chatGenerationParams: models.ChatGenerationParams$outboundSchema,
|
|
15
|
+
}).transform((v) => {
|
|
16
|
+
return remap$(v, {
|
|
17
|
+
httpReferer: "HTTP-Referer",
|
|
18
|
+
xTitle: "X-Title",
|
|
19
|
+
chatGenerationParams: "ChatGenerationParams",
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
export function sendChatCompletionRequestRequestToJSON(sendChatCompletionRequestRequest) {
|
|
23
|
+
return JSON.stringify(SendChatCompletionRequestRequest$outboundSchema.parse(sendChatCompletionRequestRequest));
|
|
24
|
+
}
|
|
25
|
+
/** @internal */
|
|
10
26
|
export const SendChatCompletionRequestResponse$inboundSchema = z.union([
|
|
11
27
|
models.ChatResponse$inboundSchema,
|
|
12
28
|
z.custom(x => x instanceof ReadableStream)
|
|
@@ -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 UpdateGuardrailGlobals = {
|
|
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
|
*/
|
|
@@ -45,6 +60,19 @@ export type UpdateGuardrailRequestBody = {
|
|
|
45
60
|
enforceZdr?: boolean | null | undefined;
|
|
46
61
|
};
|
|
47
62
|
export type UpdateGuardrailRequest = {
|
|
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;
|
|
48
76
|
/**
|
|
49
77
|
* The unique identifier of the guardrail to update
|
|
50
78
|
*/
|
|
@@ -134,6 +162,8 @@ export declare const UpdateGuardrailRequestBody$outboundSchema: z.ZodType<Update
|
|
|
134
162
|
export declare function updateGuardrailRequestBodyToJSON(updateGuardrailRequestBody: UpdateGuardrailRequestBody): string;
|
|
135
163
|
/** @internal */
|
|
136
164
|
export type UpdateGuardrailRequest$Outbound = {
|
|
165
|
+
"HTTP-Referer"?: string | undefined;
|
|
166
|
+
"X-Title"?: string | undefined;
|
|
137
167
|
id: string;
|
|
138
168
|
RequestBody: UpdateGuardrailRequestBody$Outbound;
|
|
139
169
|
};
|
|
@@ -48,10 +48,14 @@ export function updateGuardrailRequestBodyToJSON(updateGuardrailRequestBody) {
|
|
|
48
48
|
}
|
|
49
49
|
/** @internal */
|
|
50
50
|
export const UpdateGuardrailRequest$outboundSchema = z.object({
|
|
51
|
+
httpReferer: z.string().optional(),
|
|
52
|
+
xTitle: z.string().optional(),
|
|
51
53
|
id: z.string(),
|
|
52
54
|
requestBody: z.lazy(() => UpdateGuardrailRequestBody$outboundSchema),
|
|
53
55
|
}).transform((v) => {
|
|
54
56
|
return remap$(v, {
|
|
57
|
+
httpReferer: "HTTP-Referer",
|
|
58
|
+
xTitle: "X-Title",
|
|
55
59
|
requestBody: "RequestBody",
|
|
56
60
|
});
|
|
57
61
|
});
|
|
@@ -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 UpdateKeysGlobals = {
|
|
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
|
* New limit reset type for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday.
|
|
7
22
|
*/
|
|
@@ -37,6 +52,19 @@ export type UpdateKeysRequestBody = {
|
|
|
37
52
|
includeByokInLimit?: boolean | undefined;
|
|
38
53
|
};
|
|
39
54
|
export type UpdateKeysRequest = {
|
|
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;
|
|
40
68
|
/**
|
|
41
69
|
* The hash identifier of the API key to update
|
|
42
70
|
*/
|
|
@@ -148,6 +176,8 @@ export declare const UpdateKeysRequestBody$outboundSchema: z.ZodType<UpdateKeysR
|
|
|
148
176
|
export declare function updateKeysRequestBodyToJSON(updateKeysRequestBody: UpdateKeysRequestBody): string;
|
|
149
177
|
/** @internal */
|
|
150
178
|
export type UpdateKeysRequest$Outbound = {
|
|
179
|
+
"HTTP-Referer"?: string | undefined;
|
|
180
|
+
"X-Title"?: string | undefined;
|
|
151
181
|
hash: string;
|
|
152
182
|
RequestBody: UpdateKeysRequestBody$Outbound;
|
|
153
183
|
};
|
|
@@ -34,10 +34,14 @@ export function updateKeysRequestBodyToJSON(updateKeysRequestBody) {
|
|
|
34
34
|
}
|
|
35
35
|
/** @internal */
|
|
36
36
|
export const UpdateKeysRequest$outboundSchema = z.object({
|
|
37
|
+
httpReferer: z.string().optional(),
|
|
38
|
+
xTitle: z.string().optional(),
|
|
37
39
|
hash: z.string(),
|
|
38
40
|
requestBody: z.lazy(() => UpdateKeysRequestBody$outboundSchema),
|
|
39
41
|
}).transform((v) => {
|
|
40
42
|
return remap$(v, {
|
|
43
|
+
httpReferer: "HTTP-Referer",
|
|
44
|
+
xTitle: "X-Title",
|
|
41
45
|
requestBody: "RequestBody",
|
|
42
46
|
});
|
|
43
47
|
});
|
|
@@ -4,6 +4,7 @@ export declare const ProviderName: {
|
|
|
4
4
|
readonly Ai21: "AI21";
|
|
5
5
|
readonly AionLabs: "AionLabs";
|
|
6
6
|
readonly Alibaba: "Alibaba";
|
|
7
|
+
readonly Ambient: "Ambient";
|
|
7
8
|
readonly AmazonBedrock: "Amazon Bedrock";
|
|
8
9
|
readonly AmazonNova: "Amazon Nova";
|
|
9
10
|
readonly Anthropic: "Anthropic";
|
|
@@ -60,6 +61,7 @@ export declare const ProviderName: {
|
|
|
60
61
|
readonly Seed: "Seed";
|
|
61
62
|
readonly SiliconFlow: "SiliconFlow";
|
|
62
63
|
readonly Sourceful: "Sourceful";
|
|
64
|
+
readonly StepFun: "StepFun";
|
|
63
65
|
readonly Stealth: "Stealth";
|
|
64
66
|
readonly StreamLake: "StreamLake";
|
|
65
67
|
readonly Switchpoint: "Switchpoint";
|
|
@@ -7,6 +7,7 @@ export const ProviderName = {
|
|
|
7
7
|
Ai21: "AI21",
|
|
8
8
|
AionLabs: "AionLabs",
|
|
9
9
|
Alibaba: "Alibaba",
|
|
10
|
+
Ambient: "Ambient",
|
|
10
11
|
AmazonBedrock: "Amazon Bedrock",
|
|
11
12
|
AmazonNova: "Amazon Nova",
|
|
12
13
|
Anthropic: "Anthropic",
|
|
@@ -63,6 +64,7 @@ export const ProviderName = {
|
|
|
63
64
|
Seed: "Seed",
|
|
64
65
|
SiliconFlow: "SiliconFlow",
|
|
65
66
|
Sourceful: "Sourceful",
|
|
67
|
+
StepFun: "StepFun",
|
|
66
68
|
Stealth: "Stealth",
|
|
67
69
|
StreamLake: "StreamLake",
|
|
68
70
|
Switchpoint: "Switchpoint",
|
|
@@ -46,24 +46,12 @@ export type ProviderPreferencesSortUnion = ProviderPreferencesProviderSort | Pro
|
|
|
46
46
|
*/
|
|
47
47
|
export type ProviderPreferencesMaxPrice = {
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* Price per million prompt tokens
|
|
50
50
|
*/
|
|
51
51
|
prompt?: string | undefined;
|
|
52
|
-
/**
|
|
53
|
-
* A value in string format that is a large number
|
|
54
|
-
*/
|
|
55
52
|
completion?: string | undefined;
|
|
56
|
-
/**
|
|
57
|
-
* A value in string format that is a large number
|
|
58
|
-
*/
|
|
59
53
|
image?: string | undefined;
|
|
60
|
-
/**
|
|
61
|
-
* A value in string format that is a large number
|
|
62
|
-
*/
|
|
63
54
|
audio?: string | undefined;
|
|
64
|
-
/**
|
|
65
|
-
* A value in string format that is a large number
|
|
66
|
-
*/
|
|
67
55
|
request?: string | undefined;
|
|
68
56
|
};
|
|
69
57
|
/**
|
|
@@ -7,57 +7,18 @@ import { Parameter } from "./parameter.js";
|
|
|
7
7
|
import { PercentileStats } from "./percentilestats.js";
|
|
8
8
|
import { ProviderName } from "./providername.js";
|
|
9
9
|
export type Pricing = {
|
|
10
|
-
/**
|
|
11
|
-
* A value in string format that is a large number
|
|
12
|
-
*/
|
|
13
10
|
prompt: string;
|
|
14
|
-
/**
|
|
15
|
-
* A value in string format that is a large number
|
|
16
|
-
*/
|
|
17
11
|
completion: string;
|
|
18
|
-
/**
|
|
19
|
-
* A value in string format that is a large number
|
|
20
|
-
*/
|
|
21
12
|
request?: string | undefined;
|
|
22
|
-
/**
|
|
23
|
-
* A value in string format that is a large number
|
|
24
|
-
*/
|
|
25
13
|
image?: string | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* A value in string format that is a large number
|
|
28
|
-
*/
|
|
29
14
|
imageToken?: string | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* A value in string format that is a large number
|
|
32
|
-
*/
|
|
33
15
|
imageOutput?: string | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* A value in string format that is a large number
|
|
36
|
-
*/
|
|
37
16
|
audio?: string | undefined;
|
|
38
|
-
/**
|
|
39
|
-
* A value in string format that is a large number
|
|
40
|
-
*/
|
|
41
17
|
audioOutput?: string | undefined;
|
|
42
|
-
/**
|
|
43
|
-
* A value in string format that is a large number
|
|
44
|
-
*/
|
|
45
18
|
inputAudioCache?: string | undefined;
|
|
46
|
-
/**
|
|
47
|
-
* A value in string format that is a large number
|
|
48
|
-
*/
|
|
49
19
|
webSearch?: string | undefined;
|
|
50
|
-
/**
|
|
51
|
-
* A value in string format that is a large number
|
|
52
|
-
*/
|
|
53
20
|
internalReasoning?: string | undefined;
|
|
54
|
-
/**
|
|
55
|
-
* A value in string format that is a large number
|
|
56
|
-
*/
|
|
57
21
|
inputCacheRead?: string | undefined;
|
|
58
|
-
/**
|
|
59
|
-
* A value in string format that is a large number
|
|
60
|
-
*/
|
|
61
22
|
inputCacheWrite?: string | undefined;
|
|
62
23
|
discount?: number | undefined;
|
|
63
24
|
};
|
|
@@ -5,57 +5,18 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
|
5
5
|
* Pricing information for the model
|
|
6
6
|
*/
|
|
7
7
|
export type PublicPricing = {
|
|
8
|
-
/**
|
|
9
|
-
* A value in string format that is a large number
|
|
10
|
-
*/
|
|
11
8
|
prompt: string;
|
|
12
|
-
/**
|
|
13
|
-
* A value in string format that is a large number
|
|
14
|
-
*/
|
|
15
9
|
completion: string;
|
|
16
|
-
/**
|
|
17
|
-
* A value in string format that is a large number
|
|
18
|
-
*/
|
|
19
10
|
request?: string | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* A value in string format that is a large number
|
|
22
|
-
*/
|
|
23
11
|
image?: string | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* A value in string format that is a large number
|
|
26
|
-
*/
|
|
27
12
|
imageToken?: string | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* A value in string format that is a large number
|
|
30
|
-
*/
|
|
31
13
|
imageOutput?: string | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* A value in string format that is a large number
|
|
34
|
-
*/
|
|
35
14
|
audio?: string | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* A value in string format that is a large number
|
|
38
|
-
*/
|
|
39
15
|
audioOutput?: string | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* A value in string format that is a large number
|
|
42
|
-
*/
|
|
43
16
|
inputAudioCache?: string | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* A value in string format that is a large number
|
|
46
|
-
*/
|
|
47
17
|
webSearch?: string | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* A value in string format that is a large number
|
|
50
|
-
*/
|
|
51
18
|
internalReasoning?: string | undefined;
|
|
52
|
-
/**
|
|
53
|
-
* A value in string format that is a large number
|
|
54
|
-
*/
|
|
55
19
|
inputCacheRead?: string | undefined;
|
|
56
|
-
/**
|
|
57
|
-
* A value in string format that is a large number
|
|
58
|
-
*/
|
|
59
20
|
inputCacheWrite?: string | undefined;
|
|
60
21
|
discount?: number | undefined;
|
|
61
22
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Schema14, Schema14$Outbound } from "./schema14.js";
|
|
3
|
+
export type Prompt = number | string | any;
|
|
4
|
+
export type Completion = number | string | any;
|
|
5
|
+
export type Schema10 = {
|
|
6
|
+
prompt?: number | string | any | undefined;
|
|
7
|
+
completion?: number | string | any | undefined;
|
|
8
|
+
image?: Schema14 | undefined;
|
|
9
|
+
audio?: Schema14 | undefined;
|
|
10
|
+
request?: Schema14 | undefined;
|
|
11
|
+
};
|
|
12
|
+
/** @internal */
|
|
13
|
+
export type Prompt$Outbound = number | string | any;
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare const Prompt$outboundSchema: z.ZodType<Prompt$Outbound, Prompt>;
|
|
16
|
+
export declare function promptToJSON(prompt: Prompt): string;
|
|
17
|
+
/** @internal */
|
|
18
|
+
export type Completion$Outbound = number | string | any;
|
|
19
|
+
/** @internal */
|
|
20
|
+
export declare const Completion$outboundSchema: z.ZodType<Completion$Outbound, Completion>;
|
|
21
|
+
export declare function completionToJSON(completion: Completion): string;
|
|
22
|
+
/** @internal */
|
|
23
|
+
export type Schema10$Outbound = {
|
|
24
|
+
prompt?: number | string | any | undefined;
|
|
25
|
+
completion?: number | string | any | undefined;
|
|
26
|
+
image?: Schema14$Outbound | undefined;
|
|
27
|
+
audio?: Schema14$Outbound | undefined;
|
|
28
|
+
request?: Schema14$Outbound | undefined;
|
|
29
|
+
};
|
|
30
|
+
/** @internal */
|
|
31
|
+
export declare const Schema10$outboundSchema: z.ZodType<Schema10$Outbound, Schema10>;
|
|
32
|
+
export declare function schema10ToJSON(schema10: Schema10): string;
|
|
33
|
+
//# sourceMappingURL=schema10.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 3a361cbac0f8
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { Schema14$outboundSchema, } from "./schema14.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const Prompt$outboundSchema = z
|
|
9
|
+
.union([z.number(), z.string(), z.any()]);
|
|
10
|
+
export function promptToJSON(prompt) {
|
|
11
|
+
return JSON.stringify(Prompt$outboundSchema.parse(prompt));
|
|
12
|
+
}
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const Completion$outboundSchema = z.union([z.number(), z.string(), z.any()]);
|
|
15
|
+
export function completionToJSON(completion) {
|
|
16
|
+
return JSON.stringify(Completion$outboundSchema.parse(completion));
|
|
17
|
+
}
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const Schema10$outboundSchema = z
|
|
20
|
+
.object({
|
|
21
|
+
prompt: z.union([z.number(), z.string(), z.any()]).optional(),
|
|
22
|
+
completion: z.union([z.number(), z.string(), z.any()]).optional(),
|
|
23
|
+
image: Schema14$outboundSchema.optional(),
|
|
24
|
+
audio: Schema14$outboundSchema.optional(),
|
|
25
|
+
request: Schema14$outboundSchema.optional(),
|
|
26
|
+
});
|
|
27
|
+
export function schema10ToJSON(schema10) {
|
|
28
|
+
return JSON.stringify(Schema10$outboundSchema.parse(schema10));
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=schema10.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
export type Schema14 = number | string | any;
|
|
3
|
+
/** @internal */
|
|
4
|
+
export type Schema14$Outbound = number | string | any;
|
|
5
|
+
/** @internal */
|
|
6
|
+
export declare const Schema14$outboundSchema: z.ZodType<Schema14$Outbound, Schema14>;
|
|
7
|
+
export declare function schema14ToJSON(schema14: Schema14): string;
|
|
8
|
+
//# sourceMappingURL=schema14.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 197e0ddbcace
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const Schema14$outboundSchema = z
|
|
8
|
+
.union([z.number(), z.string(), z.any()]);
|
|
9
|
+
export function schema14ToJSON(schema14) {
|
|
10
|
+
return JSON.stringify(Schema14$outboundSchema.parse(schema14));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=schema14.js.map
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
export type Schema17ResponseHealing = {
|
|
4
|
+
id: "response-healing";
|
|
5
|
+
enabled?: boolean | undefined;
|
|
6
|
+
};
|
|
7
|
+
export declare const PdfEngine: {
|
|
8
|
+
readonly MistralOcr: "mistral-ocr";
|
|
9
|
+
readonly PdfText: "pdf-text";
|
|
10
|
+
readonly Native: "native";
|
|
11
|
+
};
|
|
12
|
+
export type PdfEngine = OpenEnum<typeof PdfEngine>;
|
|
13
|
+
export type Pdf = {
|
|
14
|
+
engine?: PdfEngine | undefined;
|
|
15
|
+
};
|
|
16
|
+
export type Schema17FileParser = {
|
|
17
|
+
id: "file-parser";
|
|
18
|
+
enabled?: boolean | undefined;
|
|
19
|
+
pdf?: Pdf | undefined;
|
|
20
|
+
};
|
|
21
|
+
export declare const Engine: {
|
|
22
|
+
readonly Native: "native";
|
|
23
|
+
readonly Exa: "exa";
|
|
24
|
+
};
|
|
25
|
+
export type Engine = OpenEnum<typeof Engine>;
|
|
26
|
+
export type Schema17Web = {
|
|
27
|
+
id: "web";
|
|
28
|
+
enabled?: boolean | undefined;
|
|
29
|
+
maxResults?: number | undefined;
|
|
30
|
+
searchPrompt?: string | undefined;
|
|
31
|
+
engine?: Engine | undefined;
|
|
32
|
+
};
|
|
33
|
+
export type Schema17Moderation = {
|
|
34
|
+
id: "moderation";
|
|
35
|
+
};
|
|
36
|
+
export type Schema17AutoRouter = {
|
|
37
|
+
id: "auto-router";
|
|
38
|
+
enabled?: boolean | undefined;
|
|
39
|
+
allowedModels?: Array<string> | undefined;
|
|
40
|
+
};
|
|
41
|
+
export type Schema17 = Schema17AutoRouter | Schema17Moderation | Schema17Web | Schema17FileParser | Schema17ResponseHealing;
|
|
42
|
+
/** @internal */
|
|
43
|
+
export type Schema17ResponseHealing$Outbound = {
|
|
44
|
+
id: "response-healing";
|
|
45
|
+
enabled?: boolean | undefined;
|
|
46
|
+
};
|
|
47
|
+
/** @internal */
|
|
48
|
+
export declare const Schema17ResponseHealing$outboundSchema: z.ZodType<Schema17ResponseHealing$Outbound, Schema17ResponseHealing>;
|
|
49
|
+
export declare function schema17ResponseHealingToJSON(schema17ResponseHealing: Schema17ResponseHealing): string;
|
|
50
|
+
/** @internal */
|
|
51
|
+
export declare const PdfEngine$outboundSchema: z.ZodType<string, PdfEngine>;
|
|
52
|
+
/** @internal */
|
|
53
|
+
export type Pdf$Outbound = {
|
|
54
|
+
engine?: string | undefined;
|
|
55
|
+
};
|
|
56
|
+
/** @internal */
|
|
57
|
+
export declare const Pdf$outboundSchema: z.ZodType<Pdf$Outbound, Pdf>;
|
|
58
|
+
export declare function pdfToJSON(pdf: Pdf): string;
|
|
59
|
+
/** @internal */
|
|
60
|
+
export type Schema17FileParser$Outbound = {
|
|
61
|
+
id: "file-parser";
|
|
62
|
+
enabled?: boolean | undefined;
|
|
63
|
+
pdf?: Pdf$Outbound | undefined;
|
|
64
|
+
};
|
|
65
|
+
/** @internal */
|
|
66
|
+
export declare const Schema17FileParser$outboundSchema: z.ZodType<Schema17FileParser$Outbound, Schema17FileParser>;
|
|
67
|
+
export declare function schema17FileParserToJSON(schema17FileParser: Schema17FileParser): string;
|
|
68
|
+
/** @internal */
|
|
69
|
+
export declare const Engine$outboundSchema: z.ZodType<string, Engine>;
|
|
70
|
+
/** @internal */
|
|
71
|
+
export type Schema17Web$Outbound = {
|
|
72
|
+
id: "web";
|
|
73
|
+
enabled?: boolean | undefined;
|
|
74
|
+
max_results?: number | undefined;
|
|
75
|
+
search_prompt?: string | undefined;
|
|
76
|
+
engine?: string | undefined;
|
|
77
|
+
};
|
|
78
|
+
/** @internal */
|
|
79
|
+
export declare const Schema17Web$outboundSchema: z.ZodType<Schema17Web$Outbound, Schema17Web>;
|
|
80
|
+
export declare function schema17WebToJSON(schema17Web: Schema17Web): string;
|
|
81
|
+
/** @internal */
|
|
82
|
+
export type Schema17Moderation$Outbound = {
|
|
83
|
+
id: "moderation";
|
|
84
|
+
};
|
|
85
|
+
/** @internal */
|
|
86
|
+
export declare const Schema17Moderation$outboundSchema: z.ZodType<Schema17Moderation$Outbound, Schema17Moderation>;
|
|
87
|
+
export declare function schema17ModerationToJSON(schema17Moderation: Schema17Moderation): string;
|
|
88
|
+
/** @internal */
|
|
89
|
+
export type Schema17AutoRouter$Outbound = {
|
|
90
|
+
id: "auto-router";
|
|
91
|
+
enabled?: boolean | undefined;
|
|
92
|
+
allowed_models?: Array<string> | undefined;
|
|
93
|
+
};
|
|
94
|
+
/** @internal */
|
|
95
|
+
export declare const Schema17AutoRouter$outboundSchema: z.ZodType<Schema17AutoRouter$Outbound, Schema17AutoRouter>;
|
|
96
|
+
export declare function schema17AutoRouterToJSON(schema17AutoRouter: Schema17AutoRouter): string;
|
|
97
|
+
/** @internal */
|
|
98
|
+
export type Schema17$Outbound = Schema17AutoRouter$Outbound | Schema17Moderation$Outbound | Schema17Web$Outbound | Schema17FileParser$Outbound | Schema17ResponseHealing$Outbound;
|
|
99
|
+
/** @internal */
|
|
100
|
+
export declare const Schema17$outboundSchema: z.ZodType<Schema17$Outbound, Schema17>;
|
|
101
|
+
export declare function schema17ToJSON(schema17: Schema17): string;
|
|
102
|
+
//# sourceMappingURL=schema17.d.ts.map
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: f882e1dc50da
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import * as openEnums from "../types/enums.js";
|
|
8
|
+
export const PdfEngine = {
|
|
9
|
+
MistralOcr: "mistral-ocr",
|
|
10
|
+
PdfText: "pdf-text",
|
|
11
|
+
Native: "native",
|
|
12
|
+
};
|
|
13
|
+
export const Engine = {
|
|
14
|
+
Native: "native",
|
|
15
|
+
Exa: "exa",
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const Schema17ResponseHealing$outboundSchema = z.object({
|
|
19
|
+
id: z.literal("response-healing"),
|
|
20
|
+
enabled: z.boolean().optional(),
|
|
21
|
+
});
|
|
22
|
+
export function schema17ResponseHealingToJSON(schema17ResponseHealing) {
|
|
23
|
+
return JSON.stringify(Schema17ResponseHealing$outboundSchema.parse(schema17ResponseHealing));
|
|
24
|
+
}
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const PdfEngine$outboundSchema = openEnums
|
|
27
|
+
.outboundSchema(PdfEngine);
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const Pdf$outboundSchema = z.object({
|
|
30
|
+
engine: PdfEngine$outboundSchema.optional(),
|
|
31
|
+
});
|
|
32
|
+
export function pdfToJSON(pdf) {
|
|
33
|
+
return JSON.stringify(Pdf$outboundSchema.parse(pdf));
|
|
34
|
+
}
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const Schema17FileParser$outboundSchema = z.object({
|
|
37
|
+
id: z.literal("file-parser"),
|
|
38
|
+
enabled: z.boolean().optional(),
|
|
39
|
+
pdf: z.lazy(() => Pdf$outboundSchema).optional(),
|
|
40
|
+
});
|
|
41
|
+
export function schema17FileParserToJSON(schema17FileParser) {
|
|
42
|
+
return JSON.stringify(Schema17FileParser$outboundSchema.parse(schema17FileParser));
|
|
43
|
+
}
|
|
44
|
+
/** @internal */
|
|
45
|
+
export const Engine$outboundSchema = openEnums
|
|
46
|
+
.outboundSchema(Engine);
|
|
47
|
+
/** @internal */
|
|
48
|
+
export const Schema17Web$outboundSchema = z.object({
|
|
49
|
+
id: z.literal("web"),
|
|
50
|
+
enabled: z.boolean().optional(),
|
|
51
|
+
maxResults: z.number().optional(),
|
|
52
|
+
searchPrompt: z.string().optional(),
|
|
53
|
+
engine: Engine$outboundSchema.optional(),
|
|
54
|
+
}).transform((v) => {
|
|
55
|
+
return remap$(v, {
|
|
56
|
+
maxResults: "max_results",
|
|
57
|
+
searchPrompt: "search_prompt",
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
export function schema17WebToJSON(schema17Web) {
|
|
61
|
+
return JSON.stringify(Schema17Web$outboundSchema.parse(schema17Web));
|
|
62
|
+
}
|
|
63
|
+
/** @internal */
|
|
64
|
+
export const Schema17Moderation$outboundSchema = z.object({
|
|
65
|
+
id: z.literal("moderation"),
|
|
66
|
+
});
|
|
67
|
+
export function schema17ModerationToJSON(schema17Moderation) {
|
|
68
|
+
return JSON.stringify(Schema17Moderation$outboundSchema.parse(schema17Moderation));
|
|
69
|
+
}
|
|
70
|
+
/** @internal */
|
|
71
|
+
export const Schema17AutoRouter$outboundSchema = z.object({
|
|
72
|
+
id: z.literal("auto-router"),
|
|
73
|
+
enabled: z.boolean().optional(),
|
|
74
|
+
allowedModels: z.array(z.string()).optional(),
|
|
75
|
+
}).transform((v) => {
|
|
76
|
+
return remap$(v, {
|
|
77
|
+
allowedModels: "allowed_models",
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
export function schema17AutoRouterToJSON(schema17AutoRouter) {
|
|
81
|
+
return JSON.stringify(Schema17AutoRouter$outboundSchema.parse(schema17AutoRouter));
|
|
82
|
+
}
|
|
83
|
+
/** @internal */
|
|
84
|
+
export const Schema17$outboundSchema = z
|
|
85
|
+
.union([
|
|
86
|
+
z.lazy(() => Schema17AutoRouter$outboundSchema),
|
|
87
|
+
z.lazy(() => Schema17Moderation$outboundSchema),
|
|
88
|
+
z.lazy(() => Schema17Web$outboundSchema),
|
|
89
|
+
z.lazy(() => Schema17FileParser$outboundSchema),
|
|
90
|
+
z.lazy(() => Schema17ResponseHealing$outboundSchema),
|
|
91
|
+
]);
|
|
92
|
+
export function schema17ToJSON(schema17) {
|
|
93
|
+
return JSON.stringify(Schema17$outboundSchema.parse(schema17));
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=schema17.js.map
|