@openrouter/sdk 0.2.11 → 0.3.1
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/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/chatgenerationparams.d.ts +30 -44
- package/esm/models/chatgenerationparams.js +27 -32
- package/esm/models/chatresponsechoice.d.ts +2 -0
- package/esm/models/chatresponsechoice.js +3 -0
- package/esm/models/chatstreamingmessagechunk.d.ts +2 -0
- package/esm/models/chatstreamingmessagechunk.js +3 -0
- package/esm/models/index.d.ts +7 -0
- package/esm/models/index.js +7 -0
- package/esm/models/openresponsesrequest.d.ts +51 -64
- package/esm/models/openresponsesrequest.js +32 -54
- package/esm/models/operations/createembeddings.d.ts +5 -138
- package/esm/models/operations/createembeddings.js +1 -65
- package/esm/models/operations/getparameters.d.ts +3 -75
- package/esm/models/operations/getparameters.js +3 -74
- package/esm/models/parameter.d.ts +1 -0
- package/esm/models/parameter.js +1 -0
- package/esm/models/pdfparserengine.d.ts +17 -0
- package/esm/models/pdfparserengine.js +15 -0
- package/esm/models/pdfparseroptions.d.ts +19 -0
- package/esm/models/pdfparseroptions.js +13 -0
- package/esm/models/providerpreferences.d.ts +215 -0
- package/esm/models/providerpreferences.js +135 -0
- package/esm/models/providersort.d.ts +0 -6
- package/esm/models/providersort.js +0 -3
- package/esm/models/providersortconfig.d.ts +23 -0
- package/esm/models/providersortconfig.js +22 -0
- package/esm/models/providersortunion.d.ts +10 -0
- package/esm/models/providersortunion.js +12 -0
- package/esm/models/schema3.d.ts +50 -0
- package/esm/models/schema3.js +60 -0
- package/esm/models/websearchengine.d.ts +16 -0
- package/esm/models/websearchengine.js +14 -0
- package/esm/types/discriminatedUnion.d.ts +25 -0
- package/esm/types/discriminatedUnion.js +57 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
|
@@ -2,85 +2,14 @@ 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
|
+
import * as models from "../index.js";
|
|
5
6
|
export type GetParametersSecurity = {
|
|
6
7
|
bearer: string;
|
|
7
8
|
};
|
|
8
|
-
export declare const GetParametersProvider: {
|
|
9
|
-
readonly Ai21: "AI21";
|
|
10
|
-
readonly AionLabs: "AionLabs";
|
|
11
|
-
readonly Alibaba: "Alibaba";
|
|
12
|
-
readonly AmazonBedrock: "Amazon Bedrock";
|
|
13
|
-
readonly AmazonNova: "Amazon Nova";
|
|
14
|
-
readonly Anthropic: "Anthropic";
|
|
15
|
-
readonly ArceeAI: "Arcee AI";
|
|
16
|
-
readonly AtlasCloud: "AtlasCloud";
|
|
17
|
-
readonly Avian: "Avian";
|
|
18
|
-
readonly Azure: "Azure";
|
|
19
|
-
readonly BaseTen: "BaseTen";
|
|
20
|
-
readonly BytePlus: "BytePlus";
|
|
21
|
-
readonly BlackForestLabs: "Black Forest Labs";
|
|
22
|
-
readonly Cerebras: "Cerebras";
|
|
23
|
-
readonly Chutes: "Chutes";
|
|
24
|
-
readonly Cirrascale: "Cirrascale";
|
|
25
|
-
readonly Clarifai: "Clarifai";
|
|
26
|
-
readonly Cloudflare: "Cloudflare";
|
|
27
|
-
readonly Cohere: "Cohere";
|
|
28
|
-
readonly Crusoe: "Crusoe";
|
|
29
|
-
readonly DeepInfra: "DeepInfra";
|
|
30
|
-
readonly DeepSeek: "DeepSeek";
|
|
31
|
-
readonly Featherless: "Featherless";
|
|
32
|
-
readonly Fireworks: "Fireworks";
|
|
33
|
-
readonly Friendli: "Friendli";
|
|
34
|
-
readonly GMICloud: "GMICloud";
|
|
35
|
-
readonly GoPomelo: "GoPomelo";
|
|
36
|
-
readonly Google: "Google";
|
|
37
|
-
readonly GoogleAIStudio: "Google AI Studio";
|
|
38
|
-
readonly Groq: "Groq";
|
|
39
|
-
readonly Hyperbolic: "Hyperbolic";
|
|
40
|
-
readonly Inception: "Inception";
|
|
41
|
-
readonly InferenceNet: "InferenceNet";
|
|
42
|
-
readonly Infermatic: "Infermatic";
|
|
43
|
-
readonly Inflection: "Inflection";
|
|
44
|
-
readonly Liquid: "Liquid";
|
|
45
|
-
readonly Mara: "Mara";
|
|
46
|
-
readonly Mancer2: "Mancer 2";
|
|
47
|
-
readonly Minimax: "Minimax";
|
|
48
|
-
readonly ModelRun: "ModelRun";
|
|
49
|
-
readonly Mistral: "Mistral";
|
|
50
|
-
readonly Modular: "Modular";
|
|
51
|
-
readonly MoonshotAI: "Moonshot AI";
|
|
52
|
-
readonly Morph: "Morph";
|
|
53
|
-
readonly NCompass: "NCompass";
|
|
54
|
-
readonly Nebius: "Nebius";
|
|
55
|
-
readonly NextBit: "NextBit";
|
|
56
|
-
readonly Novita: "Novita";
|
|
57
|
-
readonly Nvidia: "Nvidia";
|
|
58
|
-
readonly OpenAI: "OpenAI";
|
|
59
|
-
readonly OpenInference: "OpenInference";
|
|
60
|
-
readonly Parasail: "Parasail";
|
|
61
|
-
readonly Perplexity: "Perplexity";
|
|
62
|
-
readonly Phala: "Phala";
|
|
63
|
-
readonly Relace: "Relace";
|
|
64
|
-
readonly SambaNova: "SambaNova";
|
|
65
|
-
readonly SiliconFlow: "SiliconFlow";
|
|
66
|
-
readonly Sourceful: "Sourceful";
|
|
67
|
-
readonly Stealth: "Stealth";
|
|
68
|
-
readonly StreamLake: "StreamLake";
|
|
69
|
-
readonly Switchpoint: "Switchpoint";
|
|
70
|
-
readonly Targon: "Targon";
|
|
71
|
-
readonly Together: "Together";
|
|
72
|
-
readonly Venice: "Venice";
|
|
73
|
-
readonly WandB: "WandB";
|
|
74
|
-
readonly Xiaomi: "Xiaomi";
|
|
75
|
-
readonly XAI: "xAI";
|
|
76
|
-
readonly ZAi: "Z.AI";
|
|
77
|
-
readonly FakeProvider: "FakeProvider";
|
|
78
|
-
};
|
|
79
|
-
export type GetParametersProvider = OpenEnum<typeof GetParametersProvider>;
|
|
80
9
|
export type GetParametersRequest = {
|
|
81
10
|
author: string;
|
|
82
11
|
slug: string;
|
|
83
|
-
provider?:
|
|
12
|
+
provider?: models.ProviderName | undefined;
|
|
84
13
|
};
|
|
85
14
|
export declare const SupportedParameter: {
|
|
86
15
|
readonly Temperature: "temperature";
|
|
@@ -104,6 +33,7 @@ export declare const SupportedParameter: {
|
|
|
104
33
|
readonly ParallelToolCalls: "parallel_tool_calls";
|
|
105
34
|
readonly IncludeReasoning: "include_reasoning";
|
|
106
35
|
readonly Reasoning: "reasoning";
|
|
36
|
+
readonly ReasoningEffort: "reasoning_effort";
|
|
107
37
|
readonly WebSearchOptions: "web_search_options";
|
|
108
38
|
readonly Verbosity: "verbosity";
|
|
109
39
|
};
|
|
@@ -138,8 +68,6 @@ export type GetParametersSecurity$Outbound = {
|
|
|
138
68
|
export declare const GetParametersSecurity$outboundSchema: z.ZodType<GetParametersSecurity$Outbound, GetParametersSecurity>;
|
|
139
69
|
export declare function getParametersSecurityToJSON(getParametersSecurity: GetParametersSecurity): string;
|
|
140
70
|
/** @internal */
|
|
141
|
-
export declare const GetParametersProvider$outboundSchema: z.ZodType<string, GetParametersProvider>;
|
|
142
|
-
/** @internal */
|
|
143
71
|
export type GetParametersRequest$Outbound = {
|
|
144
72
|
author: string;
|
|
145
73
|
slug: string;
|
|
@@ -5,77 +5,7 @@ import * as z from "zod/v4";
|
|
|
5
5
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
7
|
import * as openEnums from "../../types/enums.js";
|
|
8
|
-
|
|
9
|
-
Ai21: "AI21",
|
|
10
|
-
AionLabs: "AionLabs",
|
|
11
|
-
Alibaba: "Alibaba",
|
|
12
|
-
AmazonBedrock: "Amazon Bedrock",
|
|
13
|
-
AmazonNova: "Amazon Nova",
|
|
14
|
-
Anthropic: "Anthropic",
|
|
15
|
-
ArceeAI: "Arcee AI",
|
|
16
|
-
AtlasCloud: "AtlasCloud",
|
|
17
|
-
Avian: "Avian",
|
|
18
|
-
Azure: "Azure",
|
|
19
|
-
BaseTen: "BaseTen",
|
|
20
|
-
BytePlus: "BytePlus",
|
|
21
|
-
BlackForestLabs: "Black Forest Labs",
|
|
22
|
-
Cerebras: "Cerebras",
|
|
23
|
-
Chutes: "Chutes",
|
|
24
|
-
Cirrascale: "Cirrascale",
|
|
25
|
-
Clarifai: "Clarifai",
|
|
26
|
-
Cloudflare: "Cloudflare",
|
|
27
|
-
Cohere: "Cohere",
|
|
28
|
-
Crusoe: "Crusoe",
|
|
29
|
-
DeepInfra: "DeepInfra",
|
|
30
|
-
DeepSeek: "DeepSeek",
|
|
31
|
-
Featherless: "Featherless",
|
|
32
|
-
Fireworks: "Fireworks",
|
|
33
|
-
Friendli: "Friendli",
|
|
34
|
-
GMICloud: "GMICloud",
|
|
35
|
-
GoPomelo: "GoPomelo",
|
|
36
|
-
Google: "Google",
|
|
37
|
-
GoogleAIStudio: "Google AI Studio",
|
|
38
|
-
Groq: "Groq",
|
|
39
|
-
Hyperbolic: "Hyperbolic",
|
|
40
|
-
Inception: "Inception",
|
|
41
|
-
InferenceNet: "InferenceNet",
|
|
42
|
-
Infermatic: "Infermatic",
|
|
43
|
-
Inflection: "Inflection",
|
|
44
|
-
Liquid: "Liquid",
|
|
45
|
-
Mara: "Mara",
|
|
46
|
-
Mancer2: "Mancer 2",
|
|
47
|
-
Minimax: "Minimax",
|
|
48
|
-
ModelRun: "ModelRun",
|
|
49
|
-
Mistral: "Mistral",
|
|
50
|
-
Modular: "Modular",
|
|
51
|
-
MoonshotAI: "Moonshot AI",
|
|
52
|
-
Morph: "Morph",
|
|
53
|
-
NCompass: "NCompass",
|
|
54
|
-
Nebius: "Nebius",
|
|
55
|
-
NextBit: "NextBit",
|
|
56
|
-
Novita: "Novita",
|
|
57
|
-
Nvidia: "Nvidia",
|
|
58
|
-
OpenAI: "OpenAI",
|
|
59
|
-
OpenInference: "OpenInference",
|
|
60
|
-
Parasail: "Parasail",
|
|
61
|
-
Perplexity: "Perplexity",
|
|
62
|
-
Phala: "Phala",
|
|
63
|
-
Relace: "Relace",
|
|
64
|
-
SambaNova: "SambaNova",
|
|
65
|
-
SiliconFlow: "SiliconFlow",
|
|
66
|
-
Sourceful: "Sourceful",
|
|
67
|
-
Stealth: "Stealth",
|
|
68
|
-
StreamLake: "StreamLake",
|
|
69
|
-
Switchpoint: "Switchpoint",
|
|
70
|
-
Targon: "Targon",
|
|
71
|
-
Together: "Together",
|
|
72
|
-
Venice: "Venice",
|
|
73
|
-
WandB: "WandB",
|
|
74
|
-
Xiaomi: "Xiaomi",
|
|
75
|
-
XAI: "xAI",
|
|
76
|
-
ZAi: "Z.AI",
|
|
77
|
-
FakeProvider: "FakeProvider",
|
|
78
|
-
};
|
|
8
|
+
import * as models from "../index.js";
|
|
79
9
|
export const SupportedParameter = {
|
|
80
10
|
Temperature: "temperature",
|
|
81
11
|
TopP: "top_p",
|
|
@@ -98,6 +28,7 @@ export const SupportedParameter = {
|
|
|
98
28
|
ParallelToolCalls: "parallel_tool_calls",
|
|
99
29
|
IncludeReasoning: "include_reasoning",
|
|
100
30
|
Reasoning: "reasoning",
|
|
31
|
+
ReasoningEffort: "reasoning_effort",
|
|
101
32
|
WebSearchOptions: "web_search_options",
|
|
102
33
|
Verbosity: "verbosity",
|
|
103
34
|
};
|
|
@@ -109,12 +40,10 @@ export function getParametersSecurityToJSON(getParametersSecurity) {
|
|
|
109
40
|
return JSON.stringify(GetParametersSecurity$outboundSchema.parse(getParametersSecurity));
|
|
110
41
|
}
|
|
111
42
|
/** @internal */
|
|
112
|
-
export const GetParametersProvider$outboundSchema = openEnums.outboundSchema(GetParametersProvider);
|
|
113
|
-
/** @internal */
|
|
114
43
|
export const GetParametersRequest$outboundSchema = z.object({
|
|
115
44
|
author: z.string(),
|
|
116
45
|
slug: z.string(),
|
|
117
|
-
provider:
|
|
46
|
+
provider: models.ProviderName$outboundSchema.optional(),
|
|
118
47
|
});
|
|
119
48
|
export function getParametersRequestToJSON(getParametersRequest) {
|
|
120
49
|
return JSON.stringify(GetParametersRequest$outboundSchema.parse(getParametersRequest));
|
|
@@ -22,6 +22,7 @@ export declare const Parameter: {
|
|
|
22
22
|
readonly ParallelToolCalls: "parallel_tool_calls";
|
|
23
23
|
readonly IncludeReasoning: "include_reasoning";
|
|
24
24
|
readonly Reasoning: "reasoning";
|
|
25
|
+
readonly ReasoningEffort: "reasoning_effort";
|
|
25
26
|
readonly WebSearchOptions: "web_search_options";
|
|
26
27
|
readonly Verbosity: "verbosity";
|
|
27
28
|
};
|
package/esm/models/parameter.js
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
/**
|
|
4
|
+
* The engine to use for parsing PDF files.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PDFParserEngine: {
|
|
7
|
+
readonly MistralOcr: "mistral-ocr";
|
|
8
|
+
readonly PdfText: "pdf-text";
|
|
9
|
+
readonly Native: "native";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The engine to use for parsing PDF files.
|
|
13
|
+
*/
|
|
14
|
+
export type PDFParserEngine = OpenEnum<typeof PDFParserEngine>;
|
|
15
|
+
/** @internal */
|
|
16
|
+
export declare const PDFParserEngine$outboundSchema: z.ZodType<string, PDFParserEngine>;
|
|
17
|
+
//# sourceMappingURL=pdfparserengine.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as openEnums from "../types/enums.js";
|
|
5
|
+
/**
|
|
6
|
+
* The engine to use for parsing PDF files.
|
|
7
|
+
*/
|
|
8
|
+
export const PDFParserEngine = {
|
|
9
|
+
MistralOcr: "mistral-ocr",
|
|
10
|
+
PdfText: "pdf-text",
|
|
11
|
+
Native: "native",
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const PDFParserEngine$outboundSchema = openEnums.outboundSchema(PDFParserEngine);
|
|
15
|
+
//# sourceMappingURL=pdfparserengine.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { PDFParserEngine } from "./pdfparserengine.js";
|
|
3
|
+
/**
|
|
4
|
+
* Options for PDF parsing.
|
|
5
|
+
*/
|
|
6
|
+
export type PDFParserOptions = {
|
|
7
|
+
/**
|
|
8
|
+
* The engine to use for parsing PDF files.
|
|
9
|
+
*/
|
|
10
|
+
engine?: PDFParserEngine | undefined;
|
|
11
|
+
};
|
|
12
|
+
/** @internal */
|
|
13
|
+
export type PDFParserOptions$Outbound = {
|
|
14
|
+
engine?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
export declare const PDFParserOptions$outboundSchema: z.ZodType<PDFParserOptions$Outbound, PDFParserOptions>;
|
|
18
|
+
export declare function pdfParserOptionsToJSON(pdfParserOptions: PDFParserOptions): string;
|
|
19
|
+
//# sourceMappingURL=pdfparseroptions.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { PDFParserEngine$outboundSchema, } from "./pdfparserengine.js";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const PDFParserOptions$outboundSchema = z.object({
|
|
8
|
+
engine: PDFParserEngine$outboundSchema.optional(),
|
|
9
|
+
});
|
|
10
|
+
export function pdfParserOptionsToJSON(pdfParserOptions) {
|
|
11
|
+
return JSON.stringify(PDFParserOptions$outboundSchema.parse(pdfParserOptions));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=pdfparseroptions.js.map
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { DataCollection } from "./datacollection.js";
|
|
4
|
+
import { ProviderName } from "./providername.js";
|
|
5
|
+
import { ProviderSort } from "./providersort.js";
|
|
6
|
+
import { Quantization } from "./quantization.js";
|
|
7
|
+
export type ProviderPreferencesOrder = ProviderName | string;
|
|
8
|
+
export type ProviderPreferencesOnly = ProviderName | string;
|
|
9
|
+
export type ProviderPreferencesIgnore = ProviderName | string;
|
|
10
|
+
export declare const SortEnum: {
|
|
11
|
+
readonly Price: "price";
|
|
12
|
+
readonly Throughput: "throughput";
|
|
13
|
+
readonly Latency: "latency";
|
|
14
|
+
};
|
|
15
|
+
export type SortEnum = OpenEnum<typeof SortEnum>;
|
|
16
|
+
export declare const ProviderSortConfigEnum: {
|
|
17
|
+
readonly Price: "price";
|
|
18
|
+
readonly Throughput: "throughput";
|
|
19
|
+
readonly Latency: "latency";
|
|
20
|
+
};
|
|
21
|
+
export type ProviderSortConfigEnum = ClosedEnum<typeof ProviderSortConfigEnum>;
|
|
22
|
+
export declare const ProviderPreferencesPartition: {
|
|
23
|
+
readonly Model: "model";
|
|
24
|
+
readonly None: "none";
|
|
25
|
+
};
|
|
26
|
+
export type ProviderPreferencesPartition = OpenEnum<typeof ProviderPreferencesPartition>;
|
|
27
|
+
export type ProviderPreferencesProviderSortConfig = {
|
|
28
|
+
by?: ProviderSort | null | undefined;
|
|
29
|
+
partition?: ProviderPreferencesPartition | null | undefined;
|
|
30
|
+
};
|
|
31
|
+
export type ProviderSortConfigUnion = ProviderPreferencesProviderSortConfig | ProviderSortConfigEnum;
|
|
32
|
+
export declare const ProviderPreferencesProviderSort: {
|
|
33
|
+
readonly Price: "price";
|
|
34
|
+
readonly Throughput: "throughput";
|
|
35
|
+
readonly Latency: "latency";
|
|
36
|
+
};
|
|
37
|
+
export type ProviderPreferencesProviderSort = OpenEnum<typeof ProviderPreferencesProviderSort>;
|
|
38
|
+
/**
|
|
39
|
+
* The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
|
|
40
|
+
*/
|
|
41
|
+
export type ProviderPreferencesSortUnion = ProviderPreferencesProviderSort | ProviderPreferencesProviderSortConfig | ProviderSortConfigEnum | SortEnum;
|
|
42
|
+
/**
|
|
43
|
+
* The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
|
|
44
|
+
*/
|
|
45
|
+
export type ProviderPreferencesMaxPrice = {
|
|
46
|
+
/**
|
|
47
|
+
* A value in string format that is a large number
|
|
48
|
+
*/
|
|
49
|
+
prompt?: string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* A value in string format that is a large number
|
|
52
|
+
*/
|
|
53
|
+
completion?: string | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* A value in string format that is a large number
|
|
56
|
+
*/
|
|
57
|
+
image?: string | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* A value in string format that is a large number
|
|
60
|
+
*/
|
|
61
|
+
audio?: string | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* A value in string format that is a large number
|
|
64
|
+
*/
|
|
65
|
+
request?: string | undefined;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Provider routing preferences for the request.
|
|
69
|
+
*/
|
|
70
|
+
export type ProviderPreferences = {
|
|
71
|
+
/**
|
|
72
|
+
* Whether to allow backup providers to serve requests
|
|
73
|
+
*
|
|
74
|
+
* @remarks
|
|
75
|
+
* - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
|
|
76
|
+
* - false: use only the primary/custom provider, and return the upstream error if it's unavailable.
|
|
77
|
+
*/
|
|
78
|
+
allowFallbacks?: boolean | null | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest.
|
|
81
|
+
*/
|
|
82
|
+
requireParameters?: boolean | null | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Data collection setting. If no available model provider meets the requirement, your request will return an error.
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
* - allow: (default) allow providers which store user data non-transiently and may train on it
|
|
88
|
+
*
|
|
89
|
+
* - deny: use only providers which do not collect user data.
|
|
90
|
+
*/
|
|
91
|
+
dataCollection?: DataCollection | null | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used.
|
|
94
|
+
*/
|
|
95
|
+
zdr?: boolean | null | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used.
|
|
98
|
+
*/
|
|
99
|
+
enforceDistillableText?: boolean | null | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.
|
|
102
|
+
*/
|
|
103
|
+
order?: Array<ProviderName | string> | null | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.
|
|
106
|
+
*/
|
|
107
|
+
only?: Array<ProviderName | string> | null | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.
|
|
110
|
+
*/
|
|
111
|
+
ignore?: Array<ProviderName | string> | null | undefined;
|
|
112
|
+
/**
|
|
113
|
+
* A list of quantization levels to filter the provider by.
|
|
114
|
+
*/
|
|
115
|
+
quantizations?: Array<Quantization> | null | undefined;
|
|
116
|
+
sort?: ProviderPreferencesProviderSort | ProviderPreferencesProviderSortConfig | ProviderSortConfigEnum | SortEnum | null | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
|
|
119
|
+
*/
|
|
120
|
+
maxPrice?: ProviderPreferencesMaxPrice | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* Preferred minimum throughput (in tokens per second). Endpoints below this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
|
|
123
|
+
*/
|
|
124
|
+
preferredMinThroughput?: number | null | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* Preferred maximum latency (in seconds). Endpoints above this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
|
|
127
|
+
*/
|
|
128
|
+
preferredMaxLatency?: number | null | undefined;
|
|
129
|
+
/**
|
|
130
|
+
* **DEPRECATED** Use preferred_min_throughput instead. Backwards-compatible alias for preferred_min_throughput.
|
|
131
|
+
*
|
|
132
|
+
* @deprecated field: Use preferred_min_throughput instead..
|
|
133
|
+
*/
|
|
134
|
+
minThroughput?: number | null | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* **DEPRECATED** Use preferred_max_latency instead. Backwards-compatible alias for preferred_max_latency.
|
|
137
|
+
*
|
|
138
|
+
* @deprecated field: Use preferred_max_latency instead..
|
|
139
|
+
*/
|
|
140
|
+
maxLatency?: number | null | undefined;
|
|
141
|
+
};
|
|
142
|
+
/** @internal */
|
|
143
|
+
export type ProviderPreferencesOrder$Outbound = string | string;
|
|
144
|
+
/** @internal */
|
|
145
|
+
export declare const ProviderPreferencesOrder$outboundSchema: z.ZodType<ProviderPreferencesOrder$Outbound, ProviderPreferencesOrder>;
|
|
146
|
+
export declare function providerPreferencesOrderToJSON(providerPreferencesOrder: ProviderPreferencesOrder): string;
|
|
147
|
+
/** @internal */
|
|
148
|
+
export type ProviderPreferencesOnly$Outbound = string | string;
|
|
149
|
+
/** @internal */
|
|
150
|
+
export declare const ProviderPreferencesOnly$outboundSchema: z.ZodType<ProviderPreferencesOnly$Outbound, ProviderPreferencesOnly>;
|
|
151
|
+
export declare function providerPreferencesOnlyToJSON(providerPreferencesOnly: ProviderPreferencesOnly): string;
|
|
152
|
+
/** @internal */
|
|
153
|
+
export type ProviderPreferencesIgnore$Outbound = string | string;
|
|
154
|
+
/** @internal */
|
|
155
|
+
export declare const ProviderPreferencesIgnore$outboundSchema: z.ZodType<ProviderPreferencesIgnore$Outbound, ProviderPreferencesIgnore>;
|
|
156
|
+
export declare function providerPreferencesIgnoreToJSON(providerPreferencesIgnore: ProviderPreferencesIgnore): string;
|
|
157
|
+
/** @internal */
|
|
158
|
+
export declare const SortEnum$outboundSchema: z.ZodType<string, SortEnum>;
|
|
159
|
+
/** @internal */
|
|
160
|
+
export declare const ProviderSortConfigEnum$outboundSchema: z.ZodEnum<typeof ProviderSortConfigEnum>;
|
|
161
|
+
/** @internal */
|
|
162
|
+
export declare const ProviderPreferencesPartition$outboundSchema: z.ZodType<string, ProviderPreferencesPartition>;
|
|
163
|
+
/** @internal */
|
|
164
|
+
export type ProviderPreferencesProviderSortConfig$Outbound = {
|
|
165
|
+
by?: string | null | undefined;
|
|
166
|
+
partition?: string | null | undefined;
|
|
167
|
+
};
|
|
168
|
+
/** @internal */
|
|
169
|
+
export declare const ProviderPreferencesProviderSortConfig$outboundSchema: z.ZodType<ProviderPreferencesProviderSortConfig$Outbound, ProviderPreferencesProviderSortConfig>;
|
|
170
|
+
export declare function providerPreferencesProviderSortConfigToJSON(providerPreferencesProviderSortConfig: ProviderPreferencesProviderSortConfig): string;
|
|
171
|
+
/** @internal */
|
|
172
|
+
export type ProviderSortConfigUnion$Outbound = ProviderPreferencesProviderSortConfig$Outbound | string;
|
|
173
|
+
/** @internal */
|
|
174
|
+
export declare const ProviderSortConfigUnion$outboundSchema: z.ZodType<ProviderSortConfigUnion$Outbound, ProviderSortConfigUnion>;
|
|
175
|
+
export declare function providerSortConfigUnionToJSON(providerSortConfigUnion: ProviderSortConfigUnion): string;
|
|
176
|
+
/** @internal */
|
|
177
|
+
export declare const ProviderPreferencesProviderSort$outboundSchema: z.ZodType<string, ProviderPreferencesProviderSort>;
|
|
178
|
+
/** @internal */
|
|
179
|
+
export type ProviderPreferencesSortUnion$Outbound = string | ProviderPreferencesProviderSortConfig$Outbound | string | string;
|
|
180
|
+
/** @internal */
|
|
181
|
+
export declare const ProviderPreferencesSortUnion$outboundSchema: z.ZodType<ProviderPreferencesSortUnion$Outbound, ProviderPreferencesSortUnion>;
|
|
182
|
+
export declare function providerPreferencesSortUnionToJSON(providerPreferencesSortUnion: ProviderPreferencesSortUnion): string;
|
|
183
|
+
/** @internal */
|
|
184
|
+
export type ProviderPreferencesMaxPrice$Outbound = {
|
|
185
|
+
prompt?: string | undefined;
|
|
186
|
+
completion?: string | undefined;
|
|
187
|
+
image?: string | undefined;
|
|
188
|
+
audio?: string | undefined;
|
|
189
|
+
request?: string | undefined;
|
|
190
|
+
};
|
|
191
|
+
/** @internal */
|
|
192
|
+
export declare const ProviderPreferencesMaxPrice$outboundSchema: z.ZodType<ProviderPreferencesMaxPrice$Outbound, ProviderPreferencesMaxPrice>;
|
|
193
|
+
export declare function providerPreferencesMaxPriceToJSON(providerPreferencesMaxPrice: ProviderPreferencesMaxPrice): string;
|
|
194
|
+
/** @internal */
|
|
195
|
+
export type ProviderPreferences$Outbound = {
|
|
196
|
+
allow_fallbacks?: boolean | null | undefined;
|
|
197
|
+
require_parameters?: boolean | null | undefined;
|
|
198
|
+
data_collection?: string | null | undefined;
|
|
199
|
+
zdr?: boolean | null | undefined;
|
|
200
|
+
enforce_distillable_text?: boolean | null | undefined;
|
|
201
|
+
order?: Array<string | string> | null | undefined;
|
|
202
|
+
only?: Array<string | string> | null | undefined;
|
|
203
|
+
ignore?: Array<string | string> | null | undefined;
|
|
204
|
+
quantizations?: Array<string> | null | undefined;
|
|
205
|
+
sort?: string | ProviderPreferencesProviderSortConfig$Outbound | string | string | null | undefined;
|
|
206
|
+
max_price?: ProviderPreferencesMaxPrice$Outbound | undefined;
|
|
207
|
+
preferred_min_throughput?: number | null | undefined;
|
|
208
|
+
preferred_max_latency?: number | null | undefined;
|
|
209
|
+
min_throughput?: number | null | undefined;
|
|
210
|
+
max_latency?: number | null | undefined;
|
|
211
|
+
};
|
|
212
|
+
/** @internal */
|
|
213
|
+
export declare const ProviderPreferences$outboundSchema: z.ZodType<ProviderPreferences$Outbound, ProviderPreferences>;
|
|
214
|
+
export declare function providerPreferencesToJSON(providerPreferences: ProviderPreferences): string;
|
|
215
|
+
//# sourceMappingURL=providerpreferences.d.ts.map
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
|
+
import * as openEnums from "../types/enums.js";
|
|
7
|
+
import { DataCollection$outboundSchema, } from "./datacollection.js";
|
|
8
|
+
import { ProviderName$outboundSchema } from "./providername.js";
|
|
9
|
+
import { ProviderSort$outboundSchema } from "./providersort.js";
|
|
10
|
+
import { Quantization$outboundSchema } from "./quantization.js";
|
|
11
|
+
export const SortEnum = {
|
|
12
|
+
Price: "price",
|
|
13
|
+
Throughput: "throughput",
|
|
14
|
+
Latency: "latency",
|
|
15
|
+
};
|
|
16
|
+
export const ProviderSortConfigEnum = {
|
|
17
|
+
Price: "price",
|
|
18
|
+
Throughput: "throughput",
|
|
19
|
+
Latency: "latency",
|
|
20
|
+
};
|
|
21
|
+
export const ProviderPreferencesPartition = {
|
|
22
|
+
Model: "model",
|
|
23
|
+
None: "none",
|
|
24
|
+
};
|
|
25
|
+
export const ProviderPreferencesProviderSort = {
|
|
26
|
+
Price: "price",
|
|
27
|
+
Throughput: "throughput",
|
|
28
|
+
Latency: "latency",
|
|
29
|
+
};
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const ProviderPreferencesOrder$outboundSchema = z.union([ProviderName$outboundSchema, z.string()]);
|
|
32
|
+
export function providerPreferencesOrderToJSON(providerPreferencesOrder) {
|
|
33
|
+
return JSON.stringify(ProviderPreferencesOrder$outboundSchema.parse(providerPreferencesOrder));
|
|
34
|
+
}
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const ProviderPreferencesOnly$outboundSchema = z.union([ProviderName$outboundSchema, z.string()]);
|
|
37
|
+
export function providerPreferencesOnlyToJSON(providerPreferencesOnly) {
|
|
38
|
+
return JSON.stringify(ProviderPreferencesOnly$outboundSchema.parse(providerPreferencesOnly));
|
|
39
|
+
}
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const ProviderPreferencesIgnore$outboundSchema = z.union([ProviderName$outboundSchema, z.string()]);
|
|
42
|
+
export function providerPreferencesIgnoreToJSON(providerPreferencesIgnore) {
|
|
43
|
+
return JSON.stringify(ProviderPreferencesIgnore$outboundSchema.parse(providerPreferencesIgnore));
|
|
44
|
+
}
|
|
45
|
+
/** @internal */
|
|
46
|
+
export const SortEnum$outboundSchema = openEnums
|
|
47
|
+
.outboundSchema(SortEnum);
|
|
48
|
+
/** @internal */
|
|
49
|
+
export const ProviderSortConfigEnum$outboundSchema = z.enum(ProviderSortConfigEnum);
|
|
50
|
+
/** @internal */
|
|
51
|
+
export const ProviderPreferencesPartition$outboundSchema = openEnums.outboundSchema(ProviderPreferencesPartition);
|
|
52
|
+
/** @internal */
|
|
53
|
+
export const ProviderPreferencesProviderSortConfig$outboundSchema = z.object({
|
|
54
|
+
by: z.nullable(ProviderSort$outboundSchema).optional(),
|
|
55
|
+
partition: z.nullable(ProviderPreferencesPartition$outboundSchema).optional(),
|
|
56
|
+
});
|
|
57
|
+
export function providerPreferencesProviderSortConfigToJSON(providerPreferencesProviderSortConfig) {
|
|
58
|
+
return JSON.stringify(ProviderPreferencesProviderSortConfig$outboundSchema.parse(providerPreferencesProviderSortConfig));
|
|
59
|
+
}
|
|
60
|
+
/** @internal */
|
|
61
|
+
export const ProviderSortConfigUnion$outboundSchema = z.union([
|
|
62
|
+
z.lazy(() => ProviderPreferencesProviderSortConfig$outboundSchema),
|
|
63
|
+
ProviderSortConfigEnum$outboundSchema,
|
|
64
|
+
]);
|
|
65
|
+
export function providerSortConfigUnionToJSON(providerSortConfigUnion) {
|
|
66
|
+
return JSON.stringify(ProviderSortConfigUnion$outboundSchema.parse(providerSortConfigUnion));
|
|
67
|
+
}
|
|
68
|
+
/** @internal */
|
|
69
|
+
export const ProviderPreferencesProviderSort$outboundSchema = openEnums.outboundSchema(ProviderPreferencesProviderSort);
|
|
70
|
+
/** @internal */
|
|
71
|
+
export const ProviderPreferencesSortUnion$outboundSchema = z.union([
|
|
72
|
+
ProviderPreferencesProviderSort$outboundSchema,
|
|
73
|
+
z.union([
|
|
74
|
+
z.lazy(() => ProviderPreferencesProviderSortConfig$outboundSchema),
|
|
75
|
+
ProviderSortConfigEnum$outboundSchema,
|
|
76
|
+
]),
|
|
77
|
+
SortEnum$outboundSchema,
|
|
78
|
+
]);
|
|
79
|
+
export function providerPreferencesSortUnionToJSON(providerPreferencesSortUnion) {
|
|
80
|
+
return JSON.stringify(ProviderPreferencesSortUnion$outboundSchema.parse(providerPreferencesSortUnion));
|
|
81
|
+
}
|
|
82
|
+
/** @internal */
|
|
83
|
+
export const ProviderPreferencesMaxPrice$outboundSchema = z.object({
|
|
84
|
+
prompt: z.string().optional(),
|
|
85
|
+
completion: z.string().optional(),
|
|
86
|
+
image: z.string().optional(),
|
|
87
|
+
audio: z.string().optional(),
|
|
88
|
+
request: z.string().optional(),
|
|
89
|
+
});
|
|
90
|
+
export function providerPreferencesMaxPriceToJSON(providerPreferencesMaxPrice) {
|
|
91
|
+
return JSON.stringify(ProviderPreferencesMaxPrice$outboundSchema.parse(providerPreferencesMaxPrice));
|
|
92
|
+
}
|
|
93
|
+
/** @internal */
|
|
94
|
+
export const ProviderPreferences$outboundSchema = z.object({
|
|
95
|
+
allowFallbacks: z.nullable(z.boolean()).optional(),
|
|
96
|
+
requireParameters: z.nullable(z.boolean()).optional(),
|
|
97
|
+
dataCollection: z.nullable(DataCollection$outboundSchema).optional(),
|
|
98
|
+
zdr: z.nullable(z.boolean()).optional(),
|
|
99
|
+
enforceDistillableText: z.nullable(z.boolean()).optional(),
|
|
100
|
+
order: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()])))
|
|
101
|
+
.optional(),
|
|
102
|
+
only: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()])))
|
|
103
|
+
.optional(),
|
|
104
|
+
ignore: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()]))).optional(),
|
|
105
|
+
quantizations: z.nullable(z.array(Quantization$outboundSchema)).optional(),
|
|
106
|
+
sort: z.nullable(z.union([
|
|
107
|
+
ProviderPreferencesProviderSort$outboundSchema,
|
|
108
|
+
z.union([
|
|
109
|
+
z.lazy(() => ProviderPreferencesProviderSortConfig$outboundSchema),
|
|
110
|
+
ProviderSortConfigEnum$outboundSchema,
|
|
111
|
+
]),
|
|
112
|
+
SortEnum$outboundSchema,
|
|
113
|
+
])).optional(),
|
|
114
|
+
maxPrice: z.lazy(() => ProviderPreferencesMaxPrice$outboundSchema).optional(),
|
|
115
|
+
preferredMinThroughput: z.nullable(z.number()).optional(),
|
|
116
|
+
preferredMaxLatency: z.nullable(z.number()).optional(),
|
|
117
|
+
minThroughput: z.nullable(z.number()).optional(),
|
|
118
|
+
maxLatency: z.nullable(z.number()).optional(),
|
|
119
|
+
}).transform((v) => {
|
|
120
|
+
return remap$(v, {
|
|
121
|
+
allowFallbacks: "allow_fallbacks",
|
|
122
|
+
requireParameters: "require_parameters",
|
|
123
|
+
dataCollection: "data_collection",
|
|
124
|
+
enforceDistillableText: "enforce_distillable_text",
|
|
125
|
+
maxPrice: "max_price",
|
|
126
|
+
preferredMinThroughput: "preferred_min_throughput",
|
|
127
|
+
preferredMaxLatency: "preferred_max_latency",
|
|
128
|
+
minThroughput: "min_throughput",
|
|
129
|
+
maxLatency: "max_latency",
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
export function providerPreferencesToJSON(providerPreferences) {
|
|
133
|
+
return JSON.stringify(ProviderPreferences$outboundSchema.parse(providerPreferences));
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=providerpreferences.js.map
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
|
-
/**
|
|
4
|
-
* The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
|
|
5
|
-
*/
|
|
6
3
|
export declare const ProviderSort: {
|
|
7
4
|
readonly Price: "price";
|
|
8
5
|
readonly Throughput: "throughput";
|
|
9
6
|
readonly Latency: "latency";
|
|
10
7
|
};
|
|
11
|
-
/**
|
|
12
|
-
* The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
|
|
13
|
-
*/
|
|
14
8
|
export type ProviderSort = OpenEnum<typeof ProviderSort>;
|
|
15
9
|
/** @internal */
|
|
16
10
|
export declare const ProviderSort$outboundSchema: z.ZodType<string, ProviderSort>;
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
import * as openEnums from "../types/enums.js";
|
|
5
|
-
/**
|
|
6
|
-
* The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
|
|
7
|
-
*/
|
|
8
5
|
export const ProviderSort = {
|
|
9
6
|
Price: "price",
|
|
10
7
|
Throughput: "throughput",
|