@openrouter/sdk 0.12.3 → 0.12.5
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/chatfunctiontool.d.ts +3 -2
- package/esm/models/chatfunctiontool.js +2 -0
- package/esm/models/chatrequest.d.ts +19 -24
- package/esm/models/chatrequest.js +10 -14
- package/esm/models/chatusage.d.ts +4 -4
- package/esm/models/chatusage.js +4 -4
- package/esm/models/createguardrailrequest.d.ts +2 -2
- package/esm/models/createguardrailrequest.js +1 -1
- package/esm/models/guardrail.d.ts +1 -1
- package/esm/models/guardrail.js +1 -1
- package/esm/models/imageconfig.d.ts +8 -0
- package/esm/models/imageconfig.js +11 -0
- package/esm/models/imagegenerationservertoolconfig.d.ts +23 -0
- package/esm/models/imagegenerationservertoolconfig.js +23 -0
- package/esm/models/imagegenerationservertoolconfigunion.d.ts +8 -0
- package/esm/models/imagegenerationservertoolconfigunion.js +11 -0
- package/esm/models/imagegenerationservertoolopenrouter.d.ts +28 -0
- package/esm/models/imagegenerationservertoolopenrouter.js +20 -0
- package/esm/models/index.d.ts +4 -0
- package/esm/models/index.js +4 -0
- package/esm/models/model.d.ts +1 -1
- package/esm/models/model.js +1 -1
- package/esm/models/openresponsesresult.d.ts +5 -5
- package/esm/models/openresponsesresult.js +5 -5
- package/esm/models/operations/createkeys.d.ts +4 -4
- package/esm/models/operations/createkeys.js +3 -3
- package/esm/models/operations/getcurrentkey.d.ts +2 -2
- package/esm/models/operations/getcurrentkey.js +2 -2
- package/esm/models/operations/getgeneration.d.ts +17 -17
- package/esm/models/operations/getgeneration.js +17 -17
- package/esm/models/operations/getkey.d.ts +2 -2
- package/esm/models/operations/getkey.js +2 -2
- package/esm/models/operations/list.d.ts +4 -4
- package/esm/models/operations/list.js +3 -3
- package/esm/models/operations/listguardrailkeyassignments.d.ts +2 -2
- package/esm/models/operations/listguardrailkeyassignments.js +1 -1
- package/esm/models/operations/listguardrailmemberassignments.d.ts +2 -2
- package/esm/models/operations/listguardrailmemberassignments.js +1 -1
- package/esm/models/operations/listguardrails.d.ts +2 -2
- package/esm/models/operations/listguardrails.js +1 -1
- package/esm/models/operations/listkeyassignments.d.ts +2 -2
- package/esm/models/operations/listkeyassignments.js +1 -1
- package/esm/models/operations/listmemberassignments.d.ts +2 -2
- package/esm/models/operations/listmemberassignments.js +1 -1
- package/esm/models/operations/listorganizationmembers.d.ts +2 -2
- package/esm/models/operations/listorganizationmembers.js +1 -1
- package/esm/models/operations/updatekeys.d.ts +4 -4
- package/esm/models/operations/updatekeys.js +3 -3
- package/esm/models/percentilelatencycutoffs.d.ts +8 -8
- package/esm/models/percentilelatencycutoffs.js +4 -4
- package/esm/models/percentilethroughputcutoffs.d.ts +8 -8
- package/esm/models/percentilethroughputcutoffs.js +4 -4
- package/esm/models/publicendpoint.d.ts +5 -5
- package/esm/models/publicendpoint.js +5 -5
- package/esm/models/reasoningconfig.d.ts +2 -2
- package/esm/models/reasoningconfig.js +1 -1
- package/esm/models/responsesrequest.d.ts +27 -23
- package/esm/models/responsesrequest.js +12 -14
- package/esm/models/updateguardrailrequest.d.ts +2 -2
- package/esm/models/updateguardrailrequest.js +1 -1
- package/esm/models/usage.d.ts +2 -2
- package/esm/models/usage.js +2 -2
- package/esm/models/videogenerationusage.d.ts +1 -1
- package/esm/models/videogenerationusage.js +1 -1
- package/jsr.json +1 -1
- package/package.json +6 -6
package/esm/lib/config.d.ts
CHANGED
|
@@ -49,8 +49,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
49
49
|
export declare const SDK_METADATA: {
|
|
50
50
|
readonly language: "typescript";
|
|
51
51
|
readonly openapiDocVersion: "1.0.0";
|
|
52
|
-
readonly sdkVersion: "0.12.
|
|
52
|
+
readonly sdkVersion: "0.12.5";
|
|
53
53
|
readonly genVersion: "2.879.1";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.12.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.12.5 2.879.1 1.0.0 @openrouter/sdk";
|
|
55
55
|
};
|
|
56
56
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -26,8 +26,8 @@ export function serverURLFromOptions(options) {
|
|
|
26
26
|
export const SDK_METADATA = {
|
|
27
27
|
language: "typescript",
|
|
28
28
|
openapiDocVersion: "1.0.0",
|
|
29
|
-
sdkVersion: "0.12.
|
|
29
|
+
sdkVersion: "0.12.5",
|
|
30
30
|
genVersion: "2.879.1",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 0.12.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 0.12.5 2.879.1 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -4,6 +4,7 @@ import { ChatContentCacheControl, ChatContentCacheControl$Outbound } from "./cha
|
|
|
4
4
|
import { ChatSearchModelsServerTool, ChatSearchModelsServerTool$Outbound } from "./chatsearchmodelsservertool.js";
|
|
5
5
|
import { ChatWebSearchShorthand, ChatWebSearchShorthand$Outbound } from "./chatwebsearchshorthand.js";
|
|
6
6
|
import { DatetimeServerTool, DatetimeServerTool$Outbound } from "./datetimeservertool.js";
|
|
7
|
+
import { ImageGenerationServerToolOpenRouter, ImageGenerationServerToolOpenRouter$Outbound } from "./imagegenerationservertoolopenrouter.js";
|
|
7
8
|
import { OpenRouterWebSearchServerTool, OpenRouterWebSearchServerTool$Outbound } from "./openrouterwebsearchservertool.js";
|
|
8
9
|
/**
|
|
9
10
|
* Function definition for tool calling
|
|
@@ -46,7 +47,7 @@ export type ChatFunctionToolFunction = {
|
|
|
46
47
|
/**
|
|
47
48
|
* Tool definition for function calling (regular function or OpenRouter built-in server tool)
|
|
48
49
|
*/
|
|
49
|
-
export type ChatFunctionTool = ChatFunctionToolFunction | DatetimeServerTool | ChatSearchModelsServerTool | OpenRouterWebSearchServerTool | ChatWebSearchShorthand;
|
|
50
|
+
export type ChatFunctionTool = ChatFunctionToolFunction | DatetimeServerTool | ImageGenerationServerToolOpenRouter | ChatSearchModelsServerTool | OpenRouterWebSearchServerTool | ChatWebSearchShorthand;
|
|
50
51
|
/** @internal */
|
|
51
52
|
export type ChatFunctionToolFunctionFunction$Outbound = {
|
|
52
53
|
description?: string | undefined;
|
|
@@ -71,7 +72,7 @@ export type ChatFunctionToolFunction$Outbound = {
|
|
|
71
72
|
export declare const ChatFunctionToolFunction$outboundSchema: z.ZodType<ChatFunctionToolFunction$Outbound, ChatFunctionToolFunction>;
|
|
72
73
|
export declare function chatFunctionToolFunctionToJSON(chatFunctionToolFunction: ChatFunctionToolFunction): string;
|
|
73
74
|
/** @internal */
|
|
74
|
-
export type ChatFunctionTool$Outbound = ChatFunctionToolFunction$Outbound | DatetimeServerTool$Outbound | ChatSearchModelsServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | ChatWebSearchShorthand$Outbound;
|
|
75
|
+
export type ChatFunctionTool$Outbound = ChatFunctionToolFunction$Outbound | DatetimeServerTool$Outbound | ImageGenerationServerToolOpenRouter$Outbound | ChatSearchModelsServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | ChatWebSearchShorthand$Outbound;
|
|
75
76
|
/** @internal */
|
|
76
77
|
export declare const ChatFunctionTool$outboundSchema: z.ZodType<ChatFunctionTool$Outbound, ChatFunctionTool>;
|
|
77
78
|
export declare function chatFunctionToolToJSON(chatFunctionTool: ChatFunctionTool): string;
|
|
@@ -8,6 +8,7 @@ import { ChatContentCacheControl$outboundSchema, } from "./chatcontentcachecontr
|
|
|
8
8
|
import { ChatSearchModelsServerTool$outboundSchema, } from "./chatsearchmodelsservertool.js";
|
|
9
9
|
import { ChatWebSearchShorthand$outboundSchema, } from "./chatwebsearchshorthand.js";
|
|
10
10
|
import { DatetimeServerTool$outboundSchema, } from "./datetimeservertool.js";
|
|
11
|
+
import { ImageGenerationServerToolOpenRouter$outboundSchema, } from "./imagegenerationservertoolopenrouter.js";
|
|
11
12
|
import { OpenRouterWebSearchServerTool$outboundSchema, } from "./openrouterwebsearchservertool.js";
|
|
12
13
|
export const ChatFunctionToolType = {
|
|
13
14
|
Function: "function",
|
|
@@ -41,6 +42,7 @@ export function chatFunctionToolFunctionToJSON(chatFunctionToolFunction) {
|
|
|
41
42
|
export const ChatFunctionTool$outboundSchema = z.union([
|
|
42
43
|
z.lazy(() => ChatFunctionToolFunction$outboundSchema),
|
|
43
44
|
DatetimeServerTool$outboundSchema,
|
|
45
|
+
ImageGenerationServerToolOpenRouter$outboundSchema,
|
|
44
46
|
ChatSearchModelsServerTool$outboundSchema,
|
|
45
47
|
OpenRouterWebSearchServerTool$outboundSchema,
|
|
46
48
|
ChatWebSearchShorthand$outboundSchema,
|
|
@@ -15,12 +15,12 @@ import { ChatToolChoice, ChatToolChoice$Outbound } from "./chattoolchoice.js";
|
|
|
15
15
|
import { ContextCompressionPlugin, ContextCompressionPlugin$Outbound } from "./contextcompressionplugin.js";
|
|
16
16
|
import { FileParserPlugin, FileParserPlugin$Outbound } from "./fileparserplugin.js";
|
|
17
17
|
import { FormatJsonObjectConfig, FormatJsonObjectConfig$Outbound } from "./formatjsonobjectconfig.js";
|
|
18
|
+
import { ImageConfig, ImageConfig$Outbound } from "./imageconfig.js";
|
|
18
19
|
import { ModerationPlugin, ModerationPlugin$Outbound } from "./moderationplugin.js";
|
|
19
20
|
import { ProviderPreferences, ProviderPreferences$Outbound } from "./providerpreferences.js";
|
|
20
21
|
import { ResponseHealingPlugin, ResponseHealingPlugin$Outbound } from "./responsehealingplugin.js";
|
|
21
22
|
import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js";
|
|
22
23
|
import { WebSearchPlugin, WebSearchPlugin$Outbound } from "./websearchplugin.js";
|
|
23
|
-
export type ChatRequestImageConfig = string | number | Array<any | null>;
|
|
24
24
|
export declare const Modality: {
|
|
25
25
|
readonly Text: "text";
|
|
26
26
|
readonly Image: "image";
|
|
@@ -87,12 +87,12 @@ export type ChatRequest = {
|
|
|
87
87
|
/**
|
|
88
88
|
* Frequency penalty (-2.0 to 2.0)
|
|
89
89
|
*/
|
|
90
|
-
frequencyPenalty?: number | undefined;
|
|
90
|
+
frequencyPenalty?: number | null | undefined;
|
|
91
91
|
/**
|
|
92
92
|
* Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details.
|
|
93
93
|
*/
|
|
94
94
|
imageConfig?: {
|
|
95
|
-
[k: string]:
|
|
95
|
+
[k: string]: ImageConfig;
|
|
96
96
|
} | undefined;
|
|
97
97
|
/**
|
|
98
98
|
* Token logit bias adjustments
|
|
@@ -107,11 +107,11 @@ export type ChatRequest = {
|
|
|
107
107
|
/**
|
|
108
108
|
* Maximum tokens in completion
|
|
109
109
|
*/
|
|
110
|
-
maxCompletionTokens?: number | undefined;
|
|
110
|
+
maxCompletionTokens?: number | null | undefined;
|
|
111
111
|
/**
|
|
112
112
|
* Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16.
|
|
113
113
|
*/
|
|
114
|
-
maxTokens?: number | undefined;
|
|
114
|
+
maxTokens?: number | null | undefined;
|
|
115
115
|
/**
|
|
116
116
|
* List of messages for the conversation
|
|
117
117
|
*/
|
|
@@ -145,7 +145,7 @@ export type ChatRequest = {
|
|
|
145
145
|
/**
|
|
146
146
|
* Presence penalty (-2.0 to 2.0)
|
|
147
147
|
*/
|
|
148
|
-
presencePenalty?: number | undefined;
|
|
148
|
+
presencePenalty?: number | null | undefined;
|
|
149
149
|
/**
|
|
150
150
|
* When multiple model providers are available, optionally indicate your routing preference.
|
|
151
151
|
*/
|
|
@@ -161,7 +161,7 @@ export type ChatRequest = {
|
|
|
161
161
|
/**
|
|
162
162
|
* Random seed for deterministic outputs
|
|
163
163
|
*/
|
|
164
|
-
seed?: number | undefined;
|
|
164
|
+
seed?: number | null | undefined;
|
|
165
165
|
/**
|
|
166
166
|
* The service tier to use for processing this request.
|
|
167
167
|
*/
|
|
@@ -185,7 +185,7 @@ export type ChatRequest = {
|
|
|
185
185
|
/**
|
|
186
186
|
* Sampling temperature (0-2)
|
|
187
187
|
*/
|
|
188
|
-
temperature?: number | undefined;
|
|
188
|
+
temperature?: number | null | undefined;
|
|
189
189
|
/**
|
|
190
190
|
* Tool choice configuration
|
|
191
191
|
*/
|
|
@@ -197,11 +197,11 @@ export type ChatRequest = {
|
|
|
197
197
|
/**
|
|
198
198
|
* Number of top log probabilities to return (0-20)
|
|
199
199
|
*/
|
|
200
|
-
topLogprobs?: number | undefined;
|
|
200
|
+
topLogprobs?: number | null | undefined;
|
|
201
201
|
/**
|
|
202
202
|
* Nucleus sampling parameter (0-1)
|
|
203
203
|
*/
|
|
204
|
-
topP?: number | undefined;
|
|
204
|
+
topP?: number | null | undefined;
|
|
205
205
|
/**
|
|
206
206
|
* Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
|
|
207
207
|
*/
|
|
@@ -212,11 +212,6 @@ export type ChatRequest = {
|
|
|
212
212
|
user?: string | undefined;
|
|
213
213
|
};
|
|
214
214
|
/** @internal */
|
|
215
|
-
export type ChatRequestImageConfig$Outbound = string | number | Array<any | null>;
|
|
216
|
-
/** @internal */
|
|
217
|
-
export declare const ChatRequestImageConfig$outboundSchema: z.ZodType<ChatRequestImageConfig$Outbound, ChatRequestImageConfig>;
|
|
218
|
-
export declare function chatRequestImageConfigToJSON(chatRequestImageConfig: ChatRequestImageConfig): string;
|
|
219
|
-
/** @internal */
|
|
220
215
|
export declare const Modality$outboundSchema: z.ZodType<string, Modality>;
|
|
221
216
|
/** @internal */
|
|
222
217
|
export type ChatRequestPlugin$Outbound = AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | ModerationPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound;
|
|
@@ -249,16 +244,16 @@ export declare function stopToJSON(stop: Stop): string;
|
|
|
249
244
|
export type ChatRequest$Outbound = {
|
|
250
245
|
cache_control?: AnthropicCacheControlDirective$Outbound | undefined;
|
|
251
246
|
debug?: ChatDebugOptions$Outbound | undefined;
|
|
252
|
-
frequency_penalty?: number | undefined;
|
|
247
|
+
frequency_penalty?: number | null | undefined;
|
|
253
248
|
image_config?: {
|
|
254
|
-
[k: string]:
|
|
249
|
+
[k: string]: ImageConfig$Outbound;
|
|
255
250
|
} | undefined;
|
|
256
251
|
logit_bias?: {
|
|
257
252
|
[k: string]: number;
|
|
258
253
|
} | null | undefined;
|
|
259
254
|
logprobs?: boolean | null | undefined;
|
|
260
|
-
max_completion_tokens?: number | undefined;
|
|
261
|
-
max_tokens?: number | undefined;
|
|
255
|
+
max_completion_tokens?: number | null | undefined;
|
|
256
|
+
max_tokens?: number | null | undefined;
|
|
262
257
|
messages: Array<ChatMessages$Outbound>;
|
|
263
258
|
metadata?: {
|
|
264
259
|
[k: string]: string;
|
|
@@ -268,21 +263,21 @@ export type ChatRequest$Outbound = {
|
|
|
268
263
|
models?: Array<string> | undefined;
|
|
269
264
|
parallel_tool_calls?: boolean | null | undefined;
|
|
270
265
|
plugins?: Array<AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | ModerationPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound> | undefined;
|
|
271
|
-
presence_penalty?: number | undefined;
|
|
266
|
+
presence_penalty?: number | null | undefined;
|
|
272
267
|
provider?: ProviderPreferences$Outbound | null | undefined;
|
|
273
268
|
reasoning?: Reasoning$Outbound | undefined;
|
|
274
269
|
response_format?: ChatFormatGrammarConfig$Outbound | FormatJsonObjectConfig$Outbound | ChatFormatJsonSchemaConfig$Outbound | ChatFormatPythonConfig$Outbound | ChatFormatTextConfig$Outbound | undefined;
|
|
275
|
-
seed?: number | undefined;
|
|
270
|
+
seed?: number | null | undefined;
|
|
276
271
|
service_tier?: string | null | undefined;
|
|
277
272
|
session_id?: string | undefined;
|
|
278
273
|
stop?: string | Array<string> | any | null | undefined;
|
|
279
274
|
stream: boolean;
|
|
280
275
|
stream_options?: ChatStreamOptions$Outbound | null | undefined;
|
|
281
|
-
temperature?: number | undefined;
|
|
276
|
+
temperature?: number | null | undefined;
|
|
282
277
|
tool_choice?: ChatToolChoice$Outbound | undefined;
|
|
283
278
|
tools?: Array<ChatFunctionTool$Outbound> | undefined;
|
|
284
|
-
top_logprobs?: number | undefined;
|
|
285
|
-
top_p?: number | undefined;
|
|
279
|
+
top_logprobs?: number | null | undefined;
|
|
280
|
+
top_p?: number | null | undefined;
|
|
286
281
|
trace?: TraceConfig$Outbound | undefined;
|
|
287
282
|
user?: string | undefined;
|
|
288
283
|
};
|
|
@@ -20,6 +20,7 @@ import { ChatToolChoice$outboundSchema, } from "./chattoolchoice.js";
|
|
|
20
20
|
import { ContextCompressionPlugin$outboundSchema, } from "./contextcompressionplugin.js";
|
|
21
21
|
import { FileParserPlugin$outboundSchema, } from "./fileparserplugin.js";
|
|
22
22
|
import { FormatJsonObjectConfig$outboundSchema, } from "./formatjsonobjectconfig.js";
|
|
23
|
+
import { ImageConfig$outboundSchema, } from "./imageconfig.js";
|
|
23
24
|
import { ModerationPlugin$outboundSchema, } from "./moderationplugin.js";
|
|
24
25
|
import { ProviderPreferences$outboundSchema, } from "./providerpreferences.js";
|
|
25
26
|
import { ResponseHealingPlugin$outboundSchema, } from "./responsehealingplugin.js";
|
|
@@ -52,11 +53,6 @@ export const ChatRequestServiceTier = {
|
|
|
52
53
|
Scale: "scale",
|
|
53
54
|
};
|
|
54
55
|
/** @internal */
|
|
55
|
-
export const ChatRequestImageConfig$outboundSchema = z.union([z.string(), z.number(), z.array(z.nullable(z.any()))]);
|
|
56
|
-
export function chatRequestImageConfigToJSON(chatRequestImageConfig) {
|
|
57
|
-
return JSON.stringify(ChatRequestImageConfig$outboundSchema.parse(chatRequestImageConfig));
|
|
58
|
-
}
|
|
59
|
-
/** @internal */
|
|
60
56
|
export const Modality$outboundSchema = openEnums
|
|
61
57
|
.outboundSchema(Modality);
|
|
62
58
|
/** @internal */
|
|
@@ -109,12 +105,12 @@ export function stopToJSON(stop) {
|
|
|
109
105
|
export const ChatRequest$outboundSchema = z.object({
|
|
110
106
|
cacheControl: AnthropicCacheControlDirective$outboundSchema.optional(),
|
|
111
107
|
debug: ChatDebugOptions$outboundSchema.optional(),
|
|
112
|
-
frequencyPenalty: z.number().optional(),
|
|
113
|
-
imageConfig: z.record(z.string(),
|
|
108
|
+
frequencyPenalty: z.nullable(z.number()).optional(),
|
|
109
|
+
imageConfig: z.record(z.string(), ImageConfig$outboundSchema).optional(),
|
|
114
110
|
logitBias: z.nullable(z.record(z.string(), z.number())).optional(),
|
|
115
111
|
logprobs: z.nullable(z.boolean()).optional(),
|
|
116
|
-
maxCompletionTokens: z.int().optional(),
|
|
117
|
-
maxTokens: z.int().optional(),
|
|
112
|
+
maxCompletionTokens: z.nullable(z.int()).optional(),
|
|
113
|
+
maxTokens: z.nullable(z.int()).optional(),
|
|
118
114
|
messages: z.array(ChatMessages$outboundSchema),
|
|
119
115
|
metadata: z.record(z.string(), z.string()).optional(),
|
|
120
116
|
modalities: z.array(Modality$outboundSchema).optional(),
|
|
@@ -129,7 +125,7 @@ export const ChatRequest$outboundSchema = z.object({
|
|
|
129
125
|
ResponseHealingPlugin$outboundSchema,
|
|
130
126
|
WebSearchPlugin$outboundSchema,
|
|
131
127
|
])).optional(),
|
|
132
|
-
presencePenalty: z.number().optional(),
|
|
128
|
+
presencePenalty: z.nullable(z.number()).optional(),
|
|
133
129
|
provider: z.nullable(ProviderPreferences$outboundSchema).optional(),
|
|
134
130
|
reasoning: z.lazy(() => Reasoning$outboundSchema).optional(),
|
|
135
131
|
responseFormat: z.union([
|
|
@@ -139,18 +135,18 @@ export const ChatRequest$outboundSchema = z.object({
|
|
|
139
135
|
ChatFormatPythonConfig$outboundSchema,
|
|
140
136
|
ChatFormatTextConfig$outboundSchema,
|
|
141
137
|
]).optional(),
|
|
142
|
-
seed: z.int().optional(),
|
|
138
|
+
seed: z.nullable(z.int()).optional(),
|
|
143
139
|
serviceTier: z.nullable(ChatRequestServiceTier$outboundSchema).optional(),
|
|
144
140
|
sessionId: z.string().optional(),
|
|
145
141
|
stop: z.nullable(z.union([z.string(), z.array(z.string()), z.any()]))
|
|
146
142
|
.optional(),
|
|
147
143
|
stream: z.boolean().default(false),
|
|
148
144
|
streamOptions: z.nullable(ChatStreamOptions$outboundSchema).optional(),
|
|
149
|
-
temperature: z.number().optional(),
|
|
145
|
+
temperature: z.nullable(z.number()).optional(),
|
|
150
146
|
toolChoice: ChatToolChoice$outboundSchema.optional(),
|
|
151
147
|
tools: z.array(ChatFunctionTool$outboundSchema).optional(),
|
|
152
|
-
topLogprobs: z.int().optional(),
|
|
153
|
-
topP: z.number().optional(),
|
|
148
|
+
topLogprobs: z.nullable(z.int()).optional(),
|
|
149
|
+
topP: z.nullable(z.number()).optional(),
|
|
154
150
|
trace: TraceConfig$outboundSchema.optional(),
|
|
155
151
|
user: z.string().optional(),
|
|
156
152
|
}).transform((v) => {
|
|
@@ -8,19 +8,19 @@ export type CompletionTokensDetails = {
|
|
|
8
8
|
/**
|
|
9
9
|
* Accepted prediction tokens
|
|
10
10
|
*/
|
|
11
|
-
acceptedPredictionTokens?: number | undefined;
|
|
11
|
+
acceptedPredictionTokens?: number | null | undefined;
|
|
12
12
|
/**
|
|
13
13
|
* Tokens used for audio output
|
|
14
14
|
*/
|
|
15
|
-
audioTokens?: number | undefined;
|
|
15
|
+
audioTokens?: number | null | undefined;
|
|
16
16
|
/**
|
|
17
17
|
* Tokens used for reasoning
|
|
18
18
|
*/
|
|
19
|
-
reasoningTokens?: number | undefined;
|
|
19
|
+
reasoningTokens?: number | null | undefined;
|
|
20
20
|
/**
|
|
21
21
|
* Rejected prediction tokens
|
|
22
22
|
*/
|
|
23
|
-
rejectedPredictionTokens?: number | undefined;
|
|
23
|
+
rejectedPredictionTokens?: number | null | undefined;
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
26
|
* Detailed prompt token usage
|
package/esm/models/chatusage.js
CHANGED
|
@@ -7,10 +7,10 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
/** @internal */
|
|
9
9
|
export const CompletionTokensDetails$inboundSchema = z.object({
|
|
10
|
-
accepted_prediction_tokens: z.int().optional(),
|
|
11
|
-
audio_tokens: z.int().optional(),
|
|
12
|
-
reasoning_tokens: z.int().optional(),
|
|
13
|
-
rejected_prediction_tokens: z.int().optional(),
|
|
10
|
+
accepted_prediction_tokens: z.nullable(z.int()).optional(),
|
|
11
|
+
audio_tokens: z.nullable(z.int()).optional(),
|
|
12
|
+
reasoning_tokens: z.nullable(z.int()).optional(),
|
|
13
|
+
rejected_prediction_tokens: z.nullable(z.int()).optional(),
|
|
14
14
|
}).transform((v) => {
|
|
15
15
|
return remap$(v, {
|
|
16
16
|
"accepted_prediction_tokens": "acceptedPredictionTokens",
|
|
@@ -28,7 +28,7 @@ export type CreateGuardrailRequest = {
|
|
|
28
28
|
/**
|
|
29
29
|
* Spending limit in USD
|
|
30
30
|
*/
|
|
31
|
-
limitUsd?: number | undefined;
|
|
31
|
+
limitUsd?: number | null | undefined;
|
|
32
32
|
/**
|
|
33
33
|
* Name for the new guardrail
|
|
34
34
|
*/
|
|
@@ -46,7 +46,7 @@ export type CreateGuardrailRequest$Outbound = {
|
|
|
46
46
|
enforce_zdr?: boolean | null | undefined;
|
|
47
47
|
ignored_models?: Array<string> | null | undefined;
|
|
48
48
|
ignored_providers?: Array<string> | null | undefined;
|
|
49
|
-
limit_usd?: number | undefined;
|
|
49
|
+
limit_usd?: number | null | undefined;
|
|
50
50
|
name: string;
|
|
51
51
|
reset_interval?: string | null | undefined;
|
|
52
52
|
};
|
|
@@ -13,7 +13,7 @@ export const CreateGuardrailRequest$outboundSchema = z.object({
|
|
|
13
13
|
enforceZdr: z.nullable(z.boolean()).optional(),
|
|
14
14
|
ignoredModels: z.nullable(z.array(z.string())).optional(),
|
|
15
15
|
ignoredProviders: z.nullable(z.array(z.string())).optional(),
|
|
16
|
-
limitUsd: z.number().optional(),
|
|
16
|
+
limitUsd: z.nullable(z.number()).optional(),
|
|
17
17
|
name: z.string(),
|
|
18
18
|
resetInterval: z.nullable(GuardrailInterval$outboundSchema).optional(),
|
|
19
19
|
}).transform((v) => {
|
package/esm/models/guardrail.js
CHANGED
|
@@ -16,7 +16,7 @@ export const Guardrail$inboundSchema = z.object({
|
|
|
16
16
|
id: z.string(),
|
|
17
17
|
ignored_models: z.nullable(z.array(z.string())).optional(),
|
|
18
18
|
ignored_providers: z.nullable(z.array(z.string())).optional(),
|
|
19
|
-
limit_usd: z.number().optional(),
|
|
19
|
+
limit_usd: z.nullable(z.number()).optional(),
|
|
20
20
|
name: z.string(),
|
|
21
21
|
reset_interval: z.nullable(GuardrailInterval$inboundSchema).optional(),
|
|
22
22
|
updated_at: z.nullable(z.string()).optional(),
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
export type ImageConfig = string | number | Array<any | null>;
|
|
3
|
+
/** @internal */
|
|
4
|
+
export type ImageConfig$Outbound = string | number | Array<any | null>;
|
|
5
|
+
/** @internal */
|
|
6
|
+
export declare const ImageConfig$outboundSchema: z.ZodType<ImageConfig$Outbound, ImageConfig>;
|
|
7
|
+
export declare function imageConfigToJSON(imageConfig: ImageConfig): string;
|
|
8
|
+
//# sourceMappingURL=imageconfig.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 9b3ec0cba621
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const ImageConfig$outboundSchema = z.union([z.string(), z.number(), z.array(z.nullable(z.any()))]);
|
|
8
|
+
export function imageConfigToJSON(imageConfig) {
|
|
9
|
+
return JSON.stringify(ImageConfig$outboundSchema.parse(imageConfig));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=imageconfig.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ImageGenerationServerToolConfigUnion } from "./imagegenerationservertoolconfigunion.js";
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for the openrouter:image_generation server tool. Accepts all image_config params (aspect_ratio, quality, size, background, output_format, output_compression, moderation, etc.) plus a model field.
|
|
5
|
+
*/
|
|
6
|
+
export type ImageGenerationServerToolConfig = {
|
|
7
|
+
/**
|
|
8
|
+
* Which image generation model to use (e.g. "openai/gpt-image-1"). Defaults to "openai/gpt-image-1".
|
|
9
|
+
*/
|
|
10
|
+
model?: string | undefined;
|
|
11
|
+
additionalProperties?: {
|
|
12
|
+
[k: string]: ImageGenerationServerToolConfigUnion;
|
|
13
|
+
} | undefined;
|
|
14
|
+
};
|
|
15
|
+
/** @internal */
|
|
16
|
+
export type ImageGenerationServerToolConfig$Outbound = {
|
|
17
|
+
model?: string | undefined;
|
|
18
|
+
[additionalProperties: string]: unknown;
|
|
19
|
+
};
|
|
20
|
+
/** @internal */
|
|
21
|
+
export declare const ImageGenerationServerToolConfig$outboundSchema: z.ZodType<ImageGenerationServerToolConfig$Outbound, ImageGenerationServerToolConfig>;
|
|
22
|
+
export declare function imageGenerationServerToolConfigToJSON(imageGenerationServerToolConfig: ImageGenerationServerToolConfig): string;
|
|
23
|
+
//# sourceMappingURL=imagegenerationservertoolconfig.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 1d04d0100527
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { ImageGenerationServerToolConfigUnion$outboundSchema, } from "./imagegenerationservertoolconfigunion.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const ImageGenerationServerToolConfig$outboundSchema = z.object({
|
|
10
|
+
model: z.string().optional(),
|
|
11
|
+
additionalProperties: z.record(z.string(), ImageGenerationServerToolConfigUnion$outboundSchema).optional(),
|
|
12
|
+
}).transform((v) => {
|
|
13
|
+
return {
|
|
14
|
+
...v.additionalProperties,
|
|
15
|
+
...remap$(v, {
|
|
16
|
+
additionalProperties: null,
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
export function imageGenerationServerToolConfigToJSON(imageGenerationServerToolConfig) {
|
|
21
|
+
return JSON.stringify(ImageGenerationServerToolConfig$outboundSchema.parse(imageGenerationServerToolConfig));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=imagegenerationservertoolconfig.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
export type ImageGenerationServerToolConfigUnion = string | number | Array<any | null>;
|
|
3
|
+
/** @internal */
|
|
4
|
+
export type ImageGenerationServerToolConfigUnion$Outbound = string | number | Array<any | null>;
|
|
5
|
+
/** @internal */
|
|
6
|
+
export declare const ImageGenerationServerToolConfigUnion$outboundSchema: z.ZodType<ImageGenerationServerToolConfigUnion$Outbound, ImageGenerationServerToolConfigUnion>;
|
|
7
|
+
export declare function imageGenerationServerToolConfigUnionToJSON(imageGenerationServerToolConfigUnion: ImageGenerationServerToolConfigUnion): string;
|
|
8
|
+
//# sourceMappingURL=imagegenerationservertoolconfigunion.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 7215dce3dfc7
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const ImageGenerationServerToolConfigUnion$outboundSchema = z.union([z.string(), z.number(), z.array(z.nullable(z.any()))]);
|
|
8
|
+
export function imageGenerationServerToolConfigUnionToJSON(imageGenerationServerToolConfigUnion) {
|
|
9
|
+
return JSON.stringify(ImageGenerationServerToolConfigUnion$outboundSchema.parse(imageGenerationServerToolConfigUnion));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=imagegenerationservertoolconfigunion.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { ImageGenerationServerToolConfig, ImageGenerationServerToolConfig$Outbound } from "./imagegenerationservertoolconfig.js";
|
|
4
|
+
export declare const ImageGenerationServerToolOpenRouterType: {
|
|
5
|
+
readonly OpenrouterImageGeneration: "openrouter:image_generation";
|
|
6
|
+
};
|
|
7
|
+
export type ImageGenerationServerToolOpenRouterType = ClosedEnum<typeof ImageGenerationServerToolOpenRouterType>;
|
|
8
|
+
/**
|
|
9
|
+
* OpenRouter built-in server tool: generates images from text prompts using an image generation model
|
|
10
|
+
*/
|
|
11
|
+
export type ImageGenerationServerToolOpenRouter = {
|
|
12
|
+
/**
|
|
13
|
+
* Configuration for the openrouter:image_generation server tool. Accepts all image_config params (aspect_ratio, quality, size, background, output_format, output_compression, moderation, etc.) plus a model field.
|
|
14
|
+
*/
|
|
15
|
+
parameters?: ImageGenerationServerToolConfig | undefined;
|
|
16
|
+
type: ImageGenerationServerToolOpenRouterType;
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const ImageGenerationServerToolOpenRouterType$outboundSchema: z.ZodEnum<typeof ImageGenerationServerToolOpenRouterType>;
|
|
20
|
+
/** @internal */
|
|
21
|
+
export type ImageGenerationServerToolOpenRouter$Outbound = {
|
|
22
|
+
parameters?: ImageGenerationServerToolConfig$Outbound | undefined;
|
|
23
|
+
type: string;
|
|
24
|
+
};
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare const ImageGenerationServerToolOpenRouter$outboundSchema: z.ZodType<ImageGenerationServerToolOpenRouter$Outbound, ImageGenerationServerToolOpenRouter>;
|
|
27
|
+
export declare function imageGenerationServerToolOpenRouterToJSON(imageGenerationServerToolOpenRouter: ImageGenerationServerToolOpenRouter): string;
|
|
28
|
+
//# sourceMappingURL=imagegenerationservertoolopenrouter.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: dcbe3d0a09ac
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { ImageGenerationServerToolConfig$outboundSchema, } from "./imagegenerationservertoolconfig.js";
|
|
7
|
+
export const ImageGenerationServerToolOpenRouterType = {
|
|
8
|
+
OpenrouterImageGeneration: "openrouter:image_generation",
|
|
9
|
+
};
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const ImageGenerationServerToolOpenRouterType$outboundSchema = z.enum(ImageGenerationServerToolOpenRouterType);
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const ImageGenerationServerToolOpenRouter$outboundSchema = z.object({
|
|
14
|
+
parameters: ImageGenerationServerToolConfig$outboundSchema.optional(),
|
|
15
|
+
type: ImageGenerationServerToolOpenRouterType$outboundSchema,
|
|
16
|
+
});
|
|
17
|
+
export function imageGenerationServerToolOpenRouterToJSON(imageGenerationServerToolOpenRouter) {
|
|
18
|
+
return JSON.stringify(ImageGenerationServerToolOpenRouter$outboundSchema.parse(imageGenerationServerToolOpenRouter));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=imagegenerationservertoolopenrouter.js.map
|
package/esm/models/index.d.ts
CHANGED
|
@@ -96,11 +96,15 @@ export * from "./functioncalloutputitem.js";
|
|
|
96
96
|
export * from "./getguardrailresponse.js";
|
|
97
97
|
export * from "./guardrail.js";
|
|
98
98
|
export * from "./guardrailinterval.js";
|
|
99
|
+
export * from "./imageconfig.js";
|
|
99
100
|
export * from "./imagegencallcompletedevent.js";
|
|
100
101
|
export * from "./imagegencallgeneratingevent.js";
|
|
101
102
|
export * from "./imagegencallinprogressevent.js";
|
|
102
103
|
export * from "./imagegencallpartialimageevent.js";
|
|
103
104
|
export * from "./imagegenerationservertool.js";
|
|
105
|
+
export * from "./imagegenerationservertoolconfig.js";
|
|
106
|
+
export * from "./imagegenerationservertoolconfigunion.js";
|
|
107
|
+
export * from "./imagegenerationservertoolopenrouter.js";
|
|
104
108
|
export * from "./imagegenerationstatus.js";
|
|
105
109
|
export * from "./incompletedetails.js";
|
|
106
110
|
export * from "./inputaudio.js";
|
package/esm/models/index.js
CHANGED
|
@@ -100,11 +100,15 @@ export * from "./functioncalloutputitem.js";
|
|
|
100
100
|
export * from "./getguardrailresponse.js";
|
|
101
101
|
export * from "./guardrail.js";
|
|
102
102
|
export * from "./guardrailinterval.js";
|
|
103
|
+
export * from "./imageconfig.js";
|
|
103
104
|
export * from "./imagegencallcompletedevent.js";
|
|
104
105
|
export * from "./imagegencallgeneratingevent.js";
|
|
105
106
|
export * from "./imagegencallinprogressevent.js";
|
|
106
107
|
export * from "./imagegencallpartialimageevent.js";
|
|
107
108
|
export * from "./imagegenerationservertool.js";
|
|
109
|
+
export * from "./imagegenerationservertoolconfig.js";
|
|
110
|
+
export * from "./imagegenerationservertoolconfigunion.js";
|
|
111
|
+
export * from "./imagegenerationservertoolopenrouter.js";
|
|
108
112
|
export * from "./imagegenerationstatus.js";
|
|
109
113
|
export * from "./incompletedetails.js";
|
|
110
114
|
export * from "./inputaudio.js";
|
package/esm/models/model.d.ts
CHANGED
package/esm/models/model.js
CHANGED
|
@@ -16,7 +16,7 @@ import { TopProviderInfo$inboundSchema, } from "./topproviderinfo.js";
|
|
|
16
16
|
export const Model$inboundSchema = z.object({
|
|
17
17
|
architecture: ModelArchitecture$inboundSchema,
|
|
18
18
|
canonical_slug: z.string(),
|
|
19
|
-
context_length: z.int(),
|
|
19
|
+
context_length: z.nullable(z.int()),
|
|
20
20
|
created: z.int(),
|
|
21
21
|
default_parameters: z.nullable(DefaultParameters$inboundSchema),
|
|
22
22
|
description: z.string().optional(),
|
|
@@ -49,13 +49,13 @@ export type OpenResponsesResultToolUnion = OpenResponsesResultToolFunction | Pre
|
|
|
49
49
|
*/
|
|
50
50
|
export type OpenResponsesResult = {
|
|
51
51
|
background?: boolean | null | undefined;
|
|
52
|
-
completedAt: number;
|
|
52
|
+
completedAt: number | null;
|
|
53
53
|
createdAt: number;
|
|
54
54
|
/**
|
|
55
55
|
* Error information returned from the API
|
|
56
56
|
*/
|
|
57
57
|
error: ResponsesErrorField | null;
|
|
58
|
-
frequencyPenalty: number;
|
|
58
|
+
frequencyPenalty: number | null;
|
|
59
59
|
id: string;
|
|
60
60
|
incompleteDetails: IncompleteDetails | null;
|
|
61
61
|
instructions: BaseInputsUnion | null;
|
|
@@ -72,7 +72,7 @@ export type OpenResponsesResult = {
|
|
|
72
72
|
output: Array<OutputItems>;
|
|
73
73
|
outputText?: string | undefined;
|
|
74
74
|
parallelToolCalls: boolean;
|
|
75
|
-
presencePenalty: number;
|
|
75
|
+
presencePenalty: number | null;
|
|
76
76
|
previousResponseId?: string | null | undefined;
|
|
77
77
|
prompt?: StoredPromptTemplate | null | undefined;
|
|
78
78
|
promptCacheKey?: string | null | undefined;
|
|
@@ -81,7 +81,7 @@ export type OpenResponsesResult = {
|
|
|
81
81
|
serviceTier?: string | null | undefined;
|
|
82
82
|
status: OpenAIResponsesResponseStatus;
|
|
83
83
|
store?: boolean | undefined;
|
|
84
|
-
temperature: number;
|
|
84
|
+
temperature: number | null;
|
|
85
85
|
/**
|
|
86
86
|
* Text output configuration including format and verbosity
|
|
87
87
|
*/
|
|
@@ -89,7 +89,7 @@ export type OpenResponsesResult = {
|
|
|
89
89
|
toolChoice: OpenAIResponsesToolChoiceUnion;
|
|
90
90
|
tools: Array<OpenResponsesResultToolFunction | PreviewWebSearchServerTool | Preview20250311WebSearchServerTool | LegacyWebSearchServerTool | WebSearchServerTool | FileSearchServerTool | ComputerUseServerTool | CodeInterpreterServerTool | McpServerTool | ImageGenerationServerTool | CodexLocalShellTool | ShellServerTool | ApplyPatchServerTool | CustomTool | discriminatedUnionTypes.Unknown<"type">>;
|
|
91
91
|
topLogprobs?: number | null | undefined;
|
|
92
|
-
topP: number;
|
|
92
|
+
topP: number | null;
|
|
93
93
|
truncation?: Truncation | null | undefined;
|
|
94
94
|
/**
|
|
95
95
|
* Token usage information for the response
|