@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 69,150 lines 3.25 MB
Raw
Large file — syntax highlighting disabled.
1 /**
2 * @stability unstable
3 * @since 1.0.0
4 */
5
6 import * as Data from "effect/Data"
7 import * as Effect from "effect/Effect"
8 import * as Sse from "effect/encoding/Sse"
9 import * as HttpClient from "effect/http/HttpClient"
10 import * as HttpClientError from "effect/http/HttpClientError"
11 import * as HttpClientRequest from "effect/http/HttpClientRequest"
12 import * as HttpClientResponse from "effect/http/HttpClientResponse"
13 import type { SchemaError } from "effect/Schema"
14 import * as Schema from "effect/Schema"
15 import * as Stream from "effect/Stream"
16 // recursive declarations
17 export type CompoundFilter = {
18 readonly "type": "and" | "or"
19 readonly "filters": ReadonlyArray<ComparisonFilter | CompoundFilter>
20 }
21 export const CompoundFilter = Schema.suspend((): Schema.Codec<CompoundFilter> => __recursive_CompoundFilter)
22 export type BetaCompoundFilter = {
23 readonly "type": "and" | "or"
24 readonly "filters": ReadonlyArray<BetaComparisonFilter | BetaCompoundFilter>
25 }
26 export const BetaCompoundFilter = Schema.suspend((): Schema.Codec<BetaCompoundFilter> => __recursive_BetaCompoundFilter)
27 // non-recursive definitions
28 export type AssistantToolsCode = { readonly "type": "code_interpreter" }
29 export const AssistantToolsCode = Schema.Struct({
30 "type": Schema.Literal("code_interpreter").annotate({
31 "description": "The type of tool being defined: `code_interpreter`"
32 })
33 }).annotate({ "title": "Code interpreter tool", "identifier": "AssistantToolsCode" })
34 export type FileSearchRanker = "auto" | "default_2024_08_21"
35 export const FileSearchRanker = Schema.Literals(["auto", "default_2024_08_21"]).annotate({
36 "description": "The ranker to use for the file search. If not specified will use the `auto` ranker.",
37 "identifier": "FileSearchRanker"
38 })
39 export type FunctionParameters = { readonly [x: string]: Schema.Json }
40 export const FunctionParameters = Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))
41 .annotate({
42 "description":
43 "The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://developers.openai.com/api/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.\n\nOmitting `parameters` defines a function with an empty parameter list.",
44 "identifier": "FunctionParameters"
45 })
46 export type Metadata = { readonly [x: string]: string } | null
47 export const Metadata = Schema.Union([
48 Schema.Record(Schema.String, Schema.String).annotate({
49 "description":
50 "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n"
51 }),
52 Schema.Null
53 ]).annotate({ "identifier": "Metadata" })
54 export type ResponseFormatText = { readonly "type": "text" }
55 export const ResponseFormatText = Schema.Struct({
56 "type": Schema.Literal("text").annotate({
57 "description": "The type of response format being defined. Always `text`."
58 })
59 }).annotate({
60 "title": "Text",
61 "description": "Default response format. Used to generate text responses.\n",
62 "identifier": "ResponseFormatText"
63 })
64 export type ResponseFormatJsonObject = { readonly "type": "json_object" }
65 export const ResponseFormatJsonObject = Schema.Struct({
66 "type": Schema.Literal("json_object").annotate({
67 "description": "The type of response format being defined. Always `json_object`."
68 })
69 }).annotate({
70 "title": "JSON object",
71 "description":
72 "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.\n",
73 "identifier": "ResponseFormatJsonObject"
74 })
75 export type ResponseFormatJsonSchemaSchema = { readonly [x: string]: Schema.Json }
76 export const ResponseFormatJsonSchemaSchema = Schema.Record(
77 Schema.String,
78 Schema.Json.annotate({ "expected": "JSON value" })
79 ).annotate({
80 "title": "JSON schema",
81 "description":
82 "The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/).\n",
83 "identifier": "ResponseFormatJsonSchemaSchema"
84 })
85 export type _MisalignmentErrorType =
86 | string
87 | "potentially_unintended_data_transfer"
88 | "potentially_unintended_data_access"
89 | "potentially_unintended_destructive_activity"
90 | "other"
91 export const _MisalignmentErrorType = Schema.Union([
92 Schema.String,
93 Schema.Literals([
94 "potentially_unintended_data_transfer",
95 "potentially_unintended_data_access",
96 "potentially_unintended_destructive_activity",
97 "other"
98 ])
99 ]).annotate({ "identifier": "_MisalignmentErrorType" })
100 export type _MisalignmentSteer = { readonly "message": string }
101 export const _MisalignmentSteer = Schema.Struct({
102 "message": Schema.String.annotate({ "description": "The public continuation instruction." })
103 }).annotate({ "identifier": "_MisalignmentSteer" })
104 export type AssistantSupportedModels =
105 | "gpt-5"
106 | "gpt-5-mini"
107 | "gpt-5-nano"
108 | "gpt-5-2025-08-07"
109 | "gpt-5-mini-2025-08-07"
110 | "gpt-5-nano-2025-08-07"
111 | "gpt-4.1"
112 | "gpt-4.1-mini"
113 | "gpt-4.1-nano"
114 | "gpt-4.1-2025-04-14"
115 | "gpt-4.1-mini-2025-04-14"
116 | "gpt-4.1-nano-2025-04-14"
117 | "o3-mini"
118 | "o3-mini-2025-01-31"
119 | "o1"
120 | "o1-2024-12-17"
121 | "gpt-4o"
122 | "gpt-4o-2024-11-20"
123 | "gpt-4o-2024-08-06"
124 | "gpt-4o-2024-05-13"
125 | "gpt-4o-mini"
126 | "gpt-4o-mini-2024-07-18"
127 | "gpt-4.5-preview"
128 | "gpt-4.5-preview-2025-02-27"
129 | "gpt-4-turbo"
130 | "gpt-4-turbo-2024-04-09"
131 | "gpt-4-0125-preview"
132 | "gpt-4-turbo-preview"
133 | "gpt-4-1106-preview"
134 | "gpt-4-vision-preview"
135 | "gpt-4"
136 | "gpt-4-0314"
137 | "gpt-4-0613"
138 | "gpt-4-32k"
139 | "gpt-4-32k-0314"
140 | "gpt-4-32k-0613"
141 | "gpt-3.5-turbo"
142 | "gpt-3.5-turbo-16k"
143 | "gpt-3.5-turbo-0613"
144 | "gpt-3.5-turbo-1106"
145 | "gpt-3.5-turbo-0125"
146 | "gpt-3.5-turbo-16k-0613"
147 export const AssistantSupportedModels = Schema.Literals([
148 "gpt-5",
149 "gpt-5-mini",
150 "gpt-5-nano",
151 "gpt-5-2025-08-07",
152 "gpt-5-mini-2025-08-07",
153 "gpt-5-nano-2025-08-07",
154 "gpt-4.1",
155 "gpt-4.1-mini",
156 "gpt-4.1-nano",
157 "gpt-4.1-2025-04-14",
158 "gpt-4.1-mini-2025-04-14",
159 "gpt-4.1-nano-2025-04-14",
160 "o3-mini",
161 "o3-mini-2025-01-31",
162 "o1",
163 "o1-2024-12-17",
164 "gpt-4o",
165 "gpt-4o-2024-11-20",
166 "gpt-4o-2024-08-06",
167 "gpt-4o-2024-05-13",
168 "gpt-4o-mini",
169 "gpt-4o-mini-2024-07-18",
170 "gpt-4.5-preview",
171 "gpt-4.5-preview-2025-02-27",
172 "gpt-4-turbo",
173 "gpt-4-turbo-2024-04-09",
174 "gpt-4-0125-preview",
175 "gpt-4-turbo-preview",
176 "gpt-4-1106-preview",
177 "gpt-4-vision-preview",
178 "gpt-4",
179 "gpt-4-0314",
180 "gpt-4-0613",
181 "gpt-4-32k",
182 "gpt-4-32k-0314",
183 "gpt-4-32k-0613",
184 "gpt-3.5-turbo",
185 "gpt-3.5-turbo-16k",
186 "gpt-3.5-turbo-0613",
187 "gpt-3.5-turbo-1106",
188 "gpt-3.5-turbo-0125",
189 "gpt-3.5-turbo-16k-0613"
190 ]).annotate({ "identifier": "AssistantSupportedModels" })
191 export type ReasoningEffort = "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null
192 export const ReasoningEffort = Schema.Union([
193 Schema.Literals(["none", "minimal", "low", "medium", "high", "xhigh", "max"]).annotate({
194 "description":
195 "Constrains effort on reasoning for reasoning models. Currently supported\nvalues are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.\nReducing reasoning effort can result in faster responses and fewer tokens\nused on reasoning in a response. Not all reasoning models support every\nvalue. See the\n[reasoning guide](https://developers.openai.com/api/docs/guides/reasoning)\nfor model-specific support.\n"
196 }),
197 Schema.Null
198 ]).annotate({ "identifier": "ReasoningEffort" })
199 export type DeleteAssistantResponse = {
200 readonly "id": string
201 readonly "deleted": boolean
202 readonly "object": "assistant.deleted"
203 }
204 export const DeleteAssistantResponse = Schema.Struct({
205 "id": Schema.String,
206 "deleted": Schema.Boolean,
207 "object": Schema.Literal("assistant.deleted")
208 }).annotate({ "identifier": "DeleteAssistantResponse" })
209 export type VoiceIdsShared =
210 | string
211 | "alloy"
212 | "ash"
213 | "ballad"
214 | "coral"
215 | "echo"
216 | "sage"
217 | "shimmer"
218 | "verse"
219 | "marin"
220 | "cedar"
221 export const VoiceIdsShared = Schema.Union([
222 Schema.String,
223 Schema.Literals(["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse", "marin", "cedar"])
224 ]).annotate({ "identifier": "VoiceIdsShared" })
225 export type SpeechAudioDeltaEvent = { readonly "type": "speech.audio.delta"; readonly "audio": string }
226 export const SpeechAudioDeltaEvent = Schema.Struct({
227 "type": Schema.Literal("speech.audio.delta").annotate({
228 "description": "The type of the event. Always `speech.audio.delta`.\n"
229 }),
230 "audio": Schema.String.annotate({ "description": "A chunk of Base64-encoded audio data.\n" })
231 }).annotate({
232 "description": "Emitted for each chunk of audio data generated during speech synthesis.",
233 "identifier": "SpeechAudioDeltaEvent"
234 })
235 export type SpeechAudioDoneEvent = {
236 readonly "type": "speech.audio.done"
237 readonly "usage": {
238 readonly "input_tokens": number
239 readonly "output_tokens": number
240 readonly "total_tokens": number
241 }
242 }
243 export const SpeechAudioDoneEvent = Schema.Struct({
244 "type": Schema.Literal("speech.audio.done").annotate({
245 "description": "The type of the event. Always `speech.audio.done`.\n"
246 }),
247 "usage": Schema.Struct({
248 "input_tokens": Schema.Number.annotate({ "description": "Number of input tokens in the prompt." }).check(
249 Schema.isInt().annotate({ "expected": "an integer" })
250 ),
251 "output_tokens": Schema.Number.annotate({ "description": "Number of output tokens generated." }).check(
252 Schema.isInt().annotate({ "expected": "an integer" })
253 ),
254 "total_tokens": Schema.Number.annotate({ "description": "Total number of tokens used (input + output)." }).check(
255 Schema.isInt().annotate({ "expected": "an integer" })
256 )
257 }).annotate({ "description": "Token usage statistics for the request.\n" })
258 }).annotate({
259 "description": "Emitted when the speech synthesis is complete and all audio has been streamed.",
260 "identifier": "SpeechAudioDoneEvent"
261 })
262 export type __ClientMultipartFile = globalThis.File | globalThis.Blob
263 export const __ClientMultipartFile = Schema.instanceOf(globalThis.Blob, { expected: "File | Blob" })
264 export type AudioResponseFormat = "json" | "text" | "srt" | "verbose_json" | "vtt" | "diarized_json"
265 export const AudioResponseFormat = Schema.Literals(["json", "text", "srt", "verbose_json", "vtt", "diarized_json"])
266 .annotate({
267 "description":
268 "The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, `vtt`, or `diarized_json`. For `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`, the only supported format is `json`. For `gpt-4o-transcribe-diarize`, the supported formats are `json`, `text`, and `diarized_json`, with `diarized_json` required to receive speaker annotations.\n",
269 "identifier": "AudioResponseFormat"
270 })
271 export type TranscriptionInclude = "logprobs"
272 export const TranscriptionInclude = Schema.Literal("logprobs").annotate({ "identifier": "TranscriptionInclude" })
273 export type VadConfig = {
274 readonly "type": "server_vad"
275 readonly "prefix_padding_ms"?: number
276 readonly "silence_duration_ms"?: number
277 readonly "threshold"?: number
278 }
279 export const VadConfig = Schema.Struct({
280 "type": Schema.Literal("server_vad").annotate({
281 "description": "Must be set to `server_vad` to enable manual chunking using server side VAD."
282 }),
283 "prefix_padding_ms": Schema.optionalKey(
284 Schema.Number.annotate({
285 "description": "Amount of audio to include before the VAD detected speech (in \nmilliseconds).\n"
286 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
287 ),
288 "silence_duration_ms": Schema.optionalKey(
289 Schema.Number.annotate({
290 "description":
291 "Duration of silence to detect speech stop (in milliseconds).\nWith shorter values the model will respond more quickly, \nbut may jump in on short pauses from the user.\n"
292 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
293 ),
294 "threshold": Schema.optionalKey(
295 Schema.Number.annotate({
296 "description":
297 "Sensitivity threshold (0.0 to 1.0) for voice activity detection. A \nhigher threshold will require louder audio to activate the model, and \nthus might perform better in noisy environments.\n"
298 }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
299 )
300 }).annotate({ "identifier": "VadConfig" })
301 export type TranscriptionLanguage = { readonly "code": string }
302 export const TranscriptionLanguage = Schema.Struct({
303 "code": Schema.String.annotate({ "description": "The code of a language detected in the audio." })
304 }).annotate({ "description": "A language detected in transcribed audio.", "identifier": "TranscriptionLanguage" })
305 export type TranscriptTextUsageTokens = {
306 readonly "type": "tokens"
307 readonly "input_tokens": number
308 readonly "input_token_details"?: { readonly "text_tokens"?: number; readonly "audio_tokens"?: number }
309 readonly "output_tokens": number
310 readonly "total_tokens": number
311 }
312 export const TranscriptTextUsageTokens = Schema.Struct({
313 "type": Schema.Literal("tokens").annotate({
314 "description": "The type of the usage object. Always `tokens` for this variant."
315 }),
316 "input_tokens": Schema.Number.annotate({ "description": "Number of input tokens billed for this request." }).check(
317 Schema.isInt().annotate({ "expected": "an integer" })
318 ),
319 "input_token_details": Schema.optionalKey(
320 Schema.Struct({
321 "text_tokens": Schema.optionalKey(
322 Schema.Number.annotate({ "description": "Number of text tokens billed for this request." }).check(
323 Schema.isInt().annotate({ "expected": "an integer" })
324 )
325 ),
326 "audio_tokens": Schema.optionalKey(
327 Schema.Number.annotate({ "description": "Number of audio tokens billed for this request." }).check(
328 Schema.isInt().annotate({ "expected": "an integer" })
329 )
330 )
331 }).annotate({ "description": "Details about the input tokens billed for this request." })
332 ),
333 "output_tokens": Schema.Number.annotate({ "description": "Number of output tokens generated." }).check(
334 Schema.isInt().annotate({ "expected": "an integer" })
335 ),
336 "total_tokens": Schema.Number.annotate({ "description": "Total number of tokens used (input + output)." }).check(
337 Schema.isInt().annotate({ "expected": "an integer" })
338 )
339 }).annotate({
340 "title": "Token Usage",
341 "description": "Usage statistics for models billed by token usage.",
342 "identifier": "TranscriptTextUsageTokens"
343 })
344 export type TranscriptTextUsageDuration = { readonly "type": "duration"; readonly "seconds": number }
345 export const TranscriptTextUsageDuration = Schema.Struct({
346 "type": Schema.Literal("duration").annotate({
347 "description": "The type of the usage object. Always `duration` for this variant."
348 }),
349 "seconds": Schema.Number.annotate({ "description": "Duration of the input audio in seconds.", "format": "double" })
350 .check(Schema.isFinite().annotate({ "expected": "a finite number" }))
351 }).annotate({
352 "title": "Duration Usage",
353 "description": "Usage statistics for models billed by audio input duration.",
354 "identifier": "TranscriptTextUsageDuration"
355 })
356 export type TranscriptionDiarizedSegment = {
357 readonly "type": "transcript.text.segment"
358 readonly "id": string
359 readonly "start": number
360 readonly "end": number
361 readonly "text": string
362 readonly "speaker": string
363 }
364 export const TranscriptionDiarizedSegment = Schema.Struct({
365 "type": Schema.Literal("transcript.text.segment").annotate({
366 "description": "The type of the segment. Always `transcript.text.segment`.\n"
367 }),
368 "id": Schema.String.annotate({ "description": "Unique identifier for the segment." }),
369 "start": Schema.Number.annotate({ "description": "Start timestamp of the segment in seconds.", "format": "double" })
370 .check(Schema.isFinite().annotate({ "expected": "a finite number" })),
371 "end": Schema.Number.annotate({ "description": "End timestamp of the segment in seconds.", "format": "double" })
372 .check(Schema.isFinite().annotate({ "expected": "a finite number" })),
373 "text": Schema.String.annotate({ "description": "Transcript text for this segment." }),
374 "speaker": Schema.String.annotate({
375 "description":
376 "Speaker label for this segment. When known speakers are provided, the label matches `known_speaker_names[]`. Otherwise speakers are labeled sequentially using capital letters (`A`, `B`, ...).\n"
377 })
378 }).annotate({
379 "description": "A segment of diarized transcript text with speaker metadata.",
380 "identifier": "TranscriptionDiarizedSegment"
381 })
382 export type TranscriptionWord = { readonly "word": string; readonly "start": number; readonly "end": number }
383 export const TranscriptionWord = Schema.Struct({
384 "word": Schema.String.annotate({ "description": "The text content of the word." }),
385 "start": Schema.Number.annotate({ "description": "Start time of the word in seconds.", "format": "double" }).check(
386 Schema.isFinite().annotate({ "expected": "a finite number" })
387 ),
388 "end": Schema.Number.annotate({ "description": "End time of the word in seconds.", "format": "double" }).check(
389 Schema.isFinite().annotate({ "expected": "a finite number" })
390 )
391 }).annotate({ "identifier": "TranscriptionWord" })
392 export type TranscriptionSegment = {
393 readonly "id": number
394 readonly "seek": number
395 readonly "start": number
396 readonly "end": number
397 readonly "text": string
398 readonly "tokens": ReadonlyArray<number>
399 readonly "temperature": number
400 readonly "avg_logprob": number
401 readonly "compression_ratio": number
402 readonly "no_speech_prob": number
403 }
404 export const TranscriptionSegment = Schema.Struct({
405 "id": Schema.Number.annotate({ "description": "Unique identifier of the segment." }).check(
406 Schema.isInt().annotate({ "expected": "an integer" })
407 ),
408 "seek": Schema.Number.annotate({ "description": "Seek offset of the segment." }).check(
409 Schema.isInt().annotate({ "expected": "an integer" })
410 ),
411 "start": Schema.Number.annotate({ "description": "Start time of the segment in seconds.", "format": "double" }).check(
412 Schema.isFinite().annotate({ "expected": "a finite number" })
413 ),
414 "end": Schema.Number.annotate({ "description": "End time of the segment in seconds.", "format": "double" }).check(
415 Schema.isFinite().annotate({ "expected": "a finite number" })
416 ),
417 "text": Schema.String.annotate({ "description": "Text content of the segment." }),
418 "tokens": Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))).annotate({
419 "description": "Array of token IDs for the text content."
420 }),
421 "temperature": Schema.Number.annotate({
422 "description": "Temperature parameter used for generating the segment.",
423 "format": "float"
424 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
425 "avg_logprob": Schema.Number.annotate({
426 "description": "Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.",
427 "format": "float"
428 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
429 "compression_ratio": Schema.Number.annotate({
430 "description":
431 "Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.",
432 "format": "float"
433 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
434 "no_speech_prob": Schema.Number.annotate({
435 "description":
436 "Probability of no speech in the segment. If the value is higher than 1.0 and the `avg_logprob` is below -1, consider this segment silent.",
437 "format": "float"
438 }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
439 }).annotate({ "identifier": "TranscriptionSegment" })
440 export type TranscriptTextSegmentEvent = {
441 readonly "type": "transcript.text.segment"
442 readonly "id": string
443 readonly "start": number
444 readonly "end": number
445 readonly "text": string
446 readonly "speaker": string
447 }
448 export const TranscriptTextSegmentEvent = Schema.Struct({
449 "type": Schema.Literal("transcript.text.segment").annotate({
450 "description": "The type of the event. Always `transcript.text.segment`."
451 }),
452 "id": Schema.String.annotate({ "description": "Unique identifier for the segment." }),
453 "start": Schema.Number.annotate({ "description": "Start timestamp of the segment in seconds.", "format": "double" })
454 .check(Schema.isFinite().annotate({ "expected": "a finite number" })),
455 "end": Schema.Number.annotate({ "description": "End timestamp of the segment in seconds.", "format": "double" })
456 .check(Schema.isFinite().annotate({ "expected": "a finite number" })),
457 "text": Schema.String.annotate({ "description": "Transcript text for this segment." }),
458 "speaker": Schema.String.annotate({ "description": "Speaker label for this segment." })
459 }).annotate({
460 "description":
461 "Emitted when a diarized transcription returns a completed segment with speaker information. Only emitted when you [create a transcription](https://developers.openai.com/api/reference/resources/audio/subresources/transcriptions/methods/create) with `stream` set to `true` and `response_format` set to `diarized_json`.\n",
462 "identifier": "TranscriptTextSegmentEvent"
463 })
464 export type TranscriptTextDeltaEvent = {
465 readonly "type": "transcript.text.delta"
466 readonly "delta": string
467 readonly "logprobs"?: ReadonlyArray<
468 { readonly "token"?: string; readonly "logprob"?: number; readonly "bytes"?: ReadonlyArray<number> }
469 >
470 readonly "segment_id"?: string
471 }
472 export const TranscriptTextDeltaEvent = Schema.Struct({
473 "type": Schema.Literal("transcript.text.delta").annotate({
474 "description": "The type of the event. Always `transcript.text.delta`.\n"
475 }),
476 "delta": Schema.String.annotate({ "description": "The text delta that was additionally transcribed.\n" }),
477 "logprobs": Schema.optionalKey(
478 Schema.Array(Schema.Struct({
479 "token": Schema.optionalKey(
480 Schema.String.annotate({ "description": "The token that was used to generate the log probability.\n" })
481 ),
482 "logprob": Schema.optionalKey(
483 Schema.Number.annotate({ "description": "The log probability of the token.\n" }).check(
484 Schema.isFinite().annotate({ "expected": "a finite number" })
485 )
486 ),
487 "bytes": Schema.optionalKey(
488 Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))).annotate({
489 "description": "The bytes that were used to generate the log probability.\n"
490 })
491 )
492 })).annotate({
493 "description":
494 "The log probabilities of the delta. Only included if you [create a transcription](https://developers.openai.com/api/reference/resources/audio/subresources/transcriptions/methods/create) with the `include[]` parameter set to `logprobs`.\n"
495 })
496 ),
497 "segment_id": Schema.optionalKey(
498 Schema.String.annotate({
499 "description":
500 "Identifier of the diarized segment that this delta belongs to. Only present when using `gpt-4o-transcribe-diarize`.\n"
501 })
502 )
503 }).annotate({
504 "description":
505 "Emitted when there is an additional text delta. This is also the first event emitted when the transcription starts. Only emitted when you [create a transcription](https://developers.openai.com/api/reference/resources/audio/subresources/transcriptions/methods/create) with the `Stream` parameter set to `true`.",
506 "identifier": "TranscriptTextDeltaEvent"
507 })
508 export type CreateTranslationResponseJson = { readonly "text": string }
509 export const CreateTranslationResponseJson = Schema.Struct({ "text": Schema.String }).annotate({
510 "identifier": "CreateTranslationResponseJson"
511 })
512 export type VoiceConsentResource = {
513 readonly "object": "audio.voice_consent"
514 readonly "id": string
515 readonly "name": string
516 readonly "language": string
517 readonly "created_at": number
518 }
519 export const VoiceConsentResource = Schema.Struct({
520 "object": Schema.Literal("audio.voice_consent").annotate({
521 "description": "The object type, which is always `audio.voice_consent`."
522 }),
523 "id": Schema.String.annotate({ "description": "The consent recording identifier." }),
524 "name": Schema.String.annotate({ "description": "The label provided when the consent recording was uploaded." }),
525 "language": Schema.String.annotate({
526 "description": "The BCP 47 language tag for the consent phrase (for example, `en-US`)."
527 }),
528 "created_at": Schema.Number.annotate({
529 "description": "The Unix timestamp (in seconds) for when the consent recording was created.",
530 "format": "unixtime"
531 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
532 }).annotate({
533 "title": "Voice consent",
534 "description": "A consent recording used to authorize creation of a custom voice.",
535 "identifier": "VoiceConsentResource"
536 })
537 export type UpdateVoiceConsentRequest = { readonly "name": string }
538 export const UpdateVoiceConsentRequest = Schema.Struct({
539 "name": Schema.String.annotate({ "description": "The updated label for this consent recording." })
540 }).annotate({ "identifier": "UpdateVoiceConsentRequest" })
541 export type VoiceConsentDeletedResource = {
542 readonly "id": string
543 readonly "object": "audio.voice_consent"
544 readonly "deleted": boolean
545 }
546 export const VoiceConsentDeletedResource = Schema.Struct({
547 "id": Schema.String.annotate({ "description": "The consent recording identifier." }),
548 "object": Schema.Literal("audio.voice_consent"),
549 "deleted": Schema.Boolean
550 }).annotate({ "identifier": "VoiceConsentDeletedResource" })
551 export type VoiceResource = {
552 readonly "object": "audio.voice"
553 readonly "id": string
554 readonly "type": "audio_sample"
555 readonly "name": string
556 readonly "created_at": number
557 }
558 export const VoiceResource = Schema.Struct({
559 "object": Schema.Literal("audio.voice").annotate({
560 "description": "The object type, which is always `audio.voice`."
561 }),
562 "id": Schema.String.annotate({ "description": "The voice identifier, which can be referenced in API endpoints." }),
563 "type": Schema.Literal("audio_sample").annotate({ "description": "How the voice was created." }),
564 "name": Schema.String.annotate({ "description": "The name of the voice." }),
565 "created_at": Schema.Number.annotate({
566 "description": "The Unix timestamp (in seconds) for when the voice was created.",
567 "format": "unixtime"
568 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
569 }).annotate({
570 "title": "Voice",
571 "description": "A custom voice that can be used for audio output.",
572 "identifier": "VoiceResource"
573 })
574 export type BatchError = {
575 readonly "code"?: string
576 readonly "message"?: string
577 readonly "param"?: string | null
578 readonly "line"?: number | null
579 }
580 export const BatchError = Schema.Struct({
581 "code": Schema.optionalKey(Schema.String.annotate({ "description": "An error code identifying the error type." })),
582 "message": Schema.optionalKey(
583 Schema.String.annotate({ "description": "A human-readable message providing more details about the error." })
584 ),
585 "param": Schema.optionalKey(
586 Schema.Union([
587 Schema.String.annotate({ "description": "The name of the parameter that caused the error, if applicable." }),
588 Schema.Null
589 ])
590 ),
591 "line": Schema.optionalKey(
592 Schema.Union([
593 Schema.Number.annotate({
594 "description": "The line number of the input file where the error occurred, if applicable."
595 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
596 Schema.Null
597 ])
598 )
599 }).annotate({ "identifier": "BatchError" })
600 export type BatchRequestCounts = { readonly "total": number; readonly "completed": number; readonly "failed": number }
601 export const BatchRequestCounts = Schema.Struct({
602 "total": Schema.Number.annotate({ "description": "Total number of requests in the batch." }).check(
603 Schema.isInt().annotate({ "expected": "an integer" })
604 ),
605 "completed": Schema.Number.annotate({ "description": "Number of requests that have been completed successfully." })
606 .check(Schema.isInt().annotate({ "expected": "an integer" })),
607 "failed": Schema.Number.annotate({ "description": "Number of requests that have failed." }).check(
608 Schema.isInt().annotate({ "expected": "an integer" })
609 )
610 }).annotate({
611 "description": "The request counts for different statuses within the batch.",
612 "identifier": "BatchRequestCounts"
613 })
614 export type BatchFileExpirationAfter = { readonly "anchor": "created_at"; readonly "seconds": number }
615 export const BatchFileExpirationAfter = Schema.Struct({
616 "anchor": Schema.Literal("created_at").annotate({
617 "description":
618 "Anchor timestamp after which the expiration policy applies. Supported anchors: `created_at`. Note that the anchor is the file creation time, not the time the batch is created."
619 }),
620 "seconds": Schema.Number.annotate({
621 "description":
622 "The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days).",
623 "format": "int64"
624 }).check(Schema.isInt().annotate({ "expected": "an integer" })).check(
625 Schema.isGreaterThanOrEqualTo(3600).annotate({ "expected": "a value greater than or equal to 3600" })
626 ).check(Schema.isLessThanOrEqualTo(2592000).annotate({ "expected": "a value less than or equal to 2592000" }))
627 }).annotate({
628 "title": "File expiration policy",
629 "description": "The expiration policy for the output and/or error file that are generated for a batch.",
630 "identifier": "BatchFileExpirationAfter"
631 })
632 export type ChatCompletionMessageToolCall = {
633 readonly "id": string
634 readonly "type": "function"
635 readonly "function": { readonly "name": string; readonly "arguments": string }
636 }
637 export const ChatCompletionMessageToolCall = Schema.Struct({
638 "id": Schema.String.annotate({ "description": "The ID of the tool call." }),
639 "type": Schema.Literal("function").annotate({
640 "description": "The type of the tool. Currently, only `function` is supported."
641 }),
642 "function": Schema.Struct({
643 "name": Schema.String.annotate({ "description": "The name of the function to call." }),
644 "arguments": Schema.String.annotate({
645 "description":
646 "The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function."
647 })
648 }).annotate({ "description": "The function that the model called." })
649 }).annotate({
650 "title": "Function tool call",
651 "description": "A call to a function tool created by the model.\n",
652 "identifier": "ChatCompletionMessageToolCall"
653 })
654 export type ChatCompletionMessageCustomToolCall = {
655 readonly "id": string
656 readonly "type": "custom"
657 readonly "custom": { readonly "name": string; readonly "input": string }
658 }
659 export const ChatCompletionMessageCustomToolCall = Schema.Struct({
660 "id": Schema.String.annotate({ "description": "The ID of the tool call." }),
661 "type": Schema.Literal("custom").annotate({ "description": "The type of the tool. Always `custom`." }),
662 "custom": Schema.Struct({
663 "name": Schema.String.annotate({ "description": "The name of the custom tool to call." }),
664 "input": Schema.String.annotate({ "description": "The input for the custom tool call generated by the model." })
665 }).annotate({ "description": "The custom tool that the model called." })
666 }).annotate({
667 "title": "Custom tool call",
668 "description": "A call to a custom tool created by the model.\n",
669 "identifier": "ChatCompletionMessageCustomToolCall"
670 })
671 export type ChatCompletionTokenLogprob = {
672 readonly "token": string
673 readonly "logprob": number
674 readonly "bytes": ReadonlyArray<number> | null
675 readonly "top_logprobs": ReadonlyArray<
676 { readonly "token": string; readonly "logprob": number; readonly "bytes": ReadonlyArray<number> | null }
677 >
678 }
679 export const ChatCompletionTokenLogprob = Schema.Struct({
680 "token": Schema.String.annotate({ "description": "The token." }),
681 "logprob": Schema.Number.annotate({
682 "description":
683 "The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely."
684 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
685 "bytes": Schema.Union([
686 Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))).annotate({
687 "description":
688 "A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token."
689 }),
690 Schema.Null
691 ]),
692 "top_logprobs": Schema.Array(Schema.Struct({
693 "token": Schema.String.annotate({ "description": "The token." }),
694 "logprob": Schema.Number.annotate({
695 "description":
696 "The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely."
697 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
698 "bytes": Schema.Union([
699 Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))).annotate({
700 "description":
701 "A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token."
702 }),
703 Schema.Null
704 ])
705 })).annotate({
706 "description":
707 "List of the most likely tokens and their log probability, at this token position. The number of entries may be fewer than the requested `top_logprobs`."
708 })
709 }).annotate({ "identifier": "ChatCompletionTokenLogprob" })
710 export type ServiceTier = "auto" | "default" | "flex" | "scale" | "priority" | "fast" | null
711 export const ServiceTier = Schema.Union([
712 Schema.Literals(["auto", "default", "flex", "scale", "priority", "fast"]).annotate({
713 "description":
714 "Specifies the processing type used for serving the request.\n - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.\n - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.\n - If set to '[flex](https://developers.openai.com/api/docs/guides/flex-processing)', then the request will be processed with the Flex Processing service tier.\n - To opt-in to [Fast mode](https://developers.openai.com/api/docs/guides/fast-mode) at the request level, include the `service_tier=fast` or `service_tier=priority` parameter for Responses or Chat Completions. The response will show `service_tier=priority` regardless of if you specify `service_tier=fast` or `priority` in your request.\n - When not set, the default behavior is 'auto'.\n\n When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.\n"
715 }),
716 Schema.Null
717 ]).annotate({ "identifier": "ServiceTier" })
718 export type CompletionUsage = {
719 readonly "completion_tokens": number
720 readonly "prompt_tokens": number
721 readonly "total_tokens": number
722 readonly "completion_tokens_details"?: {
723 readonly "accepted_prediction_tokens"?: number
724 readonly "audio_tokens"?: number
725 readonly "reasoning_tokens"?: number
726 readonly "text_tokens"?: number
727 readonly "rejected_prediction_tokens"?: number
728 }
729 readonly "prompt_tokens_details"?: {
730 readonly "audio_tokens"?: number
731 readonly "cached_tokens"?: number
732 readonly "text_tokens"?: number
733 readonly "image_tokens"?: number
734 readonly "cache_write_tokens"?: number
735 }
736 }
737 export const CompletionUsage = Schema.Struct({
738 "completion_tokens": Schema.Number.annotate({ "description": "Number of tokens in the generated completion." }).check(
739 Schema.isInt().annotate({ "expected": "an integer" })
740 ),
741 "prompt_tokens": Schema.Number.annotate({ "description": "Number of tokens in the prompt." }).check(
742 Schema.isInt().annotate({ "expected": "an integer" })
743 ),
744 "total_tokens": Schema.Number.annotate({
745 "description": "Total number of tokens used in the request (prompt + completion)."
746 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
747 "completion_tokens_details": Schema.optionalKey(
748 Schema.Struct({
749 "accepted_prediction_tokens": Schema.optionalKey(
750 Schema.Number.annotate({
751 "description":
752 "When using Predicted Outputs, the number of tokens in the\nprediction that appeared in the completion.\n"
753 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
754 ),
755 "audio_tokens": Schema.optionalKey(
756 Schema.Number.annotate({ "description": "Audio input tokens generated by the model." }).check(
757 Schema.isInt().annotate({ "expected": "an integer" })
758 )
759 ),
760 "reasoning_tokens": Schema.optionalKey(
761 Schema.Number.annotate({ "description": "Tokens generated by the model for reasoning." }).check(
762 Schema.isInt().annotate({ "expected": "an integer" })
763 )
764 ),
765 "text_tokens": Schema.optionalKey(
766 Schema.Number.annotate({ "description": "Text output tokens generated by the model." }).check(
767 Schema.isInt().annotate({ "expected": "an integer" })
768 )
769 ),
770 "rejected_prediction_tokens": Schema.optionalKey(
771 Schema.Number.annotate({
772 "description":
773 "When using Predicted Outputs, the number of tokens in the\nprediction that did not appear in the completion. However, like\nreasoning tokens, these tokens are still counted in the total\ncompletion tokens for purposes of billing, output, and context window\nlimits.\n"
774 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
775 )
776 }).annotate({ "description": "Breakdown of tokens used in a completion." })
777 ),
778 "prompt_tokens_details": Schema.optionalKey(
779 Schema.Struct({
780 "audio_tokens": Schema.optionalKey(
781 Schema.Number.annotate({ "description": "Audio input tokens present in the prompt." }).check(
782 Schema.isInt().annotate({ "expected": "an integer" })
783 )
784 ),
785 "cached_tokens": Schema.optionalKey(
786 Schema.Number.annotate({ "description": "Cached tokens present in the prompt." }).check(
787 Schema.isInt().annotate({ "expected": "an integer" })
788 )
789 ),
790 "text_tokens": Schema.optionalKey(
791 Schema.Number.annotate({ "description": "Text input tokens present in the prompt." }).check(
792 Schema.isInt().annotate({ "expected": "an integer" })
793 )
794 ),
795 "image_tokens": Schema.optionalKey(
796 Schema.Number.annotate({ "description": "Image input tokens present in the prompt." }).check(
797 Schema.isInt().annotate({ "expected": "an integer" })
798 )
799 ),
800 "cache_write_tokens": Schema.optionalKey(
801 Schema.Number.annotate({ "description": "The unadjusted number of prompt tokens written to cache." }).check(
802 Schema.isInt().annotate({ "expected": "an integer" })
803 )
804 )
805 }).annotate({ "description": "Breakdown of tokens used in the prompt." })
806 )
807 }).annotate({ "description": "Usage statistics for the completion request.", "identifier": "CompletionUsage" })
808 export type ModerationInputType = "text" | "image"
809 export const ModerationInputType = Schema.Literals(["text", "image"]).annotate({ "identifier": "ModerationInputType" })
810 export type ChatCompletionModerationError = {
811 readonly "type": "error"
812 readonly "code": string
813 readonly "message": string
814 }
815 export const ChatCompletionModerationError = Schema.Struct({
816 "type": Schema.Literal("error").annotate({ "description": "The object type, which is always `error`." }),
817 "code": Schema.String.annotate({ "description": "The error code." }),
818 "message": Schema.String.annotate({ "description": "The error message." })
819 }).annotate({
820 "description": "An error produced while attempting moderation.",
821 "identifier": "ChatCompletionModerationError"
822 })
823 export type PromptCacheTTLEnum = "30m"
824 export const PromptCacheTTLEnum = Schema.Literal("30m").annotate({ "identifier": "PromptCacheTTLEnum" })
825 export type PromptCacheModeEnum = "implicit" | "explicit"
826 export const PromptCacheModeEnum = Schema.Literals(["implicit", "explicit"]).annotate({
827 "identifier": "PromptCacheModeEnum"
828 })
829 export type PromptCacheBreakpointParam = { readonly "mode": "explicit" }
830 export const PromptCacheBreakpointParam = Schema.Struct({
831 "mode": Schema.Literal("explicit").annotate({ "description": "The breakpoint mode. Always `explicit`." })
832 }).annotate({
833 "title": "Prompt cache breakpoint",
834 "description":
835 "Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.",
836 "identifier": "PromptCacheBreakpointParam"
837 })
838 export type ChatCompletionRequestMessageContentPartRefusal = { readonly "type": "refusal"; readonly "refusal": string }
839 export const ChatCompletionRequestMessageContentPartRefusal = Schema.Struct({
840 "type": Schema.Literal("refusal").annotate({ "description": "The type of the content part." }),
841 "refusal": Schema.String.annotate({ "description": "The refusal message generated by the model." })
842 }).annotate({ "title": "Refusal content part", "identifier": "ChatCompletionRequestMessageContentPartRefusal" })
843 export type ChatCompletionRequestFunctionMessage = {
844 readonly "role": "function"
845 readonly "content": string | null
846 readonly "name": string
847 }
848 export const ChatCompletionRequestFunctionMessage = Schema.Struct({
849 "role": Schema.Literal("function").annotate({
850 "description": "The role of the messages author, in this case `function`."
851 }),
852 "content": Schema.Union([
853 Schema.String.annotate({ "description": "The contents of the function message." }),
854 Schema.Null
855 ]),
856 "name": Schema.String.annotate({ "description": "The name of the function to call." })
857 }).annotate({ "title": "Function message", "identifier": "ChatCompletionRequestFunctionMessage" })
858 export type ModelIdsShared =
859 | string
860 | "gpt-6-astra"
861 | "gpt-6.1-sol"
862 | "gpt-6-sol"
863 | "gpt-6-luna"
864 | "gpt-5.6-sol"
865 | "gpt-5.6-terra"
866 | "gpt-5.6-luna"
867 | "gpt-5.5"
868 | "gpt-5.5-2026-04-23"
869 | "gpt-5.4"
870 | "gpt-5.4-mini"
871 | "gpt-5.4-nano"
872 | "gpt-5.4-mini-2026-03-17"
873 | "gpt-5.4-nano-2026-03-17"
874 | "gpt-5.3-chat-latest"
875 | "gpt-5.2"
876 | "gpt-5.2-2025-12-11"
877 | "gpt-5.2-chat-latest"
878 | "gpt-5.2-pro"
879 | "gpt-5.2-pro-2025-12-11"
880 | "gpt-5.1"
881 | "gpt-5.1-2025-11-13"
882 | "gpt-5.1-codex"
883 | "gpt-5.1-mini"
884 | "gpt-5.1-chat-latest"
885 | "gpt-5"
886 | "gpt-5-mini"
887 | "gpt-5-nano"
888 | "gpt-5-2025-08-07"
889 | "gpt-5-mini-2025-08-07"
890 | "gpt-5-nano-2025-08-07"
891 | "gpt-5-chat-latest"
892 | "gpt-4.1"
893 | "gpt-4.1-mini"
894 | "gpt-4.1-nano"
895 | "gpt-4.1-2025-04-14"
896 | "gpt-4.1-mini-2025-04-14"
897 | "gpt-4.1-nano-2025-04-14"
898 | "o4-mini"
899 | "o4-mini-2025-04-16"
900 | "o3"
901 | "o3-2025-04-16"
902 | "o3-mini"
903 | "o3-mini-2025-01-31"
904 | "o1"
905 | "o1-2024-12-17"
906 | "o1-preview"
907 | "o1-preview-2024-09-12"
908 | "o1-mini"
909 | "o1-mini-2024-09-12"
910 | "gpt-4o"
911 | "gpt-4o-2024-11-20"
912 | "gpt-4o-2024-08-06"
913 | "gpt-4o-2024-05-13"
914 | "gpt-audio-mini"
915 | "gpt-audio-mini-2025-12-15"
916 | "gpt-4o-audio-preview"
917 | "gpt-4o-audio-preview-2024-10-01"
918 | "gpt-4o-audio-preview-2024-12-17"
919 | "gpt-4o-audio-preview-2025-06-03"
920 | "gpt-4o-mini-audio-preview"
921 | "gpt-4o-mini-audio-preview-2024-12-17"
922 | "gpt-4o-search-preview"
923 | "gpt-4o-mini-search-preview"
924 | "gpt-4o-search-preview-2025-03-11"
925 | "gpt-4o-mini-search-preview-2025-03-11"
926 | "chatgpt-4o-latest"
927 | "codex-mini-latest"
928 | "gpt-4o-mini"
929 | "gpt-4o-mini-2024-07-18"
930 | "gpt-4-turbo"
931 | "gpt-4-turbo-2024-04-09"
932 | "gpt-4-0125-preview"
933 | "gpt-4-turbo-preview"
934 | "gpt-4-1106-preview"
935 | "gpt-4-vision-preview"
936 | "gpt-4"
937 | "gpt-4-0314"
938 | "gpt-4-0613"
939 | "gpt-4-32k"
940 | "gpt-4-32k-0314"
941 | "gpt-4-32k-0613"
942 | "gpt-3.5-turbo"
943 | "gpt-3.5-turbo-16k"
944 | "gpt-3.5-turbo-0301"
945 | "gpt-3.5-turbo-0613"
946 | "gpt-3.5-turbo-1106"
947 | "gpt-3.5-turbo-0125"
948 | "gpt-3.5-turbo-16k-0613"
949 export const ModelIdsShared = Schema.Union([
950 Schema.String,
951 Schema.Literals([
952 "gpt-6-astra",
953 "gpt-6.1-sol",
954 "gpt-6-sol",
955 "gpt-6-luna",
956 "gpt-5.6-sol",
957 "gpt-5.6-terra",
958 "gpt-5.6-luna",
959 "gpt-5.5",
960 "gpt-5.5-2026-04-23",
961 "gpt-5.4",
962 "gpt-5.4-mini",
963 "gpt-5.4-nano",
964 "gpt-5.4-mini-2026-03-17",
965 "gpt-5.4-nano-2026-03-17",
966 "gpt-5.3-chat-latest",
967 "gpt-5.2",
968 "gpt-5.2-2025-12-11",
969 "gpt-5.2-chat-latest",
970 "gpt-5.2-pro",
971 "gpt-5.2-pro-2025-12-11",
972 "gpt-5.1",
973 "gpt-5.1-2025-11-13",
974 "gpt-5.1-codex",
975 "gpt-5.1-mini",
976 "gpt-5.1-chat-latest",
977 "gpt-5",
978 "gpt-5-mini",
979 "gpt-5-nano",
980 "gpt-5-2025-08-07",
981 "gpt-5-mini-2025-08-07",
982 "gpt-5-nano-2025-08-07",
983 "gpt-5-chat-latest",
984 "gpt-4.1",
985 "gpt-4.1-mini",
986 "gpt-4.1-nano",
987 "gpt-4.1-2025-04-14",
988 "gpt-4.1-mini-2025-04-14",
989 "gpt-4.1-nano-2025-04-14",
990 "o4-mini",
991 "o4-mini-2025-04-16",
992 "o3",
993 "o3-2025-04-16",
994 "o3-mini",
995 "o3-mini-2025-01-31",
996 "o1",
997 "o1-2024-12-17",
998 "o1-preview",
999 "o1-preview-2024-09-12",
1000 "o1-mini",
1001 "o1-mini-2024-09-12",
1002 "gpt-4o",
1003 "gpt-4o-2024-11-20",
1004 "gpt-4o-2024-08-06",
1005 "gpt-4o-2024-05-13",
1006 "gpt-audio-mini",
1007 "gpt-audio-mini-2025-12-15",
1008 "gpt-4o-audio-preview",
1009 "gpt-4o-audio-preview-2024-10-01",
1010 "gpt-4o-audio-preview-2024-12-17",
1011 "gpt-4o-audio-preview-2025-06-03",
1012 "gpt-4o-mini-audio-preview",
1013 "gpt-4o-mini-audio-preview-2024-12-17",
1014 "gpt-4o-search-preview",
1015 "gpt-4o-mini-search-preview",
1016 "gpt-4o-search-preview-2025-03-11",
1017 "gpt-4o-mini-search-preview-2025-03-11",
1018 "chatgpt-4o-latest",
1019 "codex-mini-latest",
1020 "gpt-4o-mini",
1021 "gpt-4o-mini-2024-07-18",
1022 "gpt-4-turbo",
1023 "gpt-4-turbo-2024-04-09",
1024 "gpt-4-0125-preview",
1025 "gpt-4-turbo-preview",
1026 "gpt-4-1106-preview",
1027 "gpt-4-vision-preview",
1028 "gpt-4",
1029 "gpt-4-0314",
1030 "gpt-4-0613",
1031 "gpt-4-32k",
1032 "gpt-4-32k-0314",
1033 "gpt-4-32k-0613",
1034 "gpt-3.5-turbo",
1035 "gpt-3.5-turbo-16k",
1036 "gpt-3.5-turbo-0301",
1037 "gpt-3.5-turbo-0613",
1038 "gpt-3.5-turbo-1106",
1039 "gpt-3.5-turbo-0125",
1040 "gpt-3.5-turbo-16k-0613"
1041 ])
1042 ]).annotate({ "identifier": "ModelIdsShared" })
1043 export type ResponseModalities = ReadonlyArray<"text" | "audio"> | null
1044 export const ResponseModalities = Schema.Union([
1045 Schema.Array(Schema.Literals(["text", "audio"])).annotate({
1046 "description":
1047 "Output types that you would like the model to generate.\nMost models are capable of generating text, which is the default:\n\n`[\"text\"]`\n\nThe `gpt-4o-audio-preview` model can also be used to\n[generate audio](https://developers.openai.com/api/docs/guides/audio). To request that this model generate\nboth text and audio responses, you can use:\n\n`[\"text\", \"audio\"]`\n"
1048 }),
1049 Schema.Null
1050 ]).annotate({ "identifier": "ResponseModalities" })
1051 export type Verbosity = "low" | "medium" | "high" | null
1052 export const Verbosity = Schema.Union([
1053 Schema.Literals(["low", "medium", "high"]).annotate({
1054 "description":
1055 "Constrains the verbosity of the model's response. Lower values will result in\nmore concise responses, while higher values will result in more verbose responses.\nCurrently supported values are `low`, `medium`, and `high`. The default is\n`medium`.\n"
1056 }),
1057 Schema.Null
1058 ]).annotate({ "identifier": "Verbosity" })
1059 export type WebSearchLocation = {
1060 readonly "country"?: string
1061 readonly "region"?: string
1062 readonly "city"?: string
1063 readonly "timezone"?: string
1064 }
1065 export const WebSearchLocation = Schema.Struct({
1066 "country": Schema.optionalKey(
1067 Schema.String.annotate({
1068 "description":
1069 "The two-letter \n[ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user,\ne.g. `US`.\n"
1070 })
1071 ),
1072 "region": Schema.optionalKey(
1073 Schema.String.annotate({ "description": "Free text input for the region of the user, e.g. `California`.\n" })
1074 ),
1075 "city": Schema.optionalKey(
1076 Schema.String.annotate({ "description": "Free text input for the city of the user, e.g. `San Francisco`.\n" })
1077 ),
1078 "timezone": Schema.optionalKey(
1079 Schema.String.annotate({
1080 "description":
1081 "The [IANA timezone](https://timeapi.io/documentation/iana-timezones) \nof the user, e.g. `America/Los_Angeles`.\n"
1082 })
1083 )
1084 }).annotate({
1085 "title": "Web search location",
1086 "description": "Approximate location parameters for the search.",
1087 "identifier": "WebSearchLocation"
1088 })
1089 export type WebSearchContextSize = "low" | "medium" | "high"
1090 export const WebSearchContextSize = Schema.Literals(["low", "medium", "high"]).annotate({
1091 "description":
1092 "High level guidance for the amount of context window space to use for the \nsearch. One of `low`, `medium`, or `high`. `medium` is the default.\n",
1093 "identifier": "WebSearchContextSize"
1094 })
1095 export type ModerationMode = "score" | "block"
1096 export const ModerationMode = Schema.Literals(["score", "block"]).annotate({ "identifier": "ModerationMode" })
1097 export type StopConfiguration = string | ReadonlyArray<string> | null
1098 export const StopConfiguration = Schema.Union([
1099 Schema.String,
1100 Schema.Array(Schema.String).check(
1101 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
1102 ).check(Schema.isMaxLength(4).annotate({ "expected": "a value with a length of at most 4" })),
1103 Schema.Null
1104 ], { mode: "oneOf" }).annotate({
1105 "description":
1106 "Not supported with latest reasoning models `o3` and `o4-mini`.\n\nUp to 4 sequences where the API will stop generating further tokens. The\nreturned text will not contain the stop sequence.\n",
1107 "identifier": "StopConfiguration"
1108 })
1109 export type ChatCompletionStreamOptions = {
1110 readonly "include_usage"?: boolean
1111 readonly "include_obfuscation"?: boolean
1112 } | null
1113 export const ChatCompletionStreamOptions = Schema.Union([
1114 Schema.Struct({
1115 "include_usage": Schema.optionalKey(Schema.Boolean.annotate({
1116 "description":
1117 "If set, an additional chunk will be streamed before the `data: [DONE]`\nmessage. The `usage` field on this chunk shows the token usage statistics\nfor the entire request, and the `choices` field will always be an empty\narray.\n\nAll other chunks will also include a `usage` field, but with a null\nvalue. **NOTE:** If the stream is interrupted, you may not receive the\nfinal usage chunk which contains the total token usage for the request.\n"
1118 })),
1119 "include_obfuscation": Schema.optionalKey(Schema.Boolean.annotate({
1120 "description":
1121 "When true, stream obfuscation will be enabled. Stream obfuscation adds\nrandom characters to an `obfuscation` field on streaming delta events to\nnormalize payload sizes as a mitigation to certain side-channel attacks.\nThese obfuscation fields are included by default, but add a small amount\nof overhead to the data stream. You can set `include_obfuscation` to\nfalse to optimize for bandwidth if you trust the network links between\nyour application and the OpenAI API.\n"
1122 }))
1123 }).annotate({ "description": "Options for streaming response. Only set this when you set `stream: true`.\n" }),
1124 Schema.Null
1125 ]).annotate({ "identifier": "ChatCompletionStreamOptions" })
1126 export type CustomToolChatCompletions = {
1127 readonly "type": "custom"
1128 readonly "custom": {
1129 readonly "name": string
1130 readonly "description"?: string
1131 readonly "format"?: { readonly "type": "text" } | {
1132 readonly "type": "grammar"
1133 readonly "grammar": { readonly "definition": string; readonly "syntax": "lark" | "regex" }
1134 }
1135 }
1136 }
1137 export const CustomToolChatCompletions = Schema.Struct({
1138 "type": Schema.Literal("custom").annotate({ "description": "The type of the custom tool. Always `custom`." }),
1139 "custom": Schema.Struct({
1140 "name": Schema.String.annotate({
1141 "description": "The name of the custom tool, used to identify it in tool calls."
1142 }),
1143 "description": Schema.optionalKey(
1144 Schema.String.annotate({
1145 "description": "Optional description of the custom tool, used to provide more context.\n"
1146 })
1147 ),
1148 "format": Schema.optionalKey(
1149 Schema.Union([
1150 Schema.Struct({
1151 "type": Schema.Literal("text").annotate({ "description": "Unconstrained text format. Always `text`." })
1152 }).annotate({ "title": "Text format", "description": "Unconstrained free-form text." }),
1153 Schema.Struct({
1154 "type": Schema.Literal("grammar").annotate({ "description": "Grammar format. Always `grammar`." }),
1155 "grammar": Schema.Struct({
1156 "definition": Schema.String.annotate({ "description": "The grammar definition." }),
1157 "syntax": Schema.Literals(["lark", "regex"]).annotate({
1158 "description": "The syntax of the grammar definition. One of `lark` or `regex`."
1159 })
1160 }).annotate({ "title": "Grammar format", "description": "Your chosen grammar." })
1161 }).annotate({ "title": "Grammar format", "description": "A grammar defined by the user." })
1162 ], { mode: "oneOf" }).annotate({
1163 "description": "The input format for the custom tool. Default is unconstrained text.\n"
1164 })
1165 )
1166 }).annotate({ "title": "Custom tool properties", "description": "Properties of the custom tool.\n" })
1167 }).annotate({
1168 "title": "Custom tool",
1169 "description": "A custom tool that processes input using a specified format.\n",
1170 "identifier": "CustomToolChatCompletions"
1171 })
1172 export type ChatCompletionAllowedTools = {
1173 readonly "mode": "auto" | "required"
1174 readonly "tools": ReadonlyArray<{ readonly [x: string]: Schema.Json }>
1175 }
1176 export const ChatCompletionAllowedTools = Schema.Struct({
1177 "mode": Schema.Literals(["auto", "required"]).annotate({
1178 "description":
1179 "Constrains the tools available to the model to a pre-defined set.\n\n`auto` allows the model to pick from among the allowed tools and generate a\nmessage.\n\n`required` requires the model to call one or more of the allowed tools.\n"
1180 }),
1181 "tools": Schema.Array(
1182 Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })).annotate({
1183 "description": "A tool definition that the model should be allowed to call.\n"
1184 })
1185 ).annotate({
1186 "description":
1187 "A list of tool definitions that the model should be allowed to call.\n\nFor the Chat Completions API, the list of tool definitions might look like:\n```json\n[\n { \"type\": \"function\", \"function\": { \"name\": \"get_weather\" } },\n { \"type\": \"function\", \"function\": { \"name\": \"get_time\" } }\n]\n```\n"
1188 })
1189 }).annotate({
1190 "title": "Allowed tools",
1191 "description": "Constrains the tools available to the model to a pre-defined set.\n",
1192 "identifier": "ChatCompletionAllowedTools"
1193 })
1194 export type ChatCompletionNamedToolChoice = {
1195 readonly "type": "function"
1196 readonly "function": { readonly "name": string }
1197 }
1198 export const ChatCompletionNamedToolChoice = Schema.Struct({
1199 "type": Schema.Literal("function").annotate({
1200 "description": "For function calling, the type is always `function`."
1201 }),
1202 "function": Schema.Struct({ "name": Schema.String.annotate({ "description": "The name of the function to call." }) })
1203 }).annotate({
1204 "title": "Function tool choice",
1205 "description": "Specifies a tool the model should use. Use to force the model to call a specific function.",
1206 "identifier": "ChatCompletionNamedToolChoice"
1207 })
1208 export type ChatCompletionNamedToolChoiceCustom = {
1209 readonly "type": "custom"
1210 readonly "custom": { readonly "name": string }
1211 }
1212 export const ChatCompletionNamedToolChoiceCustom = Schema.Struct({
1213 "type": Schema.Literal("custom").annotate({ "description": "For custom tool calling, the type is always `custom`." }),
1214 "custom": Schema.Struct({
1215 "name": Schema.String.annotate({ "description": "The name of the custom tool to call." })
1216 })
1217 }).annotate({
1218 "title": "Custom tool choice",
1219 "description": "Specifies a tool the model should use. Use to force the model to call a specific custom tool.",
1220 "identifier": "ChatCompletionNamedToolChoiceCustom"
1221 })
1222 export type ParallelToolCalls = boolean
1223 export const ParallelToolCalls = Schema.Boolean.annotate({
1224 "description":
1225 "Whether to enable [parallel function calling](https://developers.openai.com/api/docs/guides/function-calling#parallel-function-calling) during tool use.",
1226 "identifier": "ParallelToolCalls"
1227 })
1228 export type ChatCompletionFunctionCallOption = { readonly "name": string }
1229 export const ChatCompletionFunctionCallOption = Schema.Struct({
1230 "name": Schema.String.annotate({ "description": "The name of the function to call." })
1231 }).annotate({
1232 "description":
1233 "Specifying a particular function via `{\"name\": \"my_function\"}` forces the model to call that function.\n",
1234 "identifier": "ChatCompletionFunctionCallOption"
1235 })
1236 export type ChatCompletionMessageToolCallChunk = {
1237 readonly "index": number
1238 readonly "id"?: string
1239 readonly "type"?: "function"
1240 readonly "function"?: { readonly "name"?: string; readonly "arguments"?: string }
1241 }
1242 export const ChatCompletionMessageToolCallChunk = Schema.Struct({
1243 "index": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
1244 "id": Schema.optionalKey(Schema.String.annotate({ "description": "The ID of the tool call." })),
1245 "type": Schema.optionalKey(
1246 Schema.Literal("function").annotate({
1247 "description": "The type of the tool. Currently, only `function` is supported."
1248 })
1249 ),
1250 "function": Schema.optionalKey(Schema.Struct({
1251 "name": Schema.optionalKey(Schema.String.annotate({ "description": "The name of the function to call." })),
1252 "arguments": Schema.optionalKey(Schema.String.annotate({
1253 "description":
1254 "The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function."
1255 }))
1256 }))
1257 }).annotate({ "identifier": "ChatCompletionMessageToolCallChunk" })
1258 export type ChatCompletionDeleted = {
1259 readonly "object": "chat.completion.deleted"
1260 readonly "id": string
1261 readonly "deleted": boolean
1262 }
1263 export const ChatCompletionDeleted = Schema.Struct({
1264 "object": Schema.Literal("chat.completion.deleted").annotate({ "description": "The type of object being deleted." }),
1265 "id": Schema.String.annotate({ "description": "The ID of the chat completion that was deleted." }),
1266 "deleted": Schema.Boolean.annotate({ "description": "Whether the chat completion was deleted." })
1267 }).annotate({ "identifier": "ChatCompletionDeleted" })
1268 export type ChatCompletionMessageList = {
1269 readonly "object": "list"
1270 readonly "data": ReadonlyArray<
1271 {
1272 readonly "id": string
1273 readonly "role": "user" | "assistant" | "tool" | "system" | "function" | "developer"
1274 readonly "content": string | null
1275 readonly "content_parts":
1276 | ReadonlyArray<
1277 {
1278 readonly "type": "text" | "image_url" | "input_audio" | "file"
1279 readonly "text"?: string | null
1280 readonly "image_url"?: { readonly "url": string; readonly "detail"?: string | null } | null
1281 readonly "input_audio"?: { readonly "data": string; readonly "format": string } | null
1282 readonly "file"?: {
1283 readonly "file_data"?: string | null
1284 readonly "filename"?: string | null
1285 readonly "file_id"?: string | null
1286 } | null
1287 }
1288 >
1289 | null
1290 readonly "name"?: string | null
1291 }
1292 >
1293 readonly "first_id": string | null
1294 readonly "last_id": string | null
1295 readonly "has_more": boolean
1296 }
1297 export const ChatCompletionMessageList = Schema.Struct({
1298 "object": Schema.Literal("list").annotate({
1299 "description": "The type of this object. It is always set to \"list\".\n"
1300 }),
1301 "data": Schema.Array(Schema.Struct({
1302 "id": Schema.String,
1303 "role": Schema.Literals(["user", "assistant", "tool", "system", "function", "developer"]),
1304 "content": Schema.Union([Schema.String, Schema.Null]),
1305 "content_parts": Schema.Union([
1306 Schema.Array(Schema.Struct({
1307 "type": Schema.Literals(["text", "image_url", "input_audio", "file"]),
1308 "text": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
1309 "image_url": Schema.optionalKey(
1310 Schema.Union([
1311 Schema.Struct({
1312 "url": Schema.String,
1313 "detail": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
1314 }),
1315 Schema.Null
1316 ])
1317 ),
1318 "input_audio": Schema.optionalKey(
1319 Schema.Union([Schema.Struct({ "data": Schema.String, "format": Schema.String }), Schema.Null])
1320 ),
1321 "file": Schema.optionalKey(
1322 Schema.Union([
1323 Schema.Struct({
1324 "file_data": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
1325 "filename": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
1326 "file_id": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
1327 }),
1328 Schema.Null
1329 ])
1330 )
1331 })),
1332 Schema.Null
1333 ]),
1334 "name": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null]))
1335 })).annotate({ "description": "An array of chat completion message objects.\n" }),
1336 "first_id": Schema.Union([Schema.String, Schema.Null]).annotate({
1337 "description": "The identifier of the first chat message in the data array."
1338 }),
1339 "last_id": Schema.Union([Schema.String, Schema.Null]).annotate({
1340 "description": "The identifier of the last chat message in the data array."
1341 }),
1342 "has_more": Schema.Boolean.annotate({ "description": "Indicates whether there are more chat messages available." })
1343 }).annotate({
1344 "title": "ChatCompletionMessageList",
1345 "description": "An object representing a list of chat completion messages.\n",
1346 "identifier": "ChatCompletionMessageList"
1347 })
1348 export type ContainerResource = {
1349 readonly "id": string
1350 readonly "object": string
1351 readonly "name": string
1352 readonly "created_at": number
1353 readonly "status": string
1354 readonly "last_active_at"?: number
1355 readonly "expires_after"?: { readonly "anchor"?: "last_active_at"; readonly "minutes"?: number }
1356 readonly "memory_limit"?: "1g" | "4g" | "16g" | "64g"
1357 readonly "network_policy"?: {
1358 readonly "type": "allowlist" | "disabled"
1359 readonly "allowed_domains"?: ReadonlyArray<string>
1360 }
1361 }
1362 export const ContainerResource = Schema.Struct({
1363 "id": Schema.String.annotate({ "description": "Unique identifier for the container." }),
1364 "object": Schema.String.annotate({ "description": "The type of this object." }),
1365 "name": Schema.String.annotate({ "description": "Name of the container." }),
1366 "created_at": Schema.Number.annotate({
1367 "description": "Unix timestamp (in seconds) when the container was created.",
1368 "format": "unixtime"
1369 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
1370 "status": Schema.String.annotate({ "description": "Status of the container (e.g., active, deleted)." }),
1371 "last_active_at": Schema.optionalKey(
1372 Schema.Number.annotate({
1373 "description": "Unix timestamp (in seconds) when the container was last active.",
1374 "format": "unixtime"
1375 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
1376 ),
1377 "expires_after": Schema.optionalKey(
1378 Schema.Struct({
1379 "anchor": Schema.optionalKey(
1380 Schema.Literal("last_active_at").annotate({ "description": "The reference point for the expiration." })
1381 ),
1382 "minutes": Schema.optionalKey(
1383 Schema.Number.annotate({
1384 "description": "The number of minutes after the anchor before the container expires."
1385 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
1386 )
1387 }).annotate({
1388 "description":
1389 "The container will expire after this time period.\nThe anchor is the reference point for the expiration.\nThe minutes is the number of minutes after the anchor before the container expires.\n"
1390 })
1391 ),
1392 "memory_limit": Schema.optionalKey(
1393 Schema.Literals(["1g", "4g", "16g", "64g"]).annotate({
1394 "description": "The memory limit configured for the container."
1395 })
1396 ),
1397 "network_policy": Schema.optionalKey(
1398 Schema.Struct({
1399 "type": Schema.Literals(["allowlist", "disabled"]).annotate({ "description": "The network policy mode." }),
1400 "allowed_domains": Schema.optionalKey(
1401 Schema.Array(Schema.String).annotate({ "description": "Allowed outbound domains when `type` is `allowlist`." })
1402 )
1403 }).annotate({ "description": "Network access policy for the container." })
1404 )
1405 }).annotate({ "title": "The container object", "identifier": "ContainerResource" })
1406 export type SkillReferenceParam = {
1407 readonly "type": "skill_reference"
1408 readonly "skill_id": string
1409 readonly "version"?: string
1410 }
1411 export const SkillReferenceParam = Schema.Struct({
1412 "type": Schema.Literal("skill_reference").annotate({
1413 "description": "References a skill created with the /v1/skills endpoint."
1414 }),
1415 "skill_id": Schema.String.annotate({ "description": "The ID of the referenced skill." }).check(
1416 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
1417 ).check(Schema.isMaxCodePoints(64).annotate({ "expected": "a string with at most 64 code points" })),
1418 "version": Schema.optionalKey(
1419 Schema.String.annotate({
1420 "description": "Optional skill version. Use a positive integer or 'latest'. Omit for default."
1421 })
1422 )
1423 }).annotate({ "identifier": "SkillReferenceParam" })
1424 export type InlineSkillSourceParam = {
1425 readonly "type": "base64"
1426 readonly "media_type": "application/zip"
1427 readonly "data": string
1428 }
1429 export const InlineSkillSourceParam = Schema.Struct({
1430 "type": Schema.Literal("base64").annotate({
1431 "description": "The type of the inline skill source. Must be `base64`."
1432 }),
1433 "media_type": Schema.Literal("application/zip").annotate({
1434 "description": "The media type of the inline skill payload. Must be `application/zip`."
1435 }),
1436 "data": Schema.String.annotate({ "description": "Base64-encoded skill zip bundle." }).check(
1437 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
1438 ).check(Schema.isMaxCodePoints(70254592).annotate({ "expected": "a string with at most 70254592 code points" }))
1439 }).annotate({ "description": "Inline skill payload", "identifier": "InlineSkillSourceParam" })
1440 export type ContainerNetworkPolicyDisabledParam = { readonly "type": "disabled" }
1441 export const ContainerNetworkPolicyDisabledParam = Schema.Struct({
1442 "type": Schema.Literal("disabled").annotate({ "description": "Disable outbound network access. Always `disabled`." })
1443 }).annotate({ "identifier": "ContainerNetworkPolicyDisabledParam" })
1444 export type ContainerNetworkPolicyDomainSecretParam = {
1445 readonly "domain": string
1446 readonly "name": string
1447 readonly "value": string
1448 }
1449 export const ContainerNetworkPolicyDomainSecretParam = Schema.Struct({
1450 "domain": Schema.String.annotate({ "description": "The domain associated with the secret." }).check(
1451 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
1452 ),
1453 "name": Schema.String.annotate({ "description": "The name of the secret to inject for the domain." }).check(
1454 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
1455 ),
1456 "value": Schema.String.annotate({ "description": "The secret value to inject for the domain." }).check(
1457 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
1458 ).check(Schema.isMaxCodePoints(10485760).annotate({ "expected": "a string with at most 10485760 code points" }))
1459 }).annotate({ "identifier": "ContainerNetworkPolicyDomainSecretParam" })
1460 export type ContainerFileResource = {
1461 readonly "id": string
1462 readonly "object": string
1463 readonly "container_id": string
1464 readonly "created_at": number
1465 readonly "bytes": number
1466 readonly "path": string
1467 readonly "source": string
1468 }
1469 export const ContainerFileResource = Schema.Struct({
1470 "id": Schema.String.annotate({ "description": "Unique identifier for the file." }),
1471 "object": Schema.String.annotate({ "description": "The type of this object (`container.file`)." }),
1472 "container_id": Schema.String.annotate({ "description": "The container this file belongs to." }),
1473 "created_at": Schema.Number.annotate({
1474 "description": "Unix timestamp (in seconds) when the file was created.",
1475 "format": "unixtime"
1476 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
1477 "bytes": Schema.Number.annotate({ "description": "Size of the file in bytes." }).check(
1478 Schema.isInt().annotate({ "expected": "an integer" })
1479 ),
1480 "path": Schema.String.annotate({ "description": "Path of the file in the container." }),
1481 "source": Schema.String.annotate({ "description": "Source of the file (e.g., `user`, `assistant`)." })
1482 }).annotate({ "title": "The container file object", "identifier": "ContainerFileResource" })
1483 export type CreateContainerFileBody = { readonly "file_id"?: string; readonly "file"?: string }
1484 export const CreateContainerFileBody = Schema.Struct({
1485 "file_id": Schema.optionalKey(Schema.String.annotate({ "description": "Name of the file to create." })),
1486 "file": Schema.optionalKey(
1487 Schema.String.annotate({ "description": "The File object (not file name) to be uploaded.\n", "format": "binary" })
1488 )
1489 }).annotate({ "identifier": "CreateContainerFileBody" })
1490 export type IncludeEnum =
1491 | "file_search_call.results"
1492 | "web_search_call.results"
1493 | "web_search_call.action.sources"
1494 | "message.input_image.image_url"
1495 | "computer_call_output.output.image_url"
1496 | "code_interpreter_call.outputs"
1497 | "reasoning.encrypted_content"
1498 | "message.output_text.logprobs"
1499 export const IncludeEnum = Schema.Literals([
1500 "file_search_call.results",
1501 "web_search_call.results",
1502 "web_search_call.action.sources",
1503 "message.input_image.image_url",
1504 "computer_call_output.output.image_url",
1505 "code_interpreter_call.outputs",
1506 "reasoning.encrypted_content",
1507 "message.output_text.logprobs"
1508 ]).annotate({
1509 "description":
1510 "Specify additional output data to include in the model response. Currently supported values are:\n- `web_search_call.results`: Include the search results of the web search tool call.\n- `web_search_call.action.sources`: Include the sources of the web search tool call.\n- `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items.\n- `computer_call_output.output.image_url`: Include image urls from the computer call output.\n- `file_search_call.results`: Include the search results of the file search tool call.\n- `message.input_image.image_url`: Include image urls from the input message.\n- `message.output_text.logprobs`: Include logprobs with assistant messages.\n- `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program).",
1511 "identifier": "IncludeEnum"
1512 })
1513 export type MessageStatus = "in_progress" | "completed" | "incomplete"
1514 export const MessageStatus = Schema.Literals(["in_progress", "completed", "incomplete"]).annotate({
1515 "identifier": "MessageStatus"
1516 })
1517 export type MessageRole =
1518 | "unknown"
1519 | "user"
1520 | "assistant"
1521 | "system"
1522 | "critic"
1523 | "discriminator"
1524 | "developer"
1525 | "tool"
1526 export const MessageRole = Schema.Literals([
1527 "unknown",
1528 "user",
1529 "assistant",
1530 "system",
1531 "critic",
1532 "discriminator",
1533 "developer",
1534 "tool"
1535 ]).annotate({ "identifier": "MessageRole" })
1536 export type PromptCacheBreakpointConfig = { readonly "mode": "explicit" }
1537 export const PromptCacheBreakpointConfig = Schema.Struct({
1538 "mode": Schema.Literal("explicit").annotate({ "description": "The breakpoint mode. Always `explicit`." })
1539 }).annotate({
1540 "title": "Prompt cache breakpoint",
1541 "description":
1542 "Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.",
1543 "identifier": "PromptCacheBreakpointConfig"
1544 })
1545 export type FileCitationBody = {
1546 readonly "type": "file_citation"
1547 readonly "file_id": string
1548 readonly "index": number
1549 readonly "filename": string
1550 }
1551 export const FileCitationBody = Schema.Struct({
1552 "type": Schema.Literal("file_citation").annotate({
1553 "description": "The type of the file citation. Always `file_citation`."
1554 }),
1555 "file_id": Schema.String.annotate({ "description": "The ID of the file." }),
1556 "index": Schema.Number.annotate({
1557 "description": "The index in the output text at which to insert the file citation."
1558 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
1559 "filename": Schema.String.annotate({ "description": "The filename of the file cited." })
1560 }).annotate({ "title": "File citation", "description": "A citation to a file.", "identifier": "FileCitationBody" })
1561 export type UrlCitationBody = {
1562 readonly "type": "url_citation"
1563 readonly "url": string
1564 readonly "start_index": number
1565 readonly "end_index": number
1566 readonly "title": string
1567 }
1568 export const UrlCitationBody = Schema.Struct({
1569 "type": Schema.Literal("url_citation").annotate({
1570 "description": "The type of the URL citation. Always `url_citation`."
1571 }),
1572 "url": Schema.String.annotate({ "description": "The URL of the web resource.", "format": "uri" }),
1573 "start_index": Schema.Number.annotate({
1574 "description": "The index of the first character of the URL citation in the message."
1575 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
1576 "end_index": Schema.Number.annotate({
1577 "description": "The index of the last character of the URL citation in the message."
1578 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
1579 "title": Schema.String.annotate({ "description": "The title of the web resource." })
1580 }).annotate({
1581 "title": "URL citation",
1582 "description": "A citation for a web resource used to generate a model response.",
1583 "identifier": "UrlCitationBody"
1584 })
1585 export type ContainerFileCitationBody = {
1586 readonly "type": "container_file_citation"
1587 readonly "container_id": string
1588 readonly "file_id": string
1589 readonly "start_index": number
1590 readonly "end_index": number
1591 readonly "filename": string
1592 }
1593 export const ContainerFileCitationBody = Schema.Struct({
1594 "type": Schema.Literal("container_file_citation").annotate({
1595 "description": "The type of the container file citation. Always `container_file_citation`."
1596 }),
1597 "container_id": Schema.String.annotate({ "description": "The ID of the container file." }),
1598 "file_id": Schema.String.annotate({ "description": "The ID of the file." }),
1599 "start_index": Schema.Number.annotate({
1600 "description": "The index of the first character of the container file citation in the message."
1601 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
1602 "end_index": Schema.Number.annotate({
1603 "description": "The index of the last character of the container file citation in the message."
1604 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
1605 "filename": Schema.String.annotate({ "description": "The filename of the container file cited." })
1606 }).annotate({
1607 "title": "Container file citation",
1608 "description": "A citation for a container file used to generate a model response.",
1609 "identifier": "ContainerFileCitationBody"
1610 })
1611 export type FilePath = { readonly "type": "file_path"; readonly "file_id": string; readonly "index": number }
1612 export const FilePath = Schema.Struct({
1613 "type": Schema.Literal("file_path").annotate({ "description": "The type of the file path. Always `file_path`.\n" }),
1614 "file_id": Schema.String.annotate({ "description": "The ID of the file.\n" }),
1615 "index": Schema.Number.annotate({ "description": "The index of the file in the list of files.\n" }).check(
1616 Schema.isInt().annotate({ "expected": "an integer" })
1617 )
1618 }).annotate({ "title": "File path", "description": "A path to a file.\n", "identifier": "FilePath" })
1619 export type TopLogProb = {
1620 readonly "token": string
1621 readonly "logprob": number
1622 readonly "bytes": ReadonlyArray<number>
1623 }
1624 export const TopLogProb = Schema.Struct({
1625 "token": Schema.String,
1626 "logprob": Schema.Finite,
1627 "bytes": Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })))
1628 }).annotate({
1629 "title": "Top log probability",
1630 "description": "The top log probability of a token.",
1631 "identifier": "TopLogProb"
1632 })
1633 export type TextContent = { readonly "type": "text"; readonly "text": string }
1634 export const TextContent = Schema.Struct({ "type": Schema.Literal("text"), "text": Schema.String }).annotate({
1635 "title": "Text Content",
1636 "description": "A text content.",
1637 "identifier": "TextContent"
1638 })
1639 export type SummaryTextContent = { readonly "type": "summary_text"; readonly "text": string }
1640 export const SummaryTextContent = Schema.Struct({
1641 "type": Schema.Literal("summary_text").annotate({ "description": "The type of the object. Always `summary_text`." }),
1642 "text": Schema.String.annotate({ "description": "A summary of the reasoning output from the model so far." })
1643 }).annotate({
1644 "title": "Summary text",
1645 "description": "A summary text from the model.",
1646 "identifier": "SummaryTextContent"
1647 })
1648 export type ReasoningTextContent = { readonly "type": "reasoning_text"; readonly "text": string }
1649 export const ReasoningTextContent = Schema.Struct({
1650 "type": Schema.Literal("reasoning_text").annotate({
1651 "description": "The type of the reasoning text. Always `reasoning_text`."
1652 }),
1653 "text": Schema.String.annotate({ "description": "The reasoning text from the model." })
1654 }).annotate({
1655 "title": "Reasoning text",
1656 "description": "Reasoning text from the model.",
1657 "identifier": "ReasoningTextContent"
1658 })
1659 export type RefusalContent = { readonly "type": "refusal"; readonly "refusal": string }
1660 export const RefusalContent = Schema.Struct({
1661 "type": Schema.Literal("refusal").annotate({ "description": "The type of the refusal. Always `refusal`." }),
1662 "refusal": Schema.String.annotate({ "description": "The refusal explanation from the model." })
1663 }).annotate({ "title": "Refusal", "description": "A refusal from the model.", "identifier": "RefusalContent" })
1664 export type ImageDetail = "low" | "high" | "auto" | "original"
1665 export const ImageDetail = Schema.Literals(["low", "high", "auto", "original"]).annotate({
1666 "identifier": "ImageDetail"
1667 })
1668 export type FileInputDetail = "auto" | "low" | "high"
1669 export const FileInputDetail = Schema.Literals(["auto", "low", "high"]).annotate({ "identifier": "FileInputDetail" })
1670 export type MessagePhase_2 = "commentary" | "final_answer"
1671 export const MessagePhase_2 = Schema.Literals(["commentary", "final_answer"]).annotate({
1672 "identifier": "MessagePhase-2"
1673 })
1674 export type DirectToolCallCaller = { readonly "type": "direct" }
1675 export const DirectToolCallCaller = Schema.Struct({ "type": Schema.Literal("direct") }).annotate({
1676 "identifier": "DirectToolCallCaller"
1677 })
1678 export type ProgramToolCallCaller = { readonly "type": "program"; readonly "caller_id": string }
1679 export const ProgramToolCallCaller = Schema.Struct({
1680 "type": Schema.Literal("program"),
1681 "caller_id": Schema.String.annotate({
1682 "description": "The call ID of the program item that produced this tool call."
1683 })
1684 }).annotate({ "identifier": "ProgramToolCallCaller" })
1685 export type DirectToolCallCallerParam = { readonly "type": "direct" }
1686 export const DirectToolCallCallerParam = Schema.Struct({
1687 "type": Schema.Literal("direct").annotate({ "description": "The caller type. Always `direct`." })
1688 }).annotate({ "identifier": "DirectToolCallCallerParam" })
1689 export type ProgramToolCallCallerParam = { readonly "type": "program"; readonly "caller_id": string }
1690 export const ProgramToolCallCallerParam = Schema.Struct({
1691 "type": Schema.Literal("program").annotate({ "description": "The caller type. Always `program`." }),
1692 "caller_id": Schema.String.annotate({
1693 "description": "The call ID of the program item that produced this tool call."
1694 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(
1695 Schema.isMaxCodePoints(64).annotate({ "expected": "a string with at most 64 code points" })
1696 )
1697 }).annotate({ "identifier": "ProgramToolCallCallerParam" })
1698 export type VectorStoreFileAttributes = { readonly [x: string]: string | number | boolean } | null
1699 export const VectorStoreFileAttributes = Schema.Union([
1700 Schema.Record(
1701 Schema.String,
1702 Schema.Union([
1703 Schema.String.check(
1704 Schema.isMaxCodePoints(512).annotate({ "expected": "a string with at most 512 code points" })
1705 ),
1706 Schema.Finite,
1707 Schema.Boolean
1708 ], { mode: "oneOf" })
1709 ).annotate({
1710 "description":
1711 "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard. Keys are strings\nwith a maximum length of 64 characters. Values are strings with a maximum\nlength of 512 characters, booleans, or numbers.\n"
1712 }).check(Schema.isMaxProperties(16).annotate({ "expected": "a value with at most 16 entries" })).check(
1713 Schema.isPropertyNames(
1714 Schema.String.check(Schema.isMaxCodePoints(64).annotate({ "expected": "a string with at most 64 code points" }))
1715 ).annotate({ "expected": "an object with property names matching the schema" })
1716 ),
1717 Schema.Null
1718 ]).annotate({ "identifier": "VectorStoreFileAttributes" })
1719 export type WebSearchCallStatus = "in_progress" | "searching" | "completed" | "failed" | "incomplete"
1720 export const WebSearchCallStatus = Schema.Literals(["in_progress", "searching", "completed", "failed", "incomplete"])
1721 .annotate({ "identifier": "WebSearchCallStatus" })
1722 export type WebSearchActionSearch = {
1723 readonly "type": "search"
1724 readonly "query"?: string
1725 readonly "queries"?: ReadonlyArray<string>
1726 readonly "sources"?: ReadonlyArray<
1727 { readonly "type": "url"; readonly "url": string } | { readonly "type": "api"; readonly "name": string }
1728 >
1729 }
1730 export const WebSearchActionSearch = Schema.Struct({
1731 "type": Schema.Literal("search").annotate({ "description": "The action type.\n" }),
1732 "query": Schema.optionalKey(Schema.String.annotate({ "description": "The search query.\n" })),
1733 "queries": Schema.optionalKey(
1734 Schema.Array(Schema.String.annotate({ "description": "A search query.\n" })).annotate({
1735 "title": "Search queries",
1736 "description": "The search queries.\n"
1737 })
1738 ),
1739 "sources": Schema.optionalKey(
1740 Schema.Array(
1741 Schema.Union([
1742 Schema.Struct({
1743 "type": Schema.Literal("url").annotate({ "description": "The type of source. Always `url`.\n" }),
1744 "url": Schema.String.annotate({ "description": "The URL of the source.\n", "format": "uri" })
1745 }).annotate({ "title": "Web search source", "description": "A source used in the search.\n" }),
1746 Schema.Struct({
1747 "type": Schema.Literal("api").annotate({ "description": "The type of source. Always `api`.\n" }),
1748 "name": Schema.String.annotate({
1749 "description": "The name of the API source, such as `oai-weather`, `oai-sports`, or `oai-finance`.\n"
1750 })
1751 }).annotate({ "title": "Web search API source", "description": "An API source used in the search.\n" })
1752 ])
1753 ).annotate({ "title": "Web search sources", "description": "The sources used in the search.\n" })
1754 )
1755 }).annotate({
1756 "title": "Search action",
1757 "description": "Action type \"search\" - Performs a web search query.\n",
1758 "identifier": "WebSearchActionSearch"
1759 })
1760 export type WebSearchActionOpenPage = { readonly "type": "open_page"; readonly "url"?: string | null }
1761 export const WebSearchActionOpenPage = Schema.Struct({
1762 "type": Schema.Literal("open_page").annotate({ "description": "The action type.\n" }),
1763 "url": Schema.optionalKey(
1764 Schema.Union([Schema.String.annotate({ "format": "uri" }), Schema.Null]).annotate({
1765 "description": "The URL opened by the model.\n"
1766 })
1767 )
1768 }).annotate({
1769 "title": "Open page action",
1770 "description": "Action type \"open_page\" - Opens a specific URL from search results.\n",
1771 "identifier": "WebSearchActionOpenPage"
1772 })
1773 export type WebSearchActionFind = {
1774 readonly "type": "find_in_page"
1775 readonly "url"?: string
1776 readonly "pattern"?: string
1777 }
1778 export const WebSearchActionFind = Schema.Struct({
1779 "type": Schema.Literal("find_in_page").annotate({ "description": "The action type.\n" }),
1780 "url": Schema.optionalKey(
1781 Schema.String.annotate({ "description": "The URL of the page searched for the pattern.\n", "format": "uri" })
1782 ),
1783 "pattern": Schema.optionalKey(
1784 Schema.String.annotate({ "description": "The pattern or text to search for within the page.\n" })
1785 )
1786 }).annotate({
1787 "title": "Find action",
1788 "description": "Action type \"find_in_page\": Searches for a pattern within a loaded page.\n",
1789 "identifier": "WebSearchActionFind"
1790 })
1791 export type ImageGenActionEnum = "generate" | "edit" | "auto"
1792 export const ImageGenActionEnum = Schema.Literals(["generate", "edit", "auto"]).annotate({
1793 "identifier": "ImageGenActionEnum"
1794 })
1795 export type ImageBackground = "transparent" | "opaque" | "auto"
1796 export const ImageBackground = Schema.Literals(["transparent", "opaque", "auto"]).annotate({
1797 "identifier": "ImageBackground"
1798 })
1799 export type ImageOutputFormat = "png" | "webp" | "jpeg"
1800 export const ImageOutputFormat = Schema.Literals(["png", "webp", "jpeg"]).annotate({
1801 "identifier": "ImageOutputFormat"
1802 })
1803 export type ClickButtonType = "left" | "right" | "wheel" | "back" | "forward"
1804 export const ClickButtonType = Schema.Literals(["left", "right", "wheel", "back", "forward"]).annotate({
1805 "identifier": "ClickButtonType"
1806 })
1807 export type DoubleClickAction = {
1808 readonly "type": "double_click"
1809 readonly "x": number
1810 readonly "y": number
1811 readonly "keys": ReadonlyArray<string> | null
1812 }
1813 export const DoubleClickAction = Schema.Struct({
1814 "type": Schema.Literal("double_click").annotate({
1815 "description": "Specifies the event type. For a double click action, this property is always set to `double_click`."
1816 }),
1817 "x": Schema.Number.annotate({ "description": "The x-coordinate where the double click occurred." }).check(
1818 Schema.isInt().annotate({ "expected": "an integer" })
1819 ),
1820 "y": Schema.Number.annotate({ "description": "The y-coordinate where the double click occurred." }).check(
1821 Schema.isInt().annotate({ "expected": "an integer" })
1822 ),
1823 "keys": Schema.Union([
1824 Schema.Array(Schema.String).annotate({ "description": "The keys being held while double-clicking." }),
1825 Schema.Null
1826 ])
1827 }).annotate({ "title": "DoubleClick", "description": "A double click action.", "identifier": "DoubleClickAction" })
1828 export type CoordParam = { readonly "x": number; readonly "y": number }
1829 export const CoordParam = Schema.Struct({
1830 "x": Schema.Number.annotate({ "description": "The x-coordinate." }).check(
1831 Schema.isInt().annotate({ "expected": "an integer" })
1832 ),
1833 "y": Schema.Number.annotate({ "description": "The y-coordinate." }).check(
1834 Schema.isInt().annotate({ "expected": "an integer" })
1835 )
1836 }).annotate({
1837 "title": "Coordinate",
1838 "description": "An x/y coordinate pair, e.g. `{ x: 100, y: 200 }`.",
1839 "identifier": "CoordParam"
1840 })
1841 export type KeyPressAction = { readonly "type": "keypress"; readonly "keys": ReadonlyArray<string> }
1842 export const KeyPressAction = Schema.Struct({
1843 "type": Schema.Literal("keypress").annotate({
1844 "description": "Specifies the event type. For a keypress action, this property is always set to `keypress`."
1845 }),
1846 "keys": Schema.Array(
1847 Schema.String.annotate({ "description": "One of the keys the model is requesting to be pressed." })
1848 ).annotate({
1849 "description":
1850 "The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key."
1851 })
1852 }).annotate({
1853 "title": "KeyPress",
1854 "description": "A collection of keypresses the model would like to perform.",
1855 "identifier": "KeyPressAction"
1856 })
1857 export type MoveParam = {
1858 readonly "type": "move"
1859 readonly "x": number
1860 readonly "y": number
1861 readonly "keys"?: ReadonlyArray<string> | null
1862 }
1863 export const MoveParam = Schema.Struct({
1864 "type": Schema.Literal("move").annotate({
1865 "description": "Specifies the event type. For a move action, this property is always set to `move`."
1866 }),
1867 "x": Schema.Number.annotate({ "description": "The x-coordinate to move to." }).check(
1868 Schema.isInt().annotate({ "expected": "an integer" })
1869 ),
1870 "y": Schema.Number.annotate({ "description": "The y-coordinate to move to." }).check(
1871 Schema.isInt().annotate({ "expected": "an integer" })
1872 ),
1873 "keys": Schema.optionalKey(
1874 Schema.Union([
1875 Schema.Array(Schema.String).annotate({ "description": "The keys being held while moving the mouse." }),
1876 Schema.Null
1877 ])
1878 )
1879 }).annotate({ "title": "Move", "description": "A mouse move action.", "identifier": "MoveParam" })
1880 export type ScreenshotParam = { readonly "type": "screenshot" }
1881 export const ScreenshotParam = Schema.Struct({
1882 "type": Schema.Literal("screenshot").annotate({
1883 "description": "Specifies the event type. For a screenshot action, this property is always set to `screenshot`."
1884 })
1885 }).annotate({ "title": "Screenshot", "description": "A screenshot action.", "identifier": "ScreenshotParam" })
1886 export type ScrollParam = {
1887 readonly "type": "scroll"
1888 readonly "x": number
1889 readonly "y": number
1890 readonly "scroll_x": number
1891 readonly "scroll_y": number
1892 readonly "keys"?: ReadonlyArray<string> | null
1893 }
1894 export const ScrollParam = Schema.Struct({
1895 "type": Schema.Literal("scroll").annotate({
1896 "description": "Specifies the event type. For a scroll action, this property is always set to `scroll`."
1897 }),
1898 "x": Schema.Number.annotate({ "description": "The x-coordinate where the scroll occurred." }).check(
1899 Schema.isInt().annotate({ "expected": "an integer" })
1900 ),
1901 "y": Schema.Number.annotate({ "description": "The y-coordinate where the scroll occurred." }).check(
1902 Schema.isInt().annotate({ "expected": "an integer" })
1903 ),
1904 "scroll_x": Schema.Number.annotate({ "description": "The horizontal scroll distance." }).check(
1905 Schema.isInt().annotate({ "expected": "an integer" })
1906 ),
1907 "scroll_y": Schema.Number.annotate({ "description": "The vertical scroll distance." }).check(
1908 Schema.isInt().annotate({ "expected": "an integer" })
1909 ),
1910 "keys": Schema.optionalKey(
1911 Schema.Union([
1912 Schema.Array(Schema.String).annotate({ "description": "The keys being held while scrolling." }),
1913 Schema.Null
1914 ])
1915 )
1916 }).annotate({ "title": "Scroll", "description": "A scroll action.", "identifier": "ScrollParam" })
1917 export type TypeParam = { readonly "type": "type"; readonly "text": string }
1918 export const TypeParam = Schema.Struct({
1919 "type": Schema.Literal("type").annotate({
1920 "description": "Specifies the event type. For a type action, this property is always set to `type`."
1921 }),
1922 "text": Schema.String.annotate({ "description": "The text to type." })
1923 }).annotate({ "title": "Type", "description": "An action to type in text.", "identifier": "TypeParam" })
1924 export type WaitParam = { readonly "type": "wait" }
1925 export const WaitParam = Schema.Struct({
1926 "type": Schema.Literal("wait").annotate({
1927 "description": "Specifies the event type. For a wait action, this property is always set to `wait`."
1928 })
1929 }).annotate({ "title": "Wait", "description": "A wait action.", "identifier": "WaitParam" })
1930 export type ComputerCallSafetyCheckParam = {
1931 readonly "id": string
1932 readonly "code"?: string | null
1933 readonly "message"?: string | null
1934 }
1935 export const ComputerCallSafetyCheckParam = Schema.Struct({
1936 "id": Schema.String.annotate({ "description": "The ID of the pending safety check." }),
1937 "code": Schema.optionalKey(
1938 Schema.Union([Schema.String.annotate({ "description": "The type of the pending safety check." }), Schema.Null])
1939 ),
1940 "message": Schema.optionalKey(
1941 Schema.Union([Schema.String.annotate({ "description": "Details about the pending safety check." }), Schema.Null])
1942 )
1943 }).annotate({
1944 "description": "A pending safety check for the computer call.",
1945 "identifier": "ComputerCallSafetyCheckParam"
1946 })
1947 export type ComputerScreenshotImage = {
1948 readonly "type": "computer_screenshot"
1949 readonly "image_url"?: string
1950 readonly "file_id"?: string
1951 }
1952 export const ComputerScreenshotImage = Schema.Struct({
1953 "type": Schema.Literal("computer_screenshot").annotate({
1954 "description":
1955 "Specifies the event type. For a computer screenshot, this property is \nalways set to `computer_screenshot`.\n"
1956 }),
1957 "image_url": Schema.optionalKey(
1958 Schema.String.annotate({ "description": "The URL of the screenshot image.", "format": "uri" })
1959 ),
1960 "file_id": Schema.optionalKey(
1961 Schema.String.annotate({ "description": "The identifier of an uploaded file that contains the screenshot." })
1962 )
1963 }).annotate({
1964 "description": "A computer screenshot image used with the computer use tool.\n",
1965 "identifier": "ComputerScreenshotImage"
1966 })
1967 export type ToolSearchExecutionType = "server" | "client"
1968 export const ToolSearchExecutionType = Schema.Literals(["server", "client"]).annotate({
1969 "identifier": "ToolSearchExecutionType"
1970 })
1971 export type FunctionCallStatus = "in_progress" | "completed" | "incomplete"
1972 export const FunctionCallStatus = Schema.Literals(["in_progress", "completed", "incomplete"]).annotate({
1973 "identifier": "FunctionCallStatus"
1974 })
1975 export type CallableToolAllowedCaller = "direct" | "programmatic"
1976 export const CallableToolAllowedCaller = Schema.Literals(["direct", "programmatic"]).annotate({
1977 "identifier": "CallableToolAllowedCaller"
1978 })
1979 export type RankerVersionType = "auto" | "default-2024-11-15"
1980 export const RankerVersionType = Schema.Literals(["auto", "default-2024-11-15"]).annotate({
1981 "identifier": "RankerVersionType"
1982 })
1983 export type HybridSearchOptions = { readonly "embedding_weight": number; readonly "text_weight": number }
1984 export const HybridSearchOptions = Schema.Struct({
1985 "embedding_weight": Schema.Number.annotate({
1986 "description": "The weight of the embedding in the reciprocal ranking fusion."
1987 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
1988 "text_weight": Schema.Number.annotate({ "description": "The weight of the text in the reciprocal ranking fusion." })
1989 .check(Schema.isFinite().annotate({ "expected": "a finite number" }))
1990 }).annotate({ "identifier": "HybridSearchOptions" })
1991 export type ComparisonFilter = {
1992 readonly "type": "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "nin"
1993 readonly "key": string
1994 readonly "value": string | number | boolean | ReadonlyArray<string | number>
1995 }
1996 export const ComparisonFilter = Schema.Struct({
1997 "type": Schema.Literals(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]).annotate({
1998 "description":
1999 "Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.\n- `eq`: equals\n- `ne`: not equal\n- `gt`: greater than\n- `gte`: greater than or equal\n- `lt`: less than\n- `lte`: less than or equal\n- `in`: in\n- `nin`: not in\n"
2000 }),
2001 "key": Schema.String.annotate({ "description": "The key to compare against the value." }),
2002 "value": Schema.Union([
2003 Schema.String,
2004 Schema.Finite,
2005 Schema.Boolean,
2006 Schema.Array(Schema.Union([Schema.String, Schema.Finite], { mode: "oneOf" }))
2007 ], { mode: "oneOf" }).annotate({
2008 "description": "The value to compare against the attribute key; supports string, number, or boolean types."
2009 })
2010 }).annotate({
2011 "title": "Comparison Filter",
2012 "description":
2013 "A filter used to compare a specified attribute key to a given value using a defined comparison operation.\n",
2014 "identifier": "ComparisonFilter"
2015 })
2016 export type ComputerTool = { readonly "type": "computer" }
2017 export const ComputerTool = Schema.Struct({
2018 "type": Schema.Literal("computer").annotate({ "description": "The type of the computer tool. Always `computer`." })
2019 }).annotate({
2020 "title": "Computer",
2021 "description":
2022 "A tool that controls a virtual computer. Learn more about the [computer tool](https://developers.openai.com/api/docs/guides/tools-computer-use).",
2023 "identifier": "ComputerTool"
2024 })
2025 export type ComputerEnvironment = "windows" | "mac" | "linux" | "ubuntu" | "browser"
2026 export const ComputerEnvironment = Schema.Literals(["windows", "mac", "linux", "ubuntu", "browser"]).annotate({
2027 "identifier": "ComputerEnvironment"
2028 })
2029 export type WebSearchApproximateLocation = {
2030 readonly "type"?: "approximate"
2031 readonly "country"?: string | null
2032 readonly "region"?: string | null
2033 readonly "city"?: string | null
2034 readonly "timezone"?: string | null
2035 } | null
2036 export const WebSearchApproximateLocation = Schema.Union([
2037 Schema.Struct({
2038 "type": Schema.optionalKey(
2039 Schema.Literal("approximate").annotate({
2040 "description": "The type of location approximation. Always `approximate`."
2041 })
2042 ),
2043 "country": Schema.optionalKey(
2044 Schema.Union([
2045 Schema.String.annotate({
2046 "description":
2047 "The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`."
2048 }),
2049 Schema.Null
2050 ])
2051 ),
2052 "region": Schema.optionalKey(
2053 Schema.Union([
2054 Schema.String.annotate({ "description": "Free text input for the region of the user, e.g. `California`." }),
2055 Schema.Null
2056 ])
2057 ),
2058 "city": Schema.optionalKey(
2059 Schema.Union([
2060 Schema.String.annotate({ "description": "Free text input for the city of the user, e.g. `San Francisco`." }),
2061 Schema.Null
2062 ])
2063 ),
2064 "timezone": Schema.optionalKey(
2065 Schema.Union([
2066 Schema.String.annotate({
2067 "description":
2068 "The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`."
2069 }),
2070 Schema.Null
2071 ])
2072 )
2073 }).annotate({ "title": "Web search approximate location", "description": "The approximate location of the user.\n" }),
2074 Schema.Null
2075 ]).annotate({ "identifier": "WebSearchApproximateLocation" })
2076 export type MCPToolFilter = { readonly "tool_names"?: ReadonlyArray<string>; readonly "read_only"?: boolean }
2077 export const MCPToolFilter = Schema.Struct({
2078 "tool_names": Schema.optionalKey(
2079 Schema.Array(Schema.String).annotate({ "title": "MCP allowed tools", "description": "List of allowed tool names." })
2080 ),
2081 "read_only": Schema.optionalKey(
2082 Schema.Boolean.annotate({
2083 "description":
2084 "Indicates whether or not a tool modifies data or is read-only. If an\nMCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),\nit will match this filter.\n"
2085 })
2086 )
2087 }).annotate({
2088 "title": "MCP tool filter",
2089 "description": "A filter object to specify which tools are allowed.\n",
2090 "identifier": "MCPToolFilter"
2091 })
2092 export type ContainerMemoryLimit = "1g" | "4g" | "16g" | "64g"
2093 export const ContainerMemoryLimit = Schema.Literals(["1g", "4g", "16g", "64g"]).annotate({
2094 "identifier": "ContainerMemoryLimit"
2095 })
2096 export type ProgrammaticToolCallingParam = { readonly "type": "programmatic_tool_calling" }
2097 export const ProgrammaticToolCallingParam = Schema.Struct({
2098 "type": Schema.Literal("programmatic_tool_calling").annotate({
2099 "description": "The type of the tool. Always `programmatic_tool_calling`."
2100 })
2101 }).annotate({ "identifier": "ProgrammaticToolCallingParam" })
2102 export type InputFidelity = "high" | "low"
2103 export const InputFidelity = Schema.Literals(["high", "low"]).annotate({
2104 "description":
2105 "Control how much effort the model will exert to match the style and features, especially facial features, of input images. Supports `high` and `low` on `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.",
2106 "identifier": "InputFidelity"
2107 })
2108 export type LocalShellToolParam = { readonly "type": "local_shell" }
2109 export const LocalShellToolParam = Schema.Struct({
2110 "type": Schema.Literal("local_shell").annotate({
2111 "description": "The type of the local shell tool. Always `local_shell`."
2112 })
2113 }).annotate({
2114 "title": "Local shell tool",
2115 "description": "A tool that allows the model to execute shell commands in a local environment.",
2116 "identifier": "LocalShellToolParam"
2117 })
2118 export type LocalSkillParam = { readonly "name": string; readonly "description": string; readonly "path": string }
2119 export const LocalSkillParam = Schema.Struct({
2120 "name": Schema.String.annotate({ "description": "The name of the skill." }),
2121 "description": Schema.String.annotate({ "description": "The description of the skill." }),
2122 "path": Schema.String.annotate({ "description": "The path to the directory containing the skill." })
2123 }).annotate({ "identifier": "LocalSkillParam" })
2124 export type ContainerReferenceParam = { readonly "type": "container_reference"; readonly "container_id": string }
2125 export const ContainerReferenceParam = Schema.Struct({
2126 "type": Schema.Literal("container_reference").annotate({
2127 "description": "References a container created with the /v1/containers endpoint"
2128 }),
2129 "container_id": Schema.String.annotate({ "description": "The ID of the referenced container." })
2130 }).annotate({ "identifier": "ContainerReferenceParam" })
2131 export type CustomTextFormatParam = { readonly "type": "text" }
2132 export const CustomTextFormatParam = Schema.Struct({
2133 "type": Schema.Literal("text").annotate({ "description": "Unconstrained text format. Always `text`." })
2134 }).annotate({
2135 "title": "Text format",
2136 "description": "Unconstrained free-form text.",
2137 "identifier": "CustomTextFormatParam"
2138 })
2139 export type GrammarSyntax1 = "lark" | "regex"
2140 export const GrammarSyntax1 = Schema.Literals(["lark", "regex"]).annotate({ "identifier": "GrammarSyntax1" })
2141 export type EmptyModelParam = { readonly [x: string]: Schema.Json }
2142 export const EmptyModelParam = Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))
2143 .annotate({ "identifier": "EmptyModelParam" })
2144 export type ApproximateLocation = {
2145 readonly "type": "approximate"
2146 readonly "country"?: string | null
2147 readonly "region"?: string | null
2148 readonly "city"?: string | null
2149 readonly "timezone"?: string | null
2150 }
2151 export const ApproximateLocation = Schema.Struct({
2152 "type": Schema.Literal("approximate").annotate({
2153 "description": "The type of location approximation. Always `approximate`."
2154 }),
2155 "country": Schema.optionalKey(
2156 Schema.Union([
2157 Schema.String.annotate({
2158 "description":
2159 "The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`."
2160 }),
2161 Schema.Null
2162 ])
2163 ),
2164 "region": Schema.optionalKey(
2165 Schema.Union([
2166 Schema.String.annotate({ "description": "Free text input for the region of the user, e.g. `California`." }),
2167 Schema.Null
2168 ])
2169 ),
2170 "city": Schema.optionalKey(
2171 Schema.Union([
2172 Schema.String.annotate({ "description": "Free text input for the city of the user, e.g. `San Francisco`." }),
2173 Schema.Null
2174 ])
2175 ),
2176 "timezone": Schema.optionalKey(
2177 Schema.Union([
2178 Schema.String.annotate({
2179 "description":
2180 "The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`."
2181 }),
2182 Schema.Null
2183 ])
2184 )
2185 }).annotate({ "identifier": "ApproximateLocation" })
2186 export type SearchContextSize = "low" | "medium" | "high"
2187 export const SearchContextSize = Schema.Literals(["low", "medium", "high"]).annotate({
2188 "identifier": "SearchContextSize"
2189 })
2190 export type SearchContentType = "text" | "image"
2191 export const SearchContentType = Schema.Literals(["text", "image"]).annotate({ "identifier": "SearchContentType" })
2192 export type FunctionCallOutputStatusEnum = "in_progress" | "completed" | "incomplete"
2193 export const FunctionCallOutputStatusEnum = Schema.Literals(["in_progress", "completed", "incomplete"]).annotate({
2194 "identifier": "FunctionCallOutputStatusEnum"
2195 })
2196 export type Program = {
2197 readonly "type": "program"
2198 readonly "id": string
2199 readonly "call_id": string
2200 readonly "code": string
2201 readonly "fingerprint": string
2202 }
2203 export const Program = Schema.Struct({
2204 "type": Schema.Literal("program").annotate({ "description": "The type of the item. Always `program`." }),
2205 "id": Schema.String.annotate({ "description": "The unique ID of the program item." }),
2206 "call_id": Schema.String.annotate({ "description": "The stable call ID of the program item." }),
2207 "code": Schema.String.annotate({ "description": "The JavaScript source executed by programmatic tool calling." }),
2208 "fingerprint": Schema.String.annotate({
2209 "description": "Opaque program replay fingerprint that must be round-tripped."
2210 })
2211 }).annotate({ "identifier": "Program" })
2212 export type ProgramOutputStatus = "completed" | "incomplete"
2213 export const ProgramOutputStatus = Schema.Literals(["completed", "incomplete"]).annotate({
2214 "identifier": "ProgramOutputStatus"
2215 })
2216 export type CompactionBody = {
2217 readonly "type": "compaction"
2218 readonly "id": string
2219 readonly "encrypted_content": string
2220 readonly "created_by"?: string
2221 }
2222 export const CompactionBody = Schema.Struct({
2223 "type": Schema.Literal("compaction").annotate({ "description": "The type of the item. Always `compaction`." }),
2224 "id": Schema.String.annotate({ "description": "The unique ID of the compaction item." }),
2225 "encrypted_content": Schema.String.annotate({
2226 "description": "The encrypted content that was produced by compaction."
2227 }),
2228 "created_by": Schema.optionalKey(
2229 Schema.String.annotate({ "description": "The identifier of the actor that created the item." })
2230 )
2231 }).annotate({
2232 "title": "Compaction item",
2233 "description":
2234 "A compaction item generated by the [`v1/responses/compact` API](https://developers.openai.com/api/reference/resources/responses/methods/compact).",
2235 "identifier": "CompactionBody"
2236 })
2237 export type CodeInterpreterOutputLogs = { readonly "type": "logs"; readonly "logs": string }
2238 export const CodeInterpreterOutputLogs = Schema.Struct({
2239 "type": Schema.Literal("logs").annotate({ "description": "The type of the output. Always `logs`." }),
2240 "logs": Schema.String.annotate({ "description": "The logs output from the code interpreter." })
2241 }).annotate({
2242 "title": "Code interpreter output logs",
2243 "description": "The logs output from the code interpreter.",
2244 "identifier": "CodeInterpreterOutputLogs"
2245 })
2246 export type CodeInterpreterOutputImage = { readonly "type": "image"; readonly "url": string }
2247 export const CodeInterpreterOutputImage = Schema.Struct({
2248 "type": Schema.Literal("image").annotate({ "description": "The type of the output. Always `image`." }),
2249 "url": Schema.String.annotate({
2250 "description": "The URL of the image output from the code interpreter.",
2251 "format": "uri"
2252 })
2253 }).annotate({
2254 "title": "Code interpreter output image",
2255 "description": "The image output from the code interpreter.",
2256 "identifier": "CodeInterpreterOutputImage"
2257 })
2258 export type LocalShellExecAction = {
2259 readonly "type": "exec"
2260 readonly "command": ReadonlyArray<string>
2261 readonly "timeout_ms"?: number | null
2262 readonly "working_directory"?: string | null
2263 readonly "env": { readonly [x: string]: string }
2264 readonly "user"?: string | null
2265 }
2266 export const LocalShellExecAction = Schema.Struct({
2267 "type": Schema.Literal("exec").annotate({ "description": "The type of the local shell action. Always `exec`." }),
2268 "command": Schema.Array(Schema.String).annotate({ "description": "The command to run." }),
2269 "timeout_ms": Schema.optionalKey(
2270 Schema.Union([
2271 Schema.Number.annotate({ "description": "Optional timeout in milliseconds for the command." }).check(
2272 Schema.isInt().annotate({ "expected": "an integer" })
2273 ),
2274 Schema.Null
2275 ])
2276 ),
2277 "working_directory": Schema.optionalKey(
2278 Schema.Union([
2279 Schema.String.annotate({ "description": "Optional working directory to run the command in." }),
2280 Schema.Null
2281 ])
2282 ),
2283 "env": Schema.Record(Schema.String, Schema.String).annotate({
2284 "description": "Environment variables to set for the command."
2285 }),
2286 "user": Schema.optionalKey(
2287 Schema.Union([Schema.String.annotate({ "description": "Optional user to run the command as." }), Schema.Null])
2288 )
2289 }).annotate({
2290 "title": "Local shell exec action",
2291 "description": "Execute a shell command on the server.",
2292 "identifier": "LocalShellExecAction"
2293 })
2294 export type LocalShellToolCallOutput = {
2295 readonly "type": "local_shell_call_output"
2296 readonly "id": string
2297 readonly "output": string
2298 readonly "status"?: "in_progress" | "completed" | "incomplete" | null
2299 readonly "call_id": Schema.Json
2300 }
2301 export const LocalShellToolCallOutput = Schema.Struct({
2302 "type": Schema.Literal("local_shell_call_output").annotate({
2303 "description": "The type of the local shell tool call output. Always `local_shell_call_output`.\n"
2304 }),
2305 "id": Schema.String.annotate({
2306 "description": "The unique ID of the local shell tool call generated by the model.\n"
2307 }),
2308 "output": Schema.String.annotate({ "description": "A JSON string of the output of the local shell tool call.\n" }),
2309 "status": Schema.optionalKey(
2310 Schema.Union([
2311 Schema.Literals(["in_progress", "completed", "incomplete"]).annotate({
2312 "description": "The status of the item. One of `in_progress`, `completed`, or `incomplete`.\n"
2313 }),
2314 Schema.Null
2315 ])
2316 ),
2317 "call_id": Schema.Json.annotate({ "expected": "JSON value" })
2318 }).annotate({
2319 "title": "Local shell call output",
2320 "description": "The output of a local shell tool call.\n",
2321 "identifier": "LocalShellToolCallOutput"
2322 })
2323 export type FunctionShellAction = {
2324 readonly "commands": ReadonlyArray<string>
2325 readonly "timeout_ms": number | null
2326 readonly "max_output_length": number | null
2327 }
2328 export const FunctionShellAction = Schema.Struct({
2329 "commands": Schema.Array(Schema.String.annotate({ "description": "A list of commands to run." })),
2330 "timeout_ms": Schema.Union([
2331 Schema.Number.annotate({ "description": "Optional timeout in milliseconds for the commands." }).check(
2332 Schema.isInt().annotate({ "expected": "an integer" })
2333 ),
2334 Schema.Null
2335 ]),
2336 "max_output_length": Schema.Union([
2337 Schema.Number.annotate({ "description": "Optional maximum number of characters to return from each command." })
2338 .check(Schema.isInt().annotate({ "expected": "an integer" })),
2339 Schema.Null
2340 ])
2341 }).annotate({
2342 "title": "Shell exec action",
2343 "description": "Execute a shell command.",
2344 "identifier": "FunctionShellAction"
2345 })
2346 export type FunctionShellCallStatus = "in_progress" | "completed" | "incomplete"
2347 export const FunctionShellCallStatus = Schema.Literals(["in_progress", "completed", "incomplete"]).annotate({
2348 "identifier": "FunctionShellCallStatus"
2349 })
2350 export type LocalEnvironmentResource = { readonly "type": "local" }
2351 export const LocalEnvironmentResource = Schema.Struct({
2352 "type": Schema.Literal("local").annotate({ "description": "The environment type. Always `local`." })
2353 }).annotate({
2354 "title": "Local Environment",
2355 "description": "Represents the use of a local environment to perform shell actions.",
2356 "identifier": "LocalEnvironmentResource"
2357 })
2358 export type ContainerReferenceResource = { readonly "type": "container_reference"; readonly "container_id": string }
2359 export const ContainerReferenceResource = Schema.Struct({
2360 "type": Schema.Literal("container_reference").annotate({
2361 "description": "The environment type. Always `container_reference`."
2362 }),
2363 "container_id": Schema.String
2364 }).annotate({
2365 "title": "Container Reference",
2366 "description": "Represents a container created with /v1/containers.",
2367 "identifier": "ContainerReferenceResource"
2368 })
2369 export type FunctionShellCallOutputStatusEnum = "in_progress" | "completed" | "incomplete"
2370 export const FunctionShellCallOutputStatusEnum = Schema.Literals(["in_progress", "completed", "incomplete"]).annotate({
2371 "identifier": "FunctionShellCallOutputStatusEnum"
2372 })
2373 export type FunctionShellCallOutputTimeoutOutcome = { readonly "type": "timeout" }
2374 export const FunctionShellCallOutputTimeoutOutcome = Schema.Struct({
2375 "type": Schema.Literal("timeout").annotate({ "description": "The outcome type. Always `timeout`." })
2376 }).annotate({
2377 "title": "Shell call timeout outcome",
2378 "description": "Indicates that the shell call exceeded its configured time limit.",
2379 "identifier": "FunctionShellCallOutputTimeoutOutcome"
2380 })
2381 export type FunctionShellCallOutputExitOutcome = { readonly "type": "exit"; readonly "exit_code": number }
2382 export const FunctionShellCallOutputExitOutcome = Schema.Struct({
2383 "type": Schema.Literal("exit").annotate({ "description": "The outcome type. Always `exit`." }),
2384 "exit_code": Schema.Number.annotate({ "description": "Exit code from the shell process." }).check(
2385 Schema.isInt().annotate({ "expected": "an integer" })
2386 )
2387 }).annotate({
2388 "title": "Shell call exit outcome",
2389 "description": "Indicates that the shell commands finished and returned an exit code.",
2390 "identifier": "FunctionShellCallOutputExitOutcome"
2391 })
2392 export type ApplyPatchCallStatus = "in_progress" | "completed"
2393 export const ApplyPatchCallStatus = Schema.Literals(["in_progress", "completed"]).annotate({
2394 "identifier": "ApplyPatchCallStatus"
2395 })
2396 export type ApplyPatchCreateFileOperation = {
2397 readonly "type": "create_file"
2398 readonly "path": string
2399 readonly "diff": string
2400 }
2401 export const ApplyPatchCreateFileOperation = Schema.Struct({
2402 "type": Schema.Literal("create_file").annotate({ "description": "Create a new file with the provided diff." }),
2403 "path": Schema.String.annotate({ "description": "Path of the file to create." }),
2404 "diff": Schema.String.annotate({ "description": "Diff to apply." })
2405 }).annotate({
2406 "title": "Apply patch create file operation",
2407 "description": "Instruction describing how to create a file via the apply_patch tool.",
2408 "identifier": "ApplyPatchCreateFileOperation"
2409 })
2410 export type ApplyPatchDeleteFileOperation = { readonly "type": "delete_file"; readonly "path": string }
2411 export const ApplyPatchDeleteFileOperation = Schema.Struct({
2412 "type": Schema.Literal("delete_file").annotate({ "description": "Delete the specified file." }),
2413 "path": Schema.String.annotate({ "description": "Path of the file to delete." })
2414 }).annotate({
2415 "title": "Apply patch delete file operation",
2416 "description": "Instruction describing how to delete a file via the apply_patch tool.",
2417 "identifier": "ApplyPatchDeleteFileOperation"
2418 })
2419 export type ApplyPatchUpdateFileOperation = {
2420 readonly "type": "update_file"
2421 readonly "path": string
2422 readonly "diff": string
2423 }
2424 export const ApplyPatchUpdateFileOperation = Schema.Struct({
2425 "type": Schema.Literal("update_file").annotate({ "description": "Update an existing file with the provided diff." }),
2426 "path": Schema.String.annotate({ "description": "Path of the file to update." }),
2427 "diff": Schema.String.annotate({ "description": "Diff to apply." })
2428 }).annotate({
2429 "title": "Apply patch update file operation",
2430 "description": "Instruction describing how to update a file via the apply_patch tool.",
2431 "identifier": "ApplyPatchUpdateFileOperation"
2432 })
2433 export type ApplyPatchCallOutputStatus = "completed" | "failed"
2434 export const ApplyPatchCallOutputStatus = Schema.Literals(["completed", "failed"]).annotate({
2435 "identifier": "ApplyPatchCallOutputStatus"
2436 })
2437 export type MCPListToolsTool = {
2438 readonly "name": string
2439 readonly "description"?: string | null
2440 readonly "input_schema": { readonly [x: string]: Schema.Json }
2441 readonly "annotations"?: { readonly [x: string]: Schema.Json } | null
2442 }
2443 export const MCPListToolsTool = Schema.Struct({
2444 "name": Schema.String.annotate({ "description": "The name of the tool.\n" }),
2445 "description": Schema.optionalKey(
2446 Schema.Union([Schema.String.annotate({ "description": "The description of the tool.\n" }), Schema.Null])
2447 ),
2448 "input_schema": Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })).annotate({
2449 "description": "The JSON schema describing the tool's input.\n"
2450 }),
2451 "annotations": Schema.optionalKey(
2452 Schema.Union([
2453 Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })).annotate({
2454 "description": "Additional annotations about the tool.\n"
2455 }),
2456 Schema.Null
2457 ])
2458 )
2459 }).annotate({
2460 "title": "MCP list tools tool",
2461 "description": "A tool available on an MCP server.\n",
2462 "identifier": "MCPListToolsTool"
2463 })
2464 export type MCPApprovalRequest = {
2465 readonly "type": "mcp_approval_request"
2466 readonly "id": string
2467 readonly "server_label": string
2468 readonly "name": string
2469 readonly "arguments": string
2470 }
2471 export const MCPApprovalRequest = Schema.Struct({
2472 "type": Schema.Literal("mcp_approval_request").annotate({
2473 "description": "The type of the item. Always `mcp_approval_request`.\n"
2474 }),
2475 "id": Schema.String.annotate({ "description": "The unique ID of the approval request.\n" }),
2476 "server_label": Schema.String.annotate({ "description": "The label of the MCP server making the request.\n" }),
2477 "name": Schema.String.annotate({ "description": "The name of the tool to run.\n" }),
2478 "arguments": Schema.String.annotate({ "description": "A JSON string of arguments for the tool.\n" })
2479 }).annotate({
2480 "title": "MCP approval request",
2481 "description": "A request for human approval of a tool invocation.\n",
2482 "identifier": "MCPApprovalRequest"
2483 })
2484 export type MCPApprovalResponseResource = {
2485 readonly "type": "mcp_approval_response"
2486 readonly "id": string
2487 readonly "approval_request_id": string
2488 readonly "approve": boolean
2489 readonly "reason"?: string | null
2490 readonly "request_id": Schema.Json
2491 }
2492 export const MCPApprovalResponseResource = Schema.Struct({
2493 "type": Schema.Literal("mcp_approval_response").annotate({
2494 "description": "The type of the item. Always `mcp_approval_response`.\n"
2495 }),
2496 "id": Schema.String.annotate({ "description": "The unique ID of the approval response\n" }),
2497 "approval_request_id": Schema.String.annotate({ "description": "The ID of the approval request being answered.\n" }),
2498 "approve": Schema.Boolean.annotate({ "description": "Whether the request was approved.\n" }),
2499 "reason": Schema.optionalKey(
2500 Schema.Union([Schema.String.annotate({ "description": "Optional reason for the decision.\n" }), Schema.Null])
2501 ),
2502 "request_id": Schema.Json.annotate({ "expected": "JSON value" })
2503 }).annotate({
2504 "title": "MCP approval response",
2505 "description": "A response to an MCP approval request.\n",
2506 "identifier": "MCPApprovalResponseResource"
2507 })
2508 export type MCPProtocolError = {
2509 readonly "type": "mcp_protocol_error"
2510 readonly "code": number
2511 readonly "message": string
2512 }
2513 export const MCPProtocolError = Schema.Struct({
2514 "type": Schema.Literal("mcp_protocol_error"),
2515 "code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2516 "message": Schema.String
2517 }).annotate({ "identifier": "MCPProtocolError" })
2518 export type MCPToolExecutionError = { readonly "type": "mcp_tool_execution_error"; readonly "content": Schema.Json }
2519 export const MCPToolExecutionError = Schema.Struct({
2520 "type": Schema.Literal("mcp_tool_execution_error"),
2521 "content": Schema.Json.annotate({ "expected": "JSON value" })
2522 }).annotate({ "identifier": "MCPToolExecutionError" })
2523 export type HTTPError = { readonly "type": "http_error"; readonly "code": number; readonly "message": string }
2524 export const HTTPError = Schema.Struct({
2525 "type": Schema.Literal("http_error"),
2526 "code": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
2527 "message": Schema.String
2528 }).annotate({ "identifier": "HTTPError" })
2529 export type MCPToolCallStatus = "in_progress" | "completed" | "incomplete" | "calling" | "failed"
2530 export const MCPToolCallStatus = Schema.Literals(["in_progress", "completed", "incomplete", "calling", "failed"])
2531 .annotate({ "identifier": "MCPToolCallStatus" })
2532 export type MessagePhase = "commentary" | "final_answer"
2533 export const MessagePhase = Schema.Literals(["commentary", "final_answer"]).annotate({
2534 "description":
2535 "Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`).\nFor models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend\nphase on all assistant messages — dropping it can degrade performance. Not used for user messages.\n",
2536 "identifier": "MessagePhase"
2537 })
2538 export type FunctionCallItemStatus = "in_progress" | "completed" | "incomplete"
2539 export const FunctionCallItemStatus = Schema.Literals(["in_progress", "completed", "incomplete"]).annotate({
2540 "identifier": "FunctionCallItemStatus"
2541 })
2542 export type DetailEnum = "low" | "high" | "auto" | "original"
2543 export const DetailEnum = Schema.Literals(["low", "high", "auto", "original"]).annotate({ "identifier": "DetailEnum" })
2544 export type FileDetailEnum = "auto" | "low" | "high"
2545 export const FileDetailEnum = Schema.Literals(["auto", "low", "high"]).annotate({ "identifier": "FileDetailEnum" })
2546 export type FunctionShellActionParam = {
2547 readonly "commands": ReadonlyArray<string>
2548 readonly "timeout_ms"?: number | null
2549 readonly "max_output_length"?: number | null
2550 }
2551 export const FunctionShellActionParam = Schema.Struct({
2552 "commands": Schema.Array(Schema.String).annotate({
2553 "description": "Ordered shell commands for the execution environment to run."
2554 }),
2555 "timeout_ms": Schema.optionalKey(
2556 Schema.Union([
2557 Schema.Number.annotate({
2558 "description": "Maximum wall-clock time in milliseconds to allow the shell commands to run."
2559 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
2560 Schema.Null
2561 ])
2562 ),
2563 "max_output_length": Schema.optionalKey(
2564 Schema.Union([
2565 Schema.Number.annotate({
2566 "description": "Maximum number of UTF-8 characters to capture from combined stdout and stderr output."
2567 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
2568 Schema.Null
2569 ])
2570 )
2571 }).annotate({
2572 "title": "Shell action",
2573 "description": "Commands and limits describing how to run the shell tool call.",
2574 "identifier": "FunctionShellActionParam"
2575 })
2576 export type FunctionShellCallItemStatus = "in_progress" | "completed" | "incomplete"
2577 export const FunctionShellCallItemStatus = Schema.Literals(["in_progress", "completed", "incomplete"]).annotate({
2578 "title": "Shell call status",
2579 "description": "Status values reported for shell tool calls.",
2580 "identifier": "FunctionShellCallItemStatus"
2581 })
2582 export type FunctionShellCallOutputTimeoutOutcomeParam = { readonly "type": "timeout" }
2583 export const FunctionShellCallOutputTimeoutOutcomeParam = Schema.Struct({
2584 "type": Schema.Literal("timeout").annotate({ "description": "The outcome type. Always `timeout`." })
2585 }).annotate({
2586 "title": "Shell call timeout outcome",
2587 "description": "Indicates that the shell call exceeded its configured time limit.",
2588 "identifier": "FunctionShellCallOutputTimeoutOutcomeParam"
2589 })
2590 export type FunctionShellCallOutputExitOutcomeParam = { readonly "type": "exit"; readonly "exit_code": number }
2591 export const FunctionShellCallOutputExitOutcomeParam = Schema.Struct({
2592 "type": Schema.Literal("exit").annotate({ "description": "The outcome type. Always `exit`." }),
2593 "exit_code": Schema.Number.annotate({ "description": "The exit code returned by the shell process." }).check(
2594 Schema.isInt().annotate({ "expected": "an integer" })
2595 )
2596 }).annotate({
2597 "title": "Shell call exit outcome",
2598 "description": "Indicates that the shell commands finished and returned an exit code.",
2599 "identifier": "FunctionShellCallOutputExitOutcomeParam"
2600 })
2601 export type ApplyPatchCallStatusParam = "in_progress" | "completed"
2602 export const ApplyPatchCallStatusParam = Schema.Literals(["in_progress", "completed"]).annotate({
2603 "title": "Apply patch call status",
2604 "description": "Status values reported for apply_patch tool calls.",
2605 "identifier": "ApplyPatchCallStatusParam"
2606 })
2607 export type ApplyPatchCreateFileOperationParam = {
2608 readonly "type": "create_file"
2609 readonly "path": string
2610 readonly "diff": string
2611 }
2612 export const ApplyPatchCreateFileOperationParam = Schema.Struct({
2613 "type": Schema.Literal("create_file").annotate({ "description": "The operation type. Always `create_file`." }),
2614 "path": Schema.String.annotate({ "description": "Path of the file to create relative to the workspace root." }).check(
2615 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
2616 ),
2617 "diff": Schema.String.annotate({ "description": "Unified diff content to apply when creating the file." }).check(
2618 Schema.isMaxCodePoints(10485760).annotate({ "expected": "a string with at most 10485760 code points" })
2619 )
2620 }).annotate({
2621 "title": "Apply patch create file operation",
2622 "description": "Instruction for creating a new file via the apply_patch tool.",
2623 "identifier": "ApplyPatchCreateFileOperationParam"
2624 })
2625 export type ApplyPatchDeleteFileOperationParam = { readonly "type": "delete_file"; readonly "path": string }
2626 export const ApplyPatchDeleteFileOperationParam = Schema.Struct({
2627 "type": Schema.Literal("delete_file").annotate({ "description": "The operation type. Always `delete_file`." }),
2628 "path": Schema.String.annotate({ "description": "Path of the file to delete relative to the workspace root." }).check(
2629 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
2630 )
2631 }).annotate({
2632 "title": "Apply patch delete file operation",
2633 "description": "Instruction for deleting an existing file via the apply_patch tool.",
2634 "identifier": "ApplyPatchDeleteFileOperationParam"
2635 })
2636 export type ApplyPatchUpdateFileOperationParam = {
2637 readonly "type": "update_file"
2638 readonly "path": string
2639 readonly "diff": string
2640 }
2641 export const ApplyPatchUpdateFileOperationParam = Schema.Struct({
2642 "type": Schema.Literal("update_file").annotate({ "description": "The operation type. Always `update_file`." }),
2643 "path": Schema.String.annotate({ "description": "Path of the file to update relative to the workspace root." }).check(
2644 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
2645 ),
2646 "diff": Schema.String.annotate({ "description": "Unified diff content to apply to the existing file." }).check(
2647 Schema.isMaxCodePoints(10485760).annotate({ "expected": "a string with at most 10485760 code points" })
2648 )
2649 }).annotate({
2650 "title": "Apply patch update file operation",
2651 "description": "Instruction for updating an existing file via the apply_patch tool.",
2652 "identifier": "ApplyPatchUpdateFileOperationParam"
2653 })
2654 export type ApplyPatchCallOutputStatusParam = "completed" | "failed"
2655 export const ApplyPatchCallOutputStatusParam = Schema.Literals(["completed", "failed"]).annotate({
2656 "title": "Apply patch call output status",
2657 "description": "Outcome values reported for apply_patch tool call outputs.",
2658 "identifier": "ApplyPatchCallOutputStatusParam"
2659 })
2660 export type CompactionTriggerItemParam = { readonly "id"?: string | null; readonly "type": "compaction_trigger" }
2661 export const CompactionTriggerItemParam = Schema.Struct({
2662 "id": Schema.optionalKey(
2663 Schema.Union([Schema.String.annotate({ "description": "The unique ID of this compaction trigger." }), Schema.Null])
2664 ),
2665 "type": Schema.Literal("compaction_trigger").annotate({
2666 "description": "The type of the item. Always `compaction_trigger`."
2667 })
2668 }).annotate({
2669 "title": "Compaction trigger",
2670 "description": "Compacts the current context. Must be the final input item.",
2671 "identifier": "CompactionTriggerItemParam"
2672 })
2673 export type ItemReferenceParam = { readonly "type"?: "item_reference" | null; readonly "id": string }
2674 export const ItemReferenceParam = Schema.Struct({
2675 "type": Schema.optionalKey(
2676 Schema.Union([
2677 Schema.Literal("item_reference").annotate({
2678 "description": "The type of item to reference. Always `item_reference`."
2679 }),
2680 Schema.Null
2681 ])
2682 ),
2683 "id": Schema.String.annotate({ "description": "The ID of the item to reference." })
2684 }).annotate({
2685 "title": "Item reference",
2686 "description": "An internal identifier for an item to reference.",
2687 "identifier": "ItemReferenceParam"
2688 })
2689 export type ProgramItemParam = {
2690 readonly "id": string
2691 readonly "type": "program"
2692 readonly "call_id": string
2693 readonly "code": string
2694 readonly "fingerprint": string
2695 }
2696 export const ProgramItemParam = Schema.Struct({
2697 "id": Schema.String.annotate({ "description": "The unique ID of this program item." }),
2698 "type": Schema.Literal("program").annotate({ "description": "The item type. Always `program`." }),
2699 "call_id": Schema.String.annotate({ "description": "The stable call ID of the program item." }).check(
2700 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
2701 ).check(Schema.isMaxCodePoints(64).annotate({ "expected": "a string with at most 64 code points" })),
2702 "code": Schema.String.annotate({ "description": "The JavaScript source executed by programmatic tool calling." })
2703 .check(Schema.isMaxCodePoints(10485760).annotate({ "expected": "a string with at most 10485760 code points" })),
2704 "fingerprint": Schema.String.annotate({
2705 "description": "Opaque program replay fingerprint that must be round-tripped."
2706 }).check(Schema.isMaxCodePoints(10485760).annotate({ "expected": "a string with at most 10485760 code points" }))
2707 }).annotate({ "identifier": "ProgramItemParam" })
2708 export type ProgramOutputItemStatus = "completed" | "incomplete"
2709 export const ProgramOutputItemStatus = Schema.Literals(["completed", "incomplete"]).annotate({
2710 "identifier": "ProgramOutputItemStatus"
2711 })
2712 export type ConversationResource = {
2713 readonly "id": string
2714 readonly "object": "conversation"
2715 readonly "metadata": { readonly [x: string]: string }
2716 readonly "created_at": number
2717 }
2718 export const ConversationResource = Schema.Struct({
2719 "id": Schema.String.annotate({ "description": "The unique ID of the conversation." }),
2720 "object": Schema.Literal("conversation").annotate({
2721 "description": "The object type, which is always `conversation`."
2722 }),
2723 "metadata": Schema.Record(Schema.String, Schema.String).annotate({
2724 "description":
2725 "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters."
2726 }),
2727 "created_at": Schema.Number.annotate({
2728 "description": "The time at which the conversation was created, measured in seconds since the Unix epoch.",
2729 "format": "unixtime"
2730 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
2731 }).annotate({ "identifier": "ConversationResource" })
2732 export type CreateEmbeddingRequest = {
2733 readonly "input": string | ReadonlyArray<string> | ReadonlyArray<number> | ReadonlyArray<ReadonlyArray<number>>
2734 readonly "model": string | "text-embedding-ada-002" | "text-embedding-3-small" | "text-embedding-3-large"
2735 readonly "encoding_format"?: "float" | "base64"
2736 readonly "dimensions"?: number
2737 readonly "user"?: string
2738 }
2739 export const CreateEmbeddingRequest = Schema.Struct({
2740 "input": Schema.Union([
2741 Schema.String.annotate({ "title": "string", "description": "The string that will be turned into an embedding." }),
2742 Schema.Array(Schema.String).annotate({
2743 "title": "array",
2744 "description": "The array of strings that will be turned into an embedding."
2745 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(
2746 Schema.isMaxLength(2048).annotate({ "expected": "a value with a length of at most 2048" })
2747 ),
2748 Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))).annotate({
2749 "title": "array",
2750 "description": "The array of integers that will be turned into an embedding."
2751 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(
2752 Schema.isMaxLength(2048).annotate({ "expected": "a value with a length of at most 2048" })
2753 ),
2754 Schema.Array(
2755 Schema.Array(Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" }))).check(
2756 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
2757 )
2758 ).annotate({
2759 "title": "array",
2760 "description": "The array of arrays containing integers that will be turned into an embedding."
2761 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(
2762 Schema.isMaxLength(2048).annotate({ "expected": "a value with a length of at most 2048" })
2763 )
2764 ], { mode: "oneOf" }).annotate({
2765 "description":
2766 "Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for all embedding models), cannot be an empty string, and any array must be 2048 dimensions or less. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. In addition to the per-input token limit, all embedding models enforce a maximum of 300,000 tokens summed across all inputs in a single request.\n"
2767 }),
2768 "model": Schema.Union([
2769 Schema.String,
2770 Schema.Literals(["text-embedding-ada-002", "text-embedding-3-small", "text-embedding-3-large"])
2771 ]).annotate({
2772 "description":
2773 "ID of the model to use. You can use the [List models](https://developers.openai.com/api/reference/resources/models/methods/list) API to see all of your available models, or see our [Model overview](https://developers.openai.com/api/docs/models) for descriptions of them.\n"
2774 }),
2775 "encoding_format": Schema.optionalKey(
2776 Schema.Literals(["float", "base64"]).annotate({
2777 "description":
2778 "The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/)."
2779 })
2780 ),
2781 "dimensions": Schema.optionalKey(
2782 Schema.Number.annotate({
2783 "description":
2784 "The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models.\n"
2785 }).check(Schema.isInt().annotate({ "expected": "an integer" })).check(
2786 Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })
2787 )
2788 ),
2789 "user": Schema.optionalKey(
2790 Schema.String.annotate({
2791 "description":
2792 "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers).\n"
2793 })
2794 )
2795 }).annotate({ "identifier": "CreateEmbeddingRequest" })
2796 export type Embedding = {
2797 readonly "index": number
2798 readonly "embedding": ReadonlyArray<number> | string
2799 readonly "object": "embedding"
2800 }
2801 export const Embedding = Schema.Struct({
2802 "index": Schema.Number.annotate({ "description": "The index of the embedding in the list of embeddings." }).check(
2803 Schema.isInt().annotate({ "expected": "an integer" })
2804 ),
2805 "embedding": Schema.Union([
2806 Schema.Array(
2807 Schema.Number.annotate({ "format": "float" }).check(Schema.isFinite().annotate({ "expected": "a finite number" }))
2808 ),
2809 Schema.String.annotate({ "contentEncoding": "base64" })
2810 ]).annotate({
2811 "description":
2812 "The embedding vector, returned as a list of floats when `encoding_format` is `float` (the default), or as a base64-encoded string when `encoding_format` is `base64`. The length of the vector depends on the model as listed in the [embedding guide](https://developers.openai.com/api/docs/guides/embeddings).\n"
2813 }),
2814 "object": Schema.Literal("embedding").annotate({ "description": "The object type, which is always \"embedding\"." })
2815 }).annotate({
2816 "description": "Represents an embedding vector returned by embedding endpoint.\n",
2817 "identifier": "Embedding"
2818 })
2819 export type EvalCustomDataSourceConfig = {
2820 readonly "type": "custom"
2821 readonly "schema": { readonly [x: string]: Schema.Json }
2822 }
2823 export const EvalCustomDataSourceConfig = Schema.Struct({
2824 "type": Schema.Literal("custom").annotate({ "description": "The type of data source. Always `custom`." }),
2825 "schema": Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })).annotate({
2826 "description":
2827 "The json schema for the run data source items.\nLearn how to build JSON schemas [here](https://json-schema.org/).\n"
2828 })
2829 }).annotate({
2830 "title": "CustomDataSourceConfig",
2831 "description":
2832 "A CustomDataSourceConfig which specifies the schema of your `item` and optionally `sample` namespaces.\nThe response schema defines the shape of the data that will be:\n- Used to define your testing criteria and\n- What data is required when creating a run\n",
2833 "identifier": "EvalCustomDataSourceConfig"
2834 })
2835 export type EvalItemContentText = string
2836 export const EvalItemContentText = Schema.String.annotate({
2837 "title": "Text input",
2838 "description": "A text input to the model.\n",
2839 "identifier": "EvalItemContentText"
2840 })
2841 export type EvalItemContentOutputText = { readonly "type": "output_text"; readonly "text": string }
2842 export const EvalItemContentOutputText = Schema.Struct({
2843 "type": Schema.Literal("output_text").annotate({
2844 "description": "The type of the output text. Always `output_text`.\n"
2845 }),
2846 "text": Schema.String.annotate({ "description": "The text output from the model.\n" })
2847 }).annotate({
2848 "title": "Output text",
2849 "description": "A text output from the model.\n",
2850 "identifier": "EvalItemContentOutputText"
2851 })
2852 export type EvalItemInputImage = {
2853 readonly "type": "input_image"
2854 readonly "image_url": string
2855 readonly "detail"?: string
2856 }
2857 export const EvalItemInputImage = Schema.Struct({
2858 "type": Schema.Literal("input_image").annotate({
2859 "description": "The type of the image input. Always `input_image`.\n"
2860 }),
2861 "image_url": Schema.String.annotate({ "description": "The URL of the image input.\n", "format": "uri" }),
2862 "detail": Schema.optionalKey(
2863 Schema.String.annotate({
2864 "description":
2865 "The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.\n"
2866 })
2867 )
2868 }).annotate({
2869 "title": "Input image",
2870 "description": "An image input block used within EvalItem content arrays.",
2871 "identifier": "EvalItemInputImage"
2872 })
2873 export type InputAudio = {
2874 readonly "type": "input_audio"
2875 readonly "input_audio": { readonly "data": string; readonly "format": "mp3" | "wav" }
2876 }
2877 export const InputAudio = Schema.Struct({
2878 "type": Schema.Literal("input_audio").annotate({
2879 "description": "The type of the input item. Always `input_audio`.\n"
2880 }),
2881 "input_audio": Schema.Struct({
2882 "data": Schema.String.annotate({ "description": "Base64-encoded audio data.\n" }),
2883 "format": Schema.Literals(["mp3", "wav"]).annotate({
2884 "description": "The format of the audio data. Currently supported formats are `mp3` and\n`wav`.\n"
2885 })
2886 })
2887 }).annotate({ "title": "Input audio", "description": "An audio input to the model.\n", "identifier": "InputAudio" })
2888 export type EvalGraderStringCheck = {
2889 readonly "type": "string_check"
2890 readonly "name": string
2891 readonly "input": string
2892 readonly "reference": string
2893 readonly "operation": "eq" | "ne" | "like" | "ilike"
2894 }
2895 export const EvalGraderStringCheck = Schema.Struct({
2896 "type": Schema.Literal("string_check").annotate({
2897 "description": "The object type, which is always `string_check`."
2898 }),
2899 "name": Schema.String.annotate({ "description": "The name of the grader." }),
2900 "input": Schema.String.annotate({ "description": "The input text. This may include template strings." }),
2901 "reference": Schema.String.annotate({ "description": "The reference text. This may include template strings." }),
2902 "operation": Schema.Literals(["eq", "ne", "like", "ilike"]).annotate({
2903 "description": "The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`."
2904 })
2905 }).annotate({
2906 "title": "StringCheckGrader",
2907 "description":
2908 "A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.\n",
2909 "identifier": "EvalGraderStringCheck"
2910 })
2911 export type EvalGraderTextSimilarity = {
2912 readonly "type": "text_similarity"
2913 readonly "name": string
2914 readonly "input": string
2915 readonly "reference": string
2916 readonly "evaluation_metric":
2917 | "cosine"
2918 | "fuzzy_match"
2919 | "bleu"
2920 | "gleu"
2921 | "meteor"
2922 | "rouge_1"
2923 | "rouge_2"
2924 | "rouge_3"
2925 | "rouge_4"
2926 | "rouge_5"
2927 | "rouge_l"
2928 readonly "pass_threshold": number
2929 }
2930 export const EvalGraderTextSimilarity = Schema.Struct({
2931 "type": Schema.Literal("text_similarity").annotate({ "description": "The type of grader." }),
2932 "name": Schema.String.annotate({ "description": "The name of the grader." }),
2933 "input": Schema.String.annotate({ "description": "The text being graded." }),
2934 "reference": Schema.String.annotate({ "description": "The text being graded against." }),
2935 "evaluation_metric": Schema.Literals([
2936 "cosine",
2937 "fuzzy_match",
2938 "bleu",
2939 "gleu",
2940 "meteor",
2941 "rouge_1",
2942 "rouge_2",
2943 "rouge_3",
2944 "rouge_4",
2945 "rouge_5",
2946 "rouge_l"
2947 ]).annotate({
2948 "description":
2949 "The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`, \n`gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, \nor `rouge_l`.\n"
2950 }),
2951 "pass_threshold": Schema.Number.annotate({ "description": "The threshold for the score." }).check(
2952 Schema.isFinite().annotate({ "expected": "a finite number" })
2953 )
2954 }).annotate({ "title": "TextSimilarityGrader", "identifier": "EvalGraderTextSimilarity" })
2955 export type EvalGraderPython = {
2956 readonly "type": "python"
2957 readonly "name": string
2958 readonly "source": string
2959 readonly "image_tag"?: string
2960 readonly "pass_threshold"?: number
2961 }
2962 export const EvalGraderPython = Schema.Struct({
2963 "type": Schema.Literal("python").annotate({ "description": "The object type, which is always `python`." }),
2964 "name": Schema.String.annotate({ "description": "The name of the grader." }),
2965 "source": Schema.String.annotate({ "description": "The source code of the python script." }),
2966 "image_tag": Schema.optionalKey(
2967 Schema.String.annotate({ "description": "The image tag to use for the python script." })
2968 ),
2969 "pass_threshold": Schema.optionalKey(
2970 Schema.Number.annotate({ "description": "The threshold for the score." }).check(
2971 Schema.isFinite().annotate({ "expected": "a finite number" })
2972 )
2973 )
2974 }).annotate({ "title": "PythonGrader", "identifier": "EvalGraderPython" })
2975 export type CreateEvalCustomDataSourceConfig = {
2976 readonly "type": "custom"
2977 readonly "item_schema": { readonly [x: string]: Schema.Json }
2978 readonly "include_sample_schema"?: boolean
2979 }
2980 export const CreateEvalCustomDataSourceConfig = Schema.Struct({
2981 "type": Schema.Literal("custom").annotate({ "description": "The type of data source. Always `custom`." }),
2982 "item_schema": Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })).annotate({
2983 "description": "The json schema for each row in the data source."
2984 }),
2985 "include_sample_schema": Schema.optionalKey(
2986 Schema.Boolean.annotate({
2987 "description":
2988 "Whether the eval should expect you to populate the sample namespace (ie, by generating responses off of your data source)"
2989 })
2990 )
2991 }).annotate({
2992 "title": "CustomDataSourceConfig",
2993 "description":
2994 "A CustomDataSourceConfig object that defines the schema for the data source used for the evaluation runs.\nThis schema is used to define the shape of the data that will be:\n- Used to define your testing criteria and\n- What data is required when creating a run\n",
2995 "identifier": "CreateEvalCustomDataSourceConfig"
2996 })
2997 export type CreateEvalLogsDataSourceConfig = {
2998 readonly "type": "logs"
2999 readonly "metadata"?: { readonly [x: string]: Schema.Json }
3000 }
3001 export const CreateEvalLogsDataSourceConfig = Schema.Struct({
3002 "type": Schema.Literal("logs").annotate({ "description": "The type of data source. Always `logs`." }),
3003 "metadata": Schema.optionalKey(
3004 Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })).annotate({
3005 "description": "Metadata filters for the logs data source."
3006 })
3007 )
3008 }).annotate({
3009 "title": "LogsDataSourceConfig",
3010 "description":
3011 "A data source config which specifies the metadata property of your logs query.\nThis is usually metadata like `usecase=chatbot` or `prompt-version=v2`, etc.\n",
3012 "identifier": "CreateEvalLogsDataSourceConfig"
3013 })
3014 export type CreateEvalStoredCompletionsDataSourceConfig = {
3015 readonly "type": "stored_completions"
3016 readonly "metadata"?: { readonly [x: string]: Schema.Json }
3017 }
3018 export const CreateEvalStoredCompletionsDataSourceConfig = Schema.Struct({
3019 "type": Schema.Literal("stored_completions").annotate({
3020 "description": "The type of data source. Always `stored_completions`."
3021 }),
3022 "metadata": Schema.optionalKey(
3023 Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })).annotate({
3024 "description": "Metadata filters for the stored completions data source."
3025 })
3026 )
3027 }).annotate({
3028 "title": "StoredCompletionsDataSourceConfig",
3029 "description": "Deprecated in favor of LogsDataSourceConfig.\n",
3030 "identifier": "CreateEvalStoredCompletionsDataSourceConfig"
3031 })
3032 export type EvalJsonlFileContentSource = {
3033 readonly "type": "file_content"
3034 readonly "content": ReadonlyArray<
3035 {
3036 readonly "item": { readonly [x: string]: Schema.Json }
3037 readonly "sample"?: { readonly [x: string]: Schema.Json }
3038 }
3039 >
3040 }
3041 export const EvalJsonlFileContentSource = Schema.Struct({
3042 "type": Schema.Literal("file_content").annotate({
3043 "description": "The type of jsonl source. Always `file_content`."
3044 }),
3045 "content": Schema.Array(
3046 Schema.Struct({
3047 "item": Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })),
3048 "sample": Schema.optionalKey(Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })))
3049 })
3050 ).annotate({ "description": "The content of the jsonl file." })
3051 }).annotate({ "title": "EvalJsonlFileContentSource", "identifier": "EvalJsonlFileContentSource" })
3052 export type EvalJsonlFileIdSource = { readonly "type": "file_id"; readonly "id": string }
3053 export const EvalJsonlFileIdSource = Schema.Struct({
3054 "type": Schema.Literal("file_id").annotate({ "description": "The type of jsonl source. Always `file_id`." }),
3055 "id": Schema.String.annotate({ "description": "The identifier of the file." })
3056 }).annotate({ "title": "EvalJsonlFileIdSource", "identifier": "EvalJsonlFileIdSource" })
3057 export type EvalApiError = { readonly "code": string; readonly "message": string }
3058 export const EvalApiError = Schema.Struct({
3059 "code": Schema.String.annotate({ "description": "The error code." }),
3060 "message": Schema.String.annotate({ "description": "The error message." })
3061 }).annotate({
3062 "title": "EvalApiError",
3063 "description": "An object representing an error response from the Eval API.\n",
3064 "identifier": "EvalApiError"
3065 })
3066 export type EvalRunOutputItemResult = {
3067 readonly "name": string
3068 readonly "type"?: string
3069 readonly "score": number
3070 readonly "passed": boolean
3071 readonly "sample"?: { readonly [x: string]: Schema.Json } | null
3072 } & { readonly [x: string]: Schema.Json }
3073 export const EvalRunOutputItemResult = Schema.StructWithRest(
3074 Schema.Struct({
3075 "name": Schema.String.annotate({ "description": "The name of the grader." }),
3076 "type": Schema.optionalKey(
3077 Schema.String.annotate({ "description": "The grader type (for example, \"string-check-grader\")." })
3078 ),
3079 "score": Schema.Number.annotate({ "description": "The numeric score produced by the grader." }).check(
3080 Schema.isFinite().annotate({ "expected": "a finite number" })
3081 ),
3082 "passed": Schema.Boolean.annotate({ "description": "Whether the grader considered the output a pass." }),
3083 "sample": Schema.optionalKey(
3084 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
3085 .annotate({ "description": "Optional sample or intermediate data produced by the grader." })
3086 )
3087 }),
3088 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
3089 ).annotate({
3090 "title": "EvalRunOutputItemResult",
3091 "description": "A single grader result for an evaluation run output item.\n",
3092 "identifier": "EvalRunOutputItemResult"
3093 })
3094 export type OpenAIFile =
3095 | null
3096 | string
3097 | number
3098 | boolean
3099 | {
3100 readonly "id": string
3101 readonly "bytes": number | null
3102 readonly "created_at": number
3103 readonly "expires_at"?: number | null
3104 readonly "filename": string
3105 readonly "object": "file"
3106 readonly "purpose":
3107 | "assistants"
3108 | "assistants_output"
3109 | "batch"
3110 | "batch_output"
3111 | "fine-tune"
3112 | "fine-tune-results"
3113 | "vision"
3114 | "user_data"
3115 readonly "status": "uploaded" | "processed" | "error"
3116 readonly "status_details"?: string | null
3117 } & { readonly [x: string]: Schema.Json }
3118 | ReadonlyArray<Schema.Json>
3119 export const OpenAIFile = Schema.Union([
3120 Schema.Null,
3121 Schema.String,
3122 Schema.Finite,
3123 Schema.Boolean,
3124 Schema.StructWithRest(
3125 Schema.Struct({
3126 "id": Schema.String.annotate({
3127 "description": "The file identifier, which can be referenced in the API endpoints."
3128 }),
3129 "bytes": Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
3130 .annotate({
3131 "description":
3132 "The size of the file, in bytes. In a completed file upload response, this can\nbe null when the file size is not yet available.\n"
3133 }),
3134 "created_at": Schema.Number.annotate({
3135 "description": "The Unix timestamp (in seconds) for when the file was created.",
3136 "format": "unixtime"
3137 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
3138 "expires_at": Schema.optionalKey(
3139 Schema.Union([
3140 Schema.Number.annotate({
3141 "description": "The Unix timestamp (in seconds) for when the file will expire.",
3142 "format": "unixtime"
3143 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
3144 Schema.Null
3145 ])
3146 ),
3147 "filename": Schema.String.annotate({ "description": "The name of the file." }),
3148 "object": Schema.Literal("file").annotate({ "description": "The object type, which is always `file`." }),
3149 "purpose": Schema.Literals([
3150 "assistants",
3151 "assistants_output",
3152 "batch",
3153 "batch_output",
3154 "fine-tune",
3155 "fine-tune-results",
3156 "vision",
3157 "user_data"
3158 ]).annotate({
3159 "description":
3160 "The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`, `vision`, and `user_data`."
3161 }),
3162 "status": Schema.Literals(["uploaded", "processed", "error"]).annotate({
3163 "description":
3164 "Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`."
3165 }),
3166 "status_details": Schema.optionalKey(
3167 Schema.Union([Schema.String, Schema.Null]).annotate({
3168 "description":
3169 "Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`. Completed file upload responses can return null when these details are unset."
3170 })
3171 )
3172 }),
3173 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
3174 ),
3175 Schema.Array(Schema.Json.annotate({ "expected": "JSON value" }))
3176 ]).annotate({
3177 "title": "OpenAIFile",
3178 "description": "The `File` object represents a document that has been uploaded to OpenAI.",
3179 "identifier": "OpenAIFile"
3180 })
3181 export type FileExpirationAfter = { readonly "anchor": "created_at"; readonly "seconds": number }
3182 export const FileExpirationAfter = Schema.Struct({
3183 "anchor": Schema.Literal("created_at").annotate({
3184 "description": "Anchor timestamp after which the expiration policy applies. Supported anchors: `created_at`."
3185 }),
3186 "seconds": Schema.Number.annotate({
3187 "description":
3188 "The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days).",
3189 "format": "int64"
3190 }).check(Schema.isInt().annotate({ "expected": "an integer" })).check(
3191 Schema.isGreaterThanOrEqualTo(3600).annotate({ "expected": "a value greater than or equal to 3600" })
3192 ).check(Schema.isLessThanOrEqualTo(2592000).annotate({ "expected": "a value less than or equal to 2592000" }))
3193 }).annotate({
3194 "title": "File expiration policy",
3195 "description":
3196 "The expiration policy for a file. By default, files with `purpose=batch` expire after 30 days and all other files are persisted until they are manually deleted.",
3197 "identifier": "FileExpirationAfter"
3198 })
3199 export type DeleteFileResponse = { readonly "id": string; readonly "object": "file"; readonly "deleted": boolean }
3200 export const DeleteFileResponse = Schema.Struct({
3201 "id": Schema.String,
3202 "object": Schema.Literal("file"),
3203 "deleted": Schema.Boolean
3204 }).annotate({ "identifier": "DeleteFileResponse" })
3205 export type GraderStringCheck = {
3206 readonly "type": "string_check"
3207 readonly "name": string
3208 readonly "input": string
3209 readonly "reference": string
3210 readonly "operation": "eq" | "ne" | "like" | "ilike"
3211 }
3212 export const GraderStringCheck = Schema.Struct({
3213 "type": Schema.Literal("string_check").annotate({
3214 "description": "The object type, which is always `string_check`."
3215 }),
3216 "name": Schema.String.annotate({ "description": "The name of the grader." }),
3217 "input": Schema.String.annotate({ "description": "The input text. This may include template strings." }),
3218 "reference": Schema.String.annotate({ "description": "The reference text. This may include template strings." }),
3219 "operation": Schema.Literals(["eq", "ne", "like", "ilike"]).annotate({
3220 "description": "The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`."
3221 })
3222 }).annotate({
3223 "title": "StringCheckGrader",
3224 "description":
3225 "A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.\n",
3226 "identifier": "GraderStringCheck"
3227 })
3228 export type GraderTextSimilarity = {
3229 readonly "type": "text_similarity"
3230 readonly "name": string
3231 readonly "input": string
3232 readonly "reference": string
3233 readonly "evaluation_metric":
3234 | "cosine"
3235 | "fuzzy_match"
3236 | "bleu"
3237 | "gleu"
3238 | "meteor"
3239 | "rouge_1"
3240 | "rouge_2"
3241 | "rouge_3"
3242 | "rouge_4"
3243 | "rouge_5"
3244 | "rouge_l"
3245 }
3246 export const GraderTextSimilarity = Schema.Struct({
3247 "type": Schema.Literal("text_similarity").annotate({ "description": "The type of grader." }),
3248 "name": Schema.String.annotate({ "description": "The name of the grader." }),
3249 "input": Schema.String.annotate({ "description": "The text being graded." }),
3250 "reference": Schema.String.annotate({ "description": "The text being graded against." }),
3251 "evaluation_metric": Schema.Literals([
3252 "cosine",
3253 "fuzzy_match",
3254 "bleu",
3255 "gleu",
3256 "meteor",
3257 "rouge_1",
3258 "rouge_2",
3259 "rouge_3",
3260 "rouge_4",
3261 "rouge_5",
3262 "rouge_l"
3263 ]).annotate({
3264 "description":
3265 "The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`, \n`gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, \nor `rouge_l`.\n"
3266 })
3267 }).annotate({
3268 "title": "TextSimilarityGrader",
3269 "description": "A TextSimilarityGrader object which grades text based on similarity metrics.\n",
3270 "identifier": "GraderTextSimilarity"
3271 })
3272 export type GraderPython = {
3273 readonly "type": "python"
3274 readonly "name": string
3275 readonly "source": string
3276 readonly "image_tag"?: string
3277 }
3278 export const GraderPython = Schema.Struct({
3279 "type": Schema.Literal("python").annotate({ "description": "The object type, which is always `python`." }),
3280 "name": Schema.String.annotate({ "description": "The name of the grader." }),
3281 "source": Schema.String.annotate({ "description": "The source code of the python script." }),
3282 "image_tag": Schema.optionalKey(
3283 Schema.String.annotate({ "description": "The image tag to use for the python script." })
3284 )
3285 }).annotate({
3286 "title": "PythonGrader",
3287 "description": "A PythonGrader object that runs a python script on the input.\n",
3288 "identifier": "GraderPython"
3289 })
3290 export type RunGraderResponse = {
3291 readonly "reward": number
3292 readonly "metadata": {
3293 readonly "name": string
3294 readonly "type": string
3295 readonly "errors": {
3296 readonly "formula_parse_error": boolean
3297 readonly "sample_parse_error": boolean
3298 readonly "truncated_observation_error": boolean
3299 readonly "unresponsive_reward_error": boolean
3300 readonly "invalid_variable_error": boolean
3301 readonly "other_error": boolean
3302 readonly "python_grader_server_error": boolean
3303 readonly "python_grader_server_error_type": string | null
3304 readonly "python_grader_runtime_error": boolean
3305 readonly "python_grader_runtime_error_details": string | null
3306 readonly "model_grader_server_error": boolean
3307 readonly "model_grader_refusal_error": boolean
3308 readonly "model_grader_parse_error": boolean
3309 readonly "model_grader_server_error_details": string | null
3310 }
3311 readonly "execution_time": number
3312 readonly "scores": { readonly [x: string]: Schema.Json }
3313 readonly "token_usage": {
3314 readonly "prompt_tokens": number
3315 readonly "total_tokens": number
3316 readonly "completion_tokens"?: number | null
3317 readonly "cached_tokens"?: number | null
3318 } | null
3319 readonly "sampled_model_name": string | null
3320 }
3321 readonly "sub_rewards": { readonly [x: string]: Schema.Json }
3322 readonly "model_grader_token_usage_per_model": { readonly [x: string]: Schema.Json }
3323 }
3324 export const RunGraderResponse = Schema.Struct({
3325 "reward": Schema.Finite,
3326 "metadata": Schema.Struct({
3327 "name": Schema.String,
3328 "type": Schema.String,
3329 "errors": Schema.Struct({
3330 "formula_parse_error": Schema.Boolean,
3331 "sample_parse_error": Schema.Boolean,
3332 "truncated_observation_error": Schema.Boolean,
3333 "unresponsive_reward_error": Schema.Boolean,
3334 "invalid_variable_error": Schema.Boolean,
3335 "other_error": Schema.Boolean,
3336 "python_grader_server_error": Schema.Boolean,
3337 "python_grader_server_error_type": Schema.Union([Schema.String, Schema.Null]),
3338 "python_grader_runtime_error": Schema.Boolean,
3339 "python_grader_runtime_error_details": Schema.Union([Schema.String, Schema.Null]),
3340 "model_grader_server_error": Schema.Boolean,
3341 "model_grader_refusal_error": Schema.Boolean,
3342 "model_grader_parse_error": Schema.Boolean,
3343 "model_grader_server_error_details": Schema.Union([Schema.String, Schema.Null])
3344 }),
3345 "execution_time": Schema.Finite,
3346 "scores": Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })),
3347 "token_usage": Schema.Union([
3348 Schema.Struct({
3349 "prompt_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3350 "total_tokens": Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })),
3351 "completion_tokens": Schema.optionalKey(
3352 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
3353 ),
3354 "cached_tokens": Schema.optionalKey(
3355 Schema.Union([Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })), Schema.Null])
3356 )
3357 }),
3358 Schema.Null
3359 ]),
3360 "sampled_model_name": Schema.Union([Schema.String, Schema.Null])
3361 }),
3362 "sub_rewards": Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })),
3363 "model_grader_token_usage_per_model": Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))
3364 }).annotate({ "identifier": "RunGraderResponse" })
3365 export type FineTuningCheckpointPermission = {
3366 readonly "id": string
3367 readonly "created_at": number
3368 readonly "project_id": string
3369 readonly "object": "checkpoint.permission"
3370 }
3371 export const FineTuningCheckpointPermission = Schema.Struct({
3372 "id": Schema.String.annotate({
3373 "description": "The permission identifier, which can be referenced in the API endpoints."
3374 }),
3375 "created_at": Schema.Number.annotate({
3376 "description": "The Unix timestamp (in seconds) for when the permission was created.",
3377 "format": "unixtime"
3378 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
3379 "project_id": Schema.String.annotate({ "description": "The project identifier that the permission is for." }),
3380 "object": Schema.Literal("checkpoint.permission").annotate({
3381 "description": "The object type, which is always \"checkpoint.permission\"."
3382 })
3383 }).annotate({
3384 "title": "FineTuningCheckpointPermission",
3385 "description": "The `checkpoint.permission` object represents a permission for a fine-tuned model checkpoint.\n",
3386 "identifier": "FineTuningCheckpointPermission"
3387 })
3388 export type CreateFineTuningCheckpointPermissionRequest = { readonly "project_ids": ReadonlyArray<string> }
3389 export const CreateFineTuningCheckpointPermissionRequest = Schema.Struct({
3390 "project_ids": Schema.Array(Schema.String).annotate({ "description": "The project identifiers to grant access to." })
3391 }).annotate({ "identifier": "CreateFineTuningCheckpointPermissionRequest" })
3392 export type DeleteFineTuningCheckpointPermissionResponse = {
3393 readonly "id": string
3394 readonly "object": "checkpoint.permission"
3395 readonly "deleted": boolean
3396 }
3397 export const DeleteFineTuningCheckpointPermissionResponse = Schema.Struct({
3398 "id": Schema.String.annotate({
3399 "description": "The ID of the fine-tuned model checkpoint permission that was deleted."
3400 }),
3401 "object": Schema.Literal("checkpoint.permission").annotate({
3402 "description": "The object type, which is always \"checkpoint.permission\"."
3403 }),
3404 "deleted": Schema.Boolean.annotate({
3405 "description": "Whether the fine-tuned model checkpoint permission was successfully deleted."
3406 })
3407 }).annotate({ "identifier": "DeleteFineTuningCheckpointPermissionResponse" })
3408 export type FineTuningIntegration = {
3409 readonly "type": "wandb"
3410 readonly "wandb": {
3411 readonly "project": string
3412 readonly "name"?: string | null
3413 readonly "entity"?: string | null
3414 readonly "tags"?: ReadonlyArray<string>
3415 }
3416 }
3417 export const FineTuningIntegration = Schema.Struct({
3418 "type": Schema.Literal("wandb").annotate({
3419 "description": "The type of the integration being enabled for the fine-tuning job"
3420 }),
3421 "wandb": Schema.Struct({
3422 "project": Schema.String.annotate({
3423 "description": "The name of the project that the new run will be created under.\n"
3424 }),
3425 "name": Schema.optionalKey(
3426 Schema.Union([
3427 Schema.String.annotate({
3428 "description": "A display name to set for the run. If not set, we will use the Job ID as the name.\n"
3429 }),
3430 Schema.Null
3431 ])
3432 ),
3433 "entity": Schema.optionalKey(
3434 Schema.Union([
3435 Schema.String.annotate({
3436 "description":
3437 "The entity to use for the run. This allows you to set the team or username of the WandB user that you would\nlike associated with the run. If not set, the default entity for the registered WandB API key is used.\n"
3438 }),
3439 Schema.Null
3440 ])
3441 ),
3442 "tags": Schema.optionalKey(
3443 Schema.Array(Schema.String).annotate({
3444 "description":
3445 "A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some\ndefault tags are generated by OpenAI: \"openai/finetune\", \"openai/{base-model}\", \"openai/{ftjob-abcdef}\".\n"
3446 })
3447 )
3448 }).annotate({
3449 "description":
3450 "The settings for your integration with Weights and Biases. This payload specifies the project that\nmetrics will be sent to. Optionally, you can set an explicit display name for your run, add tags\nto your run, and set a default entity (team, username, etc) to be associated with your run.\n"
3451 })
3452 }).annotate({ "title": "Fine-Tuning Job Integration", "identifier": "FineTuningIntegration" })
3453 export type FineTuneSupervisedHyperparameters = {
3454 readonly "batch_size"?: "auto" | number
3455 readonly "learning_rate_multiplier"?: "auto" | number
3456 readonly "n_epochs"?: "auto" | number
3457 }
3458 export const FineTuneSupervisedHyperparameters = Schema.Struct({
3459 "batch_size": Schema.optionalKey(
3460 Schema.Union([
3461 Schema.Literal("auto"),
3462 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
3463 Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })
3464 ).check(Schema.isLessThanOrEqualTo(256).annotate({ "expected": "a value less than or equal to 256" }))
3465 ], { mode: "oneOf" }).annotate({
3466 "description":
3467 "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.\n"
3468 })
3469 ),
3470 "learning_rate_multiplier": Schema.optionalKey(
3471 Schema.Union([
3472 Schema.Literal("auto"),
3473 Schema.Finite.check(Schema.isGreaterThan(0).annotate({ "expected": "a value greater than 0" }))
3474 ], { mode: "oneOf" }).annotate({
3475 "description":
3476 "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.\n"
3477 })
3478 ),
3479 "n_epochs": Schema.optionalKey(
3480 Schema.Union([
3481 Schema.Literal("auto"),
3482 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
3483 Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })
3484 ).check(Schema.isLessThanOrEqualTo(50).annotate({ "expected": "a value less than or equal to 50" }))
3485 ], { mode: "oneOf" }).annotate({
3486 "description":
3487 "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.\n"
3488 })
3489 )
3490 }).annotate({
3491 "description": "The hyperparameters used for the fine-tuning job.",
3492 "identifier": "FineTuneSupervisedHyperparameters"
3493 })
3494 export type FineTuneDPOHyperparameters = {
3495 readonly "beta"?: "auto" | number
3496 readonly "batch_size"?: "auto" | number
3497 readonly "learning_rate_multiplier"?: "auto" | number
3498 readonly "n_epochs"?: "auto" | number
3499 }
3500 export const FineTuneDPOHyperparameters = Schema.Struct({
3501 "beta": Schema.optionalKey(
3502 Schema.Union([
3503 Schema.Literal("auto"),
3504 Schema.Finite.check(Schema.isLessThanOrEqualTo(2).annotate({ "expected": "a value less than or equal to 2" }))
3505 .check(Schema.isGreaterThan(0).annotate({ "expected": "a value greater than 0" }))
3506 ], { mode: "oneOf" }).annotate({
3507 "description":
3508 "The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.\n"
3509 })
3510 ),
3511 "batch_size": Schema.optionalKey(
3512 Schema.Union([
3513 Schema.Literal("auto"),
3514 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
3515 Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })
3516 ).check(Schema.isLessThanOrEqualTo(256).annotate({ "expected": "a value less than or equal to 256" }))
3517 ], { mode: "oneOf" }).annotate({
3518 "description":
3519 "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.\n"
3520 })
3521 ),
3522 "learning_rate_multiplier": Schema.optionalKey(
3523 Schema.Union([
3524 Schema.Literal("auto"),
3525 Schema.Finite.check(Schema.isGreaterThan(0).annotate({ "expected": "a value greater than 0" }))
3526 ], { mode: "oneOf" }).annotate({
3527 "description":
3528 "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.\n"
3529 })
3530 ),
3531 "n_epochs": Schema.optionalKey(
3532 Schema.Union([
3533 Schema.Literal("auto"),
3534 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
3535 Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })
3536 ).check(Schema.isLessThanOrEqualTo(50).annotate({ "expected": "a value less than or equal to 50" }))
3537 ], { mode: "oneOf" }).annotate({
3538 "description":
3539 "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.\n"
3540 })
3541 )
3542 }).annotate({
3543 "description": "The hyperparameters used for the DPO fine-tuning job.",
3544 "identifier": "FineTuneDPOHyperparameters"
3545 })
3546 export type FineTuneReinforcementHyperparameters = {
3547 readonly "batch_size"?: "auto" | number
3548 readonly "learning_rate_multiplier"?: "auto" | number
3549 readonly "n_epochs"?: "auto" | number
3550 readonly "reasoning_effort"?: "default" | "low" | "medium" | "high"
3551 readonly "compute_multiplier"?: "auto" | number
3552 readonly "eval_interval"?: "auto" | number
3553 readonly "eval_samples"?: "auto" | number
3554 }
3555 export const FineTuneReinforcementHyperparameters = Schema.Struct({
3556 "batch_size": Schema.optionalKey(
3557 Schema.Union([
3558 Schema.Literal("auto"),
3559 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
3560 Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })
3561 ).check(Schema.isLessThanOrEqualTo(256).annotate({ "expected": "a value less than or equal to 256" }))
3562 ], { mode: "oneOf" }).annotate({
3563 "description":
3564 "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.\n"
3565 })
3566 ),
3567 "learning_rate_multiplier": Schema.optionalKey(
3568 Schema.Union([
3569 Schema.Literal("auto"),
3570 Schema.Finite.check(Schema.isGreaterThan(0).annotate({ "expected": "a value greater than 0" }))
3571 ], { mode: "oneOf" }).annotate({
3572 "description":
3573 "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.\n"
3574 })
3575 ),
3576 "n_epochs": Schema.optionalKey(
3577 Schema.Union([
3578 Schema.Literal("auto"),
3579 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
3580 Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })
3581 ).check(Schema.isLessThanOrEqualTo(50).annotate({ "expected": "a value less than or equal to 50" }))
3582 ], { mode: "oneOf" }).annotate({
3583 "description":
3584 "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.\n"
3585 })
3586 ),
3587 "reasoning_effort": Schema.optionalKey(
3588 Schema.Literals(["default", "low", "medium", "high"]).annotate({ "description": "Level of reasoning effort.\n" })
3589 ),
3590 "compute_multiplier": Schema.optionalKey(
3591 Schema.Union([
3592 Schema.Literal("auto"),
3593 Schema.Finite.check(Schema.isLessThanOrEqualTo(10).annotate({ "expected": "a value less than or equal to 10" }))
3594 .check(Schema.isGreaterThan(0.00001).annotate({ "expected": "a value greater than 0.00001" }))
3595 ], { mode: "oneOf" }).annotate({
3596 "description": "Multiplier on amount of compute used for exploring search space during training.\n"
3597 })
3598 ),
3599 "eval_interval": Schema.optionalKey(
3600 Schema.Union([
3601 Schema.Literal("auto"),
3602 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
3603 Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })
3604 )
3605 ], { mode: "oneOf" }).annotate({ "description": "The number of training steps between evaluation runs.\n" })
3606 ),
3607 "eval_samples": Schema.optionalKey(
3608 Schema.Union([
3609 Schema.Literal("auto"),
3610 Schema.Number.check(Schema.isInt().annotate({ "expected": "an integer" })).check(
3611 Schema.isGreaterThanOrEqualTo(1).annotate({ "expected": "a value greater than or equal to 1" })
3612 )
3613 ], { mode: "oneOf" }).annotate({ "description": "Number of evaluation samples to generate per training step.\n" })
3614 )
3615 }).annotate({
3616 "description": "The hyperparameters used for the reinforcement fine-tuning job.",
3617 "identifier": "FineTuneReinforcementHyperparameters"
3618 })
3619 export type FineTuningJobCheckpoint = {
3620 readonly "id": string
3621 readonly "created_at": number
3622 readonly "fine_tuned_model_checkpoint": string
3623 readonly "step_number": number
3624 readonly "metrics": {
3625 readonly "step"?: number
3626 readonly "train_loss"?: number
3627 readonly "train_mean_token_accuracy"?: number
3628 readonly "valid_loss"?: number
3629 readonly "valid_mean_token_accuracy"?: number
3630 readonly "full_valid_loss"?: number
3631 readonly "full_valid_mean_token_accuracy"?: number
3632 }
3633 readonly "fine_tuning_job_id": string
3634 readonly "object": "fine_tuning.job.checkpoint"
3635 }
3636 export const FineTuningJobCheckpoint = Schema.Struct({
3637 "id": Schema.String.annotate({
3638 "description": "The checkpoint identifier, which can be referenced in the API endpoints."
3639 }),
3640 "created_at": Schema.Number.annotate({
3641 "description": "The Unix timestamp (in seconds) for when the checkpoint was created.",
3642 "format": "unixtime"
3643 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
3644 "fine_tuned_model_checkpoint": Schema.String.annotate({
3645 "description": "The name of the fine-tuned checkpoint model that is created."
3646 }),
3647 "step_number": Schema.Number.annotate({ "description": "The step number that the checkpoint was created at." }).check(
3648 Schema.isInt().annotate({ "expected": "an integer" })
3649 ),
3650 "metrics": Schema.Struct({
3651 "step": Schema.optionalKey(Schema.Finite),
3652 "train_loss": Schema.optionalKey(Schema.Finite),
3653 "train_mean_token_accuracy": Schema.optionalKey(Schema.Finite),
3654 "valid_loss": Schema.optionalKey(Schema.Finite),
3655 "valid_mean_token_accuracy": Schema.optionalKey(Schema.Finite),
3656 "full_valid_loss": Schema.optionalKey(Schema.Finite),
3657 "full_valid_mean_token_accuracy": Schema.optionalKey(Schema.Finite)
3658 }).annotate({ "description": "Metrics at the step number during the fine-tuning job." }),
3659 "fine_tuning_job_id": Schema.String.annotate({
3660 "description": "The name of the fine-tuning job that this checkpoint was created from."
3661 }),
3662 "object": Schema.Literal("fine_tuning.job.checkpoint").annotate({
3663 "description": "The object type, which is always \"fine_tuning.job.checkpoint\"."
3664 })
3665 }).annotate({
3666 "title": "FineTuningJobCheckpoint",
3667 "description":
3668 "The `fine_tuning.job.checkpoint` object represents a model checkpoint for a fine-tuning job that is ready to use.\n",
3669 "identifier": "FineTuningJobCheckpoint"
3670 })
3671 export type FineTuningJobEvent = {
3672 readonly "object": "fine_tuning.job.event"
3673 readonly "id": string
3674 readonly "created_at": number
3675 readonly "level": "info" | "warn" | "error"
3676 readonly "message": string
3677 readonly "type"?: "message" | "metrics"
3678 readonly "data"?: { readonly [x: string]: Schema.Json } | null
3679 }
3680 export const FineTuningJobEvent = Schema.Struct({
3681 "object": Schema.Literal("fine_tuning.job.event").annotate({
3682 "description": "The object type, which is always \"fine_tuning.job.event\"."
3683 }),
3684 "id": Schema.String.annotate({ "description": "The object identifier." }),
3685 "created_at": Schema.Number.annotate({
3686 "description": "The Unix timestamp (in seconds) for when the fine-tuning job was created.",
3687 "format": "unixtime"
3688 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
3689 "level": Schema.Literals(["info", "warn", "error"]).annotate({ "description": "The log level of the event." }),
3690 "message": Schema.String.annotate({ "description": "The message of the event." }),
3691 "type": Schema.optionalKey(Schema.Literals(["message", "metrics"]).annotate({ "description": "The type of event." })),
3692 "data": Schema.optionalKey(
3693 Schema.Union([Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })), Schema.Null])
3694 .annotate({ "description": "The data associated with the event." })
3695 )
3696 }).annotate({ "description": "Fine-tuning job event object", "identifier": "FineTuningJobEvent" })
3697 export type ImageRefParam = { readonly "image_url": string; readonly "file_id"?: string } | {
3698 readonly "image_url"?: string
3699 readonly "file_id": string
3700 }
3701 export const ImageRefParam = Schema.Union([
3702 Schema.Struct({
3703 "image_url": Schema.String.annotate({
3704 "description": "A fully qualified URL or base64-encoded data URL.",
3705 "format": "uri"
3706 }).check(Schema.isMaxCodePoints(20971520).annotate({ "expected": "a string with at most 20971520 code points" })),
3707 "file_id": Schema.optionalKey(
3708 Schema.String.annotate({ "description": "The File API ID of an uploaded image to use as input." })
3709 )
3710 }),
3711 Schema.Struct({
3712 "image_url": Schema.optionalKey(
3713 Schema.String.annotate({ "description": "A fully qualified URL or base64-encoded data URL.", "format": "uri" })
3714 .check(Schema.isMaxCodePoints(20971520).annotate({ "expected": "a string with at most 20971520 code points" }))
3715 ),
3716 "file_id": Schema.String.annotate({ "description": "The File API ID of an uploaded image to use as input." })
3717 })
3718 ], { mode: "oneOf" }).annotate({
3719 "description":
3720 "Reference an input image by either URL or uploaded file ID.\nProvide exactly one of `image_url` or `file_id`.\n",
3721 "identifier": "ImageRefParam"
3722 })
3723 export type PartialImages = number | null
3724 export const PartialImages = Schema.Union([
3725 Schema.Number.annotate({
3726 "description":
3727 "The number of partial images to generate. This parameter is used for\nstreaming responses that return partial images. Value must be between 0 and 3.\nWhen set to 0, the response will be a single image sent in one streaming event.\n\nNote that the final image may be sent before the full number of partial images\nare generated if the full image is generated more quickly.\n"
3728 }).check(Schema.isInt().annotate({ "expected": "an integer" })).check(
3729 Schema.isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })
3730 ).check(Schema.isLessThanOrEqualTo(3).annotate({ "expected": "a value less than or equal to 3" })),
3731 Schema.Null
3732 ]).annotate({ "identifier": "PartialImages" })
3733 export type Image = { readonly "b64_json"?: string; readonly "url"?: string; readonly "revised_prompt"?: string }
3734 export const Image = Schema.Struct({
3735 "b64_json": Schema.optionalKey(
3736 Schema.String.annotate({
3737 "description":
3738 "The base64-encoded JSON of the generated image. Returned by default for GPT image models, or when `response_format` is set to `b64_json` for models that support that parameter."
3739 })
3740 ),
3741 "url": Schema.optionalKey(
3742 Schema.String.annotate({
3743 "description":
3744 "The URL of the generated image when `response_format` is set to `url` for models that support that parameter. Unsupported for GPT image models.",
3745 "format": "uri"
3746 })
3747 ),
3748 "revised_prompt": Schema.optionalKey(
3749 Schema.String.annotate({
3750 "description":
3751 "The revised prompt used to generate the image, for models that support prompt revision. Not returned by GPT image models."
3752 })
3753 )
3754 }).annotate({
3755 "description": "Represents the content or the URL of an image generated by the OpenAI API.",
3756 "identifier": "Image"
3757 })
3758 export type ImageGenOutputTokensDetails = { readonly "image_tokens": number; readonly "text_tokens": number }
3759 export const ImageGenOutputTokensDetails = Schema.Struct({
3760 "image_tokens": Schema.Number.annotate({ "description": "The number of image output tokens generated by the model." })
3761 .check(Schema.isInt().annotate({ "expected": "an integer" })),
3762 "text_tokens": Schema.Number.annotate({ "description": "The number of text output tokens generated by the model." })
3763 .check(Schema.isInt().annotate({ "expected": "an integer" }))
3764 }).annotate({
3765 "title": "Image generation output token details",
3766 "description": "The output token details for the image generation.",
3767 "identifier": "ImageGenOutputTokensDetails"
3768 })
3769 export type ImageGenInputUsageDetails = { readonly "text_tokens": number; readonly "image_tokens": number }
3770 export const ImageGenInputUsageDetails = Schema.Struct({
3771 "text_tokens": Schema.Number.annotate({ "description": "The number of text tokens in the input prompt." }).check(
3772 Schema.isInt().annotate({ "expected": "an integer" })
3773 ),
3774 "image_tokens": Schema.Number.annotate({ "description": "The number of image tokens in the input prompt." }).check(
3775 Schema.isInt().annotate({ "expected": "an integer" })
3776 )
3777 }).annotate({
3778 "title": "Input usage details",
3779 "description": "The input tokens detailed information for the image generation.",
3780 "identifier": "ImageGenInputUsageDetails"
3781 })
3782 export type ImageEditPartialImageEvent = {
3783 readonly "type": "image_edit.partial_image"
3784 readonly "b64_json": string
3785 readonly "created_at": number
3786 readonly "size": string | "1024x1024" | "1024x1536" | "1536x1024" | "auto"
3787 readonly "quality": "low" | "medium" | "high" | "xhigh" | "max" | "auto"
3788 readonly "background": "transparent" | "opaque" | "auto"
3789 readonly "output_format": "png" | "webp" | "jpeg"
3790 readonly "partial_image_index": number
3791 }
3792 export const ImageEditPartialImageEvent = Schema.Struct({
3793 "type": Schema.Literal("image_edit.partial_image").annotate({
3794 "description": "The type of the event. Always `image_edit.partial_image`.\n"
3795 }),
3796 "b64_json": Schema.String.annotate({
3797 "description": "Base64-encoded partial image data, suitable for rendering as an image.\n"
3798 }),
3799 "created_at": Schema.Number.annotate({
3800 "description": "The Unix timestamp when the event was created.\n",
3801 "format": "unixtime"
3802 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
3803 "size": Schema.Union([Schema.String, Schema.Literals(["1024x1024", "1024x1536", "1536x1024", "auto"])]).annotate({
3804 "description": "The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`."
3805 }),
3806 "quality": Schema.Literals(["low", "medium", "high", "xhigh", "max", "auto"]).annotate({
3807 "description": "The quality setting for the requested edited image.\n"
3808 }),
3809 "background": Schema.Literals(["transparent", "opaque", "auto"]).annotate({
3810 "description": "The background setting for the requested edited image.\n"
3811 }),
3812 "output_format": Schema.Literals(["png", "webp", "jpeg"]).annotate({
3813 "description": "The output format for the requested edited image.\n"
3814 }),
3815 "partial_image_index": Schema.Number.annotate({ "description": "0-based index for the partial image (streaming).\n" })
3816 .check(Schema.isInt().annotate({ "expected": "an integer" }))
3817 }).annotate({
3818 "description": "Emitted when a partial image is available during image editing streaming.\n",
3819 "identifier": "ImageEditPartialImageEvent"
3820 })
3821 export type ImagesUsage = {
3822 readonly "total_tokens": number
3823 readonly "input_tokens": number
3824 readonly "output_tokens": number
3825 readonly "input_tokens_details": { readonly "text_tokens": number; readonly "image_tokens": number }
3826 }
3827 export const ImagesUsage = Schema.Struct({
3828 "total_tokens": Schema.Number.annotate({
3829 "description": "The total number of tokens (images and text) used for the image generation.\n"
3830 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
3831 "input_tokens": Schema.Number.annotate({
3832 "description": "The number of tokens (images and text) in the input prompt."
3833 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
3834 "output_tokens": Schema.Number.annotate({ "description": "The number of image tokens in the output image." }).check(
3835 Schema.isInt().annotate({ "expected": "an integer" })
3836 ),
3837 "input_tokens_details": Schema.Struct({
3838 "text_tokens": Schema.Number.annotate({ "description": "The number of text tokens in the input prompt." }).check(
3839 Schema.isInt().annotate({ "expected": "an integer" })
3840 ),
3841 "image_tokens": Schema.Number.annotate({ "description": "The number of image tokens in the input prompt." }).check(
3842 Schema.isInt().annotate({ "expected": "an integer" })
3843 )
3844 }).annotate({ "description": "The input tokens detailed information for the image generation." })
3845 }).annotate({
3846 "description": "For the GPT image models only, the token usage information for the image generation.\n",
3847 "identifier": "ImagesUsage"
3848 })
3849 export type ImageGenPartialImageEvent = {
3850 readonly "type": "image_generation.partial_image"
3851 readonly "b64_json": string
3852 readonly "created_at": number
3853 readonly "size": string | "1024x1024" | "1024x1536" | "1536x1024" | "auto"
3854 readonly "quality": "low" | "medium" | "high" | "xhigh" | "max" | "auto"
3855 readonly "background": "transparent" | "opaque" | "auto"
3856 readonly "output_format": "png" | "webp" | "jpeg"
3857 readonly "partial_image_index": number
3858 }
3859 export const ImageGenPartialImageEvent = Schema.Struct({
3860 "type": Schema.Literal("image_generation.partial_image").annotate({
3861 "description": "The type of the event. Always `image_generation.partial_image`.\n"
3862 }),
3863 "b64_json": Schema.String.annotate({
3864 "description": "Base64-encoded partial image data, suitable for rendering as an image.\n"
3865 }),
3866 "created_at": Schema.Number.annotate({
3867 "description": "The Unix timestamp when the event was created.\n",
3868 "format": "unixtime"
3869 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
3870 "size": Schema.Union([Schema.String, Schema.Literals(["1024x1024", "1024x1536", "1536x1024", "auto"])]).annotate({
3871 "description": "The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`."
3872 }),
3873 "quality": Schema.Literals(["low", "medium", "high", "xhigh", "max", "auto"]).annotate({
3874 "description": "The quality setting for the requested image.\n"
3875 }),
3876 "background": Schema.Literals(["transparent", "opaque", "auto"]).annotate({
3877 "description": "The background setting for the requested image.\n"
3878 }),
3879 "output_format": Schema.Literals(["png", "webp", "jpeg"]).annotate({
3880 "description": "The output format for the requested image.\n"
3881 }),
3882 "partial_image_index": Schema.Number.annotate({ "description": "0-based index for the partial image (streaming).\n" })
3883 .check(Schema.isInt().annotate({ "expected": "an integer" }))
3884 }).annotate({
3885 "description": "Emitted when a partial image is available during image generation streaming.\n",
3886 "identifier": "ImageGenPartialImageEvent"
3887 })
3888 export type ModelIdsLive = string | "gpt-live-1"
3889 export const ModelIdsLive = Schema.Union([
3890 Schema.String.check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })),
3891 Schema.Literal("gpt-live-1")
3892 ]).annotate({
3893 "description":
3894 "The Live model. Required in the session configuration for every transport; do not pass it as a URL query parameter.",
3895 "identifier": "ModelIdsLive"
3896 })
3897 export type Instructions = string | null
3898 export const Instructions = Schema.Union([
3899 Schema.String.annotate({
3900 "description":
3901 "Frontend instructions for voice, conversation, interruptions, and when to delegate. Start with the [Live prompting guide](https://developers.openai.com/api/docs/guides/live-prompting); put business rules and tool workflows in a separate [backend prompt](https://developers.openai.com/api/docs/guides/live-delegation#start-with-your-existing-backend-prompt). Limited to 16,384 client-supplied tokens. Omitted or blank instructions use server defaults. Immutable after startup."
3902 }),
3903 Schema.Null
3904 ]).annotate({ "identifier": "instructions" })
3905 export type LiveCustomVoiceParam = { readonly "id": string }
3906 export const LiveCustomVoiceParam = Schema.Struct({
3907 "id": Schema.String.check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" }))
3908 .check(Schema.isMaxCodePoints(128).annotate({ "expected": "a string with at most 128 code points" }))
3909 }).annotate({ "identifier": "LiveCustomVoiceParam" })
3910 export type LiveClientDelegationParam = { readonly "type": "client" }
3911 export const LiveClientDelegationParam = Schema.Struct({
3912 "type": Schema.Literal("client").annotate({
3913 "description": "The delegation owner. Always `client` for tasks handled by your application."
3914 })
3915 }).annotate({
3916 "description":
3917 "Delegate tasks to your application. The Live session emits delegation events that your backend handles.",
3918 "identifier": "LiveClientDelegationParam"
3919 })
3920 export type LiveResponsesServiceTier = "auto" | "default" | "fast_tier_temp_pilot" | "flex" | "priority" | "ultrafast"
3921 export const LiveResponsesServiceTier = Schema.Literals([
3922 "auto",
3923 "default",
3924 "fast_tier_temp_pilot",
3925 "flex",
3926 "priority",
3927 "ultrafast"
3928 ]).annotate({ "identifier": "LiveResponsesServiceTier" })
3929 export type LiveReasoningEffort = "none" | "minimal" | "low" | "medium" | "high" | "xhigh"
3930 export const LiveReasoningEffort = Schema.Literals(["none", "minimal", "low", "medium", "high", "xhigh"]).annotate({
3931 "identifier": "LiveReasoningEffort"
3932 })
3933 export type LiveReasoningSummary = "concise" | "detailed" | "auto"
3934 export const LiveReasoningSummary = Schema.Literals(["concise", "detailed", "auto"]).annotate({
3935 "identifier": "LiveReasoningSummary"
3936 })
3937 export type LiveTextVerbosity = "low" | "medium" | "high"
3938 export const LiveTextVerbosity = Schema.Literals(["low", "medium", "high"]).annotate({
3939 "identifier": "LiveTextVerbosity"
3940 })
3941 export type LiveFunctionToolInputParam = {
3942 readonly "type": "function"
3943 readonly "name": string
3944 readonly "description"?: string | null
3945 readonly "parameters"?: { readonly [x: string]: Schema.Json } | null
3946 readonly "strict"?: boolean | null
3947 }
3948 export const LiveFunctionToolInputParam = Schema.Struct({
3949 "type": Schema.Literal("function").annotate({ "description": "The tool type. Always `function`." }),
3950 "name": Schema.String.annotate({
3951 "description": "The name the delegated Responses model uses when calling this function."
3952 }),
3953 "description": Schema.optionalKey(
3954 Schema.Union([
3955 Schema.String.annotate({
3956 "description": "What the function does and when the delegated Responses model should call it."
3957 }),
3958 Schema.Null
3959 ])
3960 ),
3961 "parameters": Schema.optionalKey(
3962 Schema.Union([
3963 Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" })).annotate({
3964 "description": "A JSON Schema object describing the arguments accepted by the function."
3965 }),
3966 Schema.Null
3967 ])
3968 ),
3969 "strict": Schema.optionalKey(
3970 Schema.Union([
3971 Schema.Boolean.annotate({
3972 "description": "Whether the delegated Responses model must follow the function’s parameter schema exactly."
3973 }),
3974 Schema.Null
3975 ])
3976 )
3977 }).annotate({
3978 "description": "A function tool available to the Responses backend when the Live model delegates a task.",
3979 "identifier": "LiveFunctionToolInputParam"
3980 })
3981 export type LiveWebSearchToolInputParam = { readonly "type": "web_search" }
3982 export const LiveWebSearchToolInputParam = Schema.Struct({
3983 "type": Schema.Literal("web_search").annotate({ "description": "The tool type. Always `web_search`." })
3984 }).annotate({
3985 "description": "A web search tool available to the Live session’s Responses backend.",
3986 "identifier": "LiveWebSearchToolInputParam"
3987 })
3988 export type LiveFileSearchToolInputParam = { readonly "type": "file_search" }
3989 export const LiveFileSearchToolInputParam = Schema.Struct({ "type": Schema.Literal("file_search") }).annotate({
3990 "identifier": "LiveFileSearchToolInputParam"
3991 })
3992 export type LiveCodeInterpreterToolInputParam = { readonly "type": "code_interpreter" }
3993 export const LiveCodeInterpreterToolInputParam = Schema.Struct({ "type": Schema.Literal("code_interpreter") }).annotate(
3994 { "identifier": "LiveCodeInterpreterToolInputParam" }
3995 )
3996 export type LiveContainerMemoryLimit = "1g" | "4g" | "16g" | "64g"
3997 export const LiveContainerMemoryLimit = Schema.Literals(["1g", "4g", "16g", "64g"]).annotate({
3998 "identifier": "LiveContainerMemoryLimit"
3999 })
4000 export type LiveContainerNetworkPolicyDisabledParam = { readonly "type": "disabled" }
4001 export const LiveContainerNetworkPolicyDisabledParam = Schema.Struct({
4002 "type": Schema.Literal("disabled").annotate({ "description": "Disable outbound network access. Always `disabled`." })
4003 }).annotate({ "identifier": "LiveContainerNetworkPolicyDisabledParam" })
4004 export type LiveHostedShellNetworkPolicyAllowlistParam = {
4005 readonly "type": "allowlist"
4006 readonly "allowed_domains": ReadonlyArray<string>
4007 }
4008 export const LiveHostedShellNetworkPolicyAllowlistParam = Schema.Struct({
4009 "type": Schema.Literal("allowlist").annotate({
4010 "description": "Allow outbound network access only to specified domains. Always `allowlist`."
4011 }),
4012 "allowed_domains": Schema.Array(Schema.String).annotate({
4013 "description": "A list of allowed domains when type is `allowlist`."
4014 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" }))
4015 }).annotate({ "identifier": "LiveHostedShellNetworkPolicyAllowlistParam" })
4016 export type LiveSkillReferenceParam = {
4017 readonly "type": "skill_reference"
4018 readonly "skill_id": string
4019 readonly "version"?: string | null
4020 }
4021 export const LiveSkillReferenceParam = Schema.Struct({
4022 "type": Schema.Literal("skill_reference").annotate({
4023 "description": "References a skill created with the /v1/skills endpoint."
4024 }),
4025 "skill_id": Schema.String.annotate({ "description": "The ID of the referenced skill." }).check(
4026 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
4027 ).check(Schema.isMaxCodePoints(64).annotate({ "expected": "a string with at most 64 code points" })),
4028 "version": Schema.optionalKey(
4029 Schema.Union([
4030 Schema.String.annotate({
4031 "description": "Optional skill version. Use a positive integer or 'latest'. Omit for default."
4032 }),
4033 Schema.Null
4034 ])
4035 )
4036 }).annotate({ "identifier": "LiveSkillReferenceParam" })
4037 export type LiveInlineSkillSourceParam = {
4038 readonly "type": "base64"
4039 readonly "media_type": "application/zip"
4040 readonly "data": string
4041 }
4042 export const LiveInlineSkillSourceParam = Schema.Struct({
4043 "type": Schema.Literal("base64").annotate({
4044 "description": "The type of the inline skill source. Must be `base64`."
4045 }),
4046 "media_type": Schema.Literal("application/zip").annotate({
4047 "description": "The media type of the inline skill payload. Must be `application/zip`."
4048 }),
4049 "data": Schema.String.annotate({ "description": "Base64-encoded skill zip bundle." }).check(
4050 Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })
4051 ).check(Schema.isMaxCodePoints(70254592).annotate({ "expected": "a string with at most 70254592 code points" }))
4052 }).annotate({ "description": "Inline skill payload", "identifier": "LiveInlineSkillSourceParam" })
4053 export type LiveContainerReferenceParam = { readonly "type": "container_reference"; readonly "container_id": string }
4054 export const LiveContainerReferenceParam = Schema.Struct({
4055 "type": Schema.Literal("container_reference").annotate({
4056 "description": "References a container created with the /v1/containers endpoint"
4057 }),
4058 "container_id": Schema.String.annotate({ "description": "The ID of the referenced container." })
4059 }).annotate({ "identifier": "LiveContainerReferenceParam" })
4060 export type LiveLocalSkillParam = { readonly "name": string; readonly "description": string; readonly "path": string }
4061 export const LiveLocalSkillParam = Schema.Struct({
4062 "name": Schema.String.annotate({ "description": "The name of the skill." }),
4063 "description": Schema.String.annotate({ "description": "The description of the skill." }),
4064 "path": Schema.String.annotate({ "description": "The path to the directory containing the skill." })
4065 }).annotate({ "identifier": "LiveLocalSkillParam" })
4066 export type LiveImageGenerationToolInputParam = { readonly "type": "image_generation" }
4067 export const LiveImageGenerationToolInputParam = Schema.Struct({ "type": Schema.Literal("image_generation") }).annotate(
4068 { "identifier": "LiveImageGenerationToolInputParam" }
4069 )
4070 export type LiveMCPToolInputParam = { readonly "type": "mcp" }
4071 export const LiveMCPToolInputParam = Schema.Struct({ "type": Schema.Literal("mcp") }).annotate({
4072 "identifier": "LiveMCPToolInputParam"
4073 })
4074 export type LiveCustomToolInputParam = { readonly "type": "custom" }
4075 export const LiveCustomToolInputParam = Schema.Struct({ "type": Schema.Literal("custom") }).annotate({
4076 "identifier": "LiveCustomToolInputParam"
4077 })
4078 export type LiveNamespaceToolInputParam = { readonly "type": "namespace" }
4079 export const LiveNamespaceToolInputParam = Schema.Struct({ "type": Schema.Literal("namespace") }).annotate({
4080 "identifier": "LiveNamespaceToolInputParam"
4081 })
4082 export type LiveToolSearchToolInputParam = { readonly "type": "tool_search" }
4083 export const LiveToolSearchToolInputParam = Schema.Struct({ "type": Schema.Literal("tool_search") }).annotate({
4084 "identifier": "LiveToolSearchToolInputParam"
4085 })
4086 export type LiveProgrammaticToolInputParam = { readonly "type": "programmatic_tool_calling" }
4087 export const LiveProgrammaticToolInputParam = Schema.Struct({ "type": Schema.Literal("programmatic_tool_calling") })
4088 .annotate({ "identifier": "LiveProgrammaticToolInputParam" })
4089 export type LiveComputerToolInputParam = { readonly "type": "computer" }
4090 export const LiveComputerToolInputParam = Schema.Struct({ "type": Schema.Literal("computer") }).annotate({
4091 "identifier": "LiveComputerToolInputParam"
4092 })
4093 export type LiveApplyPatchToolInputParam = { readonly "type": "apply_patch" }
4094 export const LiveApplyPatchToolInputParam = Schema.Struct({ "type": Schema.Literal("apply_patch") }).annotate({
4095 "identifier": "LiveApplyPatchToolInputParam"
4096 })
4097 export type LiveToolChoiceEnum = "auto" | "none" | "required"
4098 export const LiveToolChoiceEnum = Schema.Literals(["auto", "none", "required"]).annotate({
4099 "identifier": "LiveToolChoiceEnum"
4100 })
4101 export type LiveFunctionToolChoiceParam = { readonly "type": "function"; readonly "name": string }
4102 export const LiveFunctionToolChoiceParam = Schema.Struct({
4103 "type": Schema.Literal("function").annotate({ "description": "The tool to call. Always `function`." }),
4104 "name": Schema.String.annotate({ "description": "The name of the function tool to call." })
4105 }).annotate({ "identifier": "LiveFunctionToolChoiceParam" })
4106 export type LiveMCPToolChoiceParam = {
4107 readonly "type": "mcp"
4108 readonly "server_label": string
4109 readonly "name"?: string | null
4110 }
4111 export const LiveMCPToolChoiceParam = Schema.Struct({
4112 "type": Schema.Literal("mcp").annotate({ "description": "The tool to call. Always `mcp`." }),
4113 "server_label": Schema.String.annotate({ "description": "The label of the MCP server to call." }),
4114 "name": Schema.optionalKey(
4115 Schema.Union([
4116 Schema.String.annotate({
4117 "description": "The name of the MCP tool to call. If omitted, the server may choose a default."
4118 }),
4119 Schema.Null
4120 ])
4121 )
4122 }).annotate({ "identifier": "LiveMCPToolChoiceParam" })
4123 export type LiveSpecificFileSearchParam = { readonly "type": "file_search" }
4124 export const LiveSpecificFileSearchParam = Schema.Struct({
4125 "type": Schema.Literal("file_search").annotate({ "description": "The tool to call. Always `file_search`." })
4126 }).annotate({ "identifier": "LiveSpecificFileSearchParam" })
4127 export type LiveSpecificWebSearchParam = { readonly "type": "web_search" }
4128 export const LiveSpecificWebSearchParam = Schema.Struct({
4129 "type": Schema.Literal("web_search").annotate({ "description": "The tool to call. Always `web_search`." })
4130 }).annotate({ "identifier": "LiveSpecificWebSearchParam" })
4131 export type LiveSpecificWebSearchPreviewParam = { readonly "type": "web_search_preview" }
4132 export const LiveSpecificWebSearchPreviewParam = Schema.Struct({
4133 "type": Schema.Literal("web_search_preview").annotate({
4134 "description": "The tool to call. Always `web_search_preview`."
4135 })
4136 }).annotate({ "identifier": "LiveSpecificWebSearchPreviewParam" })
4137 export type LiveSpecificImageGenParam = { readonly "type": "image_generation" }
4138 export const LiveSpecificImageGenParam = Schema.Struct({
4139 "type": Schema.Literal("image_generation").annotate({ "description": "The tool to call. Always `image_generation`." })
4140 }).annotate({ "identifier": "LiveSpecificImageGenParam" })
4141 export type LiveSpecificComputerParam = { readonly "type": "computer" }
4142 export const LiveSpecificComputerParam = Schema.Struct({
4143 "type": Schema.Literal("computer").annotate({ "description": "The tool to call. Always `computer`." })
4144 }).annotate({ "identifier": "LiveSpecificComputerParam" })
4145 export type LiveSpecificCodeInterpreterParam = { readonly "type": "code_interpreter" }
4146 export const LiveSpecificCodeInterpreterParam = Schema.Struct({
4147 "type": Schema.Literal("code_interpreter").annotate({ "description": "The tool to call. Always `code_interpreter`." })
4148 }).annotate({ "identifier": "LiveSpecificCodeInterpreterParam" })
4149 export type LiveSpecificProgrammaticToolCallingParam = { readonly "type": "programmatic_tool_calling" }
4150 export const LiveSpecificProgrammaticToolCallingParam = Schema.Struct({
4151 "type": Schema.Literal("programmatic_tool_calling").annotate({
4152 "description": "The tool to call. Always `programmatic_tool_calling`."
4153 })
4154 }).annotate({ "identifier": "LiveSpecificProgrammaticToolCallingParam" })
4155 export type LiveSpecificFunctionShellParam = { readonly "type": "shell" }
4156 export const LiveSpecificFunctionShellParam = Schema.Struct({
4157 "type": Schema.Literal("shell").annotate({ "description": "The tool to call. Always `shell`." })
4158 }).annotate({
4159 "title": "Specific shell tool choice",
4160 "description": "Forces the model to call the shell tool when a tool call is required.",
4161 "identifier": "LiveSpecificFunctionShellParam"
4162 })
4163 export type LiveSpecificCustomToolParam = { readonly "type": "custom"; readonly "name": string }
4164 export const LiveSpecificCustomToolParam = Schema.Struct({
4165 "type": Schema.Literal("custom").annotate({ "description": "The tool to call. Always `custom`." }),
4166 "name": Schema.String.annotate({ "description": "The name of the custom tool to call." })
4167 }).annotate({ "identifier": "LiveSpecificCustomToolParam" })
4168 export type LiveSpecificApplyPatchParam = { readonly "type": "apply_patch" }
4169 export const LiveSpecificApplyPatchParam = Schema.Struct({
4170 "type": Schema.Literal("apply_patch").annotate({ "description": "The tool to call. Always `apply_patch`." })
4171 }).annotate({
4172 "title": "Specific apply patch tool choice",
4173 "description": "Forces the model to call the apply_patch tool when executing a tool call.",
4174 "identifier": "LiveSpecificApplyPatchParam"
4175 })
4176 export type LiveToolChoiceValueEnum = "none" | "auto" | "required"
4177 export const LiveToolChoiceValueEnum = Schema.Literals(["none", "auto", "required"]).annotate({
4178 "identifier": "LiveToolChoiceValueEnum"
4179 })
4180 export type Store = boolean
4181 export const Store = Schema.Boolean.annotate({
4182 "description":
4183 "Whether to store the session for later forking and recording download. Defaults to false for new sessions.",
4184 "identifier": "store"
4185 })
4186 export type LiveInitialMessageStatus = "incomplete" | "completed"
4187 export const LiveInitialMessageStatus = Schema.Literals(["incomplete", "completed"]).annotate({
4188 "identifier": "LiveInitialMessageStatus"
4189 })
4190 export type LiveInitialInputTextContentPartParam = { readonly "type"?: "input_text"; readonly "text": string }
4191 export const LiveInitialInputTextContentPartParam = Schema.Struct({
4192 "type": Schema.optionalKey(
4193 Schema.Literal("input_text").annotate({ "description": "The text content type. Always `input_text`." })
4194 ),
4195 "text": Schema.String.annotate({
4196 "description": "The message text to include in the Live session’s initial conversation history."
4197 })
4198 }).annotate({
4199 "description": "Text supplied in a developer or user message when starting a Live session.",
4200 "identifier": "LiveInitialInputTextContentPartParam"
4201 })
4202 export type LiveInitialTextContentPartParam = { readonly "type"?: "text"; readonly "text": string }
4203 export const LiveInitialTextContentPartParam = Schema.Struct({
4204 "type": Schema.optionalKey(
4205 Schema.Literal("text").annotate({ "description": "The text content type. Always `text`." })
4206 ),
4207 "text": Schema.String.annotate({
4208 "description": "The message text to include in the Live session’s initial conversation history."
4209 })
4210 }).annotate({
4211 "description": "Assistant text supplied as conversation history when starting a Live session.",
4212 "identifier": "LiveInitialTextContentPartParam"
4213 })
4214 export type LiveInitialOutputTextContentPartParam = { readonly "type": "output_text"; readonly "text": string }
4215 export const LiveInitialOutputTextContentPartParam = Schema.Struct({
4216 "type": Schema.Literal("output_text").annotate({ "description": "The text content type. Always `output_text`." }),
4217 "text": Schema.String.annotate({
4218 "description": "The message text to include in the Live session’s initial conversation history."
4219 })
4220 }).annotate({
4221 "description": "Assistant output text supplied as conversation history when starting a Live session.",
4222 "identifier": "LiveInitialOutputTextContentPartParam"
4223 })
4224 export type LiveAllowedServerEventParam = { readonly "type": string; readonly "response_event"?: string }
4225 export const LiveAllowedServerEventParam = Schema.Struct({
4226 "type": Schema.String.annotate({
4227 "description": "The outer Live server event type. Use 'response.event' for Responses events."
4228 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(
4229 Schema.isMaxCodePoints(256).annotate({ "expected": "a string with at most 256 code points" })
4230 ),
4231 "response_event": Schema.optionalKey(
4232 Schema.String.annotate({
4233 "description":
4234 "The nested Responses event type. Required when type is 'response.event'; forbidden for other event types."
4235 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(
4236 Schema.isMaxCodePoints(256).annotate({ "expected": "a string with at most 256 code points" })
4237 )
4238 )
4239 }).annotate({
4240 "description": "A Live server event selector for the WebRTC frontend data channel.",
4241 "identifier": "LiveAllowedServerEventParam"
4242 })
4243 export type LiveWebRTCTransport = { readonly "type": "webrtc"; readonly "sdp": string }
4244 export const LiveWebRTCTransport = Schema.Struct({
4245 "type": Schema.Literal("webrtc").annotate({
4246 "description": "The transport used for the Live session. Always `webrtc`."
4247 }),
4248 "sdp": Schema.String.annotate({ "description": "Session Description Protocol message for the WebRTC connection." })
4249 .check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" }))
4250 }).annotate({
4251 "description": "WebRTC transport carrying the offer SDP in a creation request or answer SDP in its response.",
4252 "identifier": "LiveWebRTCTransport"
4253 })
4254 export type LiveSIPTrunkAuth = { readonly "type": "digest"; readonly "username": string; readonly "password": string }
4255 export const LiveSIPTrunkAuth = Schema.Struct({
4256 "type": Schema.Literal("digest").annotate({
4257 "description": "Use `digest` for SIP Digest authentication. Handles 401 and 407 challenges."
4258 }),
4259 "username": Schema.String.annotate({
4260 "description":
4261 "Provider username. Must contain a non-whitespace character, be at most 256 bytes, and contain no CR, LF, or NUL."
4262 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })),
4263 "password": Schema.String.annotate({
4264 "description": "Provider password. Must be at most 4096 bytes and contain no CR, LF, or NUL.",
4265 "writeOnly": true
4266 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" }))
4267 }).annotate({
4268 "description": "Credentials for SIP Digest authentication with your trunk provider.",
4269 "identifier": "LiveSIPTrunkAuth"
4270 })
4271 export type Session = { readonly "id": string }
4272 export const Session = Schema.Struct({
4273 "id": Schema.String.annotate({
4274 "description": "Opaque session identifier. Preserve the returned value unchanged, including its prefix."
4275 })
4276 }).annotate({
4277 "description": "The newly created Live session. Use its ID for session controls and sideband connections.",
4278 "identifier": "session"
4279 })
4280 export type Properties_store = boolean
4281 export const Properties_store = Schema.Boolean.annotate({
4282 "description": "Whether to store the forked session. Omission inherits the stored session's setting.",
4283 "identifier": "properties-store"
4284 })
4285 export type LiveCallReferRequest = { readonly "target_uri": string }
4286 export const LiveCallReferRequest = Schema.Struct({
4287 "target_uri": Schema.String.annotate({
4288 "description": "Nonblank URI for the SIP Refer-To header, such as tel:+14155550123 or sip:agent@example.com."
4289 }).check(Schema.isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(
4290 Schema.isPattern(new RegExp("\\S", "u")).annotate({ "expected": "a string matching the RegExp \\S" })
4291 )
4292 }).annotate({
4293 "description": "Parameters used to transfer a Live SIP call to another destination.",
4294 "identifier": "LiveCallReferRequest"
4295 })
4296 export type LiveCallRejectRequest = { readonly "status_code": number }
4297 export const LiveCallRejectRequest = Schema.Struct({
4298 "status_code": Schema.Number.annotate({
4299 "description": "SIP rejection status sent to the caller. This field is required."
4300 }).check(Schema.isInt().annotate({ "expected": "an integer" })).check(
4301 Schema.isGreaterThanOrEqualTo(300).annotate({ "expected": "a value greater than or equal to 300" })
4302 ).check(Schema.isLessThanOrEqualTo(699).annotate({ "expected": "a value less than or equal to 699" }))
4303 }).annotate({
4304 "description": "Parameters used to reject an incoming Live SIP call.",
4305 "identifier": "LiveCallRejectRequest"
4306 })
4307 export type Model =
4308 | null
4309 | string
4310 | number
4311 | boolean
4312 | {
4313 readonly "id": string
4314 readonly "created": number
4315 readonly "object": "model"
4316 readonly "owned_by": string
4317 readonly "shutdown_date"?: string | null
4318 } & { readonly [x: string]: Schema.Json }
4319 | ReadonlyArray<Schema.Json>
4320 export const Model = Schema.Union([
4321 Schema.Null,
4322 Schema.String,
4323 Schema.Finite,
4324 Schema.Boolean,
4325 Schema.StructWithRest(
4326 Schema.Struct({
4327 "id": Schema.String.annotate({
4328 "description": "The model identifier, which can be referenced in the API endpoints."
4329 }),
4330 "created": Schema.Number.annotate({
4331 "description": "The Unix timestamp (in seconds) when the model was created.",
4332 "format": "unixtime"
4333 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
4334 "object": Schema.Literal("model").annotate({ "description": "The object type, which is always \"model\"." }),
4335 "owned_by": Schema.String.annotate({ "description": "The organization that owns the model." }),
4336 "shutdown_date": Schema.optionalKey(
4337 Schema.Union([Schema.String.annotate({ "format": "date" }), Schema.Null]).annotate({
4338 "description": "The date when the model will shut down, or null if not announced."
4339 })
4340 )
4341 }),
4342 [Schema.Record(Schema.String, Schema.Json.annotate({ "expected": "JSON value" }))]
4343 ),
4344 Schema.Array(Schema.Json.annotate({ "expected": "JSON value" }))
4345 ]).annotate({
4346 "title": "Model",
4347 "description": "Describes an OpenAI model offering that can be used with the API.",
4348 "identifier": "Model"
4349 })
4350 export type DeleteModelResponse = { readonly "id": string; readonly "deleted": boolean; readonly "object": string }
4351 export const DeleteModelResponse = Schema.Struct({
4352 "id": Schema.String,
4353 "deleted": Schema.Boolean,
4354 "object": Schema.String
4355 }).annotate({ "identifier": "DeleteModelResponse" })
4356 export type CreateModerationRequest = {
4357 readonly "input":
4358 | string
4359 | ReadonlyArray<string>
4360 | ReadonlyArray<
4361 { readonly "type": "image_url"; readonly "image_url": { readonly "url": string } } | {
4362 readonly "type": "text"
4363 readonly "text": string
4364 }
4365 >
4366 readonly "model"?:
4367 | string
4368 | "omni-moderation-latest"
4369 | "omni-moderation-2024-09-26"
4370 | "text-moderation-latest"
4371 | "text-moderation-stable"
4372 }
4373 export const CreateModerationRequest = Schema.Struct({
4374 "input": Schema.Union([
4375 Schema.String.annotate({ "description": "A string of text to classify for moderation." }),
4376 Schema.Array(Schema.String).annotate({ "description": "An array of strings to classify for moderation." }),
4377 Schema.Array(Schema.Union([
4378 Schema.Struct({
4379 "type": Schema.Literal("image_url").annotate({ "description": "Always `image_url`." }),
4380 "image_url": Schema.Struct({
4381 "url": Schema.String.annotate({
4382 "description": "Either a URL of the image or the base64 encoded image data.",
4383 "format": "uri"
4384 })
4385 }).annotate({ "description": "Contains either an image URL or a data URL for a base64 encoded image." })
4386 }).annotate({ "description": "An object describing an image to classify." }),
4387 Schema.Struct({
4388 "type": Schema.Literal("text").annotate({ "description": "Always `text`." }),
4389 "text": Schema.String.annotate({ "description": "A string of text to classify." })
4390 }).annotate({ "description": "An object describing text to classify." })
4391 ], { mode: "oneOf" })).annotate({ "description": "An array of multi-modal inputs to the moderation model." })
4392 ], { mode: "oneOf" }).annotate({
4393 "description":
4394 "Input (or inputs) to classify. Can be a single string, an array of strings, or\nan array of multi-modal input objects similar to other models.\n"
4395 }),
4396 "model": Schema.optionalKey(
4397 Schema.Union([
4398 Schema.String,
4399 Schema.Literals([
4400 "omni-moderation-latest",
4401 "omni-moderation-2024-09-26",
4402 "text-moderation-latest",
4403 "text-moderation-stable"
4404 ])
4405 ]).annotate({
4406 "description":
4407 "The content moderation model you would like to use. Learn more in\n[the moderation guide](https://developers.openai.com/api/docs/guides/moderation), and learn about\navailable models [here](https://developers.openai.com/api/docs/guides/moderation).\n"
4408 })
4409 )
4410 }).annotate({ "identifier": "CreateModerationRequest" })
4411 export type CreateModerationResponse = {
4412 readonly "id": string
4413 readonly "model": string
4414 readonly "results": ReadonlyArray<
4415 {
4416 readonly "flagged": boolean
4417 readonly "categories": {
4418 readonly "hate": boolean
4419 readonly "hate/threatening": boolean
4420 readonly "harassment": boolean
4421 readonly "harassment/threatening": boolean
4422 readonly "illicit": boolean | null
4423 readonly "illicit/violent": boolean | null
4424 readonly "self-harm": boolean
4425 readonly "self-harm/intent": boolean
4426 readonly "self-harm/instructions": boolean
4427 readonly "sexual": boolean
4428 readonly "sexual/minors": boolean
4429 readonly "violence": boolean
4430 readonly "violence/graphic": boolean
4431 }
4432 readonly "category_scores": {
4433 readonly "hate": number
4434 readonly "hate/threatening": number
4435 readonly "harassment": number
4436 readonly "harassment/threatening": number
4437 readonly "illicit": number
4438 readonly "illicit/violent": number
4439 readonly "self-harm": number
4440 readonly "self-harm/intent": number
4441 readonly "self-harm/instructions": number
4442 readonly "sexual": number
4443 readonly "sexual/minors": number
4444 readonly "violence": number
4445 readonly "violence/graphic": number
4446 }
4447 readonly "category_applied_input_types": {
4448 readonly "hate": ReadonlyArray<"text">
4449 readonly "hate/threatening": ReadonlyArray<"text">
4450 readonly "harassment": ReadonlyArray<"text">
4451 readonly "harassment/threatening": ReadonlyArray<"text">
4452 readonly "illicit": ReadonlyArray<"text">
4453 readonly "illicit/violent": ReadonlyArray<"text">
4454 readonly "self-harm": ReadonlyArray<"text" | "image">
4455 readonly "self-harm/intent": ReadonlyArray<"text" | "image">
4456 readonly "self-harm/instructions": ReadonlyArray<"text" | "image">
4457 readonly "sexual": ReadonlyArray<"text" | "image">
4458 readonly "sexual/minors": ReadonlyArray<"text">
4459 readonly "violence": ReadonlyArray<"text" | "image">
4460 readonly "violence/graphic": ReadonlyArray<"text" | "image">
4461 }
4462 }
4463 >
4464 }
4465 export const CreateModerationResponse = Schema.Struct({
4466 "id": Schema.String.annotate({ "description": "The unique identifier for the moderation request." }),
4467 "model": Schema.String.annotate({ "description": "The model used to generate the moderation results." }),
4468 "results": Schema.Array(Schema.Struct({
4469 "flagged": Schema.Boolean.annotate({ "description": "Whether any of the below categories are flagged." }),
4470 "categories": Schema.Struct({
4471 "hate": Schema.Boolean.annotate({
4472 "description":
4473 "Content that expresses, incites, or promotes hate based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. Hateful content aimed at non-protected groups (e.g., chess players) is harassment."
4474 }),
4475 "hate/threatening": Schema.Boolean.annotate({
4476 "description":
4477 "Hateful content that also includes violence or serious harm towards the targeted group based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste."
4478 }),
4479 "harassment": Schema.Boolean.annotate({
4480 "description": "Content that expresses, incites, or promotes harassing language towards any target."
4481 }),
4482 "harassment/threatening": Schema.Boolean.annotate({
4483 "description": "Harassment content that also includes violence or serious harm towards any target."
4484 }),
4485 "illicit": Schema.Union([
4486 Schema.Boolean.annotate({
4487 "description":
4488 "Content that includes instructions or advice that facilitate the planning or execution of wrongdoing, or that gives advice or instruction on how to commit illicit acts. For example, \"how to shoplift\" would fit this category."
4489 }),
4490 Schema.Null
4491 ]),
4492 "illicit/violent": Schema.Union([
4493 Schema.Boolean.annotate({
4494 "description":
4495 "Content that includes instructions or advice that facilitate the planning or execution of wrongdoing that also includes violence, or that gives advice or instruction on the procurement of any weapon."
4496 }),
4497 Schema.Null
4498 ]),
4499 "self-harm": Schema.Boolean.annotate({
4500 "description":
4501 "Content that promotes, encourages, or depicts acts of self-harm, such as suicide, cutting, and eating disorders."
4502 }),
4503 "self-harm/intent": Schema.Boolean.annotate({
4504 "description":
4505 "Content where the speaker expresses that they are engaging or intend to engage in acts of self-harm, such as suicide, cutting, and eating disorders."
4506 }),
4507 "self-harm/instructions": Schema.Boolean.annotate({
4508 "description":
4509 "Content that encourages performing acts of self-harm, such as suicide, cutting, and eating disorders, or that gives instructions or advice on how to commit such acts."
4510 }),
4511 "sexual": Schema.Boolean.annotate({
4512 "description":
4513 "Content meant to arouse sexual excitement, such as the description of sexual activity, or that promotes sexual services (excluding sex education and wellness)."
4514 }),
4515 "sexual/minors": Schema.Boolean.annotate({
4516 "description": "Sexual content that includes an individual who is under 18 years old."
4517 }),
4518 "violence": Schema.Boolean.annotate({
4519 "description": "Content that depicts death, violence, or physical injury."
4520 }),
4521 "violence/graphic": Schema.Boolean.annotate({
4522 "description": "Content that depicts death, violence, or physical injury in graphic detail."
4523 })
4524 }).annotate({ "description": "A list of the categories, and whether they are flagged or not." }),
4525 "category_scores": Schema.Struct({
4526 "hate": Schema.Number.annotate({ "description": "The score for the category 'hate'." }).check(
4527 Schema.isFinite().annotate({ "expected": "a finite number" })
4528 ),
4529 "hate/threatening": Schema.Number.annotate({ "description": "The score for the category 'hate/threatening'." })
4530 .check(Schema.isFinite().annotate({ "expected": "a finite number" })),
4531 "harassment": Schema.Number.annotate({ "description": "The score for the category 'harassment'." }).check(
4532 Schema.isFinite().annotate({ "expected": "a finite number" })
4533 ),
4534 "harassment/threatening": Schema.Number.annotate({
4535 "description": "The score for the category 'harassment/threatening'."
4536 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
4537 "illicit": Schema.Number.annotate({ "description": "The score for the category 'illicit'." }).check(
4538 Schema.isFinite().annotate({ "expected": "a finite number" })
4539 ),
4540 "illicit/violent": Schema.Number.annotate({ "description": "The score for the category 'illicit/violent'." })
4541 .check(Schema.isFinite().annotate({ "expected": "a finite number" })),
4542 "self-harm": Schema.Number.annotate({ "description": "The score for the category 'self-harm'." }).check(
4543 Schema.isFinite().annotate({ "expected": "a finite number" })
4544 ),
4545 "self-harm/intent": Schema.Number.annotate({ "description": "The score for the category 'self-harm/intent'." })
4546 .check(Schema.isFinite().annotate({ "expected": "a finite number" })),
4547 "self-harm/instructions": Schema.Number.annotate({
4548 "description": "The score for the category 'self-harm/instructions'."
4549 }).check(Schema.isFinite().annotate({ "expected": "a finite number" })),
4550 "sexual": Schema.Number.annotate({ "description": "The score for the category 'sexual'." }).check(
4551 Schema.isFinite().annotate({ "expected": "a finite number" })
4552 ),
4553 "sexual/minors": Schema.Number.annotate({ "description": "The score for the category 'sexual/minors'." }).check(
4554 Schema.isFinite().annotate({ "expected": "a finite number" })
4555 ),
4556 "violence": Schema.Number.annotate({ "description": "The score for the category 'violence'." }).check(
4557 Schema.isFinite().annotate({ "expected": "a finite number" })
4558 ),
4559 "violence/graphic": Schema.Number.annotate({ "description": "The score for the category 'violence/graphic'." })
4560 .check(Schema.isFinite().annotate({ "expected": "a finite number" }))
4561 }).annotate({ "description": "A list of the categories along with their scores as predicted by model." }),
4562 "category_applied_input_types": Schema.Struct({
4563 "hate": Schema.Array(Schema.Literal("text")).annotate({
4564 "description": "The applied input type(s) for the category 'hate'."
4565 }),
4566 "hate/threatening": Schema.Array(Schema.Literal("text")).annotate({
4567 "description": "The applied input type(s) for the category 'hate/threatening'."
4568 }),
4569 "harassment": Schema.Array(Schema.Literal("text")).annotate({
4570 "description": "The applied input type(s) for the category 'harassment'."
4571 }),
4572 "harassment/threatening": Schema.Array(Schema.Literal("text")).annotate({
4573 "description": "The applied input type(s) for the category 'harassment/threatening'."
4574 }),
4575 "illicit": Schema.Array(Schema.Literal("text")).annotate({
4576 "description": "The applied input type(s) for the category 'illicit'."
4577 }),
4578 "illicit/violent": Schema.Array(Schema.Literal("text")).annotate({
4579 "description": "The applied input type(s) for the category 'illicit/violent'."
4580 }),
4581 "self-harm": Schema.Array(Schema.Literals(["text", "image"])).annotate({
4582 "description": "The applied input type(s) for the category 'self-harm'."
4583 }),
4584 "self-harm/intent": Schema.Array(Schema.Literals(["text", "image"])).annotate({
4585 "description": "The applied input type(s) for the category 'self-harm/intent'."
4586 }),
4587 "self-harm/instructions": Schema.Array(Schema.Literals(["text", "image"])).annotate({
4588 "description": "The applied input type(s) for the category 'self-harm/instructions'."
4589 }),
4590 "sexual": Schema.Array(Schema.Literals(["text", "image"])).annotate({
4591 "description": "The applied input type(s) for the category 'sexual'."
4592 }),
4593 "sexual/minors": Schema.Array(Schema.Literal("text")).annotate({
4594 "description": "The applied input type(s) for the category 'sexual/minors'."
4595 }),
4596 "violence": Schema.Array(Schema.Literals(["text", "image"])).annotate({
4597 "description": "The applied input type(s) for the category 'violence'."
4598 }),
4599 "violence/graphic": Schema.Array(Schema.Literals(["text", "image"])).annotate({
4600 "description": "The applied input type(s) for the category 'violence/graphic'."
4601 })
4602 }).annotate({ "description": "A list of the categories along with the input type(s) that the score applies to." })
4603 })).annotate({ "description": "A list of moderation objects." })
4604 }).annotate({
4605 "description": "Represents if a given text input is potentially harmful.",
4606 "identifier": "CreateModerationResponse"
4607 })
4608 export type AdminApiKey = {
4609 readonly "object": "organization.admin_api_key"
4610 readonly "id": string
4611 readonly "name"?: string | null
4612 readonly "redacted_value": string
4613 readonly "created_at": number
4614 readonly "expires_at": number | null
4615 readonly "last_used_at"?: number | null
4616 readonly "owner": {
4617 readonly "type"?: string
4618 readonly "object"?: string
4619 readonly "id"?: string
4620 readonly "name"?: string
4621 readonly "created_at"?: number
4622 readonly "role"?: string
4623 }
4624 }
4625 export const AdminApiKey = Schema.Struct({
4626 "object": Schema.Literal("organization.admin_api_key").annotate({
4627 "description": "The object type, which is always `organization.admin_api_key`"
4628 }),
4629 "id": Schema.String.annotate({ "description": "The identifier, which can be referenced in API endpoints" }),
4630 "name": Schema.optionalKey(
4631 Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "The name of the API key" })
4632 ),
4633 "redacted_value": Schema.String.annotate({ "description": "The redacted value of the API key" }),
4634 "created_at": Schema.Number.annotate({
4635 "description": "The Unix timestamp (in seconds) of when the API key was created",
4636 "format": "unixtime"
4637 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
4638 "expires_at": Schema.Union([
4639 Schema.Number.annotate({
4640 "description": "The Unix timestamp (in seconds) of when the API key expires",
4641 "format": "unixtime"
4642 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
4643 Schema.Null
4644 ]),
4645 "last_used_at": Schema.optionalKey(
4646 Schema.Union([
4647 Schema.Number.annotate({
4648 "description": "The Unix timestamp (in seconds) of when the API key was last used",
4649 "format": "unixtime"
4650 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
4651 Schema.Null
4652 ])
4653 ),
4654 "owner": Schema.Struct({
4655 "type": Schema.optionalKey(Schema.String.annotate({ "description": "Always `user`" })),
4656 "object": Schema.optionalKey(
4657 Schema.String.annotate({ "description": "The object type, which is always organization.user" })
4658 ),
4659 "id": Schema.optionalKey(
4660 Schema.String.annotate({ "description": "The identifier, which can be referenced in API endpoints" })
4661 ),
4662 "name": Schema.optionalKey(Schema.String.annotate({ "description": "The name of the user" })),
4663 "created_at": Schema.optionalKey(
4664 Schema.Number.annotate({
4665 "description": "The Unix timestamp (in seconds) of when the user was created",
4666 "format": "unixtime"
4667 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
4668 ),
4669 "role": Schema.optionalKey(Schema.String.annotate({ "description": "Always `owner`" }))
4670 })
4671 }).annotate({ "description": "Represents an individual Admin API key in an org.", "identifier": "AdminApiKey" })
4672 export type AdminApiKeyCreateResponse = {
4673 readonly "object": "organization.admin_api_key"
4674 readonly "id": string
4675 readonly "name"?: string | null
4676 readonly "redacted_value": string
4677 readonly "created_at": number
4678 readonly "expires_at": number | null
4679 readonly "last_used_at"?: number | null
4680 readonly "owner": {
4681 readonly "type"?: string
4682 readonly "object"?: string
4683 readonly "id"?: string
4684 readonly "name"?: string
4685 readonly "created_at"?: number
4686 readonly "role"?: string
4687 }
4688 readonly "value": string
4689 }
4690 export const AdminApiKeyCreateResponse = Schema.Struct({
4691 "object": Schema.Literal("organization.admin_api_key").annotate({
4692 "description": "The object type, which is always `organization.admin_api_key`"
4693 }),
4694 "id": Schema.String.annotate({ "description": "The identifier, which can be referenced in API endpoints" }),
4695 "name": Schema.optionalKey(
4696 Schema.Union([Schema.String, Schema.Null]).annotate({ "description": "The name of the API key" })
4697 ),
4698 "redacted_value": Schema.String.annotate({ "description": "The redacted value of the API key" }),
4699 "created_at": Schema.Number.annotate({
4700 "description": "The Unix timestamp (in seconds) of when the API key was created",
4701 "format": "unixtime"
4702 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
4703 "expires_at": Schema.Union([
4704 Schema.Number.annotate({
4705 "description": "The Unix timestamp (in seconds) of when the API key expires",
4706 "format": "unixtime"
4707 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
4708 Schema.Null
4709 ]),
4710 "last_used_at": Schema.optionalKey(
4711 Schema.Union([
4712 Schema.Number.annotate({
4713 "description": "The Unix timestamp (in seconds) of when the API key was last used",
4714 "format": "unixtime"
4715 }).check(Schema.isInt().annotate({ "expected": "an integer" })),
4716 Schema.Null
4717 ])
4718 ),
4719 "owner": Schema.Struct({
4720 "type": Schema.optionalKey(Schema.String.annotate({ "description": "Always `user`" })),
4721 "object": Schema.optionalKey(
4722 Schema.String.annotate({ "description": "The object type, which is always organization.user" })
4723 ),
4724 "id": Schema.optionalKey(
4725 Schema.String.annotate({ "description": "The identifier, which can be referenced in API endpoints" })
4726 ),
4727 "name": Schema.optionalKey(Schema.String.annotate({ "description": "The name of the user" })),
4728 "created_at": Schema.optionalKey(
4729 Schema.Number.annotate({
4730 "description": "The Unix timestamp (in seconds) of when the user was created",
4731 "format": "unixtime"
4732 }).check(Schema.isInt().annotate({ "expected": "an integer" }))
4733 ),
4734 "role": Schema.optionalKey(Schema.String.annotate({ "description": "Always `owner`" }))
4735 }),
4736 "value": Schema.String.annotate({ "description": "The value of the API key. Only shown on create." })
4737 }).annotate({ "identifier": "AdminApiKeyCreateResponse" })
4738 export type AuditLogEventType =
4739 | "api_key.created"
4740 | "api_key.updated"
4741 | "api_key.deleted"
4742 | "certificate.created"
4743 | "certificate.updated"
4744 | "certificate.deleted"
4745 | "certificates.activated"
4746 | "certificates.deactivated"
4747 | "checkpoint.permission.created"
4748 | "checkpoint.permission.deleted"
4749 | "external_key.registered"
4750 | "external_key.removed"
4751 | "external_storage.registered"
4752 | "external_storage.removed"
4753 | "group.created"
4754 | "group.updated"
4755 | "group.deleted"
4756 | "invite.sent"
4757 | "invite.accepted"
4758 | "invite.deleted"
4759 | "ip_allowlist.created"
4760 | "ip_allowlist.updated"
4761 | "ip_allowlist.deleted"
4762 | "ip_allowlist.config.activated"
4763 | "ip_allowlist.config.deactivated"
4764 | "login.succeeded"
4765 | "login.failed"
4766 | "logout.succeeded"
4767 | "logout.failed"
4768 | "organization.updated"
4769 | "project.created"
4770 | "project.updated"
4771 | "project.archived"
4772 | "project.deleted"
4773 | "rate_limit.updated"
4774 | "rate_limit.deleted"
4775 | "resource.deleted"
4776 | "tunnel.created"
4777 | "tunnel.updated"
4778 | "tunnel.deleted"
4779 | "workload_identity_provider.created"
4780 | "workload_identity_provider.updated"
4781 | "workload_identity_provider.deleted"
4782 | "workload_identity_provider_mapping.created"
4783 | "workload_identity_provider_mapping.updated"
4784 | "workload_identity_provider_mapping.deleted"
4785 | "role.created"
4786 | "role.updated"
4787 | "role.deleted"
4788 | "role.assignment.created"
4789 | "role.assignment.deleted"
4790 | "role.bound_to_resource"
4791 | "role.unbound_from_resource"
4792 | "scim.enabled"
4793 | "scim.disabled"
4794 | "service_account.created"
4795 | "service_account.updated"
4796 | "service_account.deleted"
4797 | "user.added"
4798 | "user.updated"
4799 | "user.deleted"
4800 | "tenant.metadata.updated"
4801 | "tenant.microsoft_entra_mapping.upserted"
4802 | "tenant.microsoft_entra_mapping.deleted"
4803 | "tenant.workload_identity.provider.created"
4804 | "tenant.workload_identity.provider.updated"
4805 | "tenant.workload_identity.provider.archived"
4806 | "tenant.workload_identity.mapping.created"
4807 | "tenant.workload_identity.mapping.updated"
4808 | "tenant.workload_identity.mapping.archived"
4809 | "tenant.workload_identity.binding.created"
4810 | "tenant.workload_identity.principal.provisioned"
4811 | "tenant.workload_identity.access_token.issued"
4812 | "tenant.admin_api_key.created"
4813 | "tenant.admin_api_key.updated"
4814 | "tenant.admin_api_key.deleted"
4815 | "tenant.project_api_key.created"
4816 | "tenant.trusted_access.business_verification.started"
4817 | "tenant.trusted_access.application.submitted"
4818 | "tenant.chatgpt_access_token.revoked"
4819 | "tenant.migration.completed"
4820 | "tenant.sso.migrated"
4821 | "tenant.domains.migrated"
4822 | "tenant.sso_connection.created"
4823 | "tenant.sso_connection.updated"
4824 | "tenant.sso_connection.deleted"
4825 | "tenant.sso_connection.setup.started"
4826 | "tenant.policy.created"
4827 | "tenant.policy.updated"
4828 | "tenant.policy.deleted"
4829 | "tenant.policy.attached"
4830 | "tenant.policy.detached"
4831 | "tenant.principal_authentication_policy.resolved"
4832 | "tenant.scim.setup.started"
4833 | "tenant.scim.deletion.requested"
4834 | "tenant.scim.directory.created"
4835 | "tenant.product_access_policy.updated"
4836 | "tenant.resource_share_grant.created"
4837 | "tenant.resource_share_grant.updated"
4838 | "tenant.resource_share_grant.accepted"
4839 | "tenant.resource_share_grant.declined"
4840 | "tenant.resource_share_grant.revoked"
4841 | "tenant.resource_share_grant.deleted"
4842 | "tenant.service_account.updated"
4843 | "tenant.service_account.deleted"
4844 | "tenant.service_account.token.revoked"
4845 | "tenant.billing.overage_limit.updated"
4846 | "tenant.billing.alerts.updated"
4847 | "tenant.billing.info.updated"
4848 | "tenant.usage_limit.workspace.updated"
4849 | "tenant.usage_limit.group.updated"
4850 | "tenant.usage_limit.user.updated"
4851 | "tenant.usage_limit.increase_request.updated"
4852 | "tenant.usage_limit.increase_request.resolved"
4853 | "tenant.group.created"
4854 | "tenant.group.updated"
4855 | "tenant.group.deleted"
4856 | "tenant.group.member.added"
4857 | "tenant.group.member.removed"
4858 | "tenant.migration_rollout.status.updated"
4859 | "tenant.migration_rollout.tier.updated"
4860 | "tenant.role.metadata.updated"
4861 | "tenant.custom_role.created"
4862 | "tenant.custom_role.updated"
4863 | "tenant.custom_role.deleted"
4864 | "tenant.role_assignment.created"
4865 | "tenant.role_assignment.deleted"
4866 | "tenant.resource_role_assignment.created"
4867 | "tenant.resource_role_assignment.deleted"
4868 | "tenant.resource_access.updated"
4869 | "tenant.resource_access.deleted"
4870 | "tenant.ads_account.onboarding.redemption"
4871 | "tenant.session_policy.created"
4872 | "tenant.session_policy.updated"
4873 | "tenant.session_policy.deleted"
4874 | "tenant.session_revocation.started"
4875 | "tenant.third_party_app_policy.updated"
4876 | "tenant.user.added"
4877 | "tenant.user.updated"
4878 | "tenant.user.removed"
4879 | "tenant.user.looked_up"
4880 | "tenant.user.invited"
4881 | "tenant.membership.revoked"
4882 | "tenant.api_organization_invite.upserted"
4883 | "tenant.api_organization_invite.deleted"
4884 | "tenant.chatgpt_workspace_invite.upserted"
4885 | "tenant.membership.accepted"
4886 | "tenant.membership.declined"
4887 | "tenant.workspace_invite_email_settings.updated"
4888 export const AuditLogEventType = Schema.Literals([
4889 "api_key.created",
4890 "api_key.updated",
4891 "api_key.deleted",
4892 "certificate.created",
4893 "certificate.updated",
4894 "certificate.deleted",
4895 "certificates.activated",
4896 "certificates.deactivated",
4897 "checkpoint.permission.created",
4898 "checkpoint.permission.deleted",
4899 "external_key.registered",
4900 "external_key.removed",
4901 "external_storage.registered",
4902 "external_storage.removed",
4903 "group.created",
4904 "group.updated",
4905 "group.deleted",
4906 "invite.sent",
4907 "invite.accepted",
4908 "invite.deleted",
4909 "ip_allowlist.created",
4910 "ip_allowlist.updated",
4911 "ip_allowlist.deleted",
4912 "ip_allowlist.config.activated",
4913 "ip_allowlist.config.deactivated",
4914 "login.succeeded",
4915 "login.failed",
4916 "logout.succeeded",
4917 "logout.failed",
4918 "organization.updated",
4919 "project.created",
4920 "project.updated",
4921 "project.archived",
4922 "project.deleted",
4923 "rate_limit.updated",
4924 "rate_limit.deleted",
4925 "resource.deleted",
4926 "tunnel.created",
4927 "tunnel.updated",
4928 "tunnel.deleted",
4929 "workload_identity_provider.created",
4930 "workload_identity_provider.updated",
4931 "workload_identity_provider.deleted",
4932 "workload_identity_provider_mapping.created",
4933 "workload_identity_provider_mapping.updated",
4934 "workload_identity_provider_mapping.deleted",
4935 "role.created",
4936 "role.updated",
4937 "role.deleted",
4938 "role.assignment.created",
4939 "role.assignment.deleted",
4940 "role.bound_to_resource",
4941 "role.unbound_from_resource",
4942 "scim.enabled",
4943 "scim.disabled",
4944 "service_account.created",
4945 "service_account.updated",
4946 "service_account.deleted",
4947 "user.added",
4948 "user.updated",
4949 "user.deleted",
4950 "tenant.metadata.updated",
4951 "tenant.microsoft_entra_mapping.upserted",
4952 "tenant.microsoft_entra_mapping.deleted",
4953 "tenant.workload_identity.provider.created",
4954 "tenant.workload_identity.provider.updated",
4955 "tenant.workload_identity.provider.archived",
4956 "tenant.workload_identity.mapping.created",
4957 "tenant.workload_identity.mapping.updated",
4958 "tenant.workload_identity.mapping.archived",
4959 "tenant.workload_identity.binding.created",
4960 "tenant.workload_identity.principal.provisioned",
4961 "tenant.workload_identity.access_token.issued",
4962 "tenant.admin_api_key.created",
4963 "tenant.admin_api_key.updated",
4964 "tenant.admin_api_key.deleted",
4965 "tenant.project_api_key.created",
4966 "tenant.trusted_access.business_verification.started",
4967 "tenant.trusted_access.application.submitted",
4968 "tenant.chatgpt_access_token.revoked",
4969 "tenant.migration.completed",
4970 "tenant.sso.migrated",
4971 "tenant.domains.migrated",
4972 "tenant.sso_connection.created",
4973 "tenant.sso_connection.updated",
4974 "tenant.sso_connection.deleted",
4975 "tenant.sso_connection.setup.started",
4976 "tenant.policy.created",
4977 "tenant.policy.updated",
4978 "tenant.policy.deleted",
4979 "tenant.policy.attached",
4980 "tenant.policy.detached",
4981 "tenant.principal_authentication_policy.resolved",
4982 "tenant.scim.setup.started",
4983 "tenant.scim.deletion.requested",
4984 "tenant.scim.directory.created",
4985 "tenant.product_access_policy.updated",
4986 "tenant.resource_share_grant.created",
4987 "tenant.resource_share_grant.updated",
4988 "tenant.resource_share_grant.accepted",
4989 "tenant.resource_share_grant.declined",
4990 "tenant.resource_share_grant.revoked",
4991 "tenant.resource_share_grant.deleted",
4992 "tenant.service_account.updated",
4993 "tenant.service_account.deleted",
4994 "tenant.service_account.token.revoked",
4995 "tenant.billing.overage_limit.updated",
4996 "tenant.billing.alerts.updated",
4997 "tenant.billing.info.updated",
4998 "tenant.usage_limit.workspace.updated",
4999 "tenant.usage_limit.group.updated",
5000 "tenant.usage_limit.user.updated",
Showing first 5,000 of 69,150 lines. View raw