@openrouter/sdk 0.12.3 → 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/chatrequest.d.ts +16 -16
- package/esm/models/chatrequest.js +8 -8
- 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/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 +14 -14
- package/esm/models/responsesrequest.js +7 -7
- 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 +5 -5
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
|
|
@@ -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) => {
|
|
@@ -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/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(),
|
|
@@ -73,11 +73,11 @@ export type GetGenerationData = {
|
|
|
73
73
|
/**
|
|
74
74
|
* ID of the app that made the request
|
|
75
75
|
*/
|
|
76
|
-
appId: number;
|
|
76
|
+
appId: number | null;
|
|
77
77
|
/**
|
|
78
78
|
* Discount applied due to caching
|
|
79
79
|
*/
|
|
80
|
-
cacheDiscount: number;
|
|
80
|
+
cacheDiscount: number | null;
|
|
81
81
|
/**
|
|
82
82
|
* Whether the generation was cancelled
|
|
83
83
|
*/
|
|
@@ -97,7 +97,7 @@ export type GetGenerationData = {
|
|
|
97
97
|
/**
|
|
98
98
|
* Time taken for generation in milliseconds
|
|
99
99
|
*/
|
|
100
|
-
generationTime: number;
|
|
100
|
+
generationTime: number | null;
|
|
101
101
|
/**
|
|
102
102
|
* Referer header from the request
|
|
103
103
|
*/
|
|
@@ -113,7 +113,7 @@ export type GetGenerationData = {
|
|
|
113
113
|
/**
|
|
114
114
|
* Total latency in milliseconds
|
|
115
115
|
*/
|
|
116
|
-
latency: number;
|
|
116
|
+
latency: number | null;
|
|
117
117
|
/**
|
|
118
118
|
* Model used for the generation
|
|
119
119
|
*/
|
|
@@ -121,7 +121,7 @@ export type GetGenerationData = {
|
|
|
121
121
|
/**
|
|
122
122
|
* Moderation latency in milliseconds
|
|
123
123
|
*/
|
|
124
|
-
moderationLatency: number;
|
|
124
|
+
moderationLatency: number | null;
|
|
125
125
|
/**
|
|
126
126
|
* Native finish reason as reported by provider
|
|
127
127
|
*/
|
|
@@ -129,39 +129,39 @@ export type GetGenerationData = {
|
|
|
129
129
|
/**
|
|
130
130
|
* Native cached tokens as reported by provider
|
|
131
131
|
*/
|
|
132
|
-
nativeTokensCached: number;
|
|
132
|
+
nativeTokensCached: number | null;
|
|
133
133
|
/**
|
|
134
134
|
* Native completion tokens as reported by provider
|
|
135
135
|
*/
|
|
136
|
-
nativeTokensCompletion: number;
|
|
136
|
+
nativeTokensCompletion: number | null;
|
|
137
137
|
/**
|
|
138
138
|
* Native completion image tokens as reported by provider
|
|
139
139
|
*/
|
|
140
|
-
nativeTokensCompletionImages: number;
|
|
140
|
+
nativeTokensCompletionImages: number | null;
|
|
141
141
|
/**
|
|
142
142
|
* Native prompt tokens as reported by provider
|
|
143
143
|
*/
|
|
144
|
-
nativeTokensPrompt: number;
|
|
144
|
+
nativeTokensPrompt: number | null;
|
|
145
145
|
/**
|
|
146
146
|
* Native reasoning tokens as reported by provider
|
|
147
147
|
*/
|
|
148
|
-
nativeTokensReasoning: number;
|
|
148
|
+
nativeTokensReasoning: number | null;
|
|
149
149
|
/**
|
|
150
150
|
* Number of audio inputs in the prompt
|
|
151
151
|
*/
|
|
152
|
-
numInputAudioPrompt: number;
|
|
152
|
+
numInputAudioPrompt: number | null;
|
|
153
153
|
/**
|
|
154
154
|
* Number of media items in the completion
|
|
155
155
|
*/
|
|
156
|
-
numMediaCompletion: number;
|
|
156
|
+
numMediaCompletion: number | null;
|
|
157
157
|
/**
|
|
158
158
|
* Number of media items in the prompt
|
|
159
159
|
*/
|
|
160
|
-
numMediaPrompt: number;
|
|
160
|
+
numMediaPrompt: number | null;
|
|
161
161
|
/**
|
|
162
162
|
* Number of search results included
|
|
163
163
|
*/
|
|
164
|
-
numSearchResults: number;
|
|
164
|
+
numSearchResults: number | null;
|
|
165
165
|
/**
|
|
166
166
|
* Origin URL of the request
|
|
167
167
|
*/
|
|
@@ -193,11 +193,11 @@ export type GetGenerationData = {
|
|
|
193
193
|
/**
|
|
194
194
|
* Number of tokens in the completion
|
|
195
195
|
*/
|
|
196
|
-
tokensCompletion: number;
|
|
196
|
+
tokensCompletion: number | null;
|
|
197
197
|
/**
|
|
198
198
|
* Number of tokens in the prompt
|
|
199
199
|
*/
|
|
200
|
-
tokensPrompt: number;
|
|
200
|
+
tokensPrompt: number | null;
|
|
201
201
|
/**
|
|
202
202
|
* Total cost of the generation in USD
|
|
203
203
|
*/
|
|
@@ -209,7 +209,7 @@ export type GetGenerationData = {
|
|
|
209
209
|
/**
|
|
210
210
|
* Cost charged by the upstream provider
|
|
211
211
|
*/
|
|
212
|
-
upstreamInferenceCost: number;
|
|
212
|
+
upstreamInferenceCost: number | null;
|
|
213
213
|
/**
|
|
214
214
|
* Usage amount in USD
|
|
215
215
|
*/
|
|
@@ -36,29 +36,29 @@ export const ApiType$inboundSchema = openEnums
|
|
|
36
36
|
/** @internal */
|
|
37
37
|
export const GetGenerationData$inboundSchema = z.object({
|
|
38
38
|
api_type: z.nullable(ApiType$inboundSchema),
|
|
39
|
-
app_id: z.int(),
|
|
40
|
-
cache_discount: z.number(),
|
|
39
|
+
app_id: z.nullable(z.int()),
|
|
40
|
+
cache_discount: z.nullable(z.number()),
|
|
41
41
|
cancelled: z.nullable(z.boolean()),
|
|
42
42
|
created_at: z.string(),
|
|
43
43
|
external_user: z.nullable(z.string()),
|
|
44
44
|
finish_reason: z.nullable(z.string()),
|
|
45
|
-
generation_time: z.number(),
|
|
45
|
+
generation_time: z.nullable(z.number()),
|
|
46
46
|
http_referer: z.nullable(z.string()),
|
|
47
47
|
id: z.string(),
|
|
48
48
|
is_byok: z.boolean(),
|
|
49
|
-
latency: z.number(),
|
|
49
|
+
latency: z.nullable(z.number()),
|
|
50
50
|
model: z.string(),
|
|
51
|
-
moderation_latency: z.number(),
|
|
51
|
+
moderation_latency: z.nullable(z.number()),
|
|
52
52
|
native_finish_reason: z.nullable(z.string()),
|
|
53
|
-
native_tokens_cached: z.int(),
|
|
54
|
-
native_tokens_completion: z.int(),
|
|
55
|
-
native_tokens_completion_images: z.int(),
|
|
56
|
-
native_tokens_prompt: z.int(),
|
|
57
|
-
native_tokens_reasoning: z.int(),
|
|
58
|
-
num_input_audio_prompt: z.int(),
|
|
59
|
-
num_media_completion: z.int(),
|
|
60
|
-
num_media_prompt: z.int(),
|
|
61
|
-
num_search_results: z.int(),
|
|
53
|
+
native_tokens_cached: z.nullable(z.int()),
|
|
54
|
+
native_tokens_completion: z.nullable(z.int()),
|
|
55
|
+
native_tokens_completion_images: z.nullable(z.int()),
|
|
56
|
+
native_tokens_prompt: z.nullable(z.int()),
|
|
57
|
+
native_tokens_reasoning: z.nullable(z.int()),
|
|
58
|
+
num_input_audio_prompt: z.nullable(z.int()),
|
|
59
|
+
num_media_completion: z.nullable(z.int()),
|
|
60
|
+
num_media_prompt: z.nullable(z.int()),
|
|
61
|
+
num_search_results: z.nullable(z.int()),
|
|
62
62
|
origin: z.string(),
|
|
63
63
|
provider_name: z.nullable(z.string()),
|
|
64
64
|
provider_responses: z.nullable(z.array(models.ProviderResponse$inboundSchema)),
|
|
@@ -66,11 +66,11 @@ export const GetGenerationData$inboundSchema = z.object({
|
|
|
66
66
|
router: z.nullable(z.string()),
|
|
67
67
|
session_id: z.nullable(z.string()).optional(),
|
|
68
68
|
streamed: z.nullable(z.boolean()),
|
|
69
|
-
tokens_completion: z.int(),
|
|
70
|
-
tokens_prompt: z.int(),
|
|
69
|
+
tokens_completion: z.nullable(z.int()),
|
|
70
|
+
tokens_prompt: z.nullable(z.int()),
|
|
71
71
|
total_cost: z.number(),
|
|
72
72
|
upstream_id: z.nullable(z.string()),
|
|
73
|
-
upstream_inference_cost: z.number(),
|
|
73
|
+
upstream_inference_cost: z.nullable(z.number()),
|
|
74
74
|
usage: z.number(),
|
|
75
75
|
user_agent: z.nullable(z.string()),
|
|
76
76
|
}).transform((v) => {
|
|
@@ -98,11 +98,11 @@ export type GetKeyData = {
|
|
|
98
98
|
/**
|
|
99
99
|
* Spending limit for the API key in USD
|
|
100
100
|
*/
|
|
101
|
-
limit: number;
|
|
101
|
+
limit: number | null;
|
|
102
102
|
/**
|
|
103
103
|
* Remaining spending limit in USD
|
|
104
104
|
*/
|
|
105
|
-
limitRemaining: number;
|
|
105
|
+
limitRemaining: number | null;
|
|
106
106
|
/**
|
|
107
107
|
* Type of limit reset for the API key
|
|
108
108
|
*/
|
|
@@ -33,8 +33,8 @@ export const GetKeyData$inboundSchema = z
|
|
|
33
33
|
hash: z.string(),
|
|
34
34
|
include_byok_in_limit: z.boolean(),
|
|
35
35
|
label: z.string(),
|
|
36
|
-
limit: z.number(),
|
|
37
|
-
limit_remaining: z.number(),
|
|
36
|
+
limit: z.nullable(z.number()),
|
|
37
|
+
limit_remaining: z.nullable(z.number()),
|
|
38
38
|
limit_reset: z.nullable(z.string()),
|
|
39
39
|
name: z.string(),
|
|
40
40
|
updated_at: z.nullable(z.string()),
|