@openrouter/sdk 0.12.2 → 0.12.4
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 +16 -16
- package/esm/models/chatrequest.js +8 -8
- package/esm/models/chatsearchmodelsservertool.d.ts +28 -0
- package/esm/models/chatsearchmodelsservertool.js +20 -0
- 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/index.d.ts +2 -0
- package/esm/models/index.js +2 -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 +23 -14
- package/esm/models/responsesrequest.js +10 -7
- package/esm/models/searchmodelsservertoolconfig.d.ts +18 -0
- package/esm/models/searchmodelsservertoolconfig.js +18 -0
- 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.4";
|
|
53
53
|
readonly genVersion: "2.879.1";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.12.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.12.4 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.4",
|
|
30
30
|
genVersion: "2.879.1",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 0.12.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 0.12.4 2.879.1 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { ClosedEnum } from "../types/enums.js";
|
|
3
3
|
import { ChatContentCacheControl, ChatContentCacheControl$Outbound } from "./chatcontentcachecontrol.js";
|
|
4
|
+
import { ChatSearchModelsServerTool, ChatSearchModelsServerTool$Outbound } from "./chatsearchmodelsservertool.js";
|
|
4
5
|
import { ChatWebSearchShorthand, ChatWebSearchShorthand$Outbound } from "./chatwebsearchshorthand.js";
|
|
5
6
|
import { DatetimeServerTool, DatetimeServerTool$Outbound } from "./datetimeservertool.js";
|
|
6
7
|
import { OpenRouterWebSearchServerTool, OpenRouterWebSearchServerTool$Outbound } from "./openrouterwebsearchservertool.js";
|
|
@@ -45,7 +46,7 @@ export type ChatFunctionToolFunction = {
|
|
|
45
46
|
/**
|
|
46
47
|
* Tool definition for function calling (regular function or OpenRouter built-in server tool)
|
|
47
48
|
*/
|
|
48
|
-
export type ChatFunctionTool = ChatFunctionToolFunction | DatetimeServerTool | OpenRouterWebSearchServerTool | ChatWebSearchShorthand;
|
|
49
|
+
export type ChatFunctionTool = ChatFunctionToolFunction | DatetimeServerTool | ChatSearchModelsServerTool | OpenRouterWebSearchServerTool | ChatWebSearchShorthand;
|
|
49
50
|
/** @internal */
|
|
50
51
|
export type ChatFunctionToolFunctionFunction$Outbound = {
|
|
51
52
|
description?: string | undefined;
|
|
@@ -70,7 +71,7 @@ export type ChatFunctionToolFunction$Outbound = {
|
|
|
70
71
|
export declare const ChatFunctionToolFunction$outboundSchema: z.ZodType<ChatFunctionToolFunction$Outbound, ChatFunctionToolFunction>;
|
|
71
72
|
export declare function chatFunctionToolFunctionToJSON(chatFunctionToolFunction: ChatFunctionToolFunction): string;
|
|
72
73
|
/** @internal */
|
|
73
|
-
export type ChatFunctionTool$Outbound = ChatFunctionToolFunction$Outbound | DatetimeServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | ChatWebSearchShorthand$Outbound;
|
|
74
|
+
export type ChatFunctionTool$Outbound = ChatFunctionToolFunction$Outbound | DatetimeServerTool$Outbound | ChatSearchModelsServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | ChatWebSearchShorthand$Outbound;
|
|
74
75
|
/** @internal */
|
|
75
76
|
export declare const ChatFunctionTool$outboundSchema: z.ZodType<ChatFunctionTool$Outbound, ChatFunctionTool>;
|
|
76
77
|
export declare function chatFunctionToolToJSON(chatFunctionTool: ChatFunctionTool): string;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { ChatContentCacheControl$outboundSchema, } from "./chatcontentcachecontrol.js";
|
|
8
|
+
import { ChatSearchModelsServerTool$outboundSchema, } from "./chatsearchmodelsservertool.js";
|
|
8
9
|
import { ChatWebSearchShorthand$outboundSchema, } from "./chatwebsearchshorthand.js";
|
|
9
10
|
import { DatetimeServerTool$outboundSchema, } from "./datetimeservertool.js";
|
|
10
11
|
import { OpenRouterWebSearchServerTool$outboundSchema, } from "./openrouterwebsearchservertool.js";
|
|
@@ -40,6 +41,7 @@ export function chatFunctionToolFunctionToJSON(chatFunctionToolFunction) {
|
|
|
40
41
|
export const ChatFunctionTool$outboundSchema = z.union([
|
|
41
42
|
z.lazy(() => ChatFunctionToolFunction$outboundSchema),
|
|
42
43
|
DatetimeServerTool$outboundSchema,
|
|
44
|
+
ChatSearchModelsServerTool$outboundSchema,
|
|
43
45
|
OpenRouterWebSearchServerTool$outboundSchema,
|
|
44
46
|
ChatWebSearchShorthand$outboundSchema,
|
|
45
47
|
]);
|
|
@@ -87,7 +87,7 @@ 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
|
*/
|
|
@@ -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
|
*/
|
|
@@ -249,7 +249,7 @@ export declare function stopToJSON(stop: Stop): string;
|
|
|
249
249
|
export type ChatRequest$Outbound = {
|
|
250
250
|
cache_control?: AnthropicCacheControlDirective$Outbound | undefined;
|
|
251
251
|
debug?: ChatDebugOptions$Outbound | undefined;
|
|
252
|
-
frequency_penalty?: number | undefined;
|
|
252
|
+
frequency_penalty?: number | null | undefined;
|
|
253
253
|
image_config?: {
|
|
254
254
|
[k: string]: string | number | Array<any | null>;
|
|
255
255
|
} | undefined;
|
|
@@ -257,8 +257,8 @@ export type ChatRequest$Outbound = {
|
|
|
257
257
|
[k: string]: number;
|
|
258
258
|
} | null | undefined;
|
|
259
259
|
logprobs?: boolean | null | undefined;
|
|
260
|
-
max_completion_tokens?: number | undefined;
|
|
261
|
-
max_tokens?: number | undefined;
|
|
260
|
+
max_completion_tokens?: number | null | undefined;
|
|
261
|
+
max_tokens?: number | null | undefined;
|
|
262
262
|
messages: Array<ChatMessages$Outbound>;
|
|
263
263
|
metadata?: {
|
|
264
264
|
[k: string]: string;
|
|
@@ -268,21 +268,21 @@ export type ChatRequest$Outbound = {
|
|
|
268
268
|
models?: Array<string> | undefined;
|
|
269
269
|
parallel_tool_calls?: boolean | null | undefined;
|
|
270
270
|
plugins?: Array<AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | ModerationPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound> | undefined;
|
|
271
|
-
presence_penalty?: number | undefined;
|
|
271
|
+
presence_penalty?: number | null | undefined;
|
|
272
272
|
provider?: ProviderPreferences$Outbound | null | undefined;
|
|
273
273
|
reasoning?: Reasoning$Outbound | undefined;
|
|
274
274
|
response_format?: ChatFormatGrammarConfig$Outbound | FormatJsonObjectConfig$Outbound | ChatFormatJsonSchemaConfig$Outbound | ChatFormatPythonConfig$Outbound | ChatFormatTextConfig$Outbound | undefined;
|
|
275
|
-
seed?: number | undefined;
|
|
275
|
+
seed?: number | null | undefined;
|
|
276
276
|
service_tier?: string | null | undefined;
|
|
277
277
|
session_id?: string | undefined;
|
|
278
278
|
stop?: string | Array<string> | any | null | undefined;
|
|
279
279
|
stream: boolean;
|
|
280
280
|
stream_options?: ChatStreamOptions$Outbound | null | undefined;
|
|
281
|
-
temperature?: number | undefined;
|
|
281
|
+
temperature?: number | null | undefined;
|
|
282
282
|
tool_choice?: ChatToolChoice$Outbound | undefined;
|
|
283
283
|
tools?: Array<ChatFunctionTool$Outbound> | undefined;
|
|
284
|
-
top_logprobs?: number | undefined;
|
|
285
|
-
top_p?: number | undefined;
|
|
284
|
+
top_logprobs?: number | null | undefined;
|
|
285
|
+
top_p?: number | null | undefined;
|
|
286
286
|
trace?: TraceConfig$Outbound | undefined;
|
|
287
287
|
user?: string | undefined;
|
|
288
288
|
};
|
|
@@ -109,12 +109,12 @@ export function stopToJSON(stop) {
|
|
|
109
109
|
export const ChatRequest$outboundSchema = z.object({
|
|
110
110
|
cacheControl: AnthropicCacheControlDirective$outboundSchema.optional(),
|
|
111
111
|
debug: ChatDebugOptions$outboundSchema.optional(),
|
|
112
|
-
frequencyPenalty: z.number().optional(),
|
|
112
|
+
frequencyPenalty: z.nullable(z.number()).optional(),
|
|
113
113
|
imageConfig: z.record(z.string(), z.union([z.string(), z.number(), z.array(z.nullable(z.any()))])).optional(),
|
|
114
114
|
logitBias: z.nullable(z.record(z.string(), z.number())).optional(),
|
|
115
115
|
logprobs: z.nullable(z.boolean()).optional(),
|
|
116
|
-
maxCompletionTokens: z.int().optional(),
|
|
117
|
-
maxTokens: z.int().optional(),
|
|
116
|
+
maxCompletionTokens: z.nullable(z.int()).optional(),
|
|
117
|
+
maxTokens: z.nullable(z.int()).optional(),
|
|
118
118
|
messages: z.array(ChatMessages$outboundSchema),
|
|
119
119
|
metadata: z.record(z.string(), z.string()).optional(),
|
|
120
120
|
modalities: z.array(Modality$outboundSchema).optional(),
|
|
@@ -129,7 +129,7 @@ export const ChatRequest$outboundSchema = z.object({
|
|
|
129
129
|
ResponseHealingPlugin$outboundSchema,
|
|
130
130
|
WebSearchPlugin$outboundSchema,
|
|
131
131
|
])).optional(),
|
|
132
|
-
presencePenalty: z.number().optional(),
|
|
132
|
+
presencePenalty: z.nullable(z.number()).optional(),
|
|
133
133
|
provider: z.nullable(ProviderPreferences$outboundSchema).optional(),
|
|
134
134
|
reasoning: z.lazy(() => Reasoning$outboundSchema).optional(),
|
|
135
135
|
responseFormat: z.union([
|
|
@@ -139,18 +139,18 @@ export const ChatRequest$outboundSchema = z.object({
|
|
|
139
139
|
ChatFormatPythonConfig$outboundSchema,
|
|
140
140
|
ChatFormatTextConfig$outboundSchema,
|
|
141
141
|
]).optional(),
|
|
142
|
-
seed: z.int().optional(),
|
|
142
|
+
seed: z.nullable(z.int()).optional(),
|
|
143
143
|
serviceTier: z.nullable(ChatRequestServiceTier$outboundSchema).optional(),
|
|
144
144
|
sessionId: z.string().optional(),
|
|
145
145
|
stop: z.nullable(z.union([z.string(), z.array(z.string()), z.any()]))
|
|
146
146
|
.optional(),
|
|
147
147
|
stream: z.boolean().default(false),
|
|
148
148
|
streamOptions: z.nullable(ChatStreamOptions$outboundSchema).optional(),
|
|
149
|
-
temperature: z.number().optional(),
|
|
149
|
+
temperature: z.nullable(z.number()).optional(),
|
|
150
150
|
toolChoice: ChatToolChoice$outboundSchema.optional(),
|
|
151
151
|
tools: z.array(ChatFunctionTool$outboundSchema).optional(),
|
|
152
|
-
topLogprobs: z.int().optional(),
|
|
153
|
-
topP: z.number().optional(),
|
|
152
|
+
topLogprobs: z.nullable(z.int()).optional(),
|
|
153
|
+
topP: z.nullable(z.number()).optional(),
|
|
154
154
|
trace: TraceConfig$outboundSchema.optional(),
|
|
155
155
|
user: z.string().optional(),
|
|
156
156
|
}).transform((v) => {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { SearchModelsServerToolConfig, SearchModelsServerToolConfig$Outbound } from "./searchmodelsservertoolconfig.js";
|
|
4
|
+
export declare const ChatSearchModelsServerToolType: {
|
|
5
|
+
readonly OpenrouterExperimentalSearchModels: "openrouter:experimental__search_models";
|
|
6
|
+
};
|
|
7
|
+
export type ChatSearchModelsServerToolType = ClosedEnum<typeof ChatSearchModelsServerToolType>;
|
|
8
|
+
/**
|
|
9
|
+
* OpenRouter built-in server tool: searches and filters AI models available on OpenRouter
|
|
10
|
+
*/
|
|
11
|
+
export type ChatSearchModelsServerTool = {
|
|
12
|
+
/**
|
|
13
|
+
* Configuration for the openrouter:experimental__search_models server tool
|
|
14
|
+
*/
|
|
15
|
+
parameters?: SearchModelsServerToolConfig | undefined;
|
|
16
|
+
type: ChatSearchModelsServerToolType;
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const ChatSearchModelsServerToolType$outboundSchema: z.ZodEnum<typeof ChatSearchModelsServerToolType>;
|
|
20
|
+
/** @internal */
|
|
21
|
+
export type ChatSearchModelsServerTool$Outbound = {
|
|
22
|
+
parameters?: SearchModelsServerToolConfig$Outbound | undefined;
|
|
23
|
+
type: string;
|
|
24
|
+
};
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare const ChatSearchModelsServerTool$outboundSchema: z.ZodType<ChatSearchModelsServerTool$Outbound, ChatSearchModelsServerTool>;
|
|
27
|
+
export declare function chatSearchModelsServerToolToJSON(chatSearchModelsServerTool: ChatSearchModelsServerTool): string;
|
|
28
|
+
//# sourceMappingURL=chatsearchmodelsservertool.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: bb9f1922b007
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { SearchModelsServerToolConfig$outboundSchema, } from "./searchmodelsservertoolconfig.js";
|
|
7
|
+
export const ChatSearchModelsServerToolType = {
|
|
8
|
+
OpenrouterExperimentalSearchModels: "openrouter:experimental__search_models",
|
|
9
|
+
};
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const ChatSearchModelsServerToolType$outboundSchema = z.enum(ChatSearchModelsServerToolType);
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const ChatSearchModelsServerTool$outboundSchema = z.object({
|
|
14
|
+
parameters: SearchModelsServerToolConfig$outboundSchema.optional(),
|
|
15
|
+
type: ChatSearchModelsServerToolType$outboundSchema,
|
|
16
|
+
});
|
|
17
|
+
export function chatSearchModelsServerToolToJSON(chatSearchModelsServerTool) {
|
|
18
|
+
return JSON.stringify(ChatSearchModelsServerTool$outboundSchema.parse(chatSearchModelsServerTool));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=chatsearchmodelsservertool.js.map
|
|
@@ -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(),
|
package/esm/models/index.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export * from "./chatnamedtoolchoice.js";
|
|
|
43
43
|
export * from "./chatreasoningsummaryverbosityenum.js";
|
|
44
44
|
export * from "./chatrequest.js";
|
|
45
45
|
export * from "./chatresult.js";
|
|
46
|
+
export * from "./chatsearchmodelsservertool.js";
|
|
46
47
|
export * from "./chatstreamchoice.js";
|
|
47
48
|
export * from "./chatstreamchunk.js";
|
|
48
49
|
export * from "./chatstreamdelta.js";
|
|
@@ -216,6 +217,7 @@ export * from "./responseoutputtext.js";
|
|
|
216
217
|
export * from "./responseserrorfield.js";
|
|
217
218
|
export * from "./responsesrequest.js";
|
|
218
219
|
export * from "./searchcontextsizeenum.js";
|
|
220
|
+
export * from "./searchmodelsservertoolconfig.js";
|
|
219
221
|
export * from "./searchqualitylevel.js";
|
|
220
222
|
export * from "./security.js";
|
|
221
223
|
export * from "./serviceunavailableresponseerrordata.js";
|
package/esm/models/index.js
CHANGED
|
@@ -47,6 +47,7 @@ export * from "./chatnamedtoolchoice.js";
|
|
|
47
47
|
export * from "./chatreasoningsummaryverbosityenum.js";
|
|
48
48
|
export * from "./chatrequest.js";
|
|
49
49
|
export * from "./chatresult.js";
|
|
50
|
+
export * from "./chatsearchmodelsservertool.js";
|
|
50
51
|
export * from "./chatstreamchoice.js";
|
|
51
52
|
export * from "./chatstreamchunk.js";
|
|
52
53
|
export * from "./chatstreamdelta.js";
|
|
@@ -220,6 +221,7 @@ export * from "./responseoutputtext.js";
|
|
|
220
221
|
export * from "./responseserrorfield.js";
|
|
221
222
|
export * from "./responsesrequest.js";
|
|
222
223
|
export * from "./searchcontextsizeenum.js";
|
|
224
|
+
export * from "./searchmodelsservertoolconfig.js";
|
|
223
225
|
export * from "./searchqualitylevel.js";
|
|
224
226
|
export * from "./security.js";
|
|
225
227
|
export * from "./serviceunavailableresponseerrordata.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
|
|
@@ -69,10 +69,10 @@ export function openResponsesResultToolUnionFromJSON(jsonString) {
|
|
|
69
69
|
/** @internal */
|
|
70
70
|
export const OpenResponsesResult$inboundSchema = z.object({
|
|
71
71
|
background: z.nullable(z.boolean()).optional(),
|
|
72
|
-
completed_at: z.int(),
|
|
72
|
+
completed_at: z.nullable(z.int()),
|
|
73
73
|
created_at: z.int(),
|
|
74
74
|
error: z.nullable(ResponsesErrorField$inboundSchema),
|
|
75
|
-
frequency_penalty: z.number(),
|
|
75
|
+
frequency_penalty: z.nullable(z.number()),
|
|
76
76
|
id: z.string(),
|
|
77
77
|
incomplete_details: z.nullable(IncompleteDetails$inboundSchema),
|
|
78
78
|
instructions: z.nullable(BaseInputsUnion$inboundSchema),
|
|
@@ -84,7 +84,7 @@ export const OpenResponsesResult$inboundSchema = z.object({
|
|
|
84
84
|
output: z.array(OutputItems$inboundSchema),
|
|
85
85
|
output_text: z.string().optional(),
|
|
86
86
|
parallel_tool_calls: z.boolean(),
|
|
87
|
-
presence_penalty: z.number(),
|
|
87
|
+
presence_penalty: z.nullable(z.number()),
|
|
88
88
|
previous_response_id: z.nullable(z.string()).optional(),
|
|
89
89
|
prompt: z.nullable(StoredPromptTemplate$inboundSchema).optional(),
|
|
90
90
|
prompt_cache_key: z.nullable(z.string()).optional(),
|
|
@@ -93,7 +93,7 @@ export const OpenResponsesResult$inboundSchema = z.object({
|
|
|
93
93
|
service_tier: z.nullable(z.string()).optional(),
|
|
94
94
|
status: OpenAIResponsesResponseStatus$inboundSchema,
|
|
95
95
|
store: z.boolean().optional(),
|
|
96
|
-
temperature: z.number(),
|
|
96
|
+
temperature: z.nullable(z.number()),
|
|
97
97
|
text: TextConfig$inboundSchema.optional(),
|
|
98
98
|
tool_choice: OpenAIResponsesToolChoiceUnion$inboundSchema,
|
|
99
99
|
tools: z.array(discriminatedUnion("type", {
|
|
@@ -113,7 +113,7 @@ export const OpenResponsesResult$inboundSchema = z.object({
|
|
|
113
113
|
custom: CustomTool$inboundSchema,
|
|
114
114
|
})),
|
|
115
115
|
top_logprobs: z.nullable(z.int()).optional(),
|
|
116
|
-
top_p: z.number(),
|
|
116
|
+
top_p: z.nullable(z.number()),
|
|
117
117
|
truncation: z.nullable(Truncation$inboundSchema).optional(),
|
|
118
118
|
usage: z.nullable(Usage$inboundSchema).optional(),
|
|
119
119
|
user: z.nullable(z.string()).optional(),
|
|
@@ -51,7 +51,7 @@ export type CreateKeysRequestBody = {
|
|
|
51
51
|
/**
|
|
52
52
|
* Optional spending limit for the API key in USD
|
|
53
53
|
*/
|
|
54
|
-
limit?: number | undefined;
|
|
54
|
+
limit?: number | null | undefined;
|
|
55
55
|
/**
|
|
56
56
|
* Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday.
|
|
57
57
|
*/
|
|
@@ -134,11 +134,11 @@ export type CreateKeysData = {
|
|
|
134
134
|
/**
|
|
135
135
|
* Spending limit for the API key in USD
|
|
136
136
|
*/
|
|
137
|
-
limit: number;
|
|
137
|
+
limit: number | null;
|
|
138
138
|
/**
|
|
139
139
|
* Remaining spending limit in USD
|
|
140
140
|
*/
|
|
141
|
-
limitRemaining: number;
|
|
141
|
+
limitRemaining: number | null;
|
|
142
142
|
/**
|
|
143
143
|
* Type of limit reset for the API key
|
|
144
144
|
*/
|
|
@@ -188,7 +188,7 @@ export type CreateKeysRequestBody$Outbound = {
|
|
|
188
188
|
creator_user_id?: string | null | undefined;
|
|
189
189
|
expires_at?: string | null | undefined;
|
|
190
190
|
include_byok_in_limit?: boolean | undefined;
|
|
191
|
-
limit?: number | undefined;
|
|
191
|
+
limit?: number | null | undefined;
|
|
192
192
|
limit_reset?: string | null | undefined;
|
|
193
193
|
name: string;
|
|
194
194
|
};
|
|
@@ -21,7 +21,7 @@ export const CreateKeysRequestBody$outboundSchema = z.object({
|
|
|
21
21
|
creatorUserId: z.nullable(z.string()).optional(),
|
|
22
22
|
expiresAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
|
|
23
23
|
includeByokInLimit: z.boolean().optional(),
|
|
24
|
-
limit: z.number().optional(),
|
|
24
|
+
limit: z.nullable(z.number()).optional(),
|
|
25
25
|
limitReset: z.nullable(CreateKeysLimitReset$outboundSchema).optional(),
|
|
26
26
|
name: z.string(),
|
|
27
27
|
}).transform((v) => {
|
|
@@ -63,8 +63,8 @@ export const CreateKeysData$inboundSchema = z.object({
|
|
|
63
63
|
hash: z.string(),
|
|
64
64
|
include_byok_in_limit: z.boolean(),
|
|
65
65
|
label: z.string(),
|
|
66
|
-
limit: z.number(),
|
|
67
|
-
limit_remaining: z.number(),
|
|
66
|
+
limit: z.nullable(z.number()),
|
|
67
|
+
limit_remaining: z.nullable(z.number()),
|
|
68
68
|
limit_reset: z.nullable(z.string()),
|
|
69
69
|
name: z.string(),
|
|
70
70
|
updated_at: z.nullable(z.string()),
|
|
@@ -115,11 +115,11 @@ export type GetCurrentKeyData = {
|
|
|
115
115
|
/**
|
|
116
116
|
* Spending limit for the API key in USD
|
|
117
117
|
*/
|
|
118
|
-
limit: number;
|
|
118
|
+
limit: number | null;
|
|
119
119
|
/**
|
|
120
120
|
* Remaining spending limit in USD
|
|
121
121
|
*/
|
|
122
|
-
limitRemaining: number;
|
|
122
|
+
limitRemaining: number | null;
|
|
123
123
|
/**
|
|
124
124
|
* Type of limit reset for the API key
|
|
125
125
|
*/
|
|
@@ -40,8 +40,8 @@ export const GetCurrentKeyData$inboundSchema = z.object({
|
|
|
40
40
|
is_management_key: z.boolean(),
|
|
41
41
|
is_provisioning_key: z.boolean(),
|
|
42
42
|
label: z.string(),
|
|
43
|
-
limit: z.number(),
|
|
44
|
-
limit_remaining: z.number(),
|
|
43
|
+
limit: z.nullable(z.number()),
|
|
44
|
+
limit_remaining: z.nullable(z.number()),
|
|
45
45
|
limit_reset: z.nullable(z.string()),
|
|
46
46
|
rate_limit: z.lazy(() => RateLimit$inboundSchema),
|
|
47
47
|
usage: z.number(),
|