···11// This file is auto-generated by @hey-api/openapi-ts
2233-export * from './sdk.gen';
43export * from './types.gen';
44+export * from './sdk.gen';
···3333 */
3434export type AdminApiKey = {
3535 /**
3636- * The Unix timestamp (in seconds) of when the API key was created
3636+ * The object type, which is always `organization.admin_api_key`
3737 */
3838- created_at: number;
3838+ object: string;
3939 /**
4040 * The identifier, which can be referenced in API endpoints
4141 */
4242 id: string;
4343 /**
4444- * The Unix timestamp (in seconds) of when the API key was last used
4444+ * The name of the API key
4545+ */
4646+ name: string;
4747+ /**
4848+ * The redacted value of the API key
4549 */
4646- last_used_at: number;
5050+ redacted_value: string;
4751 /**
4848- * The name of the API key
5252+ * The value of the API key. Only shown on create.
4953 */
5050- name: string;
5454+ value?: string;
5155 /**
5252- * The object type, which is always `organization.admin_api_key`
5656+ * The Unix timestamp (in seconds) of when the API key was created
5357 */
5454- object: string;
5858+ created_at: number;
5959+ /**
6060+ * The Unix timestamp (in seconds) of when the API key was last used
6161+ */
6262+ last_used_at: number;
5563 owner: {
5664 /**
5757- * The Unix timestamp (in seconds) of when the user was created
6565+ * Always `user`
6666+ */
6767+ type?: string;
6868+ /**
6969+ * The object type, which is always organization.user
5870 */
5959- created_at?: number;
7171+ object?: string;
6072 /**
6173 * The identifier, which can be referenced in API endpoints
6274 */
···6678 */
6779 name?: string;
6880 /**
6969- * The object type, which is always organization.user
8181+ * The Unix timestamp (in seconds) of when the user was created
7082 */
7171- object?: string;
8383+ created_at?: number;
7284 /**
7385 * Always `owner`
7486 */
7587 role?: string;
7676- /**
7777- * Always `user`
7878- */
7979- type?: string;
8088 };
8181- /**
8282- * The redacted value of the API key
8383- */
8484- redacted_value: string;
8585- /**
8686- * The value of the API key. Only shown on create.
8787- */
8888- value?: string;
8989};
90909191export type ApiKeyList = {
9292+ object?: string;
9293 data?: Array<AdminApiKey>;
9393- first_id?: string;
9494 has_more?: boolean;
9595+ first_id?: string;
9596 last_id?: string;
9696- object?: string;
9797};
98989999/**
···103103 */
104104export type AssistantObject = {
105105 /**
106106+ * The identifier, which can be referenced in API endpoints.
107107+ */
108108+ id: string;
109109+ /**
110110+ * The object type, which is always `assistant`.
111111+ */
112112+ object: 'assistant';
113113+ /**
106114 * The Unix timestamp (in seconds) for when the assistant was created.
107115 */
108116 created_at: number;
109117 /**
110110- * The description of the assistant. The maximum length is 512 characters.
118118+ * The name of the assistant. The maximum length is 256 characters.
111119 *
112120 */
113113- description: string;
114114- /**
115115- * The identifier, which can be referenced in API endpoints.
116116- */
117117- id: string;
121121+ name: string;
118122 /**
119119- * The system instructions that the assistant uses. The maximum length is 256,000 characters.
123123+ * The description of the assistant. The maximum length is 512 characters.
120124 *
121125 */
122122- instructions: string;
123123- metadata: Metadata;
126126+ description: string;
124127 /**
125128 * ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them.
126129 *
127130 */
128131 model: string;
129132 /**
130130- * The name of the assistant. The maximum length is 256 characters.
133133+ * The system instructions that the assistant uses. The maximum length is 256,000 characters.
131134 *
132135 */
133133- name: string;
134134- /**
135135- * The object type, which is always `assistant`.
136136- */
137137- object: 'assistant';
138138- response_format?: AssistantsApiResponseFormatOption;
136136+ instructions: string;
139137 /**
140140- * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
138138+ * A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`.
141139 *
142140 */
143143- temperature?: number;
141141+ tools: Array<AssistantTool>;
144142 /**
145143 * A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.
146144 *
···161159 vector_store_ids?: Array<string>;
162160 };
163161 };
162162+ metadata: Metadata;
164163 /**
165165- * A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`.
164164+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
166165 *
167166 */
168168- tools: Array<AssistantTool>;
167167+ temperature?: number;
169168 /**
170169 * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
171170 *
···173172 *
174173 */
175174 top_p?: number;
175175+ response_format?: AssistantsApiResponseFormatOption;
176176};
177177178178/**
···215215 } & ErrorEvent);
216216217217export const AssistantSupportedModels = {
218218- GPT_3_5_TURBO: 'gpt-3.5-turbo',
219219- GPT_3_5_TURBO_0125: 'gpt-3.5-turbo-0125',
220220- GPT_3_5_TURBO_0613: 'gpt-3.5-turbo-0613',
221221- GPT_3_5_TURBO_1106: 'gpt-3.5-turbo-1106',
222222- GPT_4: 'gpt-4',
223223- GPT_3_5_TURBO_16K: 'gpt-3.5-turbo-16k',
224224- GPT_4O: 'gpt-4o',
225225- GPT_3_5_TURBO_16K_0613: 'gpt-3.5-turbo-16k-0613',
226226- GPT_4O_2024_05_13: 'gpt-4o-2024-05-13',
227227- GPT_4O_2024_08_06: 'gpt-4o-2024-08-06',
228228- GPT_4O_2024_11_20: 'gpt-4o-2024-11-20',
229229- GPT_4O_MINI: 'gpt-4o-mini',
230230- GPT_4O_MINI_2024_07_18: 'gpt-4o-mini-2024-07-18',
231231- GPT_4_0125_PREVIEW: 'gpt-4-0125-preview',
232232- GPT_4_0314: 'gpt-4-0314',
233233- GPT_4_0613: 'gpt-4-0613',
218218+ GPT_5: 'gpt-5',
219219+ GPT_5_MINI: 'gpt-5-mini',
220220+ GPT_5_NANO: 'gpt-5-nano',
221221+ GPT_5_2025_08_07: 'gpt-5-2025-08-07',
222222+ GPT_5_MINI_2025_08_07: 'gpt-5-mini-2025-08-07',
223223+ GPT_5_NANO_2025_08_07: 'gpt-5-nano-2025-08-07',
234224 GPT_4_1: 'gpt-4.1',
235235- GPT_4_1106_PREVIEW: 'gpt-4-1106-preview',
225225+ GPT_4_1_MINI: 'gpt-4.1-mini',
226226+ GPT_4_1_NANO: 'gpt-4.1-nano',
236227 GPT_4_1_2025_04_14: 'gpt-4.1-2025-04-14',
237237- GPT_4_1_MINI: 'gpt-4.1-mini',
238228 GPT_4_1_MINI_2025_04_14: 'gpt-4.1-mini-2025-04-14',
239239- GPT_4_1_NANO: 'gpt-4.1-nano',
240229 GPT_4_1_NANO_2025_04_14: 'gpt-4.1-nano-2025-04-14',
241241- GPT_4_32K: 'gpt-4-32k',
242242- GPT_4_32K_0314: 'gpt-4-32k-0314',
243243- GPT_4_32K_0613: 'gpt-4-32k-0613',
230230+ O3_MINI: 'o3-mini',
231231+ O3_MINI_2025_01_31: 'o3-mini-2025-01-31',
232232+ O1: 'o1',
233233+ O1_2024_12_17: 'o1-2024-12-17',
234234+ GPT_4O: 'gpt-4o',
235235+ GPT_4O_2024_11_20: 'gpt-4o-2024-11-20',
236236+ GPT_4O_2024_08_06: 'gpt-4o-2024-08-06',
237237+ GPT_4O_2024_05_13: 'gpt-4o-2024-05-13',
238238+ GPT_4O_MINI: 'gpt-4o-mini',
239239+ GPT_4O_MINI_2024_07_18: 'gpt-4o-mini-2024-07-18',
244240 GPT_4_5_PREVIEW: 'gpt-4.5-preview',
245241 GPT_4_5_PREVIEW_2025_02_27: 'gpt-4.5-preview-2025-02-27',
246242 GPT_4_TURBO: 'gpt-4-turbo',
247243 GPT_4_TURBO_2024_04_09: 'gpt-4-turbo-2024-04-09',
244244+ GPT_4_0125_PREVIEW: 'gpt-4-0125-preview',
248245 GPT_4_TURBO_PREVIEW: 'gpt-4-turbo-preview',
246246+ GPT_4_1106_PREVIEW: 'gpt-4-1106-preview',
249247 GPT_4_VISION_PREVIEW: 'gpt-4-vision-preview',
250250- GPT_5: 'gpt-5',
251251- GPT_5_2025_08_07: 'gpt-5-2025-08-07',
252252- GPT_5_MINI: 'gpt-5-mini',
253253- GPT_5_MINI_2025_08_07: 'gpt-5-mini-2025-08-07',
254254- GPT_5_NANO: 'gpt-5-nano',
255255- GPT_5_NANO_2025_08_07: 'gpt-5-nano-2025-08-07',
256256- O1: 'o1',
257257- O1_2024_12_17: 'o1-2024-12-17',
258258- O3_MINI: 'o3-mini',
259259- O3_MINI_2025_01_31: 'o3-mini-2025-01-31',
248248+ GPT_4: 'gpt-4',
249249+ GPT_4_0314: 'gpt-4-0314',
250250+ GPT_4_0613: 'gpt-4-0613',
251251+ GPT_4_32K: 'gpt-4-32k',
252252+ GPT_4_32K_0314: 'gpt-4-32k-0314',
253253+ GPT_4_32K_0613: 'gpt-4-32k-0613',
254254+ GPT_3_5_TURBO: 'gpt-3.5-turbo',
255255+ GPT_3_5_TURBO_16K: 'gpt-3.5-turbo-16k',
256256+ GPT_3_5_TURBO_0613: 'gpt-3.5-turbo-0613',
257257+ GPT_3_5_TURBO_1106: 'gpt-3.5-turbo-1106',
258258+ GPT_3_5_TURBO_0125: 'gpt-3.5-turbo-0125',
259259+ GPT_3_5_TURBO_16K_0613: 'gpt-3.5-turbo-16k-0613',
260260} as const;
261261262262export type AssistantSupportedModels =
···276276 * FileSearch tool
277277 */
278278export type AssistantToolsFileSearch = {
279279+ /**
280280+ * The type of tool being defined: `file_search`
281281+ */
282282+ type: 'file_search';
279283 /**
280284 * Overrides for the file search tool.
281285 */
···289293 max_num_results?: number;
290294 ranking_options?: FileSearchRankingOptions;
291295 };
292292- /**
293293- * The type of tool being defined: `file_search`
294294- */
295295- type: 'file_search';
296296};
297297298298/**
···309309 * Function tool
310310 */
311311export type AssistantToolsFunction = {
312312- function: FunctionObject;
313312 /**
314313 * The type of tool being defined: `function`
315314 */
316315 type: 'function';
316316+ function: FunctionObject;
317317};
318318319319/**
···350350 * Specifies a tool the model should use. Use to force the model to call a specific tool.
351351 */
352352export type AssistantsNamedToolChoice = {
353353+ /**
354354+ * The type of the tool. If type is `function`, the function name must be set
355355+ */
356356+ type: 'function' | 'code_interpreter' | 'file_search';
353357 function?: {
354358 /**
355359 * The name of the function to call.
356360 */
357361 name: string;
358362 };
359359- /**
360360- * The type of the tool. If type is `function`, the function name must be set
361361- */
362362- type: 'function' | 'code_interpreter' | 'file_search';
363363};
364364365365/**
···368368 */
369369export const AudioResponseFormat = {
370370 JSON: 'json',
371371- SRT: 'srt',
372371 TEXT: 'text',
372372+ SRT: 'srt',
373373 VERBOSE_JSON: 'verbose_json',
374374 VTT: 'vtt',
375375} as const;
···385385 * A log of a user action or configuration change within this organization.
386386 */
387387export type AuditLog = {
388388+ /**
389389+ * The ID of this log.
390390+ */
391391+ id: string;
392392+ type: AuditLogEventType;
393393+ /**
394394+ * The Unix timestamp (in seconds) of the event.
395395+ */
396396+ effective_at: number;
397397+ /**
398398+ * The project that the action was scoped to. Absent for actions not scoped to projects. Note that any admin actions taken via Admin API keys are associated with the default project.
399399+ */
400400+ project?: {
401401+ /**
402402+ * The project ID.
403403+ */
404404+ id?: string;
405405+ /**
406406+ * The project title.
407407+ */
408408+ name?: string;
409409+ };
388410 actor: AuditLogActor;
389411 /**
390412 * The details for events with this `type`.
391413 */
392414 'api_key.created'?: {
415415+ /**
416416+ * The tracking ID of the API key.
417417+ */
418418+ id?: string;
393419 /**
394420 * The payload used to create the API key.
395421 */
···399425 */
400426 scopes?: Array<string>;
401427 };
402402- /**
403403- * The tracking ID of the API key.
404404- */
405405- id?: string;
406428 };
407429 /**
408430 * The details for events with this `type`.
409431 */
410410- 'api_key.deleted'?: {
432432+ 'api_key.updated'?: {
411433 /**
412434 * The tracking ID of the API key.
413435 */
414436 id?: string;
415415- };
416416- /**
417417- * The details for events with this `type`.
418418- */
419419- 'api_key.updated'?: {
420437 /**
421438 * The payload used to update the API key.
422439 */
···426443 */
427444 scopes?: Array<string>;
428445 };
429429- /**
430430- * The tracking ID of the API key.
431431- */
432432- id?: string;
433446 };
434447 /**
435448 * The details for events with this `type`.
436449 */
437437- 'certificate.created'?: {
450450+ 'api_key.deleted'?: {
438451 /**
439439- * The certificate ID.
452452+ * The tracking ID of the API key.
440453 */
441454 id?: string;
442442- /**
443443- * The name of the certificate.
444444- */
445445- name?: string;
446455 };
447456 /**
448448- * The details for events with this `type`.
457457+ * The project and fine-tuned model checkpoint that the checkpoint permission was created for.
449458 */
450450- 'certificate.deleted'?: {
451451- /**
452452- * The certificate content in PEM format.
453453- */
454454- certificate?: string;
459459+ 'checkpoint_permission.created'?: {
455460 /**
456456- * The certificate ID.
461461+ * The ID of the checkpoint permission.
457462 */
458463 id?: string;
459464 /**
460460- * The name of the certificate.
461461- */
462462- name?: string;
463463- };
464464- /**
465465- * The details for events with this `type`.
466466- */
467467- 'certificate.updated'?: {
468468- /**
469469- * The certificate ID.
465465+ * The payload used to create the checkpoint permission.
470466 */
471471- id?: string;
472472- /**
473473- * The name of the certificate.
474474- */
475475- name?: string;
476476- };
477477- /**
478478- * The details for events with this `type`.
479479- */
480480- 'certificates.activated'?: {
481481- certificates?: Array<{
467467+ data?: {
482468 /**
483483- * The certificate ID.
469469+ * The ID of the project that the checkpoint permission was created for.
484470 */
485485- id?: string;
486486- /**
487487- * The name of the certificate.
488488- */
489489- name?: string;
490490- }>;
491491- };
492492- /**
493493- * The details for events with this `type`.
494494- */
495495- 'certificates.deactivated'?: {
496496- certificates?: Array<{
497497- /**
498498- * The certificate ID.
499499- */
500500- id?: string;
501501- /**
502502- * The name of the certificate.
503503- */
504504- name?: string;
505505- }>;
506506- };
507507- /**
508508- * The project and fine-tuned model checkpoint that the checkpoint permission was created for.
509509- */
510510- 'checkpoint_permission.created'?: {
511511- /**
512512- * The payload used to create the checkpoint permission.
513513- */
514514- data?: {
471471+ project_id?: string;
515472 /**
516473 * The ID of the fine-tuned model checkpoint.
517474 */
518475 fine_tuned_model_checkpoint?: string;
519519- /**
520520- * The ID of the project that the checkpoint permission was created for.
521521- */
522522- project_id?: string;
523476 };
524524- /**
525525- * The ID of the checkpoint permission.
526526- */
527527- id?: string;
528477 };
529478 /**
530479 * The details for events with this `type`.
···536485 id?: string;
537486 };
538487 /**
539539- * The Unix timestamp (in seconds) of the event.
540540- */
541541- effective_at: number;
542542- /**
543543- * The ID of this log.
544544- */
545545- id: string;
546546- /**
547488 * The details for events with this `type`.
548489 */
549549- 'invite.accepted'?: {
490490+ 'invite.sent'?: {
550491 /**
551492 * The ID of the invite.
552493 */
553494 id?: string;
554554- };
555555- /**
556556- * The details for events with this `type`.
557557- */
558558- 'invite.deleted'?: {
559559- /**
560560- * The ID of the invite.
561561- */
562562- id?: string;
563563- };
564564- /**
565565- * The details for events with this `type`.
566566- */
567567- 'invite.sent'?: {
568495 /**
569496 * The payload used to create the invite.
570497 */
···578505 */
579506 role?: string;
580507 };
508508+ };
509509+ /**
510510+ * The details for events with this `type`.
511511+ */
512512+ 'invite.accepted'?: {
513513+ /**
514514+ * The ID of the invite.
515515+ */
516516+ id?: string;
517517+ };
518518+ /**
519519+ * The details for events with this `type`.
520520+ */
521521+ 'invite.deleted'?: {
581522 /**
582523 * The ID of the invite.
583524 */
···613554 * The details for events with this `type`.
614555 */
615556 'organization.updated'?: {
557557+ /**
558558+ * The organization ID.
559559+ */
560560+ id?: string;
616561 /**
617562 * The payload used to update the organization settings.
618563 */
619564 changes_requested?: {
620565 /**
621621- * How your organization logs data from supported API calls. One of `disabled`, `enabled_per_call`, `enabled_for_all_projects`, or `enabled_for_selected_projects`
622622- */
623623- api_call_logging?: string;
624624- /**
625625- * The list of project ids if api_call_logging is set to `enabled_for_selected_projects`
566566+ * The organization title.
626567 */
627627- api_call_logging_project_ids?: string;
568568+ title?: string;
628569 /**
629570 * The organization description.
630571 */
···638579 */
639580 threads_ui_visibility?: string;
640581 /**
641641- * The organization title.
642642- */
643643- title?: string;
644644- /**
645582 * Visibility of the usage dashboard which shows activity and costs for your organization. One of `ANY_ROLE` or `OWNERS`.
646583 */
647584 usage_dashboard_visibility?: string;
585585+ /**
586586+ * How your organization logs data from supported API calls. One of `disabled`, `enabled_per_call`, `enabled_for_all_projects`, or `enabled_for_selected_projects`
587587+ */
588588+ api_call_logging?: string;
589589+ /**
590590+ * The list of project ids if api_call_logging is set to `enabled_for_selected_projects`
591591+ */
592592+ api_call_logging_project_ids?: string;
648593 };
649649- /**
650650- * The organization ID.
651651- */
652652- id?: string;
653653- };
654654- /**
655655- * The project that the action was scoped to. Absent for actions not scoped to projects. Note that any admin actions taken via Admin API keys are associated with the default project.
656656- */
657657- project?: {
658658- /**
659659- * The project ID.
660660- */
661661- id?: string;
662662- /**
663663- * The project title.
664664- */
665665- name?: string;
666594 };
667595 /**
668596 * The details for events with this `type`.
669597 */
670670- 'project.archived'?: {
598598+ 'project.created'?: {
671599 /**
672600 * The project ID.
673601 */
674602 id?: string;
675675- };
676676- /**
677677- * The details for events with this `type`.
678678- */
679679- 'project.created'?: {
680603 /**
681604 * The payload used to create the project.
682605 */
···690613 */
691614 title?: string;
692615 };
693693- /**
694694- * The project ID.
695695- */
696696- id?: string;
697616 };
698617 /**
699618 * The details for events with this `type`.
700619 */
701620 'project.updated'?: {
621621+ /**
622622+ * The project ID.
623623+ */
624624+ id?: string;
702625 /**
703626 * The payload used to update the project.
704627 */
···708631 */
709632 title?: string;
710633 };
711711- /**
712712- * The project ID.
713713- */
714714- id?: string;
715634 };
716635 /**
717636 * The details for events with this `type`.
718637 */
719719- 'rate_limit.deleted'?: {
638638+ 'project.archived'?: {
720639 /**
721721- * The rate limit ID
640640+ * The project ID.
722641 */
723642 id?: string;
724643 };
···727646 */
728647 'rate_limit.updated'?: {
729648 /**
649649+ * The rate limit ID
650650+ */
651651+ id?: string;
652652+ /**
730653 * The payload used to update the rate limits.
731654 */
732655 changes_requested?: {
733656 /**
734734- * The maximum batch input tokens per day. Only relevant for certain models.
657657+ * The maximum requests per minute.
735658 */
736736- batch_1_day_max_input_tokens?: number;
659659+ max_requests_per_1_minute?: number;
737660 /**
738738- * The maximum audio megabytes per minute. Only relevant for certain models.
661661+ * The maximum tokens per minute.
739662 */
740740- max_audio_megabytes_per_1_minute?: number;
663663+ max_tokens_per_1_minute?: number;
741664 /**
742665 * The maximum images per minute. Only relevant for certain models.
743666 */
744667 max_images_per_1_minute?: number;
745668 /**
669669+ * The maximum audio megabytes per minute. Only relevant for certain models.
670670+ */
671671+ max_audio_megabytes_per_1_minute?: number;
672672+ /**
746673 * The maximum requests per day. Only relevant for certain models.
747674 */
748675 max_requests_per_1_day?: number;
749676 /**
750750- * The maximum requests per minute.
677677+ * The maximum batch input tokens per day. Only relevant for certain models.
751678 */
752752- max_requests_per_1_minute?: number;
753753- /**
754754- * The maximum tokens per minute.
755755- */
756756- max_tokens_per_1_minute?: number;
679679+ batch_1_day_max_input_tokens?: number;
757680 };
681681+ };
682682+ /**
683683+ * The details for events with this `type`.
684684+ */
685685+ 'rate_limit.deleted'?: {
758686 /**
759687 * The rate limit ID
760688 */
···764692 * The details for events with this `type`.
765693 */
766694 'service_account.created'?: {
695695+ /**
696696+ * The service account ID.
697697+ */
698698+ id?: string;
767699 /**
768700 * The payload used to create the service account.
769701 */
···773705 */
774706 role?: string;
775707 };
776776- /**
777777- * The service account ID.
778778- */
779779- id?: string;
780708 };
781709 /**
782710 * The details for events with this `type`.
783711 */
784784- 'service_account.deleted'?: {
712712+ 'service_account.updated'?: {
785713 /**
786714 * The service account ID.
787715 */
788716 id?: string;
789789- };
790790- /**
791791- * The details for events with this `type`.
792792- */
793793- 'service_account.updated'?: {
794717 /**
795718 * The payload used to updated the service account.
796719 */
···800723 */
801724 role?: string;
802725 };
726726+ };
727727+ /**
728728+ * The details for events with this `type`.
729729+ */
730730+ 'service_account.deleted'?: {
803731 /**
804732 * The service account ID.
805733 */
806734 id?: string;
807735 };
808808- type: AuditLogEventType;
809736 /**
810737 * The details for events with this `type`.
811738 */
812739 'user.added'?: {
813740 /**
741741+ * The user ID.
742742+ */
743743+ id?: string;
744744+ /**
814745 * The payload used to add the user to the project.
815746 */
816747 data?: {
···819750 */
820751 role?: string;
821752 };
753753+ };
754754+ /**
755755+ * The details for events with this `type`.
756756+ */
757757+ 'user.updated'?: {
822758 /**
823823- * The user ID.
759759+ * The project ID.
824760 */
825761 id?: string;
762762+ /**
763763+ * The payload used to update the user.
764764+ */
765765+ changes_requested?: {
766766+ /**
767767+ * The role of the user. Is either `owner` or `member`.
768768+ */
769769+ role?: string;
770770+ };
826771 };
827772 /**
828773 * The details for events with this `type`.
···836781 /**
837782 * The details for events with this `type`.
838783 */
839839- 'user.updated'?: {
784784+ 'certificate.created'?: {
785785+ /**
786786+ * The certificate ID.
787787+ */
788788+ id?: string;
840789 /**
841841- * The payload used to update the user.
790790+ * The name of the certificate.
842791 */
843843- changes_requested?: {
844844- /**
845845- * The role of the user. Is either `owner` or `member`.
846846- */
847847- role?: string;
848848- };
792792+ name?: string;
793793+ };
794794+ /**
795795+ * The details for events with this `type`.
796796+ */
797797+ 'certificate.updated'?: {
849798 /**
850850- * The project ID.
799799+ * The certificate ID.
851800 */
852801 id?: string;
802802+ /**
803803+ * The name of the certificate.
804804+ */
805805+ name?: string;
806806+ };
807807+ /**
808808+ * The details for events with this `type`.
809809+ */
810810+ 'certificate.deleted'?: {
811811+ /**
812812+ * The certificate ID.
813813+ */
814814+ id?: string;
815815+ /**
816816+ * The name of the certificate.
817817+ */
818818+ name?: string;
819819+ /**
820820+ * The certificate content in PEM format.
821821+ */
822822+ certificate?: string;
823823+ };
824824+ /**
825825+ * The details for events with this `type`.
826826+ */
827827+ 'certificates.activated'?: {
828828+ certificates?: Array<{
829829+ /**
830830+ * The certificate ID.
831831+ */
832832+ id?: string;
833833+ /**
834834+ * The name of the certificate.
835835+ */
836836+ name?: string;
837837+ }>;
838838+ };
839839+ /**
840840+ * The details for events with this `type`.
841841+ */
842842+ 'certificates.deactivated'?: {
843843+ certificates?: Array<{
844844+ /**
845845+ * The certificate ID.
846846+ */
847847+ id?: string;
848848+ /**
849849+ * The name of the certificate.
850850+ */
851851+ name?: string;
852852+ }>;
853853 };
854854};
855855···857857 * The actor who performed the audit logged action.
858858 */
859859export type AuditLogActor = {
860860- api_key?: AuditLogActorApiKey;
861861- session?: AuditLogActorSession;
862860 /**
863861 * The type of actor. Is either `session` or `api_key`.
864862 */
865863 type?: 'session' | 'api_key';
864864+ session?: AuditLogActorSession;
865865+ api_key?: AuditLogActorApiKey;
866866};
867867868868/**
···873873 * The tracking id of the API key.
874874 */
875875 id?: string;
876876- service_account?: AuditLogActorServiceAccount;
877876 /**
878877 * The type of API key. Can be either `user` or `service_account`.
879878 */
880879 type?: 'user' | 'service_account';
881880 user?: AuditLogActorUser;
881881+ service_account?: AuditLogActorServiceAccount;
882882};
883883884884/**
···895895 * The session in which the audit logged action was performed.
896896 */
897897export type AuditLogActorSession = {
898898+ user?: AuditLogActorUser;
898899 /**
899900 * The IP address from which the action was performed.
900901 */
901902 ip_address?: string;
902902- user?: AuditLogActorUser;
903903};
904904905905/**
···907907 */
908908export type AuditLogActorUser = {
909909 /**
910910+ * The user id.
911911+ */
912912+ id?: string;
913913+ /**
910914 * The user email.
911915 */
912916 email?: string;
913913- /**
914914- * The user id.
915915- */
916916- id?: string;
917917};
918918919919/**
···921921 */
922922export const AuditLogEventType = {
923923 API_KEY_CREATED: 'api_key.created',
924924- API_KEY_DELETED: 'api_key.deleted',
925924 API_KEY_UPDATED: 'api_key.updated',
925925+ API_KEY_DELETED: 'api_key.deleted',
926926 CHECKPOINT_PERMISSION_CREATED: 'checkpoint_permission.created',
927927 CHECKPOINT_PERMISSION_DELETED: 'checkpoint_permission.deleted',
928928+ INVITE_SENT: 'invite.sent',
928929 INVITE_ACCEPTED: 'invite.accepted',
929930 INVITE_DELETED: 'invite.deleted',
930930- INVITE_SENT: 'invite.sent',
931931+ LOGIN_SUCCEEDED: 'login.succeeded',
931932 LOGIN_FAILED: 'login.failed',
932932- LOGIN_SUCCEEDED: 'login.succeeded',
933933+ LOGOUT_SUCCEEDED: 'logout.succeeded',
933934 LOGOUT_FAILED: 'logout.failed',
934934- LOGOUT_SUCCEEDED: 'logout.succeeded',
935935 ORGANIZATION_UPDATED: 'organization.updated',
936936- PROJECT_ARCHIVED: 'project.archived',
937936 PROJECT_CREATED: 'project.created',
938937 PROJECT_UPDATED: 'project.updated',
939939- RATE_LIMIT_DELETED: 'rate_limit.deleted',
940940- RATE_LIMIT_UPDATED: 'rate_limit.updated',
938938+ PROJECT_ARCHIVED: 'project.archived',
941939 SERVICE_ACCOUNT_CREATED: 'service_account.created',
942942- SERVICE_ACCOUNT_DELETED: 'service_account.deleted',
943940 SERVICE_ACCOUNT_UPDATED: 'service_account.updated',
941941+ SERVICE_ACCOUNT_DELETED: 'service_account.deleted',
942942+ RATE_LIMIT_UPDATED: 'rate_limit.updated',
943943+ RATE_LIMIT_DELETED: 'rate_limit.deleted',
944944 USER_ADDED: 'user.added',
945945- USER_DELETED: 'user.deleted',
946945 USER_UPDATED: 'user.updated',
946946+ USER_DELETED: 'user.deleted',
947947} as const;
948948949949/**
···965965};
966966967967export type Batch = {
968968+ id: string;
968969 /**
969969- * The Unix timestamp (in seconds) for when the batch was cancelled.
970970+ * The object type, which is always `batch`.
970971 */
971971- cancelled_at?: number;
972972+ object: 'batch';
972973 /**
973973- * The Unix timestamp (in seconds) for when the batch started cancelling.
974974+ * The OpenAI API endpoint used by the batch.
974975 */
975975- cancelling_at?: number;
976976+ endpoint: string;
977977+ errors?: {
978978+ /**
979979+ * The object type, which is always `list`.
980980+ */
981981+ object?: string;
982982+ data?: Array<BatchError>;
983983+ };
976984 /**
977977- * The Unix timestamp (in seconds) for when the batch was completed.
985985+ * The ID of the input file for the batch.
978986 */
979979- completed_at?: number;
987987+ input_file_id: string;
980988 /**
981989 * The time frame within which the batch should be processed.
982990 */
983991 completion_window: string;
984992 /**
985985- * The Unix timestamp (in seconds) for when the batch was created.
993993+ * The current status of the batch.
986994 */
987987- created_at: number;
995995+ status:
996996+ | 'validating'
997997+ | 'failed'
998998+ | 'in_progress'
999999+ | 'finalizing'
10001000+ | 'completed'
10011001+ | 'expired'
10021002+ | 'cancelling'
10031003+ | 'cancelled';
9881004 /**
989989- * The OpenAI API endpoint used by the batch.
10051005+ * The ID of the file containing the outputs of successfully executed requests.
9901006 */
991991- endpoint: string;
10071007+ output_file_id?: string;
9921008 /**
9931009 * The ID of the file containing the outputs of requests with errors.
9941010 */
9951011 error_file_id?: string;
996996- errors?: {
997997- data?: Array<BatchError>;
998998- /**
999999- * The object type, which is always `list`.
10001000- */
10011001- object?: string;
10021002- };
10121012+ /**
10131013+ * The Unix timestamp (in seconds) for when the batch was created.
10141014+ */
10151015+ created_at: number;
10031016 /**
10041004- * The Unix timestamp (in seconds) for when the batch expired.
10171017+ * The Unix timestamp (in seconds) for when the batch started processing.
10051018 */
10061006- expired_at?: number;
10191019+ in_progress_at?: number;
10071020 /**
10081021 * The Unix timestamp (in seconds) for when the batch will expire.
10091022 */
10101023 expires_at?: number;
10111024 /**
10121012- * The Unix timestamp (in seconds) for when the batch failed.
10131013- */
10141014- failed_at?: number;
10151015- /**
10161025 * The Unix timestamp (in seconds) for when the batch started finalizing.
10171026 */
10181027 finalizing_at?: number;
10191019- id: string;
10201028 /**
10211021- * The Unix timestamp (in seconds) for when the batch started processing.
10291029+ * The Unix timestamp (in seconds) for when the batch was completed.
10221030 */
10231023- in_progress_at?: number;
10311031+ completed_at?: number;
10241032 /**
10251025- * The ID of the input file for the batch.
10331033+ * The Unix timestamp (in seconds) for when the batch failed.
10261034 */
10271027- input_file_id: string;
10281028- metadata?: Metadata;
10351035+ failed_at?: number;
10291036 /**
10301030- * The object type, which is always `batch`.
10371037+ * The Unix timestamp (in seconds) for when the batch expired.
10311038 */
10321032- object: 'batch';
10391039+ expired_at?: number;
10331040 /**
10341034- * The ID of the file containing the outputs of successfully executed requests.
10411041+ * The Unix timestamp (in seconds) for when the batch started cancelling.
10351042 */
10361036- output_file_id?: string;
10371037- request_counts?: BatchRequestCounts;
10431043+ cancelling_at?: number;
10381044 /**
10391039- * The current status of the batch.
10451045+ * The Unix timestamp (in seconds) for when the batch was cancelled.
10401046 */
10411041- status:
10421042- | 'validating'
10431043- | 'failed'
10441044- | 'in_progress'
10451045- | 'finalizing'
10461046- | 'completed'
10471047- | 'expired'
10481048- | 'cancelling'
10491049- | 'cancelled';
10471047+ cancelled_at?: number;
10481048+ request_counts?: BatchRequestCounts;
10491049+ metadata?: Metadata;
10501050};
1051105110521052/**
···10871087 * The per-line object of the batch output and error files
10881088 */
10891089export type BatchRequestOutput = {
10901090+ id?: string;
10901091 /**
10911092 * A developer-provided per-request id that will be used to match outputs to inputs.
10921093 */
10931094 custom_id?: string;
10941094- /**
10951095- * For requests that failed with a non-HTTP error, this will contain more information on the cause of the failure.
10961096- */
10971097- error?: {
10951095+ response?: {
10981096 /**
10991099- * A machine-readable error code.
10971097+ * The HTTP status code of the response
11001098 */
11011101- code?: string;
10991099+ status_code?: number;
11021100 /**
11031103- * A human-readable error message.
11011101+ * An unique identifier for the OpenAI API request. Please include this request ID when contacting support.
11041102 */
11051105- message?: string;
11061106- };
11071107- id?: string;
11081108- response?: {
11031103+ request_id?: string;
11091104 /**
11101105 * The JSON body of the response
11111106 */
11121107 body?: {
11131108 [key: string]: unknown;
11141109 };
11101110+ };
11111111+ /**
11121112+ * For requests that failed with a non-HTTP error, this will contain more information on the cause of the failure.
11131113+ */
11141114+ error?: {
11151115 /**
11161116- * An unique identifier for the OpenAI API request. Please include this request ID when contacting support.
11161116+ * A machine-readable error code.
11171117 */
11181118- request_id?: string;
11181118+ code?: string;
11191119 /**
11201120- * The HTTP status code of the response
11201120+ * A human-readable error message.
11211121 */
11221122- status_code?: number;
11221122+ message?: string;
11231123 };
11241124};
11251125···11281128 */
11291129export type Certificate = {
11301130 /**
11311131- * Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate.
11311131+ * The object type.
11321132+ *
11331133+ * - If creating, updating, or getting a specific certificate, the object type is `certificate`.
11341134+ * - If listing, activating, or deactivating certificates for the organization, the object type is `organization.certificate`.
11351135+ * - If listing, activating, or deactivating certificates for a project, the object type is `organization.project.certificate`.
11361136+ *
11371137+ */
11381138+ object:
11391139+ | 'certificate'
11401140+ | 'organization.certificate'
11411141+ | 'organization.project.certificate';
11421142+ /**
11431143+ * The identifier, which can be referenced in API endpoints
11441144+ */
11451145+ id: string;
11461146+ /**
11471147+ * The name of the certificate.
11321148 */
11331133- active?: boolean;
11491149+ name: string;
11501150+ /**
11511151+ * The Unix timestamp (in seconds) of when the certificate was uploaded.
11521152+ */
11531153+ created_at: number;
11341154 certificate_details: {
11351155 /**
11361136- * The content of the certificate in PEM format.
11561156+ * The Unix timestamp (in seconds) of when the certificate becomes valid.
11371157 */
11381138- content?: string;
11581158+ valid_at?: number;
11391159 /**
11401160 * The Unix timestamp (in seconds) of when the certificate expires.
11411161 */
11421162 expires_at?: number;
11431163 /**
11441144- * The Unix timestamp (in seconds) of when the certificate becomes valid.
11641164+ * The content of the certificate in PEM format.
11451165 */
11461146- valid_at?: number;
11661166+ content?: string;
11471167 };
11481168 /**
11491149- * The Unix timestamp (in seconds) of when the certificate was uploaded.
11501150- */
11511151- created_at: number;
11521152- /**
11531153- * The identifier, which can be referenced in API endpoints
11541154- */
11551155- id: string;
11561156- /**
11571157- * The name of the certificate.
11691169+ * Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate.
11581170 */
11591159- name: string;
11601160- /**
11611161- * The object type.
11621162- *
11631163- * - If creating, updating, or getting a specific certificate, the object type is `certificate`.
11641164- * - If listing, activating, or deactivating certificates for the organization, the object type is `organization.certificate`.
11651165- * - If listing, activating, or deactivating certificates for a project, the object type is `organization.project.certificate`.
11661166- *
11671167- */
11681168- object:
11691169- | 'certificate'
11701170- | 'organization.certificate'
11711171- | 'organization.project.certificate';
11711171+ active?: boolean;
11721172};
1173117311741174/**
···12121212 *
12131213 */
12141214export type ChatCompletionAllowedToolsChoice = {
12151215- allowed_tools: ChatCompletionAllowedTools;
12161215 /**
12171216 * Allowed tool configuration type. Always `allowed_tools`.
12181217 */
12191218 type: 'allowed_tools';
12191219+ allowed_tools: ChatCompletionAllowedTools;
12201220};
1221122112221222export type ChatCompletionDeleted = {
12231223 /**
12241224- * Whether the chat completion was deleted.
12241224+ * The type of object being deleted.
12251225 */
12261226- deleted: boolean;
12261226+ object: 'chat.completion.deleted';
12271227 /**
12281228 * The ID of the chat completion that was deleted.
12291229 */
12301230 id: string;
12311231 /**
12321232- * The type of object being deleted.
12321232+ * Whether the chat completion was deleted.
12331233 */
12341234- object: 'chat.completion.deleted';
12341234+ deleted: boolean;
12351235};
1236123612371237/**
···12681268 */
12691269export type ChatCompletionList = {
12701270 /**
12711271+ * The type of this object. It is always set to "list".
12721272+ *
12731273+ */
12741274+ object: 'list';
12751275+ /**
12711276 * An array of chat completion objects.
12721277 *
12731278 */
···12771282 */
12781283 first_id: string;
12791284 /**
12801280- * Indicates whether there are more Chat Completions available.
12811281- */
12821282- has_more: boolean;
12831283- /**
12841285 * The identifier of the last chat completion in the data array.
12851286 */
12861287 last_id: string;
12871288 /**
12881288- * The type of this object. It is always set to "list".
12891289- *
12891289+ * Indicates whether there are more Chat Completions available.
12901290 */
12911291- object: 'list';
12911291+ has_more: boolean;
12921292};
1293129312941294/**
···12981298 *
12991299 */
13001300export type ChatCompletionMessageCustomToolCall = {
13011301+ /**
13021302+ * The ID of the tool call.
13031303+ */
13041304+ id: string;
13051305+ /**
13061306+ * The type of the tool. Always `custom`.
13071307+ */
13081308+ type: 'custom';
13011309 /**
13021310 * The custom tool that the model called.
13031311 */
13041312 custom: {
13051313 /**
13141314+ * The name of the custom tool to call.
13151315+ */
13161316+ name: string;
13171317+ /**
13061318 * The input for the custom tool call generated by the model.
13071319 */
13081320 input: string;
13091309- /**
13101310- * The name of the custom tool to call.
13111311- */
13121312- name: string;
13131321 };
13141314- /**
13151315- * The ID of the tool call.
13161316- */
13171317- id: string;
13181318- /**
13191319- * The type of the tool. Always `custom`.
13201320- */
13211321- type: 'custom';
13221322};
1323132313241324/**
···13281328 *
13291329 */
13301330export type ChatCompletionMessageList = {
13311331+ /**
13321332+ * The type of this object. It is always set to "list".
13331333+ *
13341334+ */
13351335+ object: 'list';
13311336 /**
13321337 * An array of chat completion message objects.
13331338 *
···13351340 data: Array<
13361341 ChatCompletionResponseMessage & {
13371342 /**
13431343+ * The identifier of the chat message.
13441344+ */
13451345+ id: string;
13461346+ /**
13381347 * If a content parts array was provided, this is an array of `text` and `image_url` parts.
13391348 * Otherwise, null.
13401349 *
···13431352 | ChatCompletionRequestMessageContentPartText
13441353 | ChatCompletionRequestMessageContentPartImage
13451354 >;
13461346- /**
13471347- * The identifier of the chat message.
13481348- */
13491349- id: string;
13501355 }
13511356 >;
13521357 /**
···13541359 */
13551360 first_id: string;
13561361 /**
13571357- * Indicates whether there are more chat messages available.
13581358- */
13591359- has_more: boolean;
13601360- /**
13611362 * The identifier of the last chat message in the data array.
13621363 */
13631364 last_id: string;
13641365 /**
13651365- * The type of this object. It is always set to "list".
13661366- *
13661366+ * Indicates whether there are more chat messages available.
13671367 */
13681368- object: 'list';
13681368+ has_more: boolean;
13691369};
1370137013711371/**
···13761376 */
13771377export type ChatCompletionMessageToolCall = {
13781378 /**
13791379- * The function that the model called.
13801380- */
13811381- function: {
13821382- /**
13831383- * 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.
13841384- */
13851385- arguments: string;
13861386- /**
13871387- * The name of the function to call.
13881388- */
13891389- name: string;
13901390- };
13911391- /**
13921379 * The ID of the tool call.
13931380 */
13941381 id: string;
···13961383 * The type of the tool. Currently, only `function` is supported.
13971384 */
13981385 type: 'function';
13991399-};
14001400-14011401-export type ChatCompletionMessageToolCallChunk = {
14021402- function?: {
13861386+ /**
13871387+ * The function that the model called.
13881388+ */
13891389+ function: {
14031390 /**
14041404- * 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.
13911391+ * The name of the function to call.
14051392 */
14061406- arguments?: string;
13931393+ name: string;
14071394 /**
14081408- * The name of the function to call.
13951395+ * 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.
14091396 */
14101410- name?: string;
13971397+ arguments: string;
14111398 };
13991399+};
14001400+14011401+export type ChatCompletionMessageToolCallChunk = {
14021402+ index: number;
14121403 /**
14131404 * The ID of the tool call.
14141405 */
14151406 id?: string;
14161416- index: number;
14171407 /**
14181408 * The type of the tool. Currently, only `function` is supported.
14191409 */
14201410 type?: 'function';
14111411+ function?: {
14121412+ /**
14131413+ * The name of the function to call.
14141414+ */
14151415+ name?: string;
14161416+ /**
14171417+ * 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.
14181418+ */
14191419+ arguments?: string;
14201420+ };
14211421};
1422142214231423/**
···14531453 * Specifies a tool the model should use. Use to force the model to call a specific function.
14541454 */
14551455export type ChatCompletionNamedToolChoice = {
14561456+ /**
14571457+ * For function calling, the type is always `function`.
14581458+ */
14591459+ type: 'function';
14561460 function: {
14571461 /**
14581462 * The name of the function to call.
14591463 */
14601464 name: string;
14611465 };
14621462- /**
14631463- * For function calling, the type is always `function`.
14641464- */
14651465- type: 'function';
14661466};
1467146714681468/**
···14711471 * Specifies a tool the model should use. Use to force the model to call a specific custom tool.
14721472 */
14731473export type ChatCompletionNamedToolChoiceCustom = {
14741474+ /**
14751475+ * For custom tool calling, the type is always `custom`.
14761476+ */
14771477+ type: 'custom';
14741478 custom: {
14751479 /**
14761480 * The name of the custom tool to call.
14771481 */
14781482 name: string;
14791483 };
14801480- /**
14811481- * For custom tool calling, the type is always `custom`.
14821482- */
14831483- type: 'custom';
14841484};
1485148514861486/**
···14911491 */
14921492export type ChatCompletionRequestAssistantMessage = {
14931493 /**
14941494+ * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
14951495+ *
14961496+ */
14971497+ content?: string | Array<ChatCompletionRequestAssistantMessageContentPart>;
14981498+ /**
14991499+ * The refusal message by the assistant.
15001500+ */
15011501+ refusal?: string;
15021502+ /**
15031503+ * The role of the messages author, in this case `assistant`.
15041504+ */
15051505+ role: 'assistant';
15061506+ /**
15071507+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
15081508+ */
15091509+ name?: string;
15101510+ /**
14941511 * Data about a previous audio response from the model.
14951512 * [Learn more](https://platform.openai.com/docs/guides/audio).
14961513 *
···15021519 */
15031520 id: string;
15041521 };
15051505- /**
15061506- * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
15071507- *
15081508- */
15091509- content?: string | Array<ChatCompletionRequestAssistantMessageContentPart>;
15221522+ tool_calls?: ChatCompletionMessageToolCalls;
15101523 /**
15111524 * Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
15121525 *
···15221535 */
15231536 name: string;
15241537 };
15251525- /**
15261526- * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
15271527- */
15281528- name?: string;
15291529- /**
15301530- * The refusal message by the assistant.
15311531- */
15321532- refusal?: string;
15331533- /**
15341534- * The role of the messages author, in this case `assistant`.
15351535- */
15361536- role: 'assistant';
15371537- tool_calls?: ChatCompletionMessageToolCalls;
15381538};
1539153915401540export type ChatCompletionRequestAssistantMessageContentPart =
···15591559 */
15601560 content: string | Array<ChatCompletionRequestMessageContentPartText>;
15611561 /**
15621562+ * The role of the messages author, in this case `developer`.
15631563+ */
15641564+ role: 'developer';
15651565+ /**
15621566 * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
15631567 */
15641568 name?: string;
15651565- /**
15661566- * The role of the messages author, in this case `developer`.
15671567- */
15681568- role: 'developer';
15691569};
1570157015711571/**
···15751575 */
15761576export type ChatCompletionRequestFunctionMessage = {
15771577 /**
15781578+ * The role of the messages author, in this case `function`.
15791579+ */
15801580+ role: 'function';
15811581+ /**
15781582 * The contents of the function message.
15791583 */
15801584 content: string;
···15821586 * The name of the function to call.
15831587 */
15841588 name: string;
15851585- /**
15861586- * The role of the messages author, in this case `function`.
15871587- */
15881588- role: 'function';
15891589};
1590159015911591export type ChatCompletionRequestMessage =
···16151615 *
16161616 */
16171617export type ChatCompletionRequestMessageContentPartAudio = {
16181618+ /**
16191619+ * The type of the content part. Always `input_audio`.
16201620+ */
16211621+ type: 'input_audio';
16181622 input_audio: {
16191623 /**
16201624 * Base64 encoded audio data.
···16261630 */
16271631 format: 'wav' | 'mp3';
16281632 };
16291629- /**
16301630- * The type of the content part. Always `input_audio`.
16311631- */
16321632- type: 'input_audio';
16331633};
1634163416351635/**
···16391639 *
16401640 */
16411641export type ChatCompletionRequestMessageContentPartFile = {
16421642+ /**
16431643+ * The type of the content part. Always `file`.
16441644+ */
16451645+ type: 'file';
16421646 file: {
16431647 /**
16481648+ * The name of the file, used when passing the file to the model as a
16491649+ * string.
16501650+ *
16511651+ */
16521652+ filename?: string;
16531653+ /**
16441654 * The base64 encoded file data, used when passing the file to the model
16451655 * as a string.
16461656 *
···16511661 *
16521662 */
16531663 file_id?: string;
16541654- /**
16551655- * The name of the file, used when passing the file to the model as a
16561656- * string.
16571657- *
16581658- */
16591659- filename?: string;
16601664 };
16611661- /**
16621662- * The type of the content part. Always `file`.
16631663- */
16641664- type: 'file';
16651665};
1666166616671667/**
···16711671 *
16721672 */
16731673export type ChatCompletionRequestMessageContentPartImage = {
16741674+ /**
16751675+ * The type of the content part.
16761676+ */
16771677+ type: 'image_url';
16741678 image_url: {
16791679+ /**
16801680+ * Either a URL of the image or the base64 encoded image data.
16811681+ */
16821682+ url: string;
16751683 /**
16761684 * Specifies the detail level of the image. Learn more in the [Vision guide](https://platform.openai.com/docs/guides/vision#low-or-high-fidelity-image-understanding).
16771685 */
16781686 detail?: 'auto' | 'low' | 'high';
16791679- /**
16801680- * Either a URL of the image or the base64 encoded image data.
16811681- */
16821682- url: string;
16831687 };
16841684- /**
16851685- * The type of the content part.
16861686- */
16871687- type: 'image_url';
16881688};
1689168916901690/**
···16921692 */
16931693export type ChatCompletionRequestMessageContentPartRefusal = {
16941694 /**
16951695- * The refusal message generated by the model.
16961696- */
16971697- refusal: string;
16981698- /**
16991695 * The type of the content part.
17001696 */
17011697 type: 'refusal';
16981698+ /**
16991699+ * The refusal message generated by the model.
17001700+ */
17011701+ refusal: string;
17021702};
1703170317041704/**
···17081708 *
17091709 */
17101710export type ChatCompletionRequestMessageContentPartText = {
17111711+ /**
17121712+ * The type of the content part.
17131713+ */
17141714+ type: 'text';
17111715 /**
17121716 * The text content.
17131717 */
17141718 text: string;
17151715- /**
17161716- * The type of the content part.
17171717- */
17181718- type: 'text';
17191719};
1720172017211721/**
···17321732 */
17331733 content: string | Array<ChatCompletionRequestSystemMessageContentPart>;
17341734 /**
17351735+ * The role of the messages author, in this case `system`.
17361736+ */
17371737+ role: 'system';
17381738+ /**
17351739 * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
17361740 */
17371741 name?: string;
17381738- /**
17391739- * The role of the messages author, in this case `system`.
17401740- */
17411741- role: 'system';
17421742};
1743174317441744export type ChatCompletionRequestSystemMessageContentPart =
···17491749 */
17501750export type ChatCompletionRequestToolMessage = {
17511751 /**
17521752- * The contents of the tool message.
17531753- */
17541754- content: string | Array<ChatCompletionRequestToolMessageContentPart>;
17551755- /**
17561752 * The role of the messages author, in this case `tool`.
17571753 */
17581754 role: 'tool';
17551755+ /**
17561756+ * The contents of the tool message.
17571757+ */
17581758+ content: string | Array<ChatCompletionRequestToolMessageContentPart>;
17591759 /**
17601760 * Tool call that this message is responding to.
17611761 */
···17791779 */
17801780 content: string | Array<ChatCompletionRequestUserMessageContentPart>;
17811781 /**
17821782- * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
17821782+ * The role of the messages author, in this case `user`.
17831783 */
17841784- name?: string;
17841784+ role: 'user';
17851785 /**
17861786- * The role of the messages author, in this case `user`.
17861786+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
17871787 */
17881788- role: 'user';
17881788+ name?: string;
17891789};
1790179017911791export type ChatCompletionRequestUserMessageContentPart =
···18071807 */
18081808export type ChatCompletionResponseMessage = {
18091809 /**
18101810+ * The contents of the message.
18111811+ */
18121812+ content: string;
18131813+ /**
18141814+ * The refusal message generated by the model.
18151815+ */
18161816+ refusal: string;
18171817+ tool_calls?: ChatCompletionMessageToolCalls;
18181818+ /**
18101819 * Annotations for the message, when applicable, as when using the
18111820 * [web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat).
18121821 *
···18291838 */
18301839 start_index: number;
18311840 /**
18411841+ * The URL of the web resource.
18421842+ */
18431843+ url: string;
18441844+ /**
18321845 * The title of the web resource.
18331846 */
18341847 title: string;
18351835- /**
18361836- * The URL of the web resource.
18371837- */
18381838- url: string;
18391848 };
18401849 }>;
18411850 /**
18511851+ * The role of the author of this message.
18521852+ */
18531853+ role: 'assistant';
18541854+ /**
18551855+ * Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
18561856+ *
18571857+ * @deprecated
18581858+ */
18591859+ function_call?: {
18601860+ /**
18611861+ * 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.
18621862+ */
18631863+ arguments: string;
18641864+ /**
18651865+ * The name of the function to call.
18661866+ */
18671867+ name: string;
18681868+ };
18691869+ /**
18421870 * If the audio output modality is requested, this object contains data
18431871 * about the audio response from the model. [Learn more](https://platform.openai.com/docs/guides/audio).
18441872 *
18451873 */
18461874 audio?: {
18471875 /**
18481848- * Base64 encoded audio bytes generated by the model, in the format
18491849- * specified in the request.
18501850- *
18761876+ * Unique identifier for this audio response.
18511877 */
18521852- data: string;
18781878+ id: string;
18531879 /**
18541880 * The Unix timestamp (in seconds) for when this audio response will
18551881 * no longer be accessible on the server for use in multi-turn
···18581884 */
18591885 expires_at: number;
18601886 /**
18611861- * Unique identifier for this audio response.
18871887+ * Base64 encoded audio bytes generated by the model, in the format
18881888+ * specified in the request.
18891889+ *
18621890 */
18631863- id: string;
18911891+ data: string;
18641892 /**
18651893 * Transcript of the audio generated by the model.
18661894 */
18671895 transcript: string;
18681896 };
18691869- /**
18701870- * The contents of the message.
18711871- */
18721872- content: string;
18731873- /**
18741874- * Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
18751875- *
18761876- * @deprecated
18771877- */
18781878- function_call?: {
18791879- /**
18801880- * 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.
18811881- */
18821882- arguments: string;
18831883- /**
18841884- * The name of the function to call.
18851885- */
18861886- name: string;
18871887- };
18881888- /**
18891889- * The refusal message generated by the model.
18901890- */
18911891- refusal: string;
18921892- /**
18931893- * The role of the author of this message.
18941894- */
18951895- role: 'assistant';
18961896- tool_calls?: ChatCompletionMessageToolCalls;
18971897};
1898189818991899/**
19001900 * The role of the author of a message
19011901 */
19021902export const ChatCompletionRole = {
19031903- ASSISTANT: 'assistant',
19041903 DEVELOPER: 'developer',
19051905- FUNCTION: 'function',
19061904 SYSTEM: 'system',
19071907- TOOL: 'tool',
19081905 USER: 'user',
19061906+ ASSISTANT: 'assistant',
19071907+ TOOL: 'tool',
19081908+ FUNCTION: 'function',
19091909} as const;
1910191019111911/**
···19201920 */
19211921export type ChatCompletionStreamOptions = {
19221922 /**
19231923- * When true, stream obfuscation will be enabled. Stream obfuscation adds
19241924- * random characters to an `obfuscation` field on streaming delta events to
19251925- * normalize payload sizes as a mitigation to certain side-channel attacks.
19261926- * These obfuscation fields are included by default, but add a small amount
19271927- * of overhead to the data stream. You can set `include_obfuscation` to
19281928- * false to optimize for bandwidth if you trust the network links between
19291929- * your application and the OpenAI API.
19301930- *
19311931- */
19321932- include_obfuscation?: boolean;
19331933- /**
19341923 * If set, an additional chunk will be streamed before the `data: [DONE]`
19351924 * message. The `usage` field on this chunk shows the token usage statistics
19361925 * for the entire request, and the `choices` field will always be an empty
···19421931 *
19431932 */
19441933 include_usage?: boolean;
19341934+ /**
19351935+ * When true, stream obfuscation will be enabled. Stream obfuscation adds
19361936+ * random characters to an `obfuscation` field on streaming delta events to
19371937+ * normalize payload sizes as a mitigation to certain side-channel attacks.
19381938+ * These obfuscation fields are included by default, but add a small amount
19391939+ * of overhead to the data stream. You can set `include_obfuscation` to
19401940+ * false to optimize for bandwidth if you trust the network links between
19411941+ * your application and the OpenAI API.
19421942+ *
19431943+ */
19441944+ include_obfuscation?: boolean;
19451945};
1946194619471947/**
···19671967 */
19681968 name?: string;
19691969 };
19701970+ tool_calls?: Array<ChatCompletionMessageToolCallChunk>;
19711971+ /**
19721972+ * The role of the author of this message.
19731973+ */
19741974+ role?: 'developer' | 'system' | 'user' | 'assistant' | 'tool';
19701975 /**
19711976 * The refusal message generated by the model.
19721977 */
19731978 refusal?: string;
19741974- /**
19751975- * The role of the author of this message.
19761976- */
19771977- role?: 'developer' | 'system' | 'user' | 'assistant' | 'tool';
19781978- tool_calls?: Array<ChatCompletionMessageToolCallChunk>;
19791979};
1980198019811981export type ChatCompletionTokenLogprob = {
19821982 /**
19831983- * 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.
19831983+ * The token.
19841984 */
19851985- bytes: Array<number>;
19851985+ token: string;
19861986 /**
19871987 * 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.
19881988 */
19891989 logprob: number;
19901990 /**
19911991- * The token.
19911991+ * 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.
19921992 */
19931993- token: string;
19931993+ bytes: Array<number>;
19941994 /**
19951995 * List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned.
19961996 */
19971997 top_logprobs: Array<{
19981998 /**
19991999- * 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.
19991999+ * The token.
20002000 */
20012001- bytes: Array<number>;
20012001+ token: string;
20022002 /**
20032003 * 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.
20042004 */
20052005 logprob: number;
20062006 /**
20072007- * The token.
20072007+ * 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.
20082008 */
20092009- token: string;
20092009+ bytes: Array<number>;
20102010 }>;
20112011};
20122012···20172017 *
20182018 */
20192019export type ChatCompletionTool = {
20202020- function: FunctionObject;
20212020 /**
20222021 * The type of the tool. Currently, only `function` is supported.
20232022 */
20242023 type: 'function';
20242024+ function: FunctionObject;
20252025};
2026202620272027/**
···20612061 */
20622062export type Click = {
20632063 /**
20642064- * Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.
20642064+ * Specifies the event type. For a click action, this property is
20652065+ * always set to `click`.
20652066 *
20662067 */
20672067- button: 'left' | 'right' | 'wheel' | 'back' | 'forward';
20682068+ type: 'click';
20682069 /**
20692069- * Specifies the event type. For a click action, this property is
20702070- * always set to `click`.
20702070+ * Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`.
20712071 *
20722072 */
20732073- type: 'click';
20732073+ button: 'left' | 'right' | 'wheel' | 'back' | 'forward';
20742074 /**
20752075 * The x-coordinate where the click occurred.
20762076 *
···20902090 *
20912091 */
20922092export type CodeInterpreterFileOutput = {
20932093+ /**
20942094+ * The type of the code interpreter file output. Always `files`.
20952095+ *
20962096+ */
20972097+ type: 'files';
20932098 files: Array<{
20942099 /**
20952095- * The ID of the file.
21002100+ * The MIME type of the file.
20962101 *
20972102 */
20982098- file_id: string;
21032103+ mime_type: string;
20992104 /**
21002100- * The MIME type of the file.
21052105+ * The ID of the file.
21012106 *
21022107 */
21032103- mime_type: string;
21082108+ file_id: string;
21042109 }>;
21052105- /**
21062106- * The type of the code interpreter file output. Always `files`.
21072107- *
21082108- */
21092109- type: 'files';
21102110};
2111211121122112/**
···21342134 */
21352135export type CodeInterpreterOutputLogs = {
21362136 /**
21372137- * The logs output from the code interpreter.
21382138- */
21392139- logs: string;
21402140- /**
21412137 * The type of the output. Always 'logs'.
21422138 */
21432139 type: 'logs';
21402140+ /**
21412141+ * The logs output from the code interpreter.
21422142+ */
21432143+ logs: string;
21442144};
2145214521462146/**
···21512151 */
21522152export type CodeInterpreterTextOutput = {
21532153 /**
21542154- * The logs of the code interpreter tool call.
21542154+ * The type of the code interpreter text output. Always `logs`.
21552155 *
21562156 */
21572157- logs: string;
21572157+ type: 'logs';
21582158 /**
21592159- * The type of the code interpreter text output. Always `logs`.
21592159+ * The logs of the code interpreter tool call.
21602160 *
21612161 */
21622162- type: 'logs';
21622162+ logs: string;
21632163};
2164216421652165/**
···21702170 */
21712171export type CodeInterpreterTool = {
21722172 /**
21732173- * The code interpreter container. Can be a container ID or an object that
21742174- * specifies uploaded file IDs to make available to your code.
21732173+ * The type of the code interpreter tool. Always `code_interpreter`.
21752174 *
21762175 */
21772177- container: string | CodeInterpreterToolAuto;
21762176+ type: 'code_interpreter';
21782177 /**
21792179- * The type of the code interpreter tool. Always `code_interpreter`.
21782178+ * The code interpreter container. Can be a container ID or an object that
21792179+ * specifies uploaded file IDs to make available to your code.
21802180 *
21812181 */
21822182- type: 'code_interpreter';
21822182+ container: string | CodeInterpreterToolAuto;
21832183};
2184218421852185/**
···21912191 */
21922192export type CodeInterpreterToolAuto = {
21932193 /**
21942194+ * Always `auto`.
21952195+ */
21962196+ type: 'auto';
21972197+ /**
21942198 * An optional list of uploaded files to make available to your code.
21952199 *
21962200 */
21972201 file_ids?: Array<string>;
21982198- /**
21992199- * Always `auto`.
22002200- */
22012201- type: 'auto';
22022202};
2203220322042204/**
···22092209 */
22102210export type CodeInterpreterToolCall = {
22112211 /**
22122212- * The code to run, or null if not available.
22122212+ * The type of the code interpreter tool call. Always `code_interpreter_call`.
22132213+ *
22142214+ */
22152215+ type: 'code_interpreter_call';
22162216+ /**
22172217+ * The unique ID of the code interpreter tool call.
22132218 *
22142219 */
22152215- code: string;
22202220+ id: string;
22212221+ /**
22222222+ * The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
22232223+ *
22242224+ */
22252225+ status:
22262226+ | 'in_progress'
22272227+ | 'completed'
22282228+ | 'incomplete'
22292229+ | 'interpreting'
22302230+ | 'failed';
22162231 /**
22172232 * The ID of the container used to run the code.
22182233 *
22192234 */
22202235 container_id: string;
22212236 /**
22222222- * The unique ID of the code interpreter tool call.
22372237+ * The code to run, or null if not available.
22232238 *
22242239 */
22252225- id: string;
22402240+ code: string;
22262241 /**
22272242 * The outputs generated by the code interpreter, such as logs or images.
22282243 * Can be null if no outputs are available.
···22362251 type?: 'CodeInterpreterOutputImage';
22372252 } & CodeInterpreterOutputImage)
22382253 >;
22392239- /**
22402240- * The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
22412241- *
22422242- */
22432243- status:
22442244- | 'in_progress'
22452245- | 'completed'
22462246- | 'incomplete'
22472247- | 'interpreting'
22482248- | 'failed';
22492249- /**
22502250- * The type of the code interpreter tool call. Always `code_interpreter_call`.
22512251- *
22522252- */
22532253- type: 'code_interpreter_call';
22542254};
2255225522562256/**
···22612261 */
22622262export type ComparisonFilter = {
22632263 /**
22642264- * The key to compare against the value.
22652265- */
22662266- key: string;
22672267- /**
22682264 * Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`.
22692265 * - `eq`: equals
22702266 * - `ne`: not equal
···22752271 *
22762272 */
22772273 type: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte';
22742274+ /**
22752275+ * The key to compare against the value.
22762276+ */
22772277+ key: string;
22782278 /**
22792279 * The value to compare against the attribute key; supports string, number, or boolean types.
22802280 */
···2283228322842284export type CompleteUploadRequest = {
22852285 /**
22862286- * The optional md5 checksum for the file contents to verify if the bytes uploaded matches what you expect.
22862286+ * The ordered list of Part IDs.
22872287 *
22882288 */
22892289- md5?: string;
22892289+ part_ids: Array<string>;
22902290 /**
22912291- * The ordered list of Part IDs.
22912291+ * The optional md5 checksum for the file contents to verify if the bytes uploaded matches what you expect.
22922292 *
22932293 */
22942294- part_ids: Array<string>;
22942294+ md5?: string;
22952295};
2296229622972297/**
···23022302 * Number of tokens in the generated completion.
23032303 */
23042304 completion_tokens: number;
23052305+ /**
23062306+ * Number of tokens in the prompt.
23072307+ */
23082308+ prompt_tokens: number;
23092309+ /**
23102310+ * Total number of tokens used in the request (prompt + completion).
23112311+ */
23122312+ total_tokens: number;
23052313 /**
23062314 * Breakdown of tokens used in a completion.
23072315 */
···23302338 */
23312339 rejected_prediction_tokens?: number;
23322340 };
23332333- /**
23342334- * Number of tokens in the prompt.
23352335- */
23362336- prompt_tokens: number;
23372341 /**
23382342 * Breakdown of tokens used in the prompt.
23392343 */
···23472351 */
23482352 cached_tokens?: number;
23492353 };
23502350- /**
23512351- * Total number of tokens used in the request (prompt + completion).
23522352- */
23532353- total_tokens: number;
23542354};
2355235523562356/**
···23602360 */
23612361export type CompoundFilter = {
23622362 /**
23632363- * Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.
23642364- */
23652365- filters: Array<ComparisonFilter | unknown>;
23662366- /**
23672363 * Type of operation: `and` or `or`.
23682364 */
23692365 type: 'and' | 'or';
23662366+ /**
23672367+ * Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.
23682368+ */
23692369+ filters: Array<ComparisonFilter | unknown>;
23702370};
2371237123722372export type ComputerAction =
···24042404 */
24052405export type ComputerScreenshotImage = {
24062406 /**
24072407- * The identifier of an uploaded file that contains the screenshot.
24072407+ * Specifies the event type. For a computer screenshot, this property is
24082408+ * always set to `computer_screenshot`.
24092409+ *
24082410 */
24092409- file_id?: string;
24112411+ type: 'computer_screenshot';
24102412 /**
24112413 * The URL of the screenshot image.
24122414 */
24132415 image_url?: string;
24142416 /**
24152415- * Specifies the event type. For a computer screenshot, this property is
24162416- * always set to `computer_screenshot`.
24172417- *
24172417+ * The identifier of an uploaded file that contains the screenshot.
24182418 */
24192419- type: 'computer_screenshot';
24192419+ file_id?: string;
24202420};
2421242124222422/**
···24272427 *
24282428 */
24292429export type ComputerToolCall = {
24302430- action: ComputerAction;
24312430 /**
24322432- * An identifier used when responding to the tool call with output.
24332433- *
24312431+ * The type of the computer call. Always `computer_call`.
24342432 */
24352435- call_id: string;
24332433+ type: 'computer_call';
24362434 /**
24372435 * The unique ID of the computer call.
24382436 */
24392437 id: string;
24402438 /**
24392439+ * An identifier used when responding to the tool call with output.
24402440+ *
24412441+ */
24422442+ call_id: string;
24432443+ action: ComputerAction;
24442444+ /**
24412445 * The pending safety checks for the computer call.
24422446 *
24432447 */
···24482452 *
24492453 */
24502454 status: 'in_progress' | 'completed' | 'incomplete';
24512451- /**
24522452- * The type of the computer call. Always `computer_call`.
24532453- */
24542454- type: 'computer_call';
24552455};
2456245624572457/**
···24622462 */
24632463export type ComputerToolCallOutput = {
24642464 /**
24652465- * The safety checks reported by the API that have been acknowledged by the
24662466- * developer.
24652465+ * The type of the computer tool call output. Always `computer_call_output`.
24662466+ *
24672467+ */
24682468+ type: 'computer_call_output';
24692469+ /**
24702470+ * The ID of the computer tool call output.
24672471 *
24682472 */
24692469- acknowledged_safety_checks?: Array<ComputerToolCallSafetyCheck>;
24732473+ id?: string;
24702474 /**
24712475 * The ID of the computer tool call that produced the output.
24722476 *
24732477 */
24742478 call_id: string;
24752479 /**
24762476- * The ID of the computer tool call output.
24802480+ * The safety checks reported by the API that have been acknowledged by the
24812481+ * developer.
24772482 *
24782483 */
24792479- id?: string;
24842484+ acknowledged_safety_checks?: Array<ComputerToolCallSafetyCheck>;
24802485 output: ComputerScreenshotImage;
24812486 /**
24822487 * The status of the message input. One of `in_progress`, `completed`, or
···24842489 *
24852490 */
24862491 status?: 'in_progress' | 'completed' | 'incomplete';
24872487- /**
24882488- * The type of the computer tool call output. Always `computer_call_output`.
24892489- *
24902490- */
24912491- type: 'computer_call_output';
24922492};
2493249324942494export type ComputerToolCallOutputResource = ComputerToolCallOutput & {
···25052505 */
25062506export type ComputerToolCallSafetyCheck = {
25072507 /**
25082508- * The type of the pending safety check.
25092509- */
25102510- code: string;
25112511- /**
25122508 * The ID of the pending safety check.
25132509 */
25142510 id: string;
25112511+ /**
25122512+ * The type of the pending safety check.
25132513+ */
25142514+ code: string;
25152515 /**
25162516 * Details about the pending safety check.
25172517 */
···2520252025212521export type ContainerFileListResource = {
25222522 /**
25232523+ * The type of object returned, must be 'list'.
25242524+ */
25252525+ object: 'list';
25262526+ /**
25232527 * A list of container files.
25242528 */
25252529 data: Array<ContainerFileResource>;
···25282532 */
25292533 first_id: string;
25302534 /**
25312531- * Whether there are more files available.
25322532- */
25332533- has_more: boolean;
25342534- /**
25352535 * The ID of the last file in the list.
25362536 */
25372537 last_id: string;
25382538 /**
25392539- * The type of object returned, must be 'list'.
25392539+ * Whether there are more files available.
25402540 */
25412541- object: 'list';
25412541+ has_more: boolean;
25422542};
2543254325442544/**
···25462546 */
25472547export type ContainerFileResource = {
25482548 /**
25492549- * Size of the file in bytes.
25492549+ * Unique identifier for the file.
25502550+ */
25512551+ id: string;
25522552+ /**
25532553+ * The type of this object (`container.file`).
25502554 */
25512551- bytes: number;
25552555+ object: 'container.file';
25522556 /**
25532557 * The container this file belongs to.
25542558 */
···25582562 */
25592563 created_at: number;
25602564 /**
25612561- * Unique identifier for the file.
25652565+ * Size of the file in bytes.
25622566 */
25632563- id: string;
25642564- /**
25652565- * The type of this object (`container.file`).
25662566- */
25672567- object: 'container.file';
25672567+ bytes: number;
25682568 /**
25692569 * Path of the file in the container.
25702570 */
···2577257725782578export type ContainerListResource = {
25792579 /**
25802580+ * The type of object returned, must be 'list'.
25812581+ */
25822582+ object: 'list';
25832583+ /**
25802584 * A list of containers.
25812585 */
25822586 data: Array<ContainerResource>;
···25842588 * The ID of the first container in the list.
25852589 */
25862590 first_id: string;
25872587- /**
25882588- * Whether there are more containers available.
25892589- */
25902590- has_more: boolean;
25912591 /**
25922592 * The ID of the last container in the list.
25932593 */
25942594 last_id: string;
25952595 /**
25962596- * The type of object returned, must be 'list'.
25962596+ * Whether there are more containers available.
25972597 */
25982598- object: 'list';
25982598+ has_more: boolean;
25992599};
2600260026012601/**
···26032603 */
26042604export type ContainerResource = {
26052605 /**
26062606+ * Unique identifier for the container.
26072607+ */
26082608+ id: string;
26092609+ /**
26102610+ * The type of this object.
26112611+ */
26122612+ object: string;
26132613+ /**
26142614+ * Name of the container.
26152615+ */
26162616+ name: string;
26172617+ /**
26062618 * Unix timestamp (in seconds) when the container was created.
26072619 */
26082620 created_at: number;
26212621+ /**
26222622+ * Status of the container (e.g., active, deleted).
26232623+ */
26242624+ status: string;
26092625 /**
26102626 * The container will expire after this time period.
26112627 * The anchor is the reference point for the expiration.
···26222638 */
26232639 minutes?: number;
26242640 };
26252625- /**
26262626- * Unique identifier for the container.
26272627- */
26282628- id: string;
26292629- /**
26302630- * Name of the container.
26312631- */
26322632- name: string;
26332633- /**
26342634- * The type of this object.
26352635- */
26362636- object: string;
26372637- /**
26382638- * Status of the container (e.g., active, deleted).
26392639- */
26402640- status: string;
26412641};
2642264226432643/**
···26692669 * The aggregated costs details of the specific time bucket.
26702670 */
26712671export type CostsResult = {
26722672+ object: 'organization.costs.result';
26722673 /**
26732674 * The monetary value in its associated currency.
26742675 */
26752676 amount?: {
26772677+ /**
26782678+ * The numeric value of the cost.
26792679+ */
26802680+ value?: number;
26762681 /**
26772682 * Lowercase ISO-4217 currency e.g. "usd"
26782683 */
26792684 currency?: string;
26802680- /**
26812681- * The numeric value of the cost.
26822682- */
26832683- value?: number;
26842685 };
26852686 /**
26862687 * When `group_by=line_item`, this field provides the line item of the grouped costs result.
26872688 */
26882689 line_item?: string;
26892689- object: 'organization.costs.result';
26902690 /**
26912691 * When `group_by=project_id`, this field provides the project ID of the grouped costs result.
26922692 */
···2695269526962696export type CreateAssistantRequest = {
26972697 /**
26982698- * The description of the assistant. The maximum length is 512 characters.
26982698+ * ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them.
26992699 *
27002700 */
27012701- description?: string;
27012701+ model: string | AssistantSupportedModels;
27022702 /**
27032703- * The system instructions that the assistant uses. The maximum length is 256,000 characters.
27032703+ * The name of the assistant. The maximum length is 256 characters.
27042704 *
27052705 */
27062706- instructions?: string;
27072707- metadata?: Metadata;
27062706+ name?: string;
27082707 /**
27092709- * ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them.
27082708+ * The description of the assistant. The maximum length is 512 characters.
27102709 *
27112710 */
27122712- model: string | AssistantSupportedModels;
27112711+ description?: string;
27132712 /**
27142714- * The name of the assistant. The maximum length is 256 characters.
27132713+ * The system instructions that the assistant uses. The maximum length is 256,000 characters.
27152714 *
27162715 */
27172717- name?: string;
27162716+ instructions?: string;
27182717 reasoning_effort?: ReasoningEffort;
27192719- response_format?: AssistantsApiResponseFormatOption;
27202718 /**
27212721- * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
27192719+ * A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`.
27222720 *
27232721 */
27242724- temperature?: number;
27222722+ tools?: Array<AssistantTool>;
27252723 /**
27262724 * A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.
27272725 *
···27462744 */
27472745 vector_stores?: Array<{
27482746 /**
27472747+ * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to add to the vector store. There can be a maximum of 10000 files in a vector store.
27482748+ *
27492749+ */
27502750+ file_ids?: Array<string>;
27512751+ /**
27492752 * The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy.
27502753 */
27512754 chunking_strategy?:
···27562759 type: 'auto';
27572760 }
27582761 | {
27622762+ /**
27632763+ * Always `static`.
27642764+ */
27652765+ type: 'static';
27592766 static: {
27602767 /**
27682768+ * The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`.
27692769+ */
27702770+ max_chunk_size_tokens: number;
27712771+ /**
27612772 * The number of tokens that overlap between chunks. The default value is `400`.
27622773 *
27632774 * Note that the overlap must not exceed half of `max_chunk_size_tokens`.
27642775 *
27652776 */
27662777 chunk_overlap_tokens: number;
27672767- /**
27682768- * The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`.
27692769- */
27702770- max_chunk_size_tokens: number;
27712778 };
27722772- /**
27732773- * Always `static`.
27742774- */
27752775- type: 'static';
27762779 };
27772777- /**
27782778- * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to add to the vector store. There can be a maximum of 10000 files in a vector store.
27792779- *
27802780- */
27812781- file_ids?: Array<string>;
27822780 metadata?: Metadata;
27832781 }>;
27842782 };
27852783 };
27842784+ metadata?: Metadata;
27862785 /**
27872787- * A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`.
27862786+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
27882787 *
27892788 */
27902790- tools?: Array<AssistantTool>;
27892789+ temperature?: number;
27912790 /**
27922791 * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
27932792 *
···27952794 *
27962795 */
27972796 top_p?: number;
27972797+ response_format?: AssistantsApiResponseFormatOption;
27982798};
2799279928002800export type CreateChatCompletionRequest = CreateModelResponseProperties & {
28012801 /**
28022802- * Parameters for audio output. Required when audio output is requested with
28032803- * `modalities: ["audio"]`. [Learn more](https://platform.openai.com/docs/guides/audio).
28022802+ * A list of messages comprising the conversation so far. Depending on the
28032803+ * [model](https://platform.openai.com/docs/models) you use, different message types (modalities) are
28042804+ * supported, like [text](https://platform.openai.com/docs/guides/text-generation),
28052805+ * [images](https://platform.openai.com/docs/guides/vision), and [audio](https://platform.openai.com/docs/guides/audio).
28042806 *
28052807 */
28062806- audio?: {
28072807- /**
28082808- * Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`,
28092809- * `opus`, or `pcm16`.
28102810- *
28112811- */
28122812- format: 'wav' | 'aac' | 'mp3' | 'flac' | 'opus' | 'pcm16';
28132813- /**
28142814- * The voice the model uses to respond. Supported voices are
28152815- * `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, and `shimmer`.
28162816- *
28172817- */
28182818- voice: VoiceIdsShared;
28192819- };
28082808+ messages: Array<ChatCompletionRequestMessage>;
28092809+ /**
28102810+ * Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI
28112811+ * offers a wide range of models with different capabilities, performance
28122812+ * characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)
28132813+ * to browse and compare available models.
28142814+ *
28152815+ */
28162816+ model: ModelIdsShared;
28172817+ modalities?: ResponseModalities;
28182818+ verbosity?: Verbosity;
28192819+ reasoning_effort?: ReasoningEffort;
28202820+ /**
28212821+ * An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).
28222822+ *
28232823+ */
28242824+ max_completion_tokens?: number;
28202825 /**
28212826 * Number between -2.0 and 2.0. Positive values penalize new tokens based on
28222827 * their existing frequency in the text so far, decreasing the model's
···28252830 */
28262831 frequency_penalty?: number;
28272832 /**
28282828- * Deprecated in favor of `tool_choice`.
28332833+ * Number between -2.0 and 2.0. Positive values penalize new tokens based on
28342834+ * whether they appear in the text so far, increasing the model's likelihood
28352835+ * to talk about new topics.
28362836+ *
28372837+ */
28382838+ presence_penalty?: number;
28392839+ /**
28402840+ * Web search
28292841 *
28302830- * Controls which (if any) function is called by the model.
28422842+ * This tool searches the web for relevant results to use in a response.
28432843+ * Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat).
28312844 *
28322832- * `none` means the model will not call a function and instead generates a
28332833- * message.
28452845+ */
28462846+ web_search_options?: {
28472847+ /**
28482848+ * Approximate location parameters for the search.
28492849+ *
28502850+ */
28512851+ user_location?: {
28522852+ /**
28532853+ * The type of location approximation. Always `approximate`.
28542854+ *
28552855+ */
28562856+ type: 'approximate';
28572857+ approximate: WebSearchLocation;
28582858+ };
28592859+ search_context_size?: WebSearchContextSize;
28602860+ };
28612861+ /**
28622862+ * An integer between 0 and 20 specifying the number of most likely tokens to
28632863+ * return at each token position, each with an associated log probability.
28642864+ * `logprobs` must be set to `true` if this parameter is used.
28342865 *
28352835- * `auto` means the model can pick between generating a message or calling a
28362836- * function.
28662866+ */
28672867+ top_logprobs?: number;
28682868+ /**
28692869+ * An object specifying the format that the model must output.
28372870 *
28382838- * Specifying a particular function via `{"name": "my_function"}` forces the
28392839- * model to call that function.
28712871+ * Setting to `{ "type": "json_schema", "json_schema": {...} }` enables
28722872+ * Structured Outputs which ensures the model will match your supplied JSON
28732873+ * schema. Learn more in the [Structured Outputs
28742874+ * guide](https://platform.openai.com/docs/guides/structured-outputs).
28402875 *
28412841- * `none` is the default when no functions are present. `auto` is the default
28422842- * if functions are present.
28762876+ * Setting to `{ "type": "json_object" }` enables the older JSON mode, which
28772877+ * ensures the message the model generates is valid JSON. Using `json_schema`
28782878+ * is preferred for models that support it.
28432879 *
28802880+ */
28812881+ response_format?:
28822882+ | ResponseFormatText
28832883+ | ResponseFormatJsonSchema
28842884+ | ResponseFormatJsonObject;
28852885+ /**
28862886+ * Parameters for audio output. Required when audio output is requested with
28872887+ * `modalities: ["audio"]`. [Learn more](https://platform.openai.com/docs/guides/audio).
28442888 *
28452845- * @deprecated
28462889 */
28472847- function_call?: 'none' | 'auto' | ChatCompletionFunctionCallOption;
28902890+ audio?: {
28912891+ /**
28922892+ * The voice the model uses to respond. Supported voices are
28932893+ * `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, and `shimmer`.
28942894+ *
28952895+ */
28962896+ voice: VoiceIdsShared;
28972897+ /**
28982898+ * Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`,
28992899+ * `opus`, or `pcm16`.
29002900+ *
29012901+ */
29022902+ format: 'wav' | 'aac' | 'mp3' | 'flac' | 'opus' | 'pcm16';
29032903+ };
28482904 /**
28492849- * Deprecated in favor of `tools`.
29052905+ * Whether or not to store the output of this chat completion request for
29062906+ * use in our [model distillation](https://platform.openai.com/docs/guides/distillation) or
29072907+ * [evals](https://platform.openai.com/docs/guides/evals) products.
28502908 *
28512851- * A list of functions the model may generate JSON inputs for.
29092909+ * Supports text and image inputs. Note: image inputs over 8MB will be dropped.
28522910 *
29112911+ */
29122912+ store?: boolean;
29132913+ /**
29142914+ * If set to true, the model response data will be streamed to the client
29152915+ * as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
29162916+ * See the [Streaming section below](https://platform.openai.com/docs/api-reference/chat/streaming)
29172917+ * for more information, along with the [streaming responses](https://platform.openai.com/docs/guides/streaming-responses)
29182918+ * guide for more information on how to handle the streaming events.
28532919 *
28542854- * @deprecated
28552920 */
28562856- functions?: Array<ChatCompletionFunctions>;
29212921+ stream?: boolean;
29222922+ stop?: StopConfiguration;
28572923 /**
28582924 * Modify the likelihood of specified tokens appearing in the completion.
28592925 *
···28762942 */
28772943 logprobs?: boolean;
28782944 /**
28792879- * An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).
28802880- *
28812881- */
28822882- max_completion_tokens?: number;
28832883- /**
28842945 * The maximum number of [tokens](/tokenizer) that can be generated in the
28852946 * chat completion. This value can be used to control
28862947 * [costs](https://openai.com/api/pricing/) for text generated via API.
···28932954 */
28942955 max_tokens?: number;
28952956 /**
28962896- * A list of messages comprising the conversation so far. Depending on the
28972897- * [model](https://platform.openai.com/docs/models) you use, different message types (modalities) are
28982898- * supported, like [text](https://platform.openai.com/docs/guides/text-generation),
28992899- * [images](https://platform.openai.com/docs/guides/vision), and [audio](https://platform.openai.com/docs/guides/audio).
29002900- *
29012901- */
29022902- messages: Array<ChatCompletionRequestMessage>;
29032903- modalities?: ResponseModalities;
29042904- /**
29052905- * Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI
29062906- * offers a wide range of models with different capabilities, performance
29072907- * characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)
29082908- * to browse and compare available models.
29092909- *
29102910- */
29112911- model: ModelIdsShared;
29122912- /**
29132957 * How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs.
29142958 */
29152959 n?: number;
29162916- parallel_tool_calls?: ParallelToolCalls;
29172960 /**
29182961 * Configuration for a [Predicted Output](https://platform.openai.com/docs/guides/predicted-outputs),
29192962 * which can greatly improve response times when large parts of the model
···29252968 type?: 'PredictionContent';
29262969 } & PredictionContent;
29272970 /**
29282928- * Number between -2.0 and 2.0. Positive values penalize new tokens based on
29292929- * whether they appear in the text so far, increasing the model's likelihood
29302930- * to talk about new topics.
29312931- *
29322932- */
29332933- presence_penalty?: number;
29342934- reasoning_effort?: ReasoningEffort;
29352935- /**
29362936- * An object specifying the format that the model must output.
29372937- *
29382938- * Setting to `{ "type": "json_schema", "json_schema": {...} }` enables
29392939- * Structured Outputs which ensures the model will match your supplied JSON
29402940- * schema. Learn more in the [Structured Outputs
29412941- * guide](https://platform.openai.com/docs/guides/structured-outputs).
29422942- *
29432943- * Setting to `{ "type": "json_object" }` enables the older JSON mode, which
29442944- * ensures the message the model generates is valid JSON. Using `json_schema`
29452945- * is preferred for models that support it.
29462946- *
29472947- */
29482948- response_format?:
29492949- | ResponseFormatText
29502950- | ResponseFormatJsonSchema
29512951- | ResponseFormatJsonObject;
29522952- /**
29532971 * This feature is in Beta.
29542972 * If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.
29552973 * Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.
···29582976 * @deprecated
29592977 */
29602978 seed?: number;
29612961- stop?: StopConfiguration;
29622962- /**
29632963- * Whether or not to store the output of this chat completion request for
29642964- * use in our [model distillation](https://platform.openai.com/docs/guides/distillation) or
29652965- * [evals](https://platform.openai.com/docs/guides/evals) products.
29662966- *
29672967- * Supports text and image inputs. Note: image inputs over 8MB will be dropped.
29682968- *
29692969- */
29702970- store?: boolean;
29712971- /**
29722972- * If set to true, the model response data will be streamed to the client
29732973- * as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
29742974- * See the [Streaming section below](https://platform.openai.com/docs/api-reference/chat/streaming)
29752975- * for more information, along with the [streaming responses](https://platform.openai.com/docs/guides/streaming-responses)
29762976- * guide for more information on how to handle the streaming events.
29772977- *
29782978- */
29792979- stream?: boolean;
29802979 stream_options?: ChatCompletionStreamOptions;
29812981- tool_choice?: ChatCompletionToolChoiceOption;
29822980 /**
29832981 * A list of tools the model may call. You can provide either
29842982 * [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) or
···29932991 type?: 'CustomToolChatCompletions';
29942992 } & CustomToolChatCompletions)
29952993 >;
29942994+ tool_choice?: ChatCompletionToolChoiceOption;
29952995+ parallel_tool_calls?: ParallelToolCalls;
29962996 /**
29972997- * An integer between 0 and 20 specifying the number of most likely tokens to
29982998- * return at each token position, each with an associated log probability.
29992999- * `logprobs` must be set to `true` if this parameter is used.
29972997+ * Deprecated in favor of `tool_choice`.
29982998+ *
29992999+ * Controls which (if any) function is called by the model.
30003000+ *
30013001+ * `none` means the model will not call a function and instead generates a
30023002+ * message.
30033003+ *
30043004+ * `auto` means the model can pick between generating a message or calling a
30053005+ * function.
30063006+ *
30073007+ * Specifying a particular function via `{"name": "my_function"}` forces the
30083008+ * model to call that function.
30093009+ *
30103010+ * `none` is the default when no functions are present. `auto` is the default
30113011+ * if functions are present.
30123012+ *
30003013 *
30143014+ * @deprecated
30013015 */
30023002- top_logprobs?: number;
30033003- verbosity?: Verbosity;
30163016+ function_call?: 'none' | 'auto' | ChatCompletionFunctionCallOption;
30043017 /**
30053005- * Web search
30183018+ * Deprecated in favor of `tools`.
30063019 *
30073007- * This tool searches the web for relevant results to use in a response.
30083008- * Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat).
30203020+ * A list of functions the model may generate JSON inputs for.
30213021+ *
30093022 *
30233023+ * @deprecated
30103024 */
30113011- web_search_options?: {
30123012- search_context_size?: WebSearchContextSize;
30133013- /**
30143014- * Approximate location parameters for the search.
30153015- *
30163016- */
30173017- user_location?: {
30183018- approximate: WebSearchLocation;
30193019- /**
30203020- * The type of location approximation. Always `approximate`.
30213021- *
30223022- */
30233023- type: 'approximate';
30243024- };
30253025- };
30253025+ functions?: Array<ChatCompletionFunctions>;
30263026};
3027302730283028/**
30293029 * Represents a chat completion response returned by model, based on the provided input.
30303030 */
30313031export type CreateChatCompletionResponse = {
30323032+ /**
30333033+ * A unique identifier for the chat completion.
30343034+ */
30353035+ id: string;
30323036 /**
30333037 * A list of chat completion choices. Can be more than one if `n` is greater than 1.
30343038 */
···30503054 * The index of the choice in the list of choices.
30513055 */
30523056 index: number;
30573057+ message: ChatCompletionResponseMessage;
30533058 /**
30543059 * Log probability information for the choice.
30553060 */
···30633068 */
30643069 refusal: Array<ChatCompletionTokenLogprob>;
30653070 };
30663066- message: ChatCompletionResponseMessage;
30673071 }>;
30683072 /**
30693073 * The Unix timestamp (in seconds) of when the chat completion was created.
30703074 */
30713075 created: number;
30723072- /**
30733073- * A unique identifier for the chat completion.
30743074- */
30753075- id: string;
30763076 /**
30773077 * The model used for the chat completion.
30783078 */
30793079 model: string;
30803080- /**
30813081- * The object type, which is always `chat.completion`.
30823082- */
30833083- object: 'chat.completion';
30843080 service_tier?: ServiceTier;
30853081 /**
30863082 * This fingerprint represents the backend configuration that the model runs with.
···30913087 * @deprecated
30923088 */
30933089 system_fingerprint?: string;
30903090+ /**
30913091+ * The object type, which is always `chat.completion`.
30923092+ */
30933093+ object: 'chat.completion';
30943094 usage?: CompletionUsage;
30953095};
30963096···31023102 */
31033103export type CreateChatCompletionStreamResponse = {
31043104 /**
31053105+ * A unique identifier for the chat completion. Each chunk has the same ID.
31063106+ */
31073107+ id: string;
31083108+ /**
31053109 * A list of chat completion choices. Can contain more than one elements if `n` is greater than 1. Can also be empty for the
31063110 * last chunk if you set `stream_options: {"include_usage": true}`.
31073111 *
···31093113 choices: Array<{
31103114 delta: ChatCompletionStreamResponseDelta;
31113115 /**
31163116+ * Log probability information for the choice.
31173117+ */
31183118+ logprobs?: {
31193119+ /**
31203120+ * A list of message content tokens with log probability information.
31213121+ */
31223122+ content: Array<ChatCompletionTokenLogprob>;
31233123+ /**
31243124+ * A list of message refusal tokens with log probability information.
31253125+ */
31263126+ refusal: Array<ChatCompletionTokenLogprob>;
31273127+ };
31283128+ /**
31123129 * The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,
31133130 * `length` if the maximum number of tokens specified in the request was reached,
31143131 * `content_filter` if content was omitted due to a flag from our content filters,
···31253142 * The index of the choice in the list of choices.
31263143 */
31273144 index: number;
31283128- /**
31293129- * Log probability information for the choice.
31303130- */
31313131- logprobs?: {
31323132- /**
31333133- * A list of message content tokens with log probability information.
31343134- */
31353135- content: Array<ChatCompletionTokenLogprob>;
31363136- /**
31373137- * A list of message refusal tokens with log probability information.
31383138- */
31393139- refusal: Array<ChatCompletionTokenLogprob>;
31403140- };
31413145 }>;
31423146 /**
31433147 * The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.
31443148 */
31453149 created: number;
31463150 /**
31473147- * A unique identifier for the chat completion. Each chunk has the same ID.
31483148- */
31493149- id: string;
31503150- /**
31513151 * The model to generate the completion.
31523152 */
31533153 model: string;
31543154- /**
31553155- * The object type, which is always `chat.completion.chunk`.
31563156- */
31573157- object: 'chat.completion.chunk';
31583154 service_tier?: ServiceTier;
31593155 /**
31603156 * This fingerprint represents the backend configuration that the model runs with.
···31653161 */
31663162 system_fingerprint?: string;
31673163 /**
31643164+ * The object type, which is always `chat.completion.chunk`.
31653165+ */
31663166+ object: 'chat.completion.chunk';
31673167+ /**
31683168 * An optional field that will only be present when you set
31693169 * `stream_options: {"include_usage": true}` in your request. When present, it
31703170 * contains a null value **except for the last chunk** which contains the
···3180318031813181export type CreateCompletionRequest = {
31823182 /**
31833183+ * ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them.
31843184+ *
31853185+ */
31863186+ model: string | 'gpt-3.5-turbo-instruct' | 'davinci-002' | 'babbage-002';
31873187+ /**
31883188+ * The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.
31893189+ *
31903190+ * Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.
31913191+ *
31923192+ */
31933193+ prompt: string | Array<string> | Array<number> | Array<Array<number>>;
31943194+ /**
31833195 * Generates `best_of` completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed.
31843196 *
31853197 * When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`.
···32263238 */
32273239 max_tokens?: number;
32283240 /**
32293229- * ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them.
32303230- *
32313231- */
32323232- model: string | 'gpt-3.5-turbo-instruct' | 'davinci-002' | 'babbage-002';
32333233- /**
32343241 * How many completions to generate for each prompt.
32353242 *
32363243 * **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.
···32443251 *
32453252 */
32463253 presence_penalty?: number;
32473247- /**
32483248- * The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.
32493249- *
32503250- * Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.
32513251- *
32523252- */
32533253- prompt: string | Array<string> | Array<number> | Array<Array<number>>;
32543254 /**
32553255 * If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.
32563256 *
···32993299 */
33003300export type CreateCompletionResponse = {
33013301 /**
33023302+ * A unique identifier for the completion.
33033303+ */
33043304+ id: string;
33053305+ /**
33023306 * The list of completion choices the model generated for the input prompt.
33033307 */
33043308 choices: Array<{
···33253329 */
33263330 created: number;
33273331 /**
33283328- * A unique identifier for the completion.
33293329- */
33303330- id: string;
33313331- /**
33323332 * The model used for completion.
33333333 */
33343334 model: string;
33353335 /**
33363336- * The object type, which is always "text_completion"
33373337- */
33383338- object: 'text_completion';
33393339- /**
33403336 * This fingerprint represents the backend configuration that the model runs with.
33413337 *
33423338 * Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.
33433339 *
33443340 */
33453341 system_fingerprint?: string;
33423342+ /**
33433343+ * The object type, which is always "text_completion"
33443344+ */
33453345+ object: 'text_completion';
33463346 usage?: CompletionUsage;
33473347};
3348334833493349export type CreateContainerBody = {
33503350 /**
33513351+ * Name of the container to create.
33523352+ */
33533353+ name: string;
33543354+ /**
33553355+ * IDs of files to copy to the container.
33563356+ */
33573357+ file_ids?: Array<string>;
33583358+ /**
33513359 * Container expiration time in seconds relative to the 'anchor' time.
33523360 */
33533361 expires_after?: {
···33573365 anchor: 'last_active_at';
33583366 minutes: number;
33593367 };
33603360- /**
33613361- * IDs of files to copy to the container.
33623362- */
33633363- file_ids?: Array<string>;
33643364- /**
33653365- * Name of the container to create.
33663366- */
33673367- name: string;
33683368};
3369336933703370export type CreateContainerFileBody = {
33713371 /**
33723372+ * Name of the file to create.
33733373+ */
33743374+ file_id?: string;
33753375+ /**
33723376 * The File object (not file name) to be uploaded.
33733377 *
33743378 */
33753379 file?: Blob | File;
33763376- /**
33773377- * Name of the file to create.
33783378- */
33793379- file_id?: string;
33803380};
3381338133823382export type CreateEmbeddingRequest = {
33833383 /**
33843384- * The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models.
33853385- *
33863386- */
33873387- dimensions?: number;
33883388- /**
33893389- * The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/).
33903390- */
33913391- encoding_format?: 'float' | 'base64';
33923392- /**
33933384 * 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.
33943385 *
33953386 */
···34033394 | 'text-embedding-ada-002'
34043395 | 'text-embedding-3-small'
34053396 | 'text-embedding-3-large';
33973397+ /**
33983398+ * The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/).
33993399+ */
34003400+ encoding_format?: 'float' | 'base64';
34013401+ /**
34023402+ * The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models.
34033403+ *
34043404+ */
34053405+ dimensions?: number;
34063406 /**
34073407 * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).
34083408 *
···34463446 */
34473447export type CreateEvalCompletionsRunDataSource = {
34483448 /**
34493449+ * The type of run data source. Always `completions`.
34503450+ */
34513451+ type: 'completions';
34523452+ /**
34493453 * Used when sampling from a model. Dictates the structure of the messages passed into the model. Can either be a reference to a prebuilt trajectory (ie, `item.input_trajectory`), or a template with variable references to the `item` namespace.
34503454 */
34513455 input_messages?:
34523456 | {
34533457 /**
34583458+ * The type of input messages. Always `template`.
34593459+ */
34603460+ type: 'template';
34613461+ /**
34543462 * A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}.
34553463 */
34563464 template: Array<
···34613469 type?: 'EvalItem';
34623470 } & EvalItem)
34633471 >;
34643464- /**
34653465- * The type of input messages. Always `template`.
34663466- */
34673467- type: 'template';
34683472 }
34693473 | {
34703470- /**
34713471- * A reference to a variable in the `item` namespace. Ie, "item.input_trajectory"
34723472- */
34733473- item_reference: string;
34743474 /**
34753475 * The type of input messages. Always `item_reference`.
34763476 */
34773477 type: 'item_reference';
34783478+ /**
34793479+ * A reference to a variable in the `item` namespace. Ie, "item.input_trajectory"
34803480+ */
34813481+ item_reference: string;
34783482 };
34793479- /**
34803480- * The name of the model to use for generating completions (e.g. "o3-mini").
34813481- */
34823482- model?: string;
34833483 sampling_params?: {
34843484 /**
34853485+ * A higher temperature increases randomness in the outputs.
34863486+ */
34873487+ temperature?: number;
34883488+ /**
34853489 * The maximum number of tokens in the generated output.
34863490 */
34873491 max_completion_tokens?: number;
34923492+ /**
34933493+ * An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
34943494+ */
34953495+ top_p?: number;
34963496+ /**
34973497+ * A seed value to initialize the randomness, during sampling.
34983498+ */
34993499+ seed?: number;
34883500 /**
34893501 * An object specifying the format that the model must output.
34903502 *
···35033515 | ResponseFormatJsonSchema
35043516 | ResponseFormatJsonObject;
35053517 /**
35063506- * A seed value to initialize the randomness, during sampling.
35073507- */
35083508- seed?: number;
35093509- /**
35103510- * A higher temperature increases randomness in the outputs.
35113511- */
35123512- temperature?: number;
35133513- /**
35143518 * A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.
35153519 *
35163520 */
35173521 tools?: Array<ChatCompletionTool>;
35183518- /**
35193519- * An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
35203520- */
35213521- top_p?: number;
35223522 };
35233523+ /**
35243524+ * The name of the model to use for generating completions (e.g. "o3-mini").
35253525+ */
35263526+ model?: string;
35233527 /**
35243528 * Determines what populates the `item` namespace in this run's data source.
35253529 */
···35333537 | ({
35343538 type?: 'EvalStoredCompletionsSource';
35353539 } & EvalStoredCompletionsSource);
35363536- /**
35373537- * The type of run data source. Always `completions`.
35383538- */
35393539- type: 'completions';
35403540};
3541354135423542/**
···35503550 */
35513551export type CreateEvalCustomDataSourceConfig = {
35523552 /**
35533553- * Whether the eval should expect you to populate the sample namespace (ie, by generating responses off of your data source)
35533553+ * The type of data source. Always `custom`.
35543554 */
35553555- include_sample_schema?: boolean;
35553555+ type: 'custom';
35563556 /**
35573557 * The json schema for each row in the data source.
35583558 */
···35603560 [key: string]: unknown;
35613561 };
35623562 /**
35633563- * The type of data source. Always `custom`.
35633563+ * Whether the eval should expect you to populate the sample namespace (ie, by generating responses off of your data source)
35643564 */
35653565- type: 'custom';
35653565+ include_sample_schema?: boolean;
35663566};
3567356735683568/**
···35733573export type CreateEvalItem =
35743574 | {
35753575 /**
35763576- * The content of the message.
35773577- */
35783578- content: string;
35793579- /**
35803576 * The role of the message (e.g. "system", "assistant", "user").
35813577 */
35823578 role: string;
35793579+ /**
35803580+ * The content of the message.
35813581+ */
35823582+ content: string;
35833583 }
35843584 | EvalItem;
35853585···35913591 */
35923592export type CreateEvalJsonlRunDataSource = {
35933593 /**
35943594+ * The type of data source. Always `jsonl`.
35953595+ */
35963596+ type: 'jsonl';
35973597+ /**
35943598 * Determines what populates the `item` namespace in the data source.
35953599 */
35963600 source:
···36003604 | ({
36013605 type?: 'EvalJsonlFileIdSource';
36023606 } & EvalJsonlFileIdSource);
36033603- /**
36043604- * The type of data source. Always `jsonl`.
36053605- */
36063606- type: 'jsonl';
36073607};
3608360836093609/**
···36153615 */
36163616export type CreateEvalLabelModelGrader = {
36173617 /**
36183618- * A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}.
36183618+ * The object type, which is always `label_model`.
36193619 */
36203620- input: Array<CreateEvalItem>;
36203620+ type: 'label_model';
36213621 /**
36223622- * The labels to classify to each item in the evaluation.
36223622+ * The name of the grader.
36233623 */
36243624- labels: Array<string>;
36243624+ name: string;
36253625 /**
36263626 * The model to use for the evaluation. Must support structured outputs.
36273627 */
36283628 model: string;
36293629 /**
36303630- * The name of the grader.
36303630+ * A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}.
36313631 */
36323632- name: string;
36323632+ input: Array<CreateEvalItem>;
36333633 /**
36343634- * The labels that indicate a passing result. Must be a subset of labels.
36343634+ * The labels to classify to each item in the evaluation.
36353635 */
36363636- passing_labels: Array<string>;
36363636+ labels: Array<string>;
36373637 /**
36383638- * The object type, which is always `label_model`.
36383638+ * The labels that indicate a passing result. Must be a subset of labels.
36393639 */
36403640- type: 'label_model';
36403640+ passing_labels: Array<string>;
36413641};
3642364236433643/**
···36493649 */
36503650export type CreateEvalLogsDataSourceConfig = {
36513651 /**
36523652+ * The type of data source. Always `logs`.
36533653+ */
36543654+ type: 'logs';
36553655+ /**
36523656 * Metadata filters for the logs data source.
36533657 */
36543658 metadata?: {
36553659 [key: string]: unknown;
36563660 };
36573657- /**
36583658- * The type of data source. Always `logs`.
36593659- */
36603660- type: 'logs';
36613661};
3662366236633663/**
···36653665 */
36663666export type CreateEvalRequest = {
36673667 /**
36683668+ * The name of the evaluation.
36693669+ */
36703670+ name?: string;
36713671+ metadata?: Metadata;
36723672+ /**
36683673 * The configuration for the data source used for the evaluation runs. Dictates the schema of the data used in the evaluation.
36693674 */
36703675 data_source_config:
···36773682 | ({
36783683 type?: 'CreateEvalStoredCompletionsDataSourceConfig';
36793684 } & CreateEvalStoredCompletionsDataSourceConfig);
36803680- metadata?: Metadata;
36813681- /**
36823682- * The name of the evaluation.
36833683- */
36843684- name?: string;
36853685 /**
36863686 * A list of graders for all eval runs in this group. Graders can reference variables in the data source using double curly braces notation, like `{{item.variable_name}}`. To reference the model's output, use the `sample` namespace (ie, `{{sample.output_text}}`).
36873687 */
···37123712 */
37133713export type CreateEvalResponsesRunDataSource = {
37143714 /**
37153715+ * The type of run data source. Always `responses`.
37163716+ */
37173717+ type: 'responses';
37183718+ /**
37153719 * Used when sampling from a model. Dictates the structure of the messages passed into the model. Can either be a reference to a prebuilt trajectory (ie, `item.input_trajectory`), or a template with variable references to the `item` namespace.
37163720 */
37173721 input_messages?:
37183722 | {
37193723 /**
37243724+ * The type of input messages. Always `template`.
37253725+ */
37263726+ type: 'template';
37273727+ /**
37203728 * A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}.
37213729 */
37223730 template: Array<
37233731 | {
37243732 /**
37253725- * The content of the message.
37263726- */
37273727- content: string;
37283728- /**
37293733 * The role of the message (e.g. "system", "assistant", "user").
37303734 */
37313735 role: string;
37363736+ /**
37373737+ * The content of the message.
37383738+ */
37393739+ content: string;
37323740 }
37333741 | EvalItem
37343742 >;
37433743+ }
37443744+ | {
37353745 /**
37363736- * The type of input messages. Always `template`.
37463746+ * The type of input messages. Always `item_reference`.
37373747 */
37383738- type: 'template';
37393739- }
37403740- | {
37483748+ type: 'item_reference';
37413749 /**
37423750 * A reference to a variable in the `item` namespace. Ie, "item.name"
37433751 */
37443752 item_reference: string;
37453745- /**
37463746- * The type of input messages. Always `item_reference`.
37473747- */
37483748- type: 'item_reference';
37493753 };
37503750- /**
37513751- * The name of the model to use for generating completions (e.g. "o3-mini").
37523752- */
37533753- model?: string;
37543754 sampling_params?: {
37553755 /**
37563756+ * A higher temperature increases randomness in the outputs.
37573757+ */
37583758+ temperature?: number;
37593759+ /**
37563760 * The maximum number of tokens in the generated output.
37573761 */
37583762 max_completion_tokens?: number;
37593763 /**
37643764+ * An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
37653765+ */
37663766+ top_p?: number;
37673767+ /**
37603768 * A seed value to initialize the randomness, during sampling.
37613769 */
37623770 seed?: number;
37633771 /**
37643764- * A higher temperature increases randomness in the outputs.
37653765- */
37663766- temperature?: number;
37673767- /**
37683768- * Configuration options for a text response from the model. Can be plain
37693769- * text or structured JSON data. Learn more:
37703770- * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
37713771- * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
37723772- *
37733773- */
37743774- text?: {
37753775- format?: TextResponseFormatConfiguration;
37763776- };
37773777- /**
37783772 * An array of tools the model may call while generating a response. You
37793773 * can specify which tool to use by setting the `tool_choice` parameter.
37803774 *
···37913785 */
37923786 tools?: Array<Tool>;
37933787 /**
37943794- * An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
37883788+ * Configuration options for a text response from the model. Can be plain
37893789+ * text or structured JSON data. Learn more:
37903790+ * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
37913791+ * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
37923792+ *
37953793 */
37963796- top_p?: number;
37943794+ text?: {
37953795+ format?: TextResponseFormatConfiguration;
37963796+ };
37973797 };
37983798+ /**
37993799+ * The name of the model to use for generating completions (e.g. "o3-mini").
38003800+ */
38013801+ model?: string;
37983802 /**
37993803 * Determines what populates the `item` namespace in this run's data source.
38003804 */
···38083812 | ({
38093813 type?: 'EvalResponsesSource';
38103814 } & EvalResponsesSource);
38113811- /**
38123812- * The type of run data source. Always `responses`.
38133813- */
38143814- type: 'responses';
38153815};
3816381638173817/**
···38193819 */
38203820export type CreateEvalRunRequest = {
38213821 /**
38223822+ * The name of the run.
38233823+ */
38243824+ name?: string;
38253825+ metadata?: Metadata;
38263826+ /**
38223827 * Details about the run's data source.
38233828 */
38243829 data_source:
38253830 | CreateEvalJsonlRunDataSource
38263831 | CreateEvalCompletionsRunDataSource
38273832 | CreateEvalResponsesRunDataSource;
38283828- metadata?: Metadata;
38293829- /**
38303830- * The name of the run.
38313831- */
38323832- name?: string;
38333833};
3834383438353835/**
···38423842 */
38433843export type CreateEvalStoredCompletionsDataSourceConfig = {
38443844 /**
38453845+ * The type of data source. Always `stored_completions`.
38463846+ */
38473847+ type: 'stored_completions';
38483848+ /**
38453849 * Metadata filters for the stored completions data source.
38463850 */
38473851 metadata?: {
38483852 [key: string]: unknown;
38493853 };
38503850- /**
38513851- * The type of data source. Always `stored_completions`.
38523852- */
38533853- type: 'stored_completions';
38543854};
3855385538563856export type CreateFileRequest = {
38573857- expires_after?: FileExpirationAfter;
38583857 /**
38593858 * The File object (not file name) to be uploaded.
38603859 *
38613860 */
38623861 file: Blob | File;
38633862 purpose: FilePurpose;
38633863+ expires_after?: FileExpirationAfter;
38643864};
3865386538663866export type CreateFineTuningCheckpointPermissionRequest = {
···3872387238733873export type CreateFineTuningJobRequest = {
38743874 /**
38753875+ * The name of the model to fine-tune. You can select one of the
38763876+ * [supported models](https://platform.openai.com/docs/guides/fine-tuning#which-models-can-be-fine-tuned).
38773877+ *
38783878+ */
38793879+ model:
38803880+ | string
38813881+ | 'babbage-002'
38823882+ | 'davinci-002'
38833883+ | 'gpt-3.5-turbo'
38843884+ | 'gpt-4o-mini';
38853885+ /**
38863886+ * The ID of an uploaded file that contains training data.
38873887+ *
38883888+ * See [upload file](https://platform.openai.com/docs/api-reference/files/create) for how to upload a file.
38893889+ *
38903890+ * Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose `fine-tune`.
38913891+ *
38923892+ * The contents of the file should differ depending on if the model uses the [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input), [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input) format, or if the fine-tuning method uses the [preference](https://platform.openai.com/docs/api-reference/fine-tuning/preference-input) format.
38933893+ *
38943894+ * See the [fine-tuning guide](https://platform.openai.com/docs/guides/model-optimization) for more details.
38953895+ *
38963896+ */
38973897+ training_file: string;
38983898+ /**
38753899 * The hyperparameters used for the fine-tuning job.
38763900 * This value is now deprecated in favor of `method`, and should be passed in under the `method` parameter.
38773901 *
···38993923 n_epochs?: 'auto' | number;
39003924 };
39013925 /**
39263926+ * A string of up to 64 characters that will be added to your fine-tuned model name.
39273927+ *
39283928+ * For example, a `suffix` of "custom-model-name" would produce a model name like `ft:gpt-4o-mini:openai:custom-model-name:7p4lURel`.
39293929+ *
39303930+ */
39313931+ suffix?: string;
39323932+ /**
39333933+ * The ID of an uploaded file that contains validation data.
39343934+ *
39353935+ * If you provide this file, the data is used to generate validation
39363936+ * metrics periodically during fine-tuning. These metrics can be viewed in
39373937+ * the fine-tuning results file.
39383938+ * The same data should not be present in both train and validation files.
39393939+ *
39403940+ * Your dataset must be formatted as a JSONL file. You must upload your file with the purpose `fine-tune`.
39413941+ *
39423942+ * See the [fine-tuning guide](https://platform.openai.com/docs/guides/model-optimization) for more details.
39433943+ *
39443944+ */
39453945+ validation_file?: string;
39463946+ /**
39023947 * A list of integrations to enable for your fine-tuning job.
39033948 */
39043949 integrations?: Array<{
···39153960 */
39163961 wandb: {
39173962 /**
39183918- * The entity to use for the run. This allows you to set the team or username of the WandB user that you would
39193919- * like associated with the run. If not set, the default entity for the registered WandB API key is used.
39633963+ * The name of the project that the new run will be created under.
39203964 *
39213965 */
39223922- entity?: string;
39663966+ project: string;
39233967 /**
39243968 * A display name to set for the run. If not set, we will use the Job ID as the name.
39253969 *
39263970 */
39273971 name?: string;
39283972 /**
39293929- * The name of the project that the new run will be created under.
39733973+ * The entity to use for the run. This allows you to set the team or username of the WandB user that you would
39743974+ * like associated with the run. If not set, the default entity for the registered WandB API key is used.
39303975 *
39313976 */
39323932- project: string;
39773977+ entity?: string;
39333978 /**
39343979 * A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some
39353980 * default tags are generated by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}".
···39383983 tags?: Array<string>;
39393984 };
39403985 }>;
39413941- metadata?: Metadata;
39423942- method?: FineTuneMethod;
39433943- /**
39443944- * The name of the model to fine-tune. You can select one of the
39453945- * [supported models](https://platform.openai.com/docs/guides/fine-tuning#which-models-can-be-fine-tuned).
39463946- *
39473947- */
39483948- model:
39493949- | string
39503950- | 'babbage-002'
39513951- | 'davinci-002'
39523952- | 'gpt-3.5-turbo'
39533953- | 'gpt-4o-mini';
39543986 /**
39553987 * The seed controls the reproducibility of the job. Passing in the same seed and job parameters should produce the same results, but may differ in rare cases.
39563988 * If a seed is not specified, one will be generated for you.
39573989 *
39583990 */
39593991 seed?: number;
39923992+ method?: FineTuneMethod;
39933993+ metadata?: Metadata;
39943994+};
39953995+39963996+export type CreateImageEditRequest = {
39603997 /**
39613961- * A string of up to 64 characters that will be added to your fine-tuned model name.
39983998+ * The image(s) to edit. Must be a supported image file or an array of images.
39623999 *
39633963- * For example, a `suffix` of "custom-model-name" would produce a model name like `ft:gpt-4o-mini:openai:custom-model-name:7p4lURel`.
40004000+ * For `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less
40014001+ * than 50MB. You can provide up to 16 images.
40024002+ *
40034003+ * For `dall-e-2`, you can only provide one image, and it should be a square
40044004+ * `png` file less than 4MB.
39644005 *
39654006 */
39663966- suffix?: string;
40074007+ image: Blob | File | Array<Blob | File>;
39674008 /**
39683968- * The ID of an uploaded file that contains training data.
39693969- *
39703970- * See [upload file](https://platform.openai.com/docs/api-reference/files/create) for how to upload a file.
39713971- *
39723972- * Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose `fine-tune`.
39733973- *
39743974- * The contents of the file should differ depending on if the model uses the [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input), [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input) format, or if the fine-tuning method uses the [preference](https://platform.openai.com/docs/api-reference/fine-tuning/preference-input) format.
39753975- *
39763976- * See the [fine-tuning guide](https://platform.openai.com/docs/guides/model-optimization) for more details.
39773977- *
40094009+ * A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for `gpt-image-1`.
39784010 */
39793979- training_file: string;
40114011+ prompt: string;
39804012 /**
39813981- * The ID of an uploaded file that contains validation data.
39823982- *
39833983- * If you provide this file, the data is used to generate validation
39843984- * metrics periodically during fine-tuning. These metrics can be viewed in
39853985- * the fine-tuning results file.
39863986- * The same data should not be present in both train and validation files.
39873987- *
39883988- * Your dataset must be formatted as a JSONL file. You must upload your file with the purpose `fine-tune`.
39893989- *
39903990- * See the [fine-tuning guide](https://platform.openai.com/docs/guides/model-optimization) for more details.
39913991- *
40134013+ * An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`.
39924014 */
39933993- validation_file?: string;
39943994-};
39953995-39963996-export type CreateImageEditRequest = {
40154015+ mask?: Blob | File;
39974016 /**
39984017 * Allows to set transparency for the background of the generated image(s).
39994018 * This parameter is only supported for `gpt-image-1`. Must be one of
···40064025 */
40074026 background?: 'transparent' | 'opaque' | 'auto';
40084027 /**
40094009- * The image(s) to edit. Must be a supported image file or an array of images.
40104010- *
40114011- * For `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less
40124012- * than 50MB. You can provide up to 16 images.
40134013- *
40144014- * For `dall-e-2`, you can only provide one image, and it should be a square
40154015- * `png` file less than 4MB.
40164016- *
40174017- */
40184018- image: Blob | File | Array<Blob | File>;
40194019- input_fidelity?: ImageInputFidelity;
40204020- /**
40214021- * An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`.
40224022- */
40234023- mask?: Blob | File;
40244024- /**
40254028 * The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are supported. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1` is used.
40264029 */
40274030 model?: string | 'dall-e-2' | 'gpt-image-1';
···40304033 */
40314034 n?: number;
40324035 /**
40334033- * The compression level (0-100%) for the generated images. This parameter
40344034- * is only supported for `gpt-image-1` with the `webp` or `jpeg` output
40354035- * formats, and defaults to 100.
40364036- *
40364036+ * The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for `gpt-image-1`, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`.
40374037 */
40384038- output_compression?: number;
40384038+ size?:
40394039+ | '256x256'
40404040+ | '512x512'
40414041+ | '1024x1024'
40424042+ | '1536x1024'
40434043+ | '1024x1536'
40444044+ | 'auto';
40454045+ /**
40464046+ * The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2`, as `gpt-image-1` will always return base64-encoded images.
40474047+ */
40484048+ response_format?: 'url' | 'b64_json';
40394049 /**
40404050 * The format in which the generated images are returned. This parameter is
40414051 * only supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`.
···40434053 *
40444054 */
40454055 output_format?: 'png' | 'jpeg' | 'webp';
40464046- partial_images?: PartialImages;
40474056 /**
40484048- * A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for `gpt-image-1`.
40574057+ * The compression level (0-100%) for the generated images. This parameter
40584058+ * is only supported for `gpt-image-1` with the `webp` or `jpeg` output
40594059+ * formats, and defaults to 100.
40604060+ *
40494061 */
40504050- prompt: string;
40624062+ output_compression?: number;
40514063 /**
40524052- * The quality of the image that will be generated. `high`, `medium` and `low` are only supported for `gpt-image-1`. `dall-e-2` only supports `standard` quality. Defaults to `auto`.
40644064+ * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).
40534065 *
40544066 */
40554055- quality?: 'standard' | 'low' | 'medium' | 'high' | 'auto';
40564056- /**
40574057- * The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2`, as `gpt-image-1` will always return base64-encoded images.
40584058- */
40594059- response_format?: 'url' | 'b64_json';
40604060- /**
40614061- * The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for `gpt-image-1`, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`.
40624062- */
40634063- size?:
40644064- | '256x256'
40654065- | '512x512'
40664066- | '1024x1024'
40674067- | '1536x1024'
40684068- | '1024x1536'
40694069- | 'auto';
40674067+ user?: string;
40684068+ input_fidelity?: ImageInputFidelity;
40704069 /**
40714070 * Edit the image in streaming mode. Defaults to `false`. See the
40724071 * [Image generation guide](https://platform.openai.com/docs/guides/image-generation) for more information.
40734072 *
40744073 */
40754074 stream?: boolean;
40754075+ partial_images?: PartialImages;
40764076 /**
40774077- * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).
40774077+ * The quality of the image that will be generated. `high`, `medium` and `low` are only supported for `gpt-image-1`. `dall-e-2` only supports `standard` quality. Defaults to `auto`.
40784078 *
40794079 */
40804080- user?: string;
40804080+ quality?: 'standard' | 'low' | 'medium' | 'high' | 'auto';
40814081};
4082408240834083export type CreateImageRequest = {
40844084 /**
40854085- * Allows to set transparency for the background of the generated image(s).
40864086- * This parameter is only supported for `gpt-image-1`. Must be one of
40874087- * `transparent`, `opaque` or `auto` (default value). When `auto` is used, the
40884088- * model will automatically determine the best background for the image.
40894089- *
40904090- * If `transparent`, the output format needs to support transparency, so it
40914091- * should be set to either `png` (default value) or `webp`.
40924092- *
40854085+ * A text description of the desired image(s). The maximum length is 32000 characters for `gpt-image-1`, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.
40934086 */
40944094- background?: 'transparent' | 'opaque' | 'auto';
40874087+ prompt: string;
40954088 /**
40964089 * The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or `gpt-image-1`. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1` is used.
40974090 */
40984091 model?: string | 'dall-e-2' | 'dall-e-3' | 'gpt-image-1';
40994099- /**
41004100- * Control the content-moderation level for images generated by `gpt-image-1`. Must be either `low` for less restrictive filtering or `auto` (default value).
41014101- */
41024102- moderation?: 'low' | 'auto';
41034092 /**
41044093 * The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.
41054094 */
41064095 n?: number;
41074096 /**
41084108- * The compression level (0-100%) for the generated images. This parameter is only supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and defaults to 100.
41094109- */
41104110- output_compression?: number;
41114111- /**
41124112- * The format in which the generated images are returned. This parameter is only supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`.
41134113- */
41144114- output_format?: 'png' | 'jpeg' | 'webp';
41154115- partial_images?: PartialImages;
41164116- /**
41174117- * A text description of the desired image(s). The maximum length is 32000 characters for `gpt-image-1`, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.
41184118- */
41194119- prompt: string;
41204120- /**
41214097 * The quality of the image that will be generated.
41224098 *
41234099 * - `auto` (default value) will automatically select the best quality for the given model.
···41324108 */
41334109 response_format?: 'url' | 'b64_json';
41344110 /**
41114111+ * The format in which the generated images are returned. This parameter is only supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`.
41124112+ */
41134113+ output_format?: 'png' | 'jpeg' | 'webp';
41144114+ /**
41154115+ * The compression level (0-100%) for the generated images. This parameter is only supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and defaults to 100.
41164116+ */
41174117+ output_compression?: number;
41184118+ /**
41194119+ * Generate the image in streaming mode. Defaults to `false`. See the
41204120+ * [Image generation guide](https://platform.openai.com/docs/guides/image-generation) for more information.
41214121+ * This parameter is only supported for `gpt-image-1`.
41224122+ *
41234123+ */
41244124+ stream?: boolean;
41254125+ partial_images?: PartialImages;
41264126+ /**
41354127 * The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for `gpt-image-1`, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`.
41364128 */
41374129 size?:
···41444136 | '1792x1024'
41454137 | '1024x1792';
41464138 /**
41474147- * Generate the image in streaming mode. Defaults to `false`. See the
41484148- * [Image generation guide](https://platform.openai.com/docs/guides/image-generation) for more information.
41494149- * This parameter is only supported for `gpt-image-1`.
41394139+ * Control the content-moderation level for images generated by `gpt-image-1`. Must be either `low` for less restrictive filtering or `auto` (default value).
41404140+ */
41414141+ moderation?: 'low' | 'auto';
41424142+ /**
41434143+ * Allows to set transparency for the background of the generated image(s).
41444144+ * This parameter is only supported for `gpt-image-1`. Must be one of
41454145+ * `transparent`, `opaque` or `auto` (default value). When `auto` is used, the
41464146+ * model will automatically determine the best background for the image.
41474147+ *
41484148+ * If `transparent`, the output format needs to support transparency, so it
41494149+ * should be set to either `png` (default value) or `webp`.
41504150 *
41514151 */
41524152- stream?: boolean;
41524152+ background?: 'transparent' | 'opaque' | 'auto';
41534153 /**
41544154 * The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images.
41554155 */
···4191419141924192export type CreateMessageRequest = {
41934193 /**
41944194+ * The role of the entity that is creating the message. Allowed values include:
41954195+ * - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.
41964196+ * - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation.
41974197+ *
41984198+ */
41994199+ role: 'user' | 'assistant';
42004200+ content:
42014201+ | string
42024202+ | Array<
42034203+ | ({
42044204+ type?: 'MessageContentImageFileObject';
42054205+ } & MessageContentImageFileObject)
42064206+ | ({
42074207+ type?: 'MessageContentImageUrlObject';
42084208+ } & MessageContentImageUrlObject)
42094209+ | ({
42104210+ type?: 'MessageRequestContentTextObject';
42114211+ } & MessageRequestContentTextObject)
42124212+ >;
42134213+ /**
41944214 * A list of files attached to the message, and the tools they should be added to.
41954215 */
41964216 attachments?: Array<{
···42104230 } & AssistantToolsFileSearchTypeOnly)
42114231 >;
42124232 }>;
42134213- content:
42144214- | string
42154215- | Array<
42164216- | ({
42174217- type?: 'MessageContentImageFileObject';
42184218- } & MessageContentImageFileObject)
42194219- | ({
42204220- type?: 'MessageContentImageUrlObject';
42214221- } & MessageContentImageUrlObject)
42224222- | ({
42234223- type?: 'MessageRequestContentTextObject';
42244224- } & MessageRequestContentTextObject)
42254225- >;
42264233 metadata?: Metadata;
42274227- /**
42284228- * The role of the entity that is creating the message. Allowed values include:
42294229- * - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.
42304230- * - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation.
42314231- *
42324232- */
42334233- role: 'user' | 'assistant';
42344234};
4235423542364236export type CreateModelResponseProperties = ModelResponseProperties & {
···42904290 */
42914291 results: Array<{
42924292 /**
42934293+ * Whether any of the below categories are flagged.
42944294+ */
42954295+ flagged: boolean;
42964296+ /**
42934297 * A list of the categories, and whether they are flagged or not.
42944298 */
42954299 categories: {
42964300 /**
43014301+ * 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.
43024302+ */
43034303+ hate: boolean;
43044304+ /**
43054305+ * 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.
43064306+ */
43074307+ 'hate/threatening': boolean;
43084308+ /**
42974309 * Content that expresses, incites, or promotes harassing language towards any target.
42984310 */
42994311 harassment: boolean;
···43024314 */
43034315 'harassment/threatening': boolean;
43044316 /**
43054305- * 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.
43064306- */
43074307- hate: boolean;
43084308- /**
43094309- * 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.
43104310- */
43114311- 'hate/threatening': boolean;
43124312- /**
43134317 * 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.
43144318 */
43154319 illicit: boolean;
···43224326 */
43234327 'self-harm': boolean;
43244328 /**
43254325- * 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.
43264326- */
43274327- 'self-harm/instructions': boolean;
43284328- /**
43294329 * 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.
43304330 */
43314331 'self-harm/intent': boolean;
43324332+ /**
43334333+ * 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.
43344334+ */
43354335+ 'self-harm/instructions': boolean;
43324336 /**
43334337 * Content meant to arouse sexual excitement, such as the description of sexual activity, or that promotes sexual services (excluding sex education and wellness).
43344338 */
···43474351 'violence/graphic': boolean;
43484352 };
43494353 /**
43504350- * A list of the categories along with the input type(s) that the score applies to.
43544354+ * A list of the categories along with their scores as predicted by model.
43514355 */
43524352- category_applied_input_types: {
43564356+ category_scores: {
43534357 /**
43544354- * The applied input type(s) for the category 'harassment'.
43584358+ * The score for the category 'hate'.
43554359 */
43564356- harassment: Array<'text'>;
43604360+ hate: number;
43574361 /**
43584358- * The applied input type(s) for the category 'harassment/threatening'.
43624362+ * The score for the category 'hate/threatening'.
43594363 */
43604360- 'harassment/threatening': Array<'text'>;
43644364+ 'hate/threatening': number;
43614365 /**
43624362- * The applied input type(s) for the category 'hate'.
43664366+ * The score for the category 'harassment'.
43634367 */
43644364- hate: Array<'text'>;
43684368+ harassment: number;
43654369 /**
43664366- * The applied input type(s) for the category 'hate/threatening'.
43704370+ * The score for the category 'harassment/threatening'.
43674371 */
43684368- 'hate/threatening': Array<'text'>;
43724372+ 'harassment/threatening': number;
43694373 /**
43704370- * The applied input type(s) for the category 'illicit'.
43744374+ * The score for the category 'illicit'.
43714375 */
43724372- illicit: Array<'text'>;
43764376+ illicit: number;
43734377 /**
43744374- * The applied input type(s) for the category 'illicit/violent'.
43784378+ * The score for the category 'illicit/violent'.
43754379 */
43764376- 'illicit/violent': Array<'text'>;
43804380+ 'illicit/violent': number;
43774381 /**
43784378- * The applied input type(s) for the category 'self-harm'.
43824382+ * The score for the category 'self-harm'.
43794383 */
43804380- 'self-harm': Array<'text' | 'image'>;
43844384+ 'self-harm': number;
43814385 /**
43824382- * The applied input type(s) for the category 'self-harm/instructions'.
43864386+ * The score for the category 'self-harm/intent'.
43834387 */
43844384- 'self-harm/instructions': Array<'text' | 'image'>;
43884388+ 'self-harm/intent': number;
43854389 /**
43864386- * The applied input type(s) for the category 'self-harm/intent'.
43904390+ * The score for the category 'self-harm/instructions'.
43874391 */
43884388- 'self-harm/intent': Array<'text' | 'image'>;
43924392+ 'self-harm/instructions': number;
43894393 /**
43904390- * The applied input type(s) for the category 'sexual'.
43944394+ * The score for the category 'sexual'.
43914395 */
43924392- sexual: Array<'text' | 'image'>;
43964396+ sexual: number;
43934397 /**
43944394- * The applied input type(s) for the category 'sexual/minors'.
43984398+ * The score for the category 'sexual/minors'.
43954399 */
43964396- 'sexual/minors': Array<'text'>;
44004400+ 'sexual/minors': number;
43974401 /**
43984398- * The applied input type(s) for the category 'violence'.
44024402+ * The score for the category 'violence'.
43994403 */
44004400- violence: Array<'text' | 'image'>;
44044404+ violence: number;
44014405 /**
44024402- * The applied input type(s) for the category 'violence/graphic'.
44064406+ * The score for the category 'violence/graphic'.
44034407 */
44044404- 'violence/graphic': Array<'text' | 'image'>;
44084408+ 'violence/graphic': number;
44054409 };
44064410 /**
44074407- * A list of the categories along with their scores as predicted by model.
44114411+ * A list of the categories along with the input type(s) that the score applies to.
44084412 */
44094409- category_scores: {
44134413+ category_applied_input_types: {
44104414 /**
44114411- * The score for the category 'harassment'.
44154415+ * The applied input type(s) for the category 'hate'.
44124416 */
44134413- harassment: number;
44174417+ hate: Array<'text'>;
44144418 /**
44154415- * The score for the category 'harassment/threatening'.
44194419+ * The applied input type(s) for the category 'hate/threatening'.
44164420 */
44174417- 'harassment/threatening': number;
44214421+ 'hate/threatening': Array<'text'>;
44184422 /**
44194419- * The score for the category 'hate'.
44234423+ * The applied input type(s) for the category 'harassment'.
44204424 */
44214421- hate: number;
44254425+ harassment: Array<'text'>;
44224426 /**
44234423- * The score for the category 'hate/threatening'.
44274427+ * The applied input type(s) for the category 'harassment/threatening'.
44244428 */
44254425- 'hate/threatening': number;
44294429+ 'harassment/threatening': Array<'text'>;
44264430 /**
44274427- * The score for the category 'illicit'.
44314431+ * The applied input type(s) for the category 'illicit'.
44284432 */
44294429- illicit: number;
44334433+ illicit: Array<'text'>;
44304434 /**
44314431- * The score for the category 'illicit/violent'.
44354435+ * The applied input type(s) for the category 'illicit/violent'.
44324436 */
44334433- 'illicit/violent': number;
44374437+ 'illicit/violent': Array<'text'>;
44344438 /**
44354435- * The score for the category 'self-harm'.
44394439+ * The applied input type(s) for the category 'self-harm'.
44364440 */
44374437- 'self-harm': number;
44414441+ 'self-harm': Array<'text' | 'image'>;
44384442 /**
44394439- * The score for the category 'self-harm/instructions'.
44434443+ * The applied input type(s) for the category 'self-harm/intent'.
44404444 */
44414441- 'self-harm/instructions': number;
44454445+ 'self-harm/intent': Array<'text' | 'image'>;
44424446 /**
44434443- * The score for the category 'self-harm/intent'.
44474447+ * The applied input type(s) for the category 'self-harm/instructions'.
44444448 */
44454445- 'self-harm/intent': number;
44494449+ 'self-harm/instructions': Array<'text' | 'image'>;
44464450 /**
44474447- * The score for the category 'sexual'.
44514451+ * The applied input type(s) for the category 'sexual'.
44484452 */
44494449- sexual: number;
44534453+ sexual: Array<'text' | 'image'>;
44504454 /**
44514451- * The score for the category 'sexual/minors'.
44554455+ * The applied input type(s) for the category 'sexual/minors'.
44524456 */
44534453- 'sexual/minors': number;
44574457+ 'sexual/minors': Array<'text'>;
44544458 /**
44554455- * The score for the category 'violence'.
44594459+ * The applied input type(s) for the category 'violence'.
44564460 */
44574457- violence: number;
44614461+ violence: Array<'text' | 'image'>;
44584462 /**
44594459- * The score for the category 'violence/graphic'.
44634463+ * The applied input type(s) for the category 'violence/graphic'.
44604464 */
44614461- 'violence/graphic': number;
44654465+ 'violence/graphic': Array<'text' | 'image'>;
44624466 };
44634463- /**
44644464- * Whether any of the below categories are flagged.
44654465- */
44664466- flagged: boolean;
44674467 }>;
44684468};
4469446944704470export type CreateResponse = CreateModelResponseProperties &
44714471 ResponseProperties & {
44724472+ /**
44734473+ * Text, image, or file inputs to the model, used to generate a response.
44744474+ *
44754475+ * Learn more:
44764476+ * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
44774477+ * - [Image inputs](https://platform.openai.com/docs/guides/images)
44784478+ * - [File inputs](https://platform.openai.com/docs/guides/pdf-files)
44794479+ * - [Conversation state](https://platform.openai.com/docs/guides/conversation-state)
44804480+ * - [Function calling](https://platform.openai.com/docs/guides/function-calling)
44814481+ *
44824482+ */
44834483+ input?: string | Array<InputItem>;
44724484 /**
44734485 * Specify additional output data to include in the model response. Currently
44744486 * supported values are:
···44884500 */
44894501 include?: Array<Includable>;
44904502 /**
44914491- * Text, image, or file inputs to the model, used to generate a response.
45034503+ * Whether to allow the model to run tool calls in parallel.
44924504 *
44934493- * Learn more:
44944494- * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
44954495- * - [Image inputs](https://platform.openai.com/docs/guides/images)
44964496- * - [File inputs](https://platform.openai.com/docs/guides/pdf-files)
44974497- * - [Conversation state](https://platform.openai.com/docs/guides/conversation-state)
44984498- * - [Function calling](https://platform.openai.com/docs/guides/function-calling)
45054505+ */
45064506+ parallel_tool_calls?: boolean;
45074507+ /**
45084508+ * Whether to store the generated model response for later retrieval via
45094509+ * API.
44994510 *
45004511 */
45014501- input?: string | Array<InputItem>;
45124512+ store?: boolean;
45024513 /**
45034514 * A system (or developer) message inserted into the model's context.
45044515 *
···45094520 */
45104521 instructions?: string;
45114522 /**
45124512- * Whether to allow the model to run tool calls in parallel.
45134513- *
45144514- */
45154515- parallel_tool_calls?: boolean;
45164516- /**
45174517- * Whether to store the generated model response for later retrieval via
45184518- * API.
45194519- *
45204520- */
45214521- store?: boolean;
45224522- /**
45234523 * If set to true, the model response data will be streamed to the client
45244524 * as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
45254525 * See the [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming)
···4532453245334533export type CreateRunRequest = {
45344534 /**
45354535+ * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run.
45364536+ */
45374537+ assistant_id: string;
45384538+ /**
45394539+ * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used.
45404540+ */
45414541+ model?: string | AssistantSupportedModels;
45424542+ reasoning_effort?: ReasoningEffort;
45434543+ /**
45444544+ * Overrides the [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis.
45454545+ */
45464546+ instructions?: string;
45474547+ /**
45354548 * Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions.
45364549 */
45374550 additional_instructions?: string;
···45404553 */
45414554 additional_messages?: Array<CreateMessageRequest>;
45424555 /**
45434543- * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run.
45444544- */
45454545- assistant_id: string;
45464546- /**
45474547- * Overrides the [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis.
45564556+ * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
45484557 */
45494549- instructions?: string;
45584558+ tools?: Array<AssistantTool>;
45594559+ metadata?: Metadata;
45504560 /**
45514551- * The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.
45614561+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
45524562 *
45534563 */
45544554- max_completion_tokens?: number;
45644564+ temperature?: number;
45554565 /**
45564556- * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.
45664566+ * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
45674567+ *
45684568+ * We generally recommend altering this or temperature but not both.
45574569 *
45584570 */
45594559- max_prompt_tokens?: number;
45604560- metadata?: Metadata;
45614561- /**
45624562- * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used.
45634563- */
45644564- model?: string | AssistantSupportedModels;
45654565- parallel_tool_calls?: ParallelToolCalls;
45664566- reasoning_effort?: ReasoningEffort;
45674567- response_format?: AssistantsApiResponseFormatOption;
45714571+ top_p?: number;
45684572 /**
45694573 * If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message.
45704574 *
45714575 */
45724576 stream?: boolean;
45734577 /**
45744574- * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
45784578+ * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.
45754579 *
45764580 */
45774577- temperature?: number;
45784578- tool_choice?: AssistantsApiToolChoiceOption & unknown;
45794579- /**
45804580- * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
45814581- */
45824582- tools?: Array<AssistantTool>;
45814581+ max_prompt_tokens?: number;
45834582 /**
45844584- * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
45854585- *
45864586- * We generally recommend altering this or temperature but not both.
45834583+ * The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.
45874584 *
45884585 */
45894589- top_p?: number;
45864586+ max_completion_tokens?: number;
45904587 truncation_strategy?: TruncationObject & unknown;
45884588+ tool_choice?: AssistantsApiToolChoiceOption & unknown;
45894589+ parallel_tool_calls?: ParallelToolCalls;
45904590+ response_format?: AssistantsApiResponseFormatOption;
45914591};
4592459245934593export type CreateSpeechRequest = {
45944594 /**
45954595+ * One of the available [TTS models](https://platform.openai.com/docs/models#tts): `tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`.
45964596+ *
45974597+ */
45984598+ model: string | 'tts-1' | 'tts-1-hd' | 'gpt-4o-mini-tts';
45994599+ /**
45954600 * The text to generate audio for. The maximum length is 4096 characters.
45964601 */
45974602 input: string;
···46004605 */
46014606 instructions?: string;
46024607 /**
46034603- * One of the available [TTS models](https://platform.openai.com/docs/models#tts): `tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`.
46044604- *
46084608+ * The voice to use when generating the audio. Supported voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and `verse`. Previews of the voices are available in the [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
46054609 */
46064606- model: string | 'tts-1' | 'tts-1-hd' | 'gpt-4o-mini-tts';
46104610+ voice: VoiceIdsShared;
46074611 /**
46084612 * The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`.
46094613 */
···46164620 * The format to stream the audio in. Supported formats are `sse` and `audio`. `sse` is not supported for `tts-1` or `tts-1-hd`.
46174621 */
46184622 stream_format?: 'sse' | 'audio';
46194619- /**
46204620- * The voice to use when generating the audio. Supported voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and `verse`. Previews of the voices are available in the [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
46214621- */
46224622- voice: VoiceIdsShared;
46234623};
4624462446254625export type CreateSpeechResponseStreamEvent =
···46354635 * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run.
46364636 */
46374637 assistant_id: string;
46384638- /**
46394639- * Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis.
46404640- */
46414641- instructions?: string;
46424642- /**
46434643- * The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.
46444644- *
46454645- */
46464646- max_completion_tokens?: number;
46474647- /**
46484648- * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.
46494649- *
46504650- */
46514651- max_prompt_tokens?: number;
46524652- metadata?: Metadata;
46384638+ thread?: CreateThreadRequest;
46534639 /**
46544640 * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used.
46554641 */
···46934679 | 'gpt-3.5-turbo-1106'
46944680 | 'gpt-3.5-turbo-0125'
46954681 | 'gpt-3.5-turbo-16k-0613';
46964696- parallel_tool_calls?: ParallelToolCalls;
46974697- response_format?: AssistantsApiResponseFormatOption;
46984682 /**
46994699- * If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message.
47004700- *
46834683+ * Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis.
47014684 */
47024702- stream?: boolean;
46854685+ instructions?: string;
47034686 /**
47044704- * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
47054705- *
46874687+ * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
47064688 */
47074707- temperature?: number;
47084708- thread?: CreateThreadRequest;
47094709- tool_choice?: AssistantsApiToolChoiceOption & unknown;
46894689+ tools?: Array<AssistantTool>;
47104690 /**
47114691 * A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.
47124692 *
···47274707 vector_store_ids?: Array<string>;
47284708 };
47294709 };
47104710+ metadata?: Metadata;
47304711 /**
47314731- * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
47124712+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
47134713+ *
47324714 */
47334733- tools?: Array<AssistantTool>;
47154715+ temperature?: number;
47344716 /**
47354717 * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
47364718 *
···47384720 *
47394721 */
47404722 top_p?: number;
47234723+ /**
47244724+ * If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message.
47254725+ *
47264726+ */
47274727+ stream?: boolean;
47284728+ /**
47294729+ * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.
47304730+ *
47314731+ */
47324732+ max_prompt_tokens?: number;
47334733+ /**
47344734+ * The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.
47354735+ *
47364736+ */
47374737+ max_completion_tokens?: number;
47414738 truncation_strategy?: TruncationObject & unknown;
47394739+ tool_choice?: AssistantsApiToolChoiceOption & unknown;
47404740+ parallel_tool_calls?: ParallelToolCalls;
47414741+ response_format?: AssistantsApiResponseFormatOption;
47424742};
4743474347444744/**
···47514751 * A list of [messages](https://platform.openai.com/docs/api-reference/messages) to start the thread with.
47524752 */
47534753 messages?: Array<CreateMessageRequest>;
47544754- metadata?: Metadata;
47554754 /**
47564755 * A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.
47574756 *
···47764775 */
47774776 vector_stores?: Array<{
47784777 /**
47784778+ * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to add to the vector store. There can be a maximum of 10000 files in a vector store.
47794779+ *
47804780+ */
47814781+ file_ids?: Array<string>;
47824782+ /**
47794783 * The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy.
47804784 */
47814785 chunking_strategy?:
···47864790 type: 'auto';
47874791 }
47884792 | {
47934793+ /**
47944794+ * Always `static`.
47954795+ */
47964796+ type: 'static';
47894797 static: {
47904798 /**
47994799+ * The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`.
48004800+ */
48014801+ max_chunk_size_tokens: number;
48024802+ /**
47914803 * The number of tokens that overlap between chunks. The default value is `400`.
47924804 *
47934805 * Note that the overlap must not exceed half of `max_chunk_size_tokens`.
47944806 *
47954807 */
47964808 chunk_overlap_tokens: number;
47974797- /**
47984798- * The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`.
47994799- */
48004800- max_chunk_size_tokens: number;
48014809 };
48024802- /**
48034803- * Always `static`.
48044804- */
48054805- type: 'static';
48064810 };
48074807- /**
48084808- * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to add to the vector store. There can be a maximum of 10000 files in a vector store.
48094809- *
48104810- */
48114811- file_ids?: Array<string>;
48124811 metadata?: Metadata;
48134812 }>;
48144813 };
48154814 };
48154815+ metadata?: Metadata;
48164816};
4817481748184818export type CreateTranscriptionRequest = {
48194819- chunking_strategy?: TranscriptionChunkingStrategy;
48204819 /**
48214820 * The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
48224821 *
48234822 */
48244823 file: Blob | File;
48254824 /**
48264826- * Additional information to include in the transcription response.
48274827- * `logprobs` will return the log probabilities of the tokens in the
48284828- * response to understand the model's confidence in the transcription.
48294829- * `logprobs` only works with response_format set to `json` and only with
48304830- * the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`.
48254825+ * ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1` (which is powered by our open source Whisper V2 model).
48314826 *
48324827 */
48334833- include?: Array<TranscriptionInclude>;
48284828+ model: string | 'whisper-1' | 'gpt-4o-transcribe' | 'gpt-4o-mini-transcribe';
48344829 /**
48354830 * The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format will improve accuracy and latency.
48364831 *
48374832 */
48384833 language?: string;
48394834 /**
48404840- * ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1` (which is powered by our open source Whisper V2 model).
48414841- *
48424842- */
48434843- model: string | 'whisper-1' | 'gpt-4o-transcribe' | 'gpt-4o-mini-transcribe';
48444844- /**
48454835 * An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) should match the audio language.
48464836 *
48474837 */
48484838 prompt?: string;
48494839 response_format?: AudioResponseFormat;
48504840 /**
48414841+ * The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
48424842+ *
48434843+ */
48444844+ temperature?: number;
48454845+ /**
48514846 * If set to true, the model response data will be streamed to the client
48524847 * as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
48534848 * See the [Streaming section of the Speech-to-Text guide](https://platform.openai.com/docs/guides/speech-to-text?lang=curl#streaming-transcriptions)
···48574852 *
48584853 */
48594854 stream?: boolean;
48554855+ chunking_strategy?: TranscriptionChunkingStrategy;
48604856 /**
48614861- * The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
48574857+ * The timestamp granularities to populate for this transcription. `response_format` must be set `verbose_json` to use timestamp granularities. Either or both of these options are supported: `word`, or `segment`. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.
48624858 *
48634859 */
48644864- temperature?: number;
48604860+ timestamp_granularities?: Array<'word' | 'segment'>;
48654861 /**
48664866- * The timestamp granularities to populate for this transcription. `response_format` must be set `verbose_json` to use timestamp granularities. Either or both of these options are supported: `word`, or `segment`. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.
48624862+ * Additional information to include in the transcription response.
48634863+ * `logprobs` will return the log probabilities of the tokens in the
48644864+ * response to understand the model's confidence in the transcription.
48654865+ * `logprobs` only works with response_format set to `json` and only with
48664866+ * the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`.
48674867 *
48684868 */
48694869- timestamp_granularities?: Array<'word' | 'segment'>;
48694869+ include?: Array<TranscriptionInclude>;
48704870};
4871487148724872/**
···48744874 */
48754875export type CreateTranscriptionResponseJson = {
48764876 /**
48774877+ * The transcribed text.
48784878+ */
48794879+ text: string;
48804880+ /**
48774881 * The log probabilities of the tokens in the transcription. Only returned with the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` if `logprobs` is added to the `include` array.
48784882 *
48794883 */
48804884 logprobs?: Array<{
48814885 /**
48824882- * The bytes of the token.
48864886+ * The token in the transcription.
48834887 */
48844884- bytes?: Array<number>;
48884888+ token?: string;
48854889 /**
48864890 * The log probability of the token.
48874891 */
48884892 logprob?: number;
48894893 /**
48904890- * The token in the transcription.
48944894+ * The bytes of the token.
48914895 */
48924892- token?: string;
48964896+ bytes?: Array<number>;
48934897 }>;
48944898 /**
48954895- * The transcribed text.
48964896- */
48974897- text: string;
48984898- /**
48994899 * Token usage statistics for the request.
49004900 */
49014901 usage?:
···49204920 */
49214921export type CreateTranscriptionResponseVerboseJson = {
49224922 /**
49234923- * The duration of the input audio.
49244924- */
49254925- duration: number;
49264926- /**
49274923 * The language of the input audio.
49284924 */
49294925 language: string;
49304926 /**
49314931- * Segments of the transcribed text and their corresponding details.
49274927+ * The duration of the input audio.
49324928 */
49334933- segments?: Array<TranscriptionSegment>;
49294929+ duration: number;
49344930 /**
49354931 * The transcribed text.
49364932 */
49374933 text: string;
49384938- usage?: TranscriptTextUsageDuration;
49394934 /**
49404935 * Extracted words and their corresponding timestamps.
49414936 */
49424937 words?: Array<TranscriptionWord>;
49384938+ /**
49394939+ * Segments of the transcribed text and their corresponding details.
49404940+ */
49414941+ segments?: Array<TranscriptionSegment>;
49424942+ usage?: TranscriptTextUsageDuration;
49434943};
4944494449454945export type CreateTranslationRequest = {
···4976497649774977export type CreateTranslationResponseVerboseJson = {
49784978 /**
49794979- * The duration of the input audio.
49804980- */
49814981- duration: number;
49824982- /**
49834979 * The language of the output translation (always `english`).
49844980 */
49854981 language: string;
49864982 /**
49874987- * Segments of the translated text and their corresponding details.
49834983+ * The duration of the input audio.
49884984 */
49894989- segments?: Array<TranscriptionSegment>;
49854985+ duration: number;
49904986 /**
49914987 * The translated text.
49924988 */
49934989 text: string;
49904990+ /**
49914991+ * Segments of the translated text and their corresponding details.
49924992+ */
49934993+ segments?: Array<TranscriptionSegment>;
49944994};
4995499549964996export type CreateUploadRequest = {
49974997 /**
49984998- * The number of bytes in the file you are uploading.
49984998+ * The name of the file to upload.
49994999+ *
50005000+ */
50015001+ filename: string;
50025002+ /**
50035003+ * The intended purpose of the uploaded file.
50045004+ *
50055005+ * See the [documentation on File purposes](https://platform.openai.com/docs/api-reference/files/create#files-create-purpose).
49995006 *
50005007 */
50015001- bytes: number;
50025002- expires_after?: FileExpirationAfter;
50085008+ purpose: 'assistants' | 'batch' | 'fine-tune' | 'vision';
50035009 /**
50045004- * The name of the file to upload.
50105010+ * The number of bytes in the file you are uploading.
50055011 *
50065012 */
50075007- filename: string;
50135013+ bytes: number;
50085014 /**
50095015 * The MIME type of the file.
50105016 *
···50125018 *
50135019 */
50145020 mime_type: string;
50155015- /**
50165016- * The intended purpose of the uploaded file.
50175017- *
50185018- * See the [documentation on File purposes](https://platform.openai.com/docs/api-reference/files/create#files-create-purpose).
50195019- *
50205020- */
50215021- purpose: 'assistants' | 'batch' | 'fine-tune' | 'vision';
50215021+ expires_after?: FileExpirationAfter;
50225022};
5023502350245024export type CreateVectorStoreFileBatchRequest = {
50255025- attributes?: VectorStoreFileAttributes;
50265026- chunking_strategy?: ChunkingStrategyRequestParam;
50275025 /**
50285026 * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files.
50295027 */
50305028 file_ids: Array<string>;
50295029+ chunking_strategy?: ChunkingStrategyRequestParam;
50305030+ attributes?: VectorStoreFileAttributes;
50315031};
5032503250335033export type CreateVectorStoreFileRequest = {
50345034- attributes?: VectorStoreFileAttributes;
50355035- chunking_strategy?: ChunkingStrategyRequestParam;
50365034 /**
50375035 * A [File](https://platform.openai.com/docs/api-reference/files) ID that the vector store should use. Useful for tools like `file_search` that can access files.
50385036 */
50395037 file_id: string;
50385038+ chunking_strategy?: ChunkingStrategyRequestParam;
50395039+ attributes?: VectorStoreFileAttributes;
50405040};
5041504150425042export type CreateVectorStoreRequest = {
50435043- chunking_strategy?: ChunkingStrategyRequestParam;
50445044- expires_after?: VectorStoreExpirationAfter;
50455043 /**
50465044 * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files.
50475045 */
50485046 file_ids?: Array<string>;
50495049- metadata?: Metadata;
50505047 /**
50515048 * The name of the vector store.
50525049 */
50535050 name?: string;
50515051+ expires_after?: VectorStoreExpirationAfter;
50525052+ chunking_strategy?: ChunkingStrategyRequestParam;
50535053+ metadata?: Metadata;
50545054};
5055505550565056/**
···50625062 */
50635063export type CustomTool = {
50645064 /**
50655065+ * The type of the custom tool. Always `custom`.
50665066+ */
50675067+ type: 'custom';
50685068+ /**
50695069+ * The name of the custom tool, used to identify it in tool calls.
50705070+ */
50715071+ name: string;
50725072+ /**
50655073 * Optional description of the custom tool, used to provide more context.
50665074 *
50675075 */
···50795087 }
50805088 | {
50815089 /**
50905090+ * Grammar format. Always `grammar`.
50915091+ */
50925092+ type: 'grammar';
50935093+ /**
50825094 * The grammar definition.
50835095 */
50845096 definition: string;
···50865098 * The syntax of the grammar definition. One of `lark` or `regex`.
50875099 */
50885100 syntax: 'lark' | 'regex';
50895089- /**
50905090- * Grammar format. Always `grammar`.
50915091- */
50925092- type: 'grammar';
50935101 };
50945094- /**
50955095- * The name of the custom tool, used to identify it in tool calls.
50965096- */
50975097- name: string;
50985098- /**
50995099- * The type of the custom tool. Always `custom`.
51005100- */
51015101- type: 'custom';
51025102};
5103510351045104/**
···51095109 */
51105110export type CustomToolCall = {
51115111 /**
51125112- * An identifier used to map this custom tool call to a tool call output.
51125112+ * The type of the custom tool call. Always `custom_tool_call`.
51135113 *
51145114 */
51155115- call_id: string;
51155115+ type: 'custom_tool_call';
51165116 /**
51175117 * The unique ID of the custom tool call in the OpenAI platform.
51185118 *
51195119 */
51205120 id?: string;
51215121 /**
51225122- * The input for the custom tool call generated by the model.
51225122+ * An identifier used to map this custom tool call to a tool call output.
51235123 *
51245124 */
51255125- input: string;
51255125+ call_id: string;
51265126 /**
51275127 * The name of the custom tool being called.
51285128 *
51295129 */
51305130 name: string;
51315131 /**
51325132- * The type of the custom tool call. Always `custom_tool_call`.
51325132+ * The input for the custom tool call generated by the model.
51335133 *
51345134 */
51355135- type: 'custom_tool_call';
51355135+ input: string;
51365136};
5137513751385138/**
···51435143 */
51445144export type CustomToolCallOutput = {
51455145 /**
51465146- * The call ID, used to map this custom tool call output to a custom tool call.
51465146+ * The type of the custom tool call output. Always `custom_tool_call_output`.
51475147 *
51485148 */
51495149- call_id: string;
51495149+ type: 'custom_tool_call_output';
51505150 /**
51515151 * The unique ID of the custom tool call output in the OpenAI platform.
51525152 *
51535153 */
51545154 id?: string;
51555155 /**
51565156- * The output from the custom tool call generated by your code.
51565156+ * The call ID, used to map this custom tool call output to a custom tool call.
51575157 *
51585158 */
51595159- output: string;
51595159+ call_id: string;
51605160 /**
51615161- * The type of the custom tool call output. Always `custom_tool_call_output`.
51615161+ * The output from the custom tool call generated by your code.
51625162 *
51635163 */
51645164- type: 'custom_tool_call_output';
51645164+ output: string;
51655165};
5166516651675167/**
···51725172 */
51735173export type CustomToolChatCompletions = {
51745174 /**
51755175+ * The type of the custom tool. Always `custom`.
51765176+ */
51775177+ type: 'custom';
51785178+ /**
51755179 * Custom tool properties
51765180 *
51775181 * Properties of the custom tool.
51785182 *
51795183 */
51805184 custom: {
51855185+ /**
51865186+ * The name of the custom tool, used to identify it in tool calls.
51875187+ */
51885188+ name: string;
51815189 /**
51825190 * Optional description of the custom tool, used to provide more context.
51835191 *
···51965204 }
51975205 | {
51985206 /**
52075207+ * Grammar format. Always `grammar`.
52085208+ */
52095209+ type: 'grammar';
52105210+ /**
51995211 * Grammar format
52005212 *
52015213 * Your chosen grammar.
···52105222 */
52115223 syntax: 'lark' | 'regex';
52125224 };
52135213- /**
52145214- * Grammar format. Always `grammar`.
52155215- */
52165216- type: 'grammar';
52175225 };
52185218- /**
52195219- * The name of the custom tool, used to identify it in tool calls.
52205220- */
52215221- name: string;
52225226 };
52235223- /**
52245224- * The type of the custom tool. Always `custom`.
52255225- */
52265226- type: 'custom';
52275227};
5228522852295229export type DeleteAssistantResponse = {
52305230- deleted: boolean;
52315230 id: string;
52315231+ deleted: boolean;
52325232 object: 'assistant.deleted';
52335233};
5234523452355235export type DeleteCertificateResponse = {
52365236 /**
52375237+ * The object type, must be `certificate.deleted`.
52385238+ */
52395239+ object: 'certificate.deleted';
52405240+ /**
52375241 * The ID of the certificate that was deleted.
52385242 */
52395243 id: string;
52405240- /**
52415241- * The object type, must be `certificate.deleted`.
52425242- */
52435243- object: 'certificate.deleted';
52445244};
5245524552465246export type DeleteFileResponse = {
52475247- deleted: boolean;
52485247 id: string;
52495248 object: 'file';
52495249+ deleted: boolean;
52505250};
5251525152525252export type DeleteFineTuningCheckpointPermissionResponse = {
52535253 /**
52545254- * Whether the fine-tuned model checkpoint permission was successfully deleted.
52555255- */
52565256- deleted: boolean;
52575257- /**
52585254 * The ID of the fine-tuned model checkpoint permission that was deleted.
52595255 */
52605256 id: string;
···52625258 * The object type, which is always "checkpoint.permission".
52635259 */
52645260 object: 'checkpoint.permission';
52615261+ /**
52625262+ * Whether the fine-tuned model checkpoint permission was successfully deleted.
52635263+ */
52645264+ deleted: boolean;
52655265};
5266526652675267export type DeleteMessageResponse = {
52685268+ id: string;
52685269 deleted: boolean;
52695269- id: string;
52705270 object: 'thread.message.deleted';
52715271};
5272527252735273export type DeleteModelResponse = {
52745274- deleted: boolean;
52755274 id: string;
52755275+ deleted: boolean;
52765276 object: string;
52775277};
5278527852795279export type DeleteThreadResponse = {
52805280- deleted: boolean;
52815280 id: string;
52815281+ deleted: boolean;
52825282 object: 'thread.deleted';
52835283};
5284528452855285export type DeleteVectorStoreFileResponse = {
52865286- deleted: boolean;
52875286 id: string;
52875287+ deleted: boolean;
52885288 object: 'vector_store.file.deleted';
52895289};
5290529052915291export type DeleteVectorStoreResponse = {
52925292- deleted: boolean;
52935292 id: string;
52935293+ deleted: boolean;
52945294 object: 'vector_store.deleted';
52955295};
52965296···52985298 * Occurs when a stream ends.
52995299 */
53005300export type DoneEvent = {
53015301- data: '[DONE]';
53025301 event: 'done';
53025302+ data: '[DONE]';
53035303};
5304530453055305/**
···53345334 *
53355335 */
53365336export type Drag = {
53375337+ /**
53385338+ * Specifies the event type. For a drag action, this property is
53395339+ * always set to `drag`.
53405340+ *
53415341+ */
53425342+ type: 'drag';
53375343 /**
53385344 * An array of coordinates representing the path of the drag action. Coordinates will appear as an array
53395345 * of objects, eg
···53465352 *
53475353 */
53485354 path: Array<Coordinate>;
53495349- /**
53505350- * Specifies the event type. For a drag action, this property is
53515351- * always set to `drag`.
53525352- *
53535353- */
53545354- type: 'drag';
53555355};
5356535653575357/**
···53665366 */
53675367export type EasyInputMessage = {
53685368 /**
53695369- * Text, image, or audio input to the model, used to generate a response.
53705370- * Can also contain previous assistant responses.
53715371- *
53725372- */
53735373- content: string | InputMessageContentList;
53745374- /**
53755369 * The role of the message input. One of `user`, `assistant`, `system`, or
53765370 * `developer`.
53775371 *
53785372 */
53795373 role: 'user' | 'assistant' | 'system' | 'developer';
53805374 /**
53755375+ * Text, image, or audio input to the model, used to generate a response.
53765376+ * Can also contain previous assistant responses.
53775377+ *
53785378+ */
53795379+ content: string | InputMessageContentList;
53805380+ /**
53815381 * The type of the message input. Always `message`.
53825382 *
53835383 */
···53905390 */
53915391export type Embedding = {
53925392 /**
53935393+ * The index of the embedding in the list of embeddings.
53945394+ */
53955395+ index: number;
53965396+ /**
53935397 * The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the [embedding guide](https://platform.openai.com/docs/guides/embeddings).
53945398 *
53955399 */
53965400 embedding: Array<number>;
53975397- /**
53985398- * The index of the embedding in the list of embeddings.
53995399- */
54005400- index: number;
54015401 /**
54025402 * The object type, which is always "embedding".
54035403 */
···54155415 * Occurs when an [error](https://platform.openai.com/docs/guides/error-codes#api-errors) occurs. This can happen due to an internal server error or a timeout.
54165416 */
54175417export type ErrorEvent = {
54185418- data: _Error;
54195418 event: 'error';
54195419+ data: _Error;
54205420};
5421542154225422export type ErrorResponse = {
···54365436 */
54375437export type Eval = {
54385438 /**
54395439- * The Unix timestamp (in seconds) for when the eval was created.
54395439+ * The object type.
54405440+ */
54415441+ object: 'eval';
54425442+ /**
54435443+ * Unique identifier for the evaluation.
54445444+ */
54455445+ id: string;
54465446+ /**
54475447+ * The name of the evaluation.
54405448 */
54415441- created_at: number;
54495449+ name: string;
54425450 /**
54435451 * Configuration of data sources used in runs of the evaluation.
54445452 */
···54535461 type?: 'EvalStoredCompletionsDataSourceConfig';
54545462 } & EvalStoredCompletionsDataSourceConfig);
54555463 /**
54565456- * Unique identifier for the evaluation.
54575457- */
54585458- id: string;
54595459- metadata: Metadata;
54605460- /**
54615461- * The name of the evaluation.
54625462- */
54635463- name: string;
54645464- /**
54655465- * The object type.
54665466- */
54675467- object: 'eval';
54685468- /**
54695464 * A list of testing criteria.
54705465 */
54715466 testing_criteria: Array<
···54755470 | EvalGraderPython
54765471 | EvalGraderScoreModel
54775472 >;
54735473+ /**
54745474+ * The Unix timestamp (in seconds) for when the eval was created.
54755475+ */
54765476+ created_at: number;
54775477+ metadata: Metadata;
54785478};
5479547954805480/**
···55045504 *
55055505 */
55065506export type EvalCustomDataSourceConfig = {
55075507+ /**
55085508+ * The type of data source. Always `custom`.
55095509+ */
55105510+ type: 'custom';
55075511 /**
55085512 * The json schema for the run data source items.
55095513 * Learn how to build JSON schemas [here](https://json-schema.org/).
···55125516 schema: {
55135517 [key: string]: unknown;
55145518 };
55155515- /**
55165516- * The type of data source. Always `custom`.
55175517- */
55185518- type: 'custom';
55195519};
5520552055215521/**
···55695569 *
55705570 */
55715571export type EvalItem = {
55725572+ /**
55735573+ * The role of the message input. One of `user`, `assistant`, `system`, or
55745574+ * `developer`.
55755575+ *
55765576+ */
55775577+ role: 'user' | 'assistant' | 'system' | 'developer';
55725578 /**
55735579 * Inputs to the model - can contain template strings.
55745580 *
···55785584 | InputTextContent
55795585 | {
55805586 /**
55815581- * The text output from the model.
55875587+ * The type of the output text. Always `output_text`.
55825588 *
55835589 */
55845584- text: string;
55905590+ type: 'output_text';
55855591 /**
55865586- * The type of the output text. Always `output_text`.
55925592+ * The text output from the model.
55875593 *
55885594 */
55895589- type: 'output_text';
55955595+ text: string;
55905596 }
55915597 | {
55925598 /**
55935593- * The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
55995599+ * The type of the image input. Always `input_image`.
55945600 *
55955601 */
55965596- detail?: string;
56025602+ type: 'input_image';
55975603 /**
55985604 * The URL of the image input.
55995605 *
56005606 */
56015607 image_url: string;
56025608 /**
56035603- * The type of the image input. Always `input_image`.
56095609+ * The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
56045610 *
56055611 */
56065606- type: 'input_image';
56125612+ detail?: string;
56075613 }
56085614 | Array<unknown>;
56095615 /**
56105610- * The role of the message input. One of `user`, `assistant`, `system`, or
56115611- * `developer`.
56125612- *
56135613- */
56145614- role: 'user' | 'assistant' | 'system' | 'developer';
56155615- /**
56165616 * The type of the message input. Always `message`.
56175617 *
56185618 */
···56245624 */
56255625export type EvalJsonlFileContentSource = {
56265626 /**
56275627+ * The type of jsonl source. Always `file_content`.
56285628+ */
56295629+ type: 'file_content';
56305630+ /**
56275631 * The content of the jsonl file.
56285632 */
56295633 content: Array<{
···56345638 [key: string]: unknown;
56355639 };
56365640 }>;
56375637- /**
56385638- * The type of jsonl source. Always `file_content`.
56395639- */
56405640- type: 'file_content';
56415641};
5642564256435643/**
···56455645 */
56465646export type EvalJsonlFileIdSource = {
56475647 /**
56485648+ * The type of jsonl source. Always `file_id`.
56495649+ */
56505650+ type: 'file_id';
56515651+ /**
56485652 * The identifier of the file.
56495653 */
56505654 id: string;
56515651- /**
56525652- * The type of jsonl source. Always `file_id`.
56535653- */
56545654- type: 'file_id';
56555655};
5656565656575657/**
···56625662 */
56635663export type EvalList = {
56645664 /**
56655665+ * The type of this object. It is always set to "list".
56665666+ *
56675667+ */
56685668+ object: 'list';
56695669+ /**
56655670 * An array of eval objects.
56665671 *
56675672 */
···56705675 * The identifier of the first eval in the data array.
56715676 */
56725677 first_id: string;
56735673- /**
56745674- * Indicates whether there are more evals available.
56755675- */
56765676- has_more: boolean;
56775678 /**
56785679 * The identifier of the last eval in the data array.
56795680 */
56805681 last_id: string;
56815682 /**
56825682- * The type of this object. It is always set to "list".
56835683- *
56835683+ * Indicates whether there are more evals available.
56845684 */
56855685- object: 'list';
56855685+ has_more: boolean;
56865686};
5687568756885688/**
···56955695 *
56965696 */
56975697export type EvalLogsDataSourceConfig = {
56985698+ /**
56995699+ * The type of data source. Always `logs`.
57005700+ */
57015701+ type: 'logs';
56985702 metadata?: Metadata;
56995703 /**
57005704 * The json schema for the run data source items.
···57045708 schema: {
57055709 [key: string]: unknown;
57065710 };
57075707- /**
57085708- * The type of data source. Always `logs`.
57095709- */
57105710- type: 'logs';
57115711};
5712571257135713/**
···57185718 */
57195719export type EvalResponsesSource = {
57205720 /**
57215721- * Only include items created after this timestamp (inclusive). This is a query parameter used to select responses.
57215721+ * The type of run data source. Always `responses`.
57225722+ */
57235723+ type: 'responses';
57245724+ /**
57255725+ * Metadata filter for the responses. This is a query parameter used to select responses.
57225726 */
57235723- created_after?: number;
57275727+ metadata?: {
57285728+ [key: string]: unknown;
57295729+ };
57245730 /**
57255725- * Only include items created before this timestamp (inclusive). This is a query parameter used to select responses.
57315731+ * The name of the model to find responses for. This is a query parameter used to select responses.
57265732 */
57275727- created_before?: number;
57335733+ model?: string;
57285734 /**
57295735 * Optional string to search the 'instructions' field. This is a query parameter used to select responses.
57305736 */
57315737 instructions_search?: string;
57325738 /**
57335733- * Metadata filter for the responses. This is a query parameter used to select responses.
57395739+ * Only include items created after this timestamp (inclusive). This is a query parameter used to select responses.
57345740 */
57355735- metadata?: {
57365736- [key: string]: unknown;
57375737- };
57415741+ created_after?: number;
57385742 /**
57395739- * The name of the model to find responses for. This is a query parameter used to select responses.
57435743+ * Only include items created before this timestamp (inclusive). This is a query parameter used to select responses.
57405744 */
57415741- model?: string;
57455745+ created_before?: number;
57425746 /**
57435747 * Optional reasoning effort parameter. This is a query parameter used to select responses.
57445748 */
···57475751 * Sampling temperature. This is a query parameter used to select responses.
57485752 */
57495753 temperature?: number;
57505750- /**
57515751- * List of tool names. This is a query parameter used to select responses.
57525752- */
57535753- tools?: Array<string>;
57545754 /**
57555755 * Nucleus sampling parameter. This is a query parameter used to select responses.
57565756 */
57575757 top_p?: number;
57585758 /**
57595759- * The type of run data source. Always `responses`.
57605760- */
57615761- type: 'responses';
57625762- /**
57635759 * List of user identifiers. This is a query parameter used to select responses.
57645760 */
57655761 users?: Array<string>;
57625762+ /**
57635763+ * List of tool names. This is a query parameter used to select responses.
57645764+ */
57655765+ tools?: Array<string>;
57665766};
5767576757685768/**
···57735773 */
57745774export type EvalRun = {
57755775 /**
57765776- * Unix timestamp (in seconds) when the evaluation run was created.
57765776+ * The type of the object. Always "eval.run".
57775777 */
57785778- created_at: number;
57785778+ object: 'eval.run';
57795779 /**
57805780- * Information about the run's data source.
57805780+ * Unique identifier for the evaluation run.
57815781 */
57825782- data_source:
57835783- | ({
57845784- type?: 'CreateEvalJsonlRunDataSource';
57855785- } & CreateEvalJsonlRunDataSource)
57865786- | ({
57875787- type?: 'CreateEvalCompletionsRunDataSource';
57885788- } & CreateEvalCompletionsRunDataSource)
57895789- | ({
57905790- type?: 'CreateEvalResponsesRunDataSource';
57915791- } & CreateEvalResponsesRunDataSource);
57925792- error: EvalApiError;
57825782+ id: string;
57935783 /**
57945784 * The identifier of the associated evaluation.
57955785 */
57965786 eval_id: string;
57975787 /**
57985798- * Unique identifier for the evaluation run.
57885788+ * The status of the evaluation run.
57995789 */
58005800- id: string;
58015801- metadata: Metadata;
57905790+ status: string;
58025791 /**
58035792 * The model that is evaluated, if applicable.
58045793 */
···58085797 */
58095798 name: string;
58105799 /**
58115811- * The type of the object. Always "eval.run".
58005800+ * Unix timestamp (in seconds) when the evaluation run was created.
58015801+ */
58025802+ created_at: number;
58035803+ /**
58045804+ * The URL to the rendered evaluation run report on the UI dashboard.
58125805 */
58135813- object: 'eval.run';
58065806+ report_url: string;
58145807 /**
58155815- * Usage statistics for each model during the evaluation run.
58085808+ * Counters summarizing the outcomes of the evaluation run.
58165809 */
58175817- per_model_usage: Array<{
58105810+ result_counts: {
58185811 /**
58195819- * The number of tokens retrieved from cache.
58125812+ * Total number of executed output items.
58205813 */
58215821- cached_tokens: number;
58145814+ total: number;
58225815 /**
58235823- * The number of completion tokens generated.
58165816+ * Number of output items that resulted in an error.
58245817 */
58255825- completion_tokens: number;
58185818+ errored: number;
58265819 /**
58275827- * The number of invocations.
58205820+ * Number of output items that failed to pass the evaluation.
58215821+ */
58225822+ failed: number;
58235823+ /**
58245824+ * Number of output items that passed the evaluation.
58285825 */
58295829- invocation_count: number;
58265826+ passed: number;
58275827+ };
58285828+ /**
58295829+ * Usage statistics for each model during the evaluation run.
58305830+ */
58315831+ per_model_usage: Array<{
58305832 /**
58315833 * The name of the model.
58325834 */
58335835 model_name: string;
58345836 /**
58375837+ * The number of invocations.
58385838+ */
58395839+ invocation_count: number;
58405840+ /**
58355841 * The number of prompt tokens used.
58365842 */
58375843 prompt_tokens: number;
58445844+ /**
58455845+ * The number of completion tokens generated.
58465846+ */
58475847+ completion_tokens: number;
58385848 /**
58395849 * The total number of tokens used.
58405850 */
58415851 total_tokens: number;
58525852+ /**
58535853+ * The number of tokens retrieved from cache.
58545854+ */
58555855+ cached_tokens: number;
58425856 }>;
58435857 /**
58445858 * Results per testing criteria applied during the evaluation run.
58455859 */
58465860 per_testing_criteria_results: Array<{
58475861 /**
58485848- * Number of tests failed for this criteria.
58495849- */
58505850- failed: number;
58515851- /**
58525852- * Number of tests passed for this criteria.
58535853- */
58545854- passed: number;
58555855- /**
58565862 * A description of the testing criteria.
58575863 */
58585864 testing_criteria: string;
58595859- }>;
58605860- /**
58615861- * The URL to the rendered evaluation run report on the UI dashboard.
58625862- */
58635863- report_url: string;
58645864- /**
58655865- * Counters summarizing the outcomes of the evaluation run.
58665866- */
58675867- result_counts: {
58685868- /**
58695869- * Number of output items that resulted in an error.
58705870- */
58715871- errored: number;
58725865 /**
58735873- * Number of output items that failed to pass the evaluation.
58745874- */
58755875- failed: number;
58765876- /**
58775877- * Number of output items that passed the evaluation.
58665866+ * Number of tests passed for this criteria.
58785867 */
58795868 passed: number;
58805869 /**
58815881- * Total number of executed output items.
58705870+ * Number of tests failed for this criteria.
58825871 */
58835883- total: number;
58845884- };
58725872+ failed: number;
58735873+ }>;
58855874 /**
58865886- * The status of the evaluation run.
58755875+ * Information about the run's data source.
58875876 */
58885888- status: string;
58775877+ data_source:
58785878+ | ({
58795879+ type?: 'CreateEvalJsonlRunDataSource';
58805880+ } & CreateEvalJsonlRunDataSource)
58815881+ | ({
58825882+ type?: 'CreateEvalCompletionsRunDataSource';
58835883+ } & CreateEvalCompletionsRunDataSource)
58845884+ | ({
58855885+ type?: 'CreateEvalResponsesRunDataSource';
58865886+ } & CreateEvalResponsesRunDataSource);
58875887+ metadata: Metadata;
58885888+ error: EvalApiError;
58895889};
5890589058915891/**
···58965896 */
58975897export type EvalRunList = {
58985898 /**
58995899+ * The type of this object. It is always set to "list".
59005900+ *
59015901+ */
59025902+ object: 'list';
59035903+ /**
58995904 * An array of eval run objects.
59005905 *
59015906 */
···59045909 * The identifier of the first eval run in the data array.
59055910 */
59065911 first_id: string;
59075907- /**
59085908- * Indicates whether there are more evals available.
59095909- */
59105910- has_more: boolean;
59115912 /**
59125913 * The identifier of the last eval run in the data array.
59135914 */
59145915 last_id: string;
59155916 /**
59165916- * The type of this object. It is always set to "list".
59175917- *
59175917+ * Indicates whether there are more evals available.
59185918 */
59195919- object: 'list';
59195919+ has_more: boolean;
59205920};
5921592159225922/**
···59275927 */
59285928export type EvalRunOutputItem = {
59295929 /**
59305930- * Unix timestamp (in seconds) when the evaluation run was created.
59305930+ * The type of the object. Always "eval.run.output_item".
59315931 */
59325932- created_at: number;
59325932+ object: 'eval.run.output_item';
59335933 /**
59345934- * Details of the input data source item.
59345934+ * Unique identifier for the evaluation run output item.
59355935 */
59365936- datasource_item: {
59375937- [key: string]: unknown;
59385938- };
59365936+ id: string;
59395937 /**
59405940- * The identifier for the data source item.
59385938+ * The identifier of the evaluation run associated with this output item.
59415939 */
59425942- datasource_item_id: number;
59405940+ run_id: string;
59435941 /**
59445942 * The identifier of the evaluation group.
59455943 */
59465944 eval_id: string;
59475945 /**
59485948- * Unique identifier for the evaluation run output item.
59465946+ * Unix timestamp (in seconds) when the evaluation run was created.
59475947+ */
59485948+ created_at: number;
59495949+ /**
59505950+ * The status of the evaluation run.
59515951+ */
59525952+ status: string;
59535953+ /**
59545954+ * The identifier for the data source item.
59495955 */
59505950- id: string;
59565956+ datasource_item_id: number;
59515957 /**
59525952- * The type of the object. Always "eval.run.output_item".
59585958+ * Details of the input data source item.
59535959 */
59545954- object: 'eval.run.output_item';
59605960+ datasource_item: {
59615961+ [key: string]: unknown;
59625962+ };
59555963 /**
59565964 * A list of results from the evaluation run.
59575965 */
59585966 results: Array<{
59595967 [key: string]: unknown;
59605968 }>;
59615961- /**
59625962- * The identifier of the evaluation run associated with this output item.
59635963- */
59645964- run_id: string;
59655969 /**
59665970 * A sample containing the input and output of the evaluation run.
59675971 */
59685972 sample: {
59695969- error: EvalApiError;
59705970- /**
59715971- * The reason why the sample generation was finished.
59725972- */
59735973- finish_reason: string;
59745973 /**
59755974 * An array of input messages.
59765975 */
59775976 input: Array<{
59785977 /**
59785978+ * The role of the message sender (e.g., system, user, developer).
59795979+ */
59805980+ role: string;
59815981+ /**
59795982 * The content of the message.
59805983 */
59815984 content: string;
59825982- /**
59835983- * The role of the message sender (e.g., system, user, developer).
59845984- */
59855985- role: string;
59865985 }>;
59875986 /**
59885988- * The maximum number of tokens allowed for completion.
59895989- */
59905990- max_completion_tokens: number;
59915991- /**
59925992- * The model used for generating the sample.
59935993- */
59945994- model: string;
59955995- /**
59965987 * An array of output messages.
59975988 */
59985989 output: Array<{
59995990 /**
59915991+ * The role of the message (e.g. "system", "assistant", "user").
59925992+ */
59935993+ role?: string;
59945994+ /**
60005995 * The content of the message.
60015996 */
60025997 content?: string;
60036003- /**
60046004- * The role of the message (e.g. "system", "assistant", "user").
60056005- */
60066006- role?: string;
60075998 }>;
60085999 /**
60096009- * The seed used for generating the sample.
60106010- */
60116011- seed: number;
60126012- /**
60136013- * The sampling temperature used.
60006000+ * The reason why the sample generation was finished.
60146001 */
60156015- temperature: number;
60026002+ finish_reason: string;
60166003 /**
60176017- * The top_p value used for sampling.
60046004+ * The model used for generating the sample.
60186005 */
60196019- top_p: number;
60066006+ model: string;
60206007 /**
60216008 * Token usage details for the sample.
60226009 */
60236010 usage: {
60246011 /**
60256025- * The number of tokens retrieved from cache.
60126012+ * The total number of tokens used.
60266013 */
60276027- cached_tokens: number;
60146014+ total_tokens: number;
60286015 /**
60296016 * The number of completion tokens generated.
60306017 */
···60346021 */
60356022 prompt_tokens: number;
60366023 /**
60376037- * The total number of tokens used.
60246024+ * The number of tokens retrieved from cache.
60386025 */
60396039- total_tokens: number;
60266026+ cached_tokens: number;
60406027 };
60286028+ error: EvalApiError;
60296029+ /**
60306030+ * The sampling temperature used.
60316031+ */
60326032+ temperature: number;
60336033+ /**
60346034+ * The maximum number of tokens allowed for completion.
60356035+ */
60366036+ max_completion_tokens: number;
60376037+ /**
60386038+ * The top_p value used for sampling.
60396039+ */
60406040+ top_p: number;
60416041+ /**
60426042+ * The seed used for generating the sample.
60436043+ */
60446044+ seed: number;
60416045 };
60426042- /**
60436043- * The status of the evaluation run.
60446044- */
60456045- status: string;
60466046};
6047604760486048/**
···60536053 */
60546054export type EvalRunOutputItemList = {
60556055 /**
60566056+ * The type of this object. It is always set to "list".
60576057+ *
60586058+ */
60596059+ object: 'list';
60606060+ /**
60566061 * An array of eval run output item objects.
60576062 *
60586063 */
···60626067 */
60636068 first_id: string;
60646069 /**
60656065- * Indicates whether there are more eval run output items available.
60666066- */
60676067- has_more: boolean;
60686068- /**
60696070 * The identifier of the last eval run output item in the data array.
60706071 */
60716072 last_id: string;
60726073 /**
60736073- * The type of this object. It is always set to "list".
60746074- *
60746074+ * Indicates whether there are more eval run output items available.
60756075 */
60766076- object: 'list';
60766076+ has_more: boolean;
60776077};
6078607860796079/**
···60856085 * @deprecated
60866086 */
60876087export type EvalStoredCompletionsDataSourceConfig = {
60886088+ /**
60896089+ * The type of data source. Always `stored_completions`.
60906090+ */
60916091+ type: 'stored_completions';
60886092 metadata?: Metadata;
60896093 /**
60906094 * The json schema for the run data source items.
···60946098 schema: {
60956099 [key: string]: unknown;
60966100 };
60976097- /**
60986098- * The type of data source. Always `stored_completions`.
60996099- */
61006100- type: 'stored_completions';
61016101};
6102610261036103/**
···61086108 */
61096109export type EvalStoredCompletionsSource = {
61106110 /**
61116111+ * The type of source. Always `stored_completions`.
61126112+ */
61136113+ type: 'stored_completions';
61146114+ metadata?: Metadata;
61156115+ /**
61166116+ * An optional model to filter by (e.g., 'gpt-4o').
61176117+ */
61186118+ model?: string;
61196119+ /**
61116120 * An optional Unix timestamp to filter items created after this time.
61126121 */
61136122 created_after?: number;
···61196128 * An optional maximum number of items to return.
61206129 */
61216130 limit?: number;
61226122- metadata?: Metadata;
61236123- /**
61246124- * An optional model to filter by (e.g., 'gpt-4o').
61256125- */
61266126- model?: string;
61276127- /**
61286128- * The type of source. Always `stored_completions`.
61296129- */
61306130- type: 'stored_completions';
61316131};
6132613261336133/**
···61546154 */
61556155export type FilePath = {
61566156 /**
61576157+ * The type of the file path. Always `file_path`.
61586158+ *
61596159+ */
61606160+ type: 'file_path';
61616161+ /**
61576162 * The ID of the file.
61586163 *
61596164 */
···61636168 *
61646169 */
61656170 index: number;
61666166- /**
61676167- * The type of the file path. Always `file_path`.
61686168- *
61696169- */
61706170- type: 'file_path';
61716171};
6172617261736173/**
···62146214 */
62156215 id: string;
62166216 /**
62176217+ * The type of the file search tool call. Always `file_search_call`.
62186218+ *
62196219+ */
62206220+ type: 'file_search_call';
62216221+ /**
62226222+ * The status of the file search tool call. One of `in_progress`,
62236223+ * `searching`, `incomplete` or `failed`,
62246224+ *
62256225+ */
62266226+ status: 'in_progress' | 'searching' | 'completed' | 'incomplete' | 'failed';
62276227+ /**
62176228 * The queries used to search for files.
62186229 *
62196230 */
···62236234 *
62246235 */
62256236 results?: Array<{
62266226- attributes?: VectorStoreFileAttributes;
62276237 /**
62286238 * The unique ID of the file.
62296239 *
62306240 */
62316241 file_id?: string;
62326242 /**
62436243+ * The text that was retrieved from the file.
62446244+ *
62456245+ */
62466246+ text?: string;
62476247+ /**
62336248 * The name of the file.
62346249 *
62356250 */
62366251 filename?: string;
62526252+ attributes?: VectorStoreFileAttributes;
62376253 /**
62386254 * The relevance score of the file - a value between 0 and 1.
62396255 *
62406256 */
62416257 score?: number;
62426242- /**
62436243- * The text that was retrieved from the file.
62446244- *
62456245- */
62466246- text?: string;
62476258 }>;
62486248- /**
62496249- * The status of the file search tool call. One of `in_progress`,
62506250- * `searching`, `incomplete` or `failed`,
62516251- *
62526252- */
62536253- status: 'in_progress' | 'searching' | 'completed' | 'incomplete' | 'failed';
62546254- /**
62556255- * The type of the file search tool call. Always `file_search_call`.
62566256- *
62576257- */
62586258- type: 'file_search_call';
62596259};
6260626062616261export type FineTuneChatCompletionRequestAssistantMessage = {
···62726272 *
62736273 */
62746274export type FineTuneChatRequestInput = {
62756275- /**
62766276- * A list of functions the model may generate JSON inputs for.
62776277- *
62786278- * @deprecated
62796279- */
62806280- functions?: Array<ChatCompletionFunctions>;
62816275 messages?: Array<
62826276 | ChatCompletionRequestSystemMessage
62836277 | ChatCompletionRequestUserMessage
···62856279 | ChatCompletionRequestToolMessage
62866280 | ChatCompletionRequestFunctionMessage
62876281 >;
62886288- parallel_tool_calls?: ParallelToolCalls;
62896282 /**
62906283 * A list of tools the model may generate JSON inputs for.
62916284 */
62926285 tools?: Array<ChatCompletionTool>;
62866286+ parallel_tool_calls?: ParallelToolCalls;
62876287+ /**
62886288+ * A list of functions the model may generate JSON inputs for.
62896289+ *
62906290+ * @deprecated
62916291+ */
62926292+ functions?: Array<ChatCompletionFunctions>;
62936293};
6294629462956295/**
···62976297 */
62986298export type FineTuneDpoHyperparameters = {
62996299 /**
63006300- * Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
63006300+ * The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.
63016301 *
63026302 */
63036303- batch_size?: 'auto' | number;
63036303+ beta?: 'auto' | number;
63046304 /**
63056305- * The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.
63056305+ * Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
63066306 *
63076307 */
63086308- beta?: 'auto' | number;
63086308+ batch_size?: 'auto' | number;
63096309 /**
63106310 * Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
63116311 *
···63296329 * The method used for fine-tuning.
63306330 */
63316331export type FineTuneMethod = {
63326332- dpo?: FineTuneDpoMethod;
63336333- reinforcement?: FineTuneReinforcementMethod;
63346334- supervised?: FineTuneSupervisedMethod;
63356332 /**
63366333 * The type of method. Is either `supervised`, `dpo`, or `reinforcement`.
63376334 */
63386335 type: 'supervised' | 'dpo' | 'reinforcement';
63366336+ supervised?: FineTuneSupervisedMethod;
63376337+ dpo?: FineTuneDpoMethod;
63386338+ reinforcement?: FineTuneReinforcementMethod;
63396339};
6340634063416341/**
···63536353 | ChatCompletionRequestToolMessage
63546354 | ChatCompletionRequestFunctionMessage
63556355 >;
63566356- parallel_tool_calls?: ParallelToolCalls;
63576356 /**
63586357 * A list of tools the model may generate JSON inputs for.
63596358 */
63606359 tools?: Array<ChatCompletionTool>;
63606360+ parallel_tool_calls?: ParallelToolCalls;
63616361 };
63626362 /**
63636363+ * The preferred completion message for the output.
63646364+ */
63656365+ preferred_output?: Array<ChatCompletionRequestAssistantMessage>;
63666366+ /**
63636367 * The non-preferred completion message for the output.
63646368 */
63656369 non_preferred_output?: Array<ChatCompletionRequestAssistantMessage>;
63666366- /**
63676367- * The preferred completion message for the output.
63686368- */
63696369- preferred_output?: Array<ChatCompletionRequestAssistantMessage>;
63706370};
6371637163726372/**
···63796379 */
63806380 batch_size?: 'auto' | number;
63816381 /**
63826382- * Multiplier on amount of compute used for exploring search space during training.
63826382+ * Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
63836383 *
63846384 */
63856385- compute_multiplier?: 'auto' | number;
63856385+ learning_rate_multiplier?: 'auto' | number;
63866386 /**
63876387- * The number of training steps between evaluation runs.
63876387+ * The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
63886388 *
63896389 */
63906390- eval_interval?: 'auto' | number;
63906390+ n_epochs?: 'auto' | number;
63916391 /**
63926392- * Number of evaluation samples to generate per training step.
63926392+ * Level of reasoning effort.
63936393 *
63946394 */
63956395- eval_samples?: 'auto' | number;
63956395+ reasoning_effort?: 'default' | 'low' | 'medium' | 'high';
63966396 /**
63976397- * Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
63976397+ * Multiplier on amount of compute used for exploring search space during training.
63986398 *
63996399 */
64006400- learning_rate_multiplier?: 'auto' | number;
64006400+ compute_multiplier?: 'auto' | number;
64016401 /**
64026402- * The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
64026402+ * The number of training steps between evaluation runs.
64036403 *
64046404 */
64056405- n_epochs?: 'auto' | number;
64056405+ eval_interval?: 'auto' | number;
64066406 /**
64076407- * Level of reasoning effort.
64076407+ * Number of evaluation samples to generate per training step.
64086408 *
64096409 */
64106410- reasoning_effort?: 'default' | 'low' | 'medium' | 'high';
64106410+ eval_samples?: 'auto' | number;
64116411};
6412641264136413/**
···64826482 */
64836483export type FineTuningCheckpointPermission = {
64846484 /**
64856485- * The Unix timestamp (in seconds) for when the permission was created.
64866486- */
64876487- created_at: number;
64886488- /**
64896485 * The permission identifier, which can be referenced in the API endpoints.
64906486 */
64916487 id: string;
64926488 /**
64936493- * The object type, which is always "checkpoint.permission".
64896489+ * The Unix timestamp (in seconds) for when the permission was created.
64946490 */
64956495- object: 'checkpoint.permission';
64916491+ created_at: number;
64966492 /**
64976493 * The project identifier that the permission is for.
64986494 */
64996495 project_id: string;
64966496+ /**
64976497+ * The object type, which is always "checkpoint.permission".
64986498+ */
64996499+ object: 'checkpoint.permission';
65006500};
6501650165026502/**
···65156515 */
65166516 wandb: {
65176517 /**
65186518- * The entity to use for the run. This allows you to set the team or username of the WandB user that you would
65196519- * like associated with the run. If not set, the default entity for the registered WandB API key is used.
65186518+ * The name of the project that the new run will be created under.
65206519 *
65216520 */
65226522- entity?: string;
65216521+ project: string;
65236522 /**
65246523 * A display name to set for the run. If not set, we will use the Job ID as the name.
65256524 *
65266525 */
65276526 name?: string;
65286527 /**
65296529- * The name of the project that the new run will be created under.
65286528+ * The entity to use for the run. This allows you to set the team or username of the WandB user that you would
65296529+ * like associated with the run. If not set, the default entity for the registered WandB API key is used.
65306530 *
65316531 */
65326532- project: string;
65326532+ entity?: string;
65336533 /**
65346534 * A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some
65356535 * default tags are generated by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}".
···65476547 */
65486548export type FineTuningJob = {
65496549 /**
65506550+ * The object identifier, which can be referenced in the API endpoints.
65516551+ */
65526552+ id: string;
65536553+ /**
65506554 * The Unix timestamp (in seconds) for when the fine-tuning job was created.
65516555 */
65526556 created_at: number;
···65686572 param: string;
65696573 };
65706574 /**
65716571- * The Unix timestamp (in seconds) for when the fine-tuning job is estimated to finish. The value will be null if the fine-tuning job is not running.
65726572- */
65736573- estimated_finish?: number;
65746574- /**
65756575 * The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running.
65766576 */
65776577 fine_tuned_model: string;
···66036603 n_epochs?: 'auto' | number;
66046604 };
66056605 /**
66066606- * The object identifier, which can be referenced in the API endpoints.
66076607- */
66086608- id: string;
66096609- /**
66106610- * A list of integrations to enable for this fine-tuning job.
66116611- */
66126612- integrations?: Array<
66136613- {
66146614- type?: 'FineTuningIntegration';
66156615- } & FineTuningIntegration
66166616- >;
66176617- metadata?: Metadata;
66186618- method?: FineTuneMethod;
66196619- /**
66206606 * The base model that is being fine-tuned.
66216607 */
66226608 model: string;
···66326618 * The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents).
66336619 */
66346620 result_files: Array<string>;
66356635- /**
66366636- * The seed used for the fine-tuning job.
66376637- */
66386638- seed: number;
66396621 /**
66406622 * The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`.
66416623 */
···66586640 * The file ID used for validation. You can retrieve the validation results with the [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents).
66596641 */
66606642 validation_file: string;
66436643+ /**
66446644+ * A list of integrations to enable for this fine-tuning job.
66456645+ */
66466646+ integrations?: Array<
66476647+ {
66486648+ type?: 'FineTuningIntegration';
66496649+ } & FineTuningIntegration
66506650+ >;
66516651+ /**
66526652+ * The seed used for the fine-tuning job.
66536653+ */
66546654+ seed: number;
66556655+ /**
66566656+ * The Unix timestamp (in seconds) for when the fine-tuning job is estimated to finish. The value will be null if the fine-tuning job is not running.
66576657+ */
66586658+ estimated_finish?: number;
66596659+ method?: FineTuneMethod;
66606660+ metadata?: Metadata;
66616661};
6662666266636663/**
···66686668 */
66696669export type FineTuningJobCheckpoint = {
66706670 /**
66716671+ * The checkpoint identifier, which can be referenced in the API endpoints.
66726672+ */
66736673+ id: string;
66746674+ /**
66716675 * The Unix timestamp (in seconds) for when the checkpoint was created.
66726676 */
66736677 created_at: number;
···66766680 */
66776681 fine_tuned_model_checkpoint: string;
66786682 /**
66796679- * The name of the fine-tuning job that this checkpoint was created from.
66806680- */
66816681- fine_tuning_job_id: string;
66826682- /**
66836683- * The checkpoint identifier, which can be referenced in the API endpoints.
66836683+ * The step number that the checkpoint was created at.
66846684 */
66856685- id: string;
66856685+ step_number: number;
66866686 /**
66876687 * Metrics at the step number during the fine-tuning job.
66886688 */
66896689 metrics: {
66906690- full_valid_loss?: number;
66916691- full_valid_mean_token_accuracy?: number;
66926690 step?: number;
66936691 train_loss?: number;
66946692 train_mean_token_accuracy?: number;
66956693 valid_loss?: number;
66966694 valid_mean_token_accuracy?: number;
66956695+ full_valid_loss?: number;
66966696+ full_valid_mean_token_accuracy?: number;
66976697 };
66986698 /**
66996699+ * The name of the fine-tuning job that this checkpoint was created from.
67006700+ */
67016701+ fine_tuning_job_id: string;
67026702+ /**
66996703 * The object type, which is always "fine_tuning.job.checkpoint".
67006704 */
67016705 object: 'fine_tuning.job.checkpoint';
67026702- /**
67036703- * The step number that the checkpoint was created at.
67046704- */
67056705- step_number: number;
67066706};
6707670767086708/**
···67106710 */
67116711export type FineTuningJobEvent = {
67126712 /**
67136713- * The Unix timestamp (in seconds) for when the fine-tuning job was created.
67136713+ * The object type, which is always "fine_tuning.job.event".
67146714 */
67156715- created_at: number;
67156715+ object: 'fine_tuning.job.event';
67166716 /**
67176717- * The data associated with the event.
67176717+ * The object identifier.
67186718 */
67196719- data?: {
67206720- [key: string]: unknown;
67216721- };
67196719+ id: string;
67226720 /**
67236723- * The object identifier.
67216721+ * The Unix timestamp (in seconds) for when the fine-tuning job was created.
67246722 */
67256725- id: string;
67236723+ created_at: number;
67266724 /**
67276725 * The log level of the event.
67286726 */
···67326730 */
67336731 message: string;
67346732 /**
67356735- * The object type, which is always "fine_tuning.job.event".
67336733+ * The type of event.
67366734 */
67376737- object: 'fine_tuning.job.event';
67356735+ type?: 'message' | 'metrics';
67386736 /**
67396739- * The type of event.
67376737+ * The data associated with the event.
67406738 */
67416741- type?: 'message' | 'metrics';
67396739+ data?: {
67406740+ [key: string]: unknown;
67416741+ };
67426742};
6743674367446744export type FunctionObject = {
···67756775 */
67766776export type FunctionToolCall = {
67776777 /**
67786778- * A JSON string of the arguments to pass to the function.
67786778+ * The unique ID of the function tool call.
67796779 *
67806780 */
67816781- arguments: string;
67816781+ id?: string;
67826782 /**
67836783- * The unique ID of the function tool call generated by the model.
67836783+ * The type of the function tool call. Always `function_call`.
67846784 *
67856785 */
67866786- call_id: string;
67866786+ type: 'function_call';
67876787 /**
67886788- * The unique ID of the function tool call.
67886788+ * The unique ID of the function tool call generated by the model.
67896789 *
67906790 */
67916791- id?: string;
67916791+ call_id: string;
67926792 /**
67936793 * The name of the function to run.
67946794 *
67956795 */
67966796 name: string;
67976797 /**
67986798+ * A JSON string of the arguments to pass to the function.
67996799+ *
68006800+ */
68016801+ arguments: string;
68026802+ /**
67986803 * The status of the item. One of `in_progress`, `completed`, or
67996804 * `incomplete`. Populated when items are returned via API.
68006805 *
68016806 */
68026807 status?: 'in_progress' | 'completed' | 'incomplete';
68036803- /**
68046804- * The type of the function tool call. Always `function_call`.
68056805- *
68066806- */
68076807- type: 'function_call';
68086808};
6809680968106810/**
···68156815 */
68166816export type FunctionToolCallOutput = {
68176817 /**
68186818- * The unique ID of the function tool call generated by the model.
68186818+ * The unique ID of the function tool call output. Populated when this item
68196819+ * is returned via API.
68206820+ *
68216821+ */
68226822+ id?: string;
68236823+ /**
68246824+ * The type of the function tool call output. Always `function_call_output`.
68196825 *
68206826 */
68216821- call_id: string;
68276827+ type: 'function_call_output';
68226828 /**
68236823- * The unique ID of the function tool call output. Populated when this item
68246824- * is returned via API.
68296829+ * The unique ID of the function tool call generated by the model.
68256830 *
68266831 */
68276827- id?: string;
68326832+ call_id: string;
68286833 /**
68296834 * A JSON string of the output of the function tool call.
68306835 *
···68366841 *
68376842 */
68386843 status?: 'in_progress' | 'completed' | 'incomplete';
68396839- /**
68406840- * The type of the function tool call output. Always `function_call_output`.
68416841- *
68426842- */
68436843- type: 'function_call_output';
68446844};
6845684568466846export type FunctionToolCallOutputResource = FunctionToolCallOutput & {
···68676867 *
68686868 */
68696869export type GraderLabelModel = {
68706870- input: Array<EvalItem>;
68706870+ /**
68716871+ * The object type, which is always `label_model`.
68726872+ */
68736873+ type: 'label_model';
68716874 /**
68726872- * The labels to assign to each item in the evaluation.
68756875+ * The name of the grader.
68736876 */
68746874- labels: Array<string>;
68776877+ name: string;
68756878 /**
68766879 * The model to use for the evaluation. Must support structured outputs.
68776880 */
68786881 model: string;
68826882+ input: Array<EvalItem>;
68796883 /**
68806880- * The name of the grader.
68846884+ * The labels to assign to each item in the evaluation.
68816885 */
68826882- name: string;
68866886+ labels: Array<string>;
68836887 /**
68846888 * The labels that indicate a passing result. Must be a subset of labels.
68856889 */
68866890 passing_labels: Array<string>;
68876887- /**
68886888- * The object type, which is always `label_model`.
68896889- */
68906890- type: 'label_model';
68916891};
6892689268936893/**
···68976897 */
68986898export type GraderMulti = {
68996899 /**
69006900- * A formula to calculate the output based on grader results.
69006900+ * The object type, which is always `multi`.
69016901+ */
69026902+ type: 'multi';
69036903+ /**
69046904+ * The name of the grader.
69016905 */
69026902- calculate_output: string;
69066906+ name: string;
69036907 graders:
69046908 | GraderStringCheck
69056909 | GraderTextSimilarity
···69076911 | GraderScoreModel
69086912 | GraderLabelModel;
69096913 /**
69106910- * The name of the grader.
69146914+ * A formula to calculate the output based on grader results.
69116915 */
69126912- name: string;
69136913- /**
69146914- * The object type, which is always `multi`.
69156915- */
69166916- type: 'multi';
69166916+ calculate_output: string;
69176917};
6918691869196919/**
···69246924 */
69256925export type GraderPython = {
69266926 /**
69276927- * The image tag to use for the python script.
69276927+ * The object type, which is always `python`.
69286928 */
69296929- image_tag?: string;
69296929+ type: 'python';
69306930 /**
69316931 * The name of the grader.
69326932 */
···69366936 */
69376937 source: string;
69386938 /**
69396939- * The object type, which is always `python`.
69396939+ * The image tag to use for the python script.
69406940 */
69416941- type: 'python';
69416941+ image_tag?: string;
69426942};
6943694369446944/**
···69496949 */
69506950export type GraderScoreModel = {
69516951 /**
69526952- * The input text. This may include template strings.
69526952+ * The object type, which is always `score_model`.
69536953 */
69546954- input: Array<EvalItem>;
69556955- /**
69566956- * The model to use for the evaluation.
69576957- */
69586958- model: string;
69546954+ type: 'score_model';
69596955 /**
69606956 * The name of the grader.
69616957 */
69626958 name: string;
69636959 /**
69646964- * The range of the score. Defaults to `[0, 1]`.
69606960+ * The model to use for the evaluation.
69656961 */
69666966- range?: Array<number>;
69626962+ model: string;
69676963 /**
69686964 * The sampling parameters for the model.
69696965 */
···69716967 [key: string]: unknown;
69726968 };
69736969 /**
69746974- * The object type, which is always `score_model`.
69706970+ * The input text. This may include template strings.
69716971+ */
69726972+ input: Array<EvalItem>;
69736973+ /**
69746974+ * The range of the score. Defaults to `[0, 1]`.
69756975 */
69766976- type: 'score_model';
69766976+ range?: Array<number>;
69776977};
6978697869796979/**
···69846984 */
69856985export type GraderStringCheck = {
69866986 /**
69876987- * The input text. This may include template strings.
69876987+ * The object type, which is always `string_check`.
69886988 */
69896989- input: string;
69896989+ type: 'string_check';
69906990 /**
69916991 * The name of the grader.
69926992 */
69936993 name: string;
69946994 /**
69956995- * The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.
69956995+ * The input text. This may include template strings.
69966996 */
69976997- operation: 'eq' | 'ne' | 'like' | 'ilike';
69976997+ input: string;
69986998 /**
69996999 * The reference text. This may include template strings.
70007000 */
70017001 reference: string;
70027002 /**
70037003- * The object type, which is always `string_check`.
70037003+ * The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.
70047004 */
70057005- type: 'string_check';
70057005+ operation: 'eq' | 'ne' | 'like' | 'ilike';
70067006};
7007700770087008/**
···70137013 */
70147014export type GraderTextSimilarity = {
70157015 /**
70167016+ * The type of grader.
70177017+ */
70187018+ type: 'text_similarity';
70197019+ /**
70207020+ * The name of the grader.
70217021+ */
70227022+ name: string;
70237023+ /**
70247024+ * The text being graded.
70257025+ */
70267026+ input: string;
70277027+ /**
70287028+ * The text being graded against.
70297029+ */
70307030+ reference: string;
70317031+ /**
70167032 * The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,
70177033 * `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,
70187034 * or `rouge_l`.
···70307046 | 'rouge_4'
70317047 | 'rouge_5'
70327048 | 'rouge_l';
70337033- /**
70347034- * The text being graded.
70357035- */
70367036- input: string;
70377037- /**
70387038- * The name of the grader.
70397039- */
70407040- name: string;
70417041- /**
70427042- * The text being graded against.
70437043- */
70447044- reference: string;
70457045- /**
70467046- * The type of grader.
70477047- */
70487048- type: 'text_similarity';
70497049};
7050705070517051/**
···70577057 */
70587058 b64_json?: string;
70597059 /**
70607060+ * When using `dall-e-2` or `dall-e-3`, the URL of the generated image if `response_format` is set to `url` (default value). Unsupported for `gpt-image-1`.
70617061+ */
70627062+ url?: string;
70637063+ /**
70607064 * For `dall-e-3` only, the revised prompt that was used to generate the image.
70617065 */
70627066 revised_prompt?: string;
70637063- /**
70647064- * When using `dall-e-2` or `dall-e-3`, the URL of the generated image if `response_format` is set to `url` (default value). Unsupported for `gpt-image-1`.
70657065- */
70667066- url?: string;
70677067};
7068706870697069/**
···70727072 */
70737073export type ImageEditCompletedEvent = {
70747074 /**
70757075- * Base64-encoded final edited image data, suitable for rendering as an image.
70757075+ * The type of the event. Always `image_edit.completed`.
70767076 *
70777077 */
70787078- b64_json: string;
70787078+ type: 'image_edit.completed';
70797079 /**
70807080- * The background setting for the edited image.
70807080+ * Base64-encoded final edited image data, suitable for rendering as an image.
70817081 *
70827082 */
70837083- background: 'transparent' | 'opaque' | 'auto';
70837083+ b64_json: string;
70847084 /**
70857085 * The Unix timestamp when the event was created.
70867086 *
70877087 */
70887088 created_at: number;
70897089 /**
70907090- * The output format for the edited image.
70907090+ * The size of the edited image.
70917091 *
70927092 */
70937093- output_format: 'png' | 'webp' | 'jpeg';
70937093+ size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto';
70947094 /**
70957095 * The quality setting for the edited image.
70967096 *
70977097 */
70987098 quality: 'low' | 'medium' | 'high' | 'auto';
70997099 /**
71007100- * The size of the edited image.
71007100+ * The background setting for the edited image.
71017101 *
71027102 */
71037103- size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto';
71037103+ background: 'transparent' | 'opaque' | 'auto';
71047104 /**
71057105- * The type of the event. Always `image_edit.completed`.
71057105+ * The output format for the edited image.
71067106 *
71077107 */
71087108- type: 'image_edit.completed';
71087108+ output_format: 'png' | 'webp' | 'jpeg';
71097109 usage: ImagesUsage;
71107110};
71117111···71157115 */
71167116export type ImageEditPartialImageEvent = {
71177117 /**
71187118- * Base64-encoded partial image data, suitable for rendering as an image.
71187118+ * The type of the event. Always `image_edit.partial_image`.
71197119 *
71207120 */
71217121- b64_json: string;
71217121+ type: 'image_edit.partial_image';
71227122 /**
71237123- * The background setting for the requested edited image.
71237123+ * Base64-encoded partial image data, suitable for rendering as an image.
71247124 *
71257125 */
71267126- background: 'transparent' | 'opaque' | 'auto';
71267126+ b64_json: string;
71277127 /**
71287128 * The Unix timestamp when the event was created.
71297129 *
71307130 */
71317131 created_at: number;
71327132 /**
71337133- * The output format for the requested edited image.
71337133+ * The size of the requested edited image.
71347134 *
71357135 */
71367136- output_format: 'png' | 'webp' | 'jpeg';
71367136+ size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto';
71377137 /**
71387138- * 0-based index for the partial image (streaming).
71387138+ * The quality setting for the requested edited image.
71397139 *
71407140 */
71417141- partial_image_index: number;
71417141+ quality: 'low' | 'medium' | 'high' | 'auto';
71427142 /**
71437143- * The quality setting for the requested edited image.
71437143+ * The background setting for the requested edited image.
71447144 *
71457145 */
71467146- quality: 'low' | 'medium' | 'high' | 'auto';
71467146+ background: 'transparent' | 'opaque' | 'auto';
71477147 /**
71487148- * The size of the requested edited image.
71487148+ * The output format for the requested edited image.
71497149 *
71507150 */
71517151- size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto';
71517151+ output_format: 'png' | 'webp' | 'jpeg';
71527152 /**
71537153- * The type of the event. Always `image_edit.partial_image`.
71537153+ * 0-based index for the partial image (streaming).
71547154 *
71557155 */
71567156- type: 'image_edit.partial_image';
71567156+ partial_image_index: number;
71577157};
7158715871597159export type ImageEditStreamEvent =
···71707170 */
71717171export type ImageGenCompletedEvent = {
71727172 /**
71737173- * Base64-encoded image data, suitable for rendering as an image.
71737173+ * The type of the event. Always `image_generation.completed`.
71747174 *
71757175 */
71767176- b64_json: string;
71767176+ type: 'image_generation.completed';
71777177 /**
71787178- * The background setting for the generated image.
71787178+ * Base64-encoded image data, suitable for rendering as an image.
71797179 *
71807180 */
71817181- background: 'transparent' | 'opaque' | 'auto';
71817181+ b64_json: string;
71827182 /**
71837183 * The Unix timestamp when the event was created.
71847184 *
71857185 */
71867186 created_at: number;
71877187 /**
71887188- * The output format for the generated image.
71887188+ * The size of the generated image.
71897189 *
71907190 */
71917191- output_format: 'png' | 'webp' | 'jpeg';
71917191+ size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto';
71927192 /**
71937193 * The quality setting for the generated image.
71947194 *
71957195 */
71967196 quality: 'low' | 'medium' | 'high' | 'auto';
71977197 /**
71987198- * The size of the generated image.
71987198+ * The background setting for the generated image.
71997199 *
72007200 */
72017201- size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto';
72017201+ background: 'transparent' | 'opaque' | 'auto';
72027202 /**
72037203- * The type of the event. Always `image_generation.completed`.
72037203+ * The output format for the generated image.
72047204 *
72057205 */
72067206- type: 'image_generation.completed';
72067206+ output_format: 'png' | 'webp' | 'jpeg';
72077207 usage: ImagesUsage;
72087208};
72097209···72137213 */
72147214export type ImageGenPartialImageEvent = {
72157215 /**
72167216- * Base64-encoded partial image data, suitable for rendering as an image.
72167216+ * The type of the event. Always `image_generation.partial_image`.
72177217 *
72187218 */
72197219- b64_json: string;
72197219+ type: 'image_generation.partial_image';
72207220 /**
72217221- * The background setting for the requested image.
72217221+ * Base64-encoded partial image data, suitable for rendering as an image.
72227222 *
72237223 */
72247224- background: 'transparent' | 'opaque' | 'auto';
72247224+ b64_json: string;
72257225 /**
72267226 * The Unix timestamp when the event was created.
72277227 *
72287228 */
72297229 created_at: number;
72307230 /**
72317231- * The output format for the requested image.
72317231+ * The size of the requested image.
72327232 *
72337233 */
72347234- output_format: 'png' | 'webp' | 'jpeg';
72347234+ size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto';
72357235 /**
72367236- * 0-based index for the partial image (streaming).
72367236+ * The quality setting for the requested image.
72377237 *
72387238 */
72397239- partial_image_index: number;
72397239+ quality: 'low' | 'medium' | 'high' | 'auto';
72407240 /**
72417241- * The quality setting for the requested image.
72417241+ * The background setting for the requested image.
72427242 *
72437243 */
72447244- quality: 'low' | 'medium' | 'high' | 'auto';
72447244+ background: 'transparent' | 'opaque' | 'auto';
72457245 /**
72467246- * The size of the requested image.
72467246+ * The output format for the requested image.
72477247 *
72487248 */
72497249- size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto';
72497249+ output_format: 'png' | 'webp' | 'jpeg';
72507250 /**
72517251- * The type of the event. Always `image_generation.partial_image`.
72517251+ * 0-based index for the partial image (streaming).
72527252 *
72537253 */
72547254- type: 'image_generation.partial_image';
72547254+ partial_image_index: number;
72557255};
7256725672577257export type ImageGenStreamEvent =
···72707270 */
72717271export type ImageGenTool = {
72727272 /**
72737273- * Background type for the generated image. One of `transparent`,
72747274- * `opaque`, or `auto`. Default: `auto`.
72737273+ * The type of the image generation tool. Always `image_generation`.
72757274 *
72767275 */
72777277- background?: 'transparent' | 'opaque' | 'auto';
72787278- input_fidelity?: ImageInputFidelity;
72797279- /**
72807280- * Optional mask for inpainting. Contains `image_url`
72817281- * (string, optional) and `file_id` (string, optional).
72827282- *
72837283- */
72847284- input_image_mask?: {
72857285- /**
72867286- * File ID for the mask image.
72877287- *
72887288- */
72897289- file_id?: string;
72907290- /**
72917291- * Base64-encoded mask image.
72927292- *
72937293- */
72947294- image_url?: string;
72957295- };
72767276+ type: 'image_generation';
72967277 /**
72977278 * The image generation model to use. Default: `gpt-image-1`.
72987279 *
72997280 */
73007281 model?: 'gpt-image-1';
73017282 /**
73027302- * Moderation level for the generated image. Default: `auto`.
72837283+ * The quality of the generated image. One of `low`, `medium`, `high`,
72847284+ * or `auto`. Default: `auto`.
73037285 *
73047286 */
73057305- moderation?: 'auto' | 'low';
72877287+ quality?: 'low' | 'medium' | 'high' | 'auto';
73067288 /**
73077307- * Compression level for the output image. Default: 100.
72897289+ * The size of the generated image. One of `1024x1024`, `1024x1536`,
72907290+ * `1536x1024`, or `auto`. Default: `auto`.
73087291 *
73097292 */
73107310- output_compression?: number;
72937293+ size?: '1024x1024' | '1024x1536' | '1536x1024' | 'auto';
73117294 /**
73127295 * The output format of the generated image. One of `png`, `webp`, or
73137296 * `jpeg`. Default: `png`.
···73157298 */
73167299 output_format?: 'png' | 'webp' | 'jpeg';
73177300 /**
73187318- * Number of partial images to generate in streaming mode, from 0 (default value) to 3.
73017301+ * Compression level for the output image. Default: 100.
73197302 *
73207303 */
73217321- partial_images?: number;
73047304+ output_compression?: number;
73227305 /**
73237323- * The quality of the generated image. One of `low`, `medium`, `high`,
73247324- * or `auto`. Default: `auto`.
73067306+ * Moderation level for the generated image. Default: `auto`.
73257307 *
73267308 */
73277327- quality?: 'low' | 'medium' | 'high' | 'auto';
73097309+ moderation?: 'auto' | 'low';
73287310 /**
73297329- * The size of the generated image. One of `1024x1024`, `1024x1536`,
73307330- * `1536x1024`, or `auto`. Default: `auto`.
73117311+ * Background type for the generated image. One of `transparent`,
73127312+ * `opaque`, or `auto`. Default: `auto`.
73137313+ *
73147314+ */
73157315+ background?: 'transparent' | 'opaque' | 'auto';
73167316+ input_fidelity?: ImageInputFidelity;
73177317+ /**
73187318+ * Optional mask for inpainting. Contains `image_url`
73197319+ * (string, optional) and `file_id` (string, optional).
73317320 *
73327321 */
73337333- size?: '1024x1024' | '1024x1536' | '1536x1024' | 'auto';
73227322+ input_image_mask?: {
73237323+ /**
73247324+ * Base64-encoded mask image.
73257325+ *
73267326+ */
73277327+ image_url?: string;
73287328+ /**
73297329+ * File ID for the mask image.
73307330+ *
73317331+ */
73327332+ file_id?: string;
73337333+ };
73347334 /**
73357335- * The type of the image generation tool. Always `image_generation`.
73357335+ * Number of partial images to generate in streaming mode, from 0 (default value) to 3.
73367336 *
73377337 */
73387338- type: 'image_generation';
73387338+ partial_images?: number;
73397339};
7340734073417341/**
···73467346 */
73477347export type ImageGenToolCall = {
73487348 /**
73497349- * The unique ID of the image generation call.
73497349+ * The type of the image generation call. Always `image_generation_call`.
73507350 *
73517351 */
73527352- id: string;
73527352+ type: 'image_generation_call';
73537353 /**
73547354- * The generated image encoded in base64.
73547354+ * The unique ID of the image generation call.
73557355 *
73567356 */
73577357- result: string;
73577357+ id: string;
73587358 /**
73597359 * The status of the image generation call.
73607360 *
73617361 */
73627362 status: 'in_progress' | 'completed' | 'generating' | 'failed';
73637363 /**
73647364- * The type of the image generation call. Always `image_generation_call`.
73647364+ * The generated image encoded in base64.
73657365 *
73667366 */
73677367- type: 'image_generation_call';
73677367+ result: string;
73687368};
7369736973707370/**
···73947394 */
73957395export type ImagesResponse = {
73967396 /**
73977397- * The background parameter used for the image generation. Either `transparent` or `opaque`.
73987398- */
73997399- background?: 'transparent' | 'opaque';
74007400- /**
74017397 * The Unix timestamp (in seconds) of when the image was created.
74027398 */
74037399 created: number;
···74067402 */
74077403 data?: Array<Image>;
74087404 /**
74057405+ * The background parameter used for the image generation. Either `transparent` or `opaque`.
74067406+ */
74077407+ background?: 'transparent' | 'opaque';
74087408+ /**
74097409 * The output format of the image generation. Either `png`, `webp`, or `jpeg`.
74107410 */
74117411 output_format?: 'png' | 'webp' | 'jpeg';
74127412 /**
74137413+ * The size of the image generated. Either `1024x1024`, `1024x1536`, or `1536x1024`.
74147414+ */
74157415+ size?: '1024x1024' | '1024x1536' | '1536x1024';
74167416+ /**
74137417 * The quality of the image generated. Either `low`, `medium`, or `high`.
74147418 */
74157419 quality?: 'low' | 'medium' | 'high';
74167416- /**
74177417- * The size of the image generated. Either `1024x1024`, `1024x1536`, or `1536x1024`.
74187418- */
74197419- size?: '1024x1024' | '1024x1536' | '1536x1024';
74207420 usage?: ImageGenUsage;
74217421};
74227422···74257425 *
74267426 */
74277427export type ImagesUsage = {
74287428+ /**
74297429+ * The total number of tokens (images and text) used for the image generation.
74307430+ *
74317431+ */
74327432+ total_tokens: number;
74287433 /**
74297434 * The number of tokens (images and text) in the input prompt.
74307435 */
74317436 input_tokens: number;
74327437 /**
74387438+ * The number of image tokens in the output image.
74397439+ */
74407440+ output_tokens: number;
74417441+ /**
74337442 * The input tokens detailed information for the image generation.
74347443 */
74357444 input_tokens_details: {
74367445 /**
74377437- * The number of image tokens in the input prompt.
74387438- */
74397439- image_tokens: number;
74407440- /**
74417446 * The number of text tokens in the input prompt.
74427447 */
74437448 text_tokens: number;
74497449+ /**
74507450+ * The number of image tokens in the input prompt.
74517451+ */
74527452+ image_tokens: number;
74447453 };
74457445- /**
74467446- * The number of image tokens in the output image.
74477447- */
74487448- output_tokens: number;
74497449- /**
74507450- * The total number of tokens (images and text) used for the image generation.
74517451- *
74527452- */
74537453- total_tokens: number;
74547454};
7455745574567456/**
···75077507 */
75087508export type InputAudio = {
75097509 /**
75107510+ * The type of the input item. Always `input_audio`.
75117511+ *
75127512+ */
75137513+ type: 'input_audio';
75147514+ /**
75107515 * Base64-encoded audio data.
75117516 *
75127517 */
···75177522 *
75187523 */
75197524 format: 'mp3' | 'wav';
75207520- /**
75217521- * The type of the input item. Always `input_audio`.
75227522- *
75237523- */
75247524- type: 'input_audio';
75257525};
7526752675277527export type InputContent =
···75557555 *
75567556 */
75577557export type InputMessage = {
75587558- content: InputMessageContentList;
75587558+ /**
75597559+ * The type of the message input. Always set to `message`.
75607560+ *
75617561+ */
75627562+ type?: 'message';
75597563 /**
75607564 * The role of the message input. One of `user`, `system`, or `developer`.
75617565 *
···75677571 *
75687572 */
75697573 status?: 'in_progress' | 'completed' | 'incomplete';
75707570- /**
75717571- * The type of the message input. Always set to `message`.
75727572- *
75737573- */
75747574- type?: 'message';
75747574+ content: InputMessageContentList;
75757575};
7576757675777577/**
···75967596 */
75977597export type Invite = {
75987598 /**
75997599- * The Unix timestamp (in seconds) of when the invite was accepted.
75997599+ * The object type, which is always `organization.invite`
76007600+ */
76017601+ object: 'organization.invite';
76027602+ /**
76037603+ * The identifier, which can be referenced in API endpoints
76007604 */
76017601- accepted_at?: number;
76057605+ id: string;
76027606 /**
76037607 * The email address of the individual to whom the invite was sent
76047608 */
76057609 email: string;
76067610 /**
76077607- * The Unix timestamp (in seconds) of when the invite expires.
76117611+ * `owner` or `reader`
76087612 */
76097609- expires_at: number;
76137613+ role: 'owner' | 'reader';
76107614 /**
76117611- * The identifier, which can be referenced in API endpoints
76157615+ * `accepted`,`expired`, or `pending`
76127616 */
76137613- id: string;
76177617+ status: 'accepted' | 'expired' | 'pending';
76147618 /**
76157619 * The Unix timestamp (in seconds) of when the invite was sent.
76167620 */
76177621 invited_at: number;
76187622 /**
76197619- * The object type, which is always `organization.invite`
76237623+ * The Unix timestamp (in seconds) of when the invite expires.
76247624+ */
76257625+ expires_at: number;
76267626+ /**
76277627+ * The Unix timestamp (in seconds) of when the invite was accepted.
76207628 */
76217621- object: 'organization.invite';
76297629+ accepted_at?: number;
76227630 /**
76237631 * The projects that were granted membership upon acceptance of the invite.
76247632 */
···76327640 */
76337641 role?: 'member' | 'owner';
76347642 }>;
76357635- /**
76367636- * `owner` or `reader`
76377637- */
76387638- role: 'owner' | 'reader';
76397639- /**
76407640- * `accepted`,`expired`, or `pending`
76417641- */
76427642- status: 'accepted' | 'expired' | 'pending';
76437643};
7644764476457645export type InviteDeleteResponse = {
76467646- deleted: boolean;
76477647- id: string;
76487646 /**
76497647 * The object type, which is always `organization.invite.deleted`
76507648 */
76517649 object: 'organization.invite.deleted';
76507650+ id: string;
76517651+ deleted: boolean;
76527652};
7653765376547654export type InviteListResponse = {
76557655+ /**
76567656+ * The object type, which is always `list`
76577657+ */
76587658+ object: 'list';
76557659 data: Array<Invite>;
76567660 /**
76577661 * The first `invite_id` in the retrieved `list`
76587662 */
76597663 first_id?: string;
76607664 /**
76617661- * The `has_more` property is used for pagination to indicate there are additional results.
76627662- */
76637663- has_more?: boolean;
76647664- /**
76657665 * The last `invite_id` in the retrieved `list`
76667666 */
76677667 last_id?: string;
76687668 /**
76697669- * The object type, which is always `list`
76697669+ * The `has_more` property is used for pagination to indicate there are additional results.
76707670 */
76717671- object: 'list';
76717671+ has_more?: boolean;
76727672};
7673767376747674export type InviteRequest = {
···76767676 * Send an email to this address
76777677 */
76787678 email: string;
76797679+ /**
76807680+ * `owner` or `reader`
76817681+ */
76827682+ role: 'reader' | 'owner';
76797683 /**
76807684 * An array of projects to which membership is granted at the same time the org invite is accepted. If omitted, the user will be invited to the default project for compatibility with legacy behavior.
76817685 */
···76897693 */
76907694 role: 'member' | 'owner';
76917695 }>;
76927692- /**
76937693- * `owner` or `reader`
76947694- */
76957695- role: 'reader' | 'owner';
76967696};
7697769776987698/**
···78207820 */
78217821export type KeyPress = {
78227822 /**
78237823+ * Specifies the event type. For a keypress action, this property is
78247824+ * always set to `keypress`.
78257825+ *
78267826+ */
78277827+ type: 'keypress';
78287828+ /**
78237829 * The combination of keys the model is requesting to be pressed. This is an
78247830 * array of strings, each representing a key.
78257831 *
78267832 */
78277833 keys: Array<string>;
78287828- /**
78297829- * Specifies the event type. For a keypress action, this property is
78307830- * always set to `keypress`.
78317831- *
78327832- */
78337833- type: 'keypress';
78347834};
7835783578367836export type ListAssistantsResponse = {
78377837+ object: string;
78377838 data: Array<AssistantObject>;
78387839 first_id: string;
78397839- has_more: boolean;
78407840 last_id: string;
78417841- object: string;
78417841+ has_more: boolean;
78427842};
7843784378447844export type ListAuditLogsResponse = {
78457845+ object: 'list';
78457846 data: Array<AuditLog>;
78467847 first_id: string;
78487848+ last_id: string;
78477849 has_more: boolean;
78487848- last_id: string;
78497849- object: 'list';
78507850};
7851785178527852export type ListBatchesResponse = {
78537853 data: Array<Batch>;
78547854 first_id?: string;
78557855- has_more: boolean;
78567855 last_id?: string;
78567856+ has_more: boolean;
78577857 object: 'list';
78587858};
7859785978607860export type ListCertificatesResponse = {
78617861 data: Array<Certificate>;
78627862 first_id?: string;
78637863+ last_id?: string;
78637864 has_more: boolean;
78647864- last_id?: string;
78657865 object: 'list';
78667866};
7867786778687868export type ListFilesResponse = {
78697869+ object: string;
78697870 data: Array<OpenAiFile>;
78707871 first_id: string;
78717871- has_more: boolean;
78727872 last_id: string;
78737873- object: string;
78737873+ has_more: boolean;
78747874};
7875787578767876export type ListFineTuningCheckpointPermissionResponse = {
78777877 data: Array<FineTuningCheckpointPermission>;
78787878+ object: 'list';
78787879 first_id?: string;
78797879- has_more: boolean;
78807880 last_id?: string;
78817881- object: 'list';
78817881+ has_more: boolean;
78827882};
7883788378847884export type ListFineTuningJobCheckpointsResponse = {
78857885 data: Array<FineTuningJobCheckpoint>;
78867886+ object: 'list';
78867887 first_id?: string;
78877887- has_more: boolean;
78887888 last_id?: string;
78897889- object: 'list';
78897889+ has_more: boolean;
78907890};
7891789178927892export type ListFineTuningJobEventsResponse = {
78937893 data: Array<FineTuningJobEvent>;
78947894- has_more: boolean;
78957894 object: 'list';
78957895+ has_more: boolean;
78967896};
7897789778987898export type ListMessagesResponse = {
78997899+ object: string;
78997900 data: Array<MessageObject>;
79007901 first_id: string;
79017901- has_more: boolean;
79027902 last_id: string;
79037903- object: string;
79037903+ has_more: boolean;
79047904};
7905790579067906export type ListModelsResponse = {
79077907- data: Array<Model>;
79087907 object: 'list';
79087908+ data: Array<Model>;
79097909};
7910791079117911export type ListPaginatedFineTuningJobsResponse = {
···79157915};
7916791679177917export type ListRunStepsResponse = {
79187918+ object: string;
79187919 data: Array<RunStepObject>;
79197920 first_id: string;
79207920- has_more: boolean;
79217921 last_id: string;
79227922- object: string;
79227922+ has_more: boolean;
79237923};
7924792479257925export type ListRunsResponse = {
79267926+ object: string;
79267927 data: Array<RunObject>;
79277928 first_id: string;
79297929+ last_id: string;
79287930 has_more: boolean;
79297929- last_id: string;
79307930- object: string;
79317931};
7932793279337933export type ListVectorStoreFilesResponse = {
79347934+ object: string;
79347935 data: Array<VectorStoreFileObject>;
79357936 first_id: string;
79377937+ last_id: string;
79367938 has_more: boolean;
79377937- last_id: string;
79387938- object: string;
79397939};
7940794079417941export type ListVectorStoresResponse = {
79427942+ object: string;
79427943 data: Array<VectorStoreObject>;
79437944 first_id: string;
79447944- has_more: boolean;
79457945 last_id: string;
79467946- object: string;
79467946+ has_more: boolean;
79477947};
7948794879497949/**
···79547954 */
79557955export type LocalShellExecAction = {
79567956 /**
79577957- * The command to run.
79577957+ * The type of the local shell action. Always `exec`.
79587958 *
79597959 */
79607960- command: Array<string>;
79607960+ type: 'exec';
79617961 /**
79627962- * Environment variables to set for the command.
79627962+ * The command to run.
79637963 *
79647964 */
79657965- env: {
79667966- [key: string]: string;
79677967- };
79657965+ command: Array<string>;
79687966 /**
79697967 * Optional timeout in milliseconds for the command.
79707968 *
79717969 */
79727970 timeout_ms?: number;
79737971 /**
79747974- * The type of the local shell action. Always `exec`.
79727972+ * Optional working directory to run the command in.
79757973 *
79767974 */
79777977- type: 'exec';
79757975+ working_directory?: string;
79787976 /**
79797979- * Optional user to run the command as.
79777977+ * Environment variables to set for the command.
79807978 *
79817979 */
79827982- user?: string;
79807980+ env: {
79817981+ [key: string]: string;
79827982+ };
79837983 /**
79847984- * Optional working directory to run the command in.
79847984+ * Optional user to run the command as.
79857985 *
79867986 */
79877987- working_directory?: string;
79877987+ user?: string;
79887988};
7989798979907990/**
···80078007 *
80088008 */
80098009export type LocalShellToolCall = {
80108010- action: LocalShellExecAction;
80118010 /**
80128012- * The unique ID of the local shell tool call generated by the model.
80118011+ * The type of the local shell call. Always `local_shell_call`.
80138012 *
80148013 */
80158015- call_id: string;
80148014+ type: 'local_shell_call';
80168015 /**
80178016 * The unique ID of the local shell call.
80188017 *
80198018 */
80208019 id: string;
80218020 /**
80228022- * The status of the local shell call.
80218021+ * The unique ID of the local shell tool call generated by the model.
80238022 *
80248023 */
80258025- status: 'in_progress' | 'completed' | 'incomplete';
80248024+ call_id: string;
80258025+ action: LocalShellExecAction;
80268026 /**
80278027- * The type of the local shell call. Always `local_shell_call`.
80278027+ * The status of the local shell call.
80288028 *
80298029 */
80308030- type: 'local_shell_call';
80308030+ status: 'in_progress' | 'completed' | 'incomplete';
80318031};
8032803280338033/**
···80378037 *
80388038 */
80398039export type LocalShellToolCallOutput = {
80408040+ /**
80418041+ * The type of the local shell tool call output. Always `local_shell_call_output`.
80428042+ *
80438043+ */
80448044+ type: 'local_shell_call_output';
80408045 /**
80418046 * The unique ID of the local shell tool call generated by the model.
80428047 *
···80528057 *
80538058 */
80548059 status?: 'in_progress' | 'completed' | 'incomplete';
80558055- /**
80568056- * The type of the local shell tool call output. Always `local_shell_call_output`.
80578057- *
80588058- */
80598059- type: 'local_shell_call_output';
80608060};
8061806180628062/**
···80658065 */
80668066export type LogProbProperties = {
80678067 /**
80688068- * The bytes that were used to generate the log probability.
80688068+ * The token that was used to generate the log probability.
80698069 *
80708070 */
80718071- bytes: Array<number>;
80718071+ token: string;
80728072 /**
80738073 * The log probability of the token.
80748074 *
80758075 */
80768076 logprob: number;
80778077 /**
80788078- * The token that was used to generate the log probability.
80788078+ * The bytes that were used to generate the log probability.
80798079 *
80808080 */
80818081- token: string;
80818081+ bytes: Array<number>;
80828082};
8083808380848084/**
···80898089 */
80908090export type McpApprovalRequest = {
80918091 /**
80928092- * A JSON string of arguments for the tool.
80928092+ * The type of the item. Always `mcp_approval_request`.
80938093 *
80948094 */
80958095- arguments: string;
80958095+ type: 'mcp_approval_request';
80968096 /**
80978097 * The unique ID of the approval request.
80988098 *
80998099 */
81008100 id: string;
81018101 /**
81028102- * The name of the tool to run.
81028102+ * The label of the MCP server making the request.
81038103 *
81048104 */
81058105- name: string;
81058105+ server_label: string;
81068106 /**
81078107- * The label of the MCP server making the request.
81078107+ * The name of the tool to run.
81088108 *
81098109 */
81108110- server_label: string;
81108110+ name: string;
81118111 /**
81128112- * The type of the item. Always `mcp_approval_request`.
81128112+ * A JSON string of arguments for the tool.
81138113 *
81148114 */
81158115- type: 'mcp_approval_request';
81158115+ arguments: string;
81168116};
8117811781188118/**
···81238123 */
81248124export type McpApprovalResponse = {
81258125 /**
81268126+ * The type of the item. Always `mcp_approval_response`.
81278127+ *
81288128+ */
81298129+ type: 'mcp_approval_response';
81308130+ /**
81318131+ * The unique ID of the approval response
81328132+ *
81338133+ */
81348134+ id?: string;
81358135+ /**
81268136 * The ID of the approval request being answered.
81278137 *
81288138 */
···81338143 */
81348144 approve: boolean;
81358145 /**
81368136- * The unique ID of the approval response
81378137- *
81388138- */
81398139- id?: string;
81408140- /**
81418146 * Optional reason for the decision.
81428147 *
81438148 */
81448149 reason?: string;
81458145- /**
81468146- * The type of the item. Always `mcp_approval_response`.
81478147- *
81488148- */
81498149- type: 'mcp_approval_response';
81508150};
8151815181528152/**
···81578157 */
81588158export type McpApprovalResponseResource = {
81598159 /**
81608160+ * The type of the item. Always `mcp_approval_response`.
81618161+ *
81628162+ */
81638163+ type: 'mcp_approval_response';
81648164+ /**
81658165+ * The unique ID of the approval response
81668166+ *
81678167+ */
81688168+ id: string;
81698169+ /**
81608170 * The ID of the approval request being answered.
81618171 *
81628172 */
···81678177 */
81688178 approve: boolean;
81698179 /**
81708170- * The unique ID of the approval response
81718171- *
81728172- */
81738173- id: string;
81748174- /**
81758180 * Optional reason for the decision.
81768181 *
81778182 */
81788183 reason?: string;
81798179- /**
81808180- * The type of the item. Always `mcp_approval_response`.
81818181- *
81828182- */
81838183- type: 'mcp_approval_response';
81848184};
8185818581868186/**
···81918191 */
81928192export type McpListTools = {
81938193 /**
81948194- * Error message if the server could not list tools.
81948194+ * The type of the item. Always `mcp_list_tools`.
81958195 *
81968196 */
81978197- error?: string;
81978197+ type: 'mcp_list_tools';
81988198 /**
81998199 * The unique ID of the list.
82008200 *
···82118211 */
82128212 tools: Array<McpListToolsTool>;
82138213 /**
82148214- * The type of the item. Always `mcp_list_tools`.
82148214+ * Error message if the server could not list tools.
82158215 *
82168216 */
82178217- type: 'mcp_list_tools';
82178217+ error?: string;
82188218};
8219821982208220/**
···82258225 */
82268226export type McpListToolsTool = {
82278227 /**
82288228- * Additional annotations about the tool.
82288228+ * The name of the tool.
82298229 *
82308230 */
82318231- annotations?: {
82328232- [key: string]: unknown;
82338233- };
82318231+ name: string;
82348232 /**
82358233 * The description of the tool.
82368234 *
···82448242 [key: string]: unknown;
82458243 };
82468244 /**
82478247- * The name of the tool.
82458245+ * Additional annotations about the tool.
82488246 *
82498247 */
82508250- name: string;
82488248+ annotations?: {
82498249+ [key: string]: unknown;
82508250+ };
82518251};
8252825282538253/**
···82598259 */
82608260export type McpTool = {
82618261 /**
82628262+ * The type of the MCP tool. Always `mcp`.
82638263+ */
82648264+ type: 'mcp';
82658265+ /**
82668266+ * A label for this MCP server, used to identify it in tool calls.
82678267+ *
82688268+ */
82698269+ server_label: string;
82708270+ /**
82718271+ * The URL for the MCP server.
82728272+ *
82738273+ */
82748274+ server_url: string;
82758275+ /**
82768276+ * Optional description of the MCP server, used to provide more context.
82778277+ *
82788278+ */
82798279+ server_description?: string;
82808280+ /**
82818281+ * Optional HTTP headers to send to the MCP server. Use for authentication
82828282+ * or other purposes.
82838283+ *
82848284+ */
82858285+ headers?: {
82868286+ [key: string]: string;
82878287+ };
82888288+ /**
82628289 * List of allowed tool names or a filter object.
82638290 *
82648291 */
···82728299 */
82738300 tool_names?: Array<string>;
82748301 };
82758275- /**
82768276- * Optional HTTP headers to send to the MCP server. Use for authentication
82778277- * or other purposes.
82788278- *
82798279- */
82808280- headers?: {
82818281- [key: string]: string;
82828282- };
82838302 /**
82848303 * Specify which of the MCP server's tools require approval.
82858304 */
···83088327 }
83098328 | 'always'
83108329 | 'never';
83118311- /**
83128312- * Optional description of the MCP server, used to provide more context.
83138313- *
83148314- */
83158315- server_description?: string;
83168316- /**
83178317- * A label for this MCP server, used to identify it in tool calls.
83188318- *
83198319- */
83208320- server_label: string;
83218321- /**
83228322- * The URL for the MCP server.
83238323- *
83248324- */
83258325- server_url: string;
83268326- /**
83278327- * The type of the MCP tool. Always `mcp`.
83288328- */
83298329- type: 'mcp';
83308330};
8331833183328332/**
···83378337 */
83388338export type McpToolCall = {
83398339 /**
83408340- * A JSON string of the arguments passed to the tool.
83408340+ * The type of the item. Always `mcp_call`.
83418341 *
83428342 */
83438343- arguments: string;
83438343+ type: 'mcp_call';
83448344 /**
83458345- * The error from the tool call, if any.
83458345+ * The unique ID of the tool call.
83468346 *
83478347 */
83488348- error?: string;
83488348+ id: string;
83498349 /**
83508350- * The unique ID of the tool call.
83508350+ * The label of the MCP server running the tool.
83518351 *
83528352 */
83538353- id: string;
83538353+ server_label: string;
83548354 /**
83558355 * The name of the tool that was run.
83568356 *
83578357 */
83588358 name: string;
83598359 /**
83608360- * The output from the tool call.
83608360+ * A JSON string of the arguments passed to the tool.
83618361 *
83628362 */
83638363- output?: string;
83638363+ arguments: string;
83648364 /**
83658365- * The label of the MCP server running the tool.
83658365+ * The output from the tool call.
83668366 *
83678367 */
83688368- server_label: string;
83688368+ output?: string;
83698369 /**
83708370- * The type of the item. Always `mcp_call`.
83708370+ * The error from the tool call, if any.
83718371 *
83728372 */
83738373- type: 'mcp_call';
83738373+ error?: string;
83748374};
8375837583768376/**
···83798379 * References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message.
83808380 */
83818381export type MessageContentImageFileObject = {
83828382+ /**
83838383+ * Always `image_file`.
83848384+ */
83858385+ type: 'image_file';
83828386 image_file: {
83878387+ /**
83888388+ * The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content.
83898389+ */
83908390+ file_id: string;
83838391 /**
83848392 * Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`.
83858393 */
83868394 detail?: 'auto' | 'low' | 'high';
83878387- /**
83888388- * The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content.
83898389- */
83908390- file_id: string;
83918395 };
83928392- /**
83938393- * Always `image_file`.
83948394- */
83958395- type: 'image_file';
83968396};
8397839783988398/**
···84018401 * References an image URL in the content of a message.
84028402 */
84038403export type MessageContentImageUrlObject = {
84048404+ /**
84058405+ * The type of the content part.
84068406+ */
84078407+ type: 'image_url';
84048408 image_url: {
84058409 /**
84108410+ * The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp.
84118411+ */
84128412+ url: string;
84138413+ /**
84068414 * Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto`
84078415 */
84088416 detail?: 'auto' | 'low' | 'high';
84098409- /**
84108410- * The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp.
84118411- */
84128412- url: string;
84138417 };
84148414- /**
84158415- * The type of the content part.
84168416- */
84178417- type: 'image_url';
84188418};
8419841984208420/**
···84238423 * The refusal content generated by the assistant.
84248424 */
84258425export type MessageContentRefusalObject = {
84268426- refusal: string;
84278426 /**
84288427 * Always `refusal`.
84298428 */
84308429 type: 'refusal';
84308430+ refusal: string;
84318431};
8432843284338433/**
···84368436 * A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.
84378437 */
84388438export type MessageContentTextAnnotationsFileCitationObject = {
84398439- end_index: number;
84398439+ /**
84408440+ * Always `file_citation`.
84418441+ */
84428442+ type: 'file_citation';
84438443+ /**
84448444+ * The text in the message content that needs to be replaced.
84458445+ */
84468446+ text: string;
84408447 file_citation: {
84418448 /**
84428449 * The ID of the specific File the citation is from.
···84448451 file_id: string;
84458452 };
84468453 start_index: number;
84478447- /**
84488448- * The text in the message content that needs to be replaced.
84498449- */
84508450- text: string;
84518451- /**
84528452- * Always `file_citation`.
84538453- */
84548454- type: 'file_citation';
84548454+ end_index: number;
84558455};
8456845684578457/**
···84608460 * A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file.
84618461 */
84628462export type MessageContentTextAnnotationsFilePathObject = {
84638463- end_index: number;
84638463+ /**
84648464+ * Always `file_path`.
84658465+ */
84668466+ type: 'file_path';
84678467+ /**
84688468+ * The text in the message content that needs to be replaced.
84698469+ */
84708470+ text: string;
84648471 file_path: {
84658472 /**
84668473 * The ID of the file that was generated.
···84688475 file_id: string;
84698476 };
84708477 start_index: number;
84718471- /**
84728472- * The text in the message content that needs to be replaced.
84738473- */
84748474- text: string;
84758475- /**
84768476- * Always `file_path`.
84778477- */
84788478- type: 'file_path';
84788478+ end_index: number;
84798479};
8480848084818481/**
···84848484 * The text content that is part of a message.
84858485 */
84868486export type MessageContentTextObject = {
84878487+ /**
84888488+ * Always `text`.
84898489+ */
84908490+ type: 'text';
84878491 text: {
84888488- annotations: Array<TextAnnotation>;
84898492 /**
84908493 * The data that makes up the text.
84918494 */
84928495 value: string;
84968496+ annotations: Array<TextAnnotation>;
84938497 };
84948494- /**
84958495- * Always `text`.
84968496- */
84978497- type: 'text';
84988498};
8499849985008500/**
···85038503 * References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message.
85048504 */
85058505export type MessageDeltaContentImageFileObject = {
85068506- image_file?: {
85078507- /**
85088508- * Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`.
85098509- */
85108510- detail?: 'auto' | 'low' | 'high';
85118511- /**
85128512- * The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content.
85138513- */
85148514- file_id?: string;
85158515- };
85168506 /**
85178507 * The index of the content part in the message.
85188508 */
···85218511 * Always `image_file`.
85228512 */
85238513 type: 'image_file';
85148514+ image_file?: {
85158515+ /**
85168516+ * The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content.
85178517+ */
85188518+ file_id?: string;
85198519+ /**
85208520+ * Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`.
85218521+ */
85228522+ detail?: 'auto' | 'low' | 'high';
85238523+ };
85248524};
8525852585268526/**
···85298529 * References an image URL in the content of a message.
85308530 */
85318531export type MessageDeltaContentImageUrlObject = {
85328532- image_url?: {
85338533- /**
85348534- * Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`.
85358535- */
85368536- detail?: 'auto' | 'low' | 'high';
85378537- /**
85388538- * The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp.
85398539- */
85408540- url?: string;
85418541- };
85428532 /**
85438533 * The index of the content part in the message.
85448534 */
···85478537 * Always `image_url`.
85488538 */
85498539 type: 'image_url';
85408540+ image_url?: {
85418541+ /**
85428542+ * The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp.
85438543+ */
85448544+ url?: string;
85458545+ /**
85468546+ * Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`.
85478547+ */
85488548+ detail?: 'auto' | 'low' | 'high';
85498549+ };
85508550};
8551855185528552/**
···85598559 * The index of the refusal part in the message.
85608560 */
85618561 index: number;
85628562- refusal?: string;
85638562 /**
85648563 * Always `refusal`.
85658564 */
85668565 type: 'refusal';
85668566+ refusal?: string;
85678567};
8568856885698569/**
···85728572 * A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files.
85738573 */
85748574export type MessageDeltaContentTextAnnotationsFileCitationObject = {
85758575- end_index?: number;
85758575+ /**
85768576+ * The index of the annotation in the text content part.
85778577+ */
85788578+ index: number;
85798579+ /**
85808580+ * Always `file_citation`.
85818581+ */
85828582+ type: 'file_citation';
85838583+ /**
85848584+ * The text in the message content that needs to be replaced.
85858585+ */
85868586+ text?: string;
85768587 file_citation?: {
85778588 /**
85788589 * The ID of the specific File the citation is from.
···85838594 */
85848595 quote?: string;
85858596 };
85868586- /**
85878587- * The index of the annotation in the text content part.
85888588- */
85898589- index: number;
85908597 start_index?: number;
85918591- /**
85928592- * The text in the message content that needs to be replaced.
85938593- */
85948594- text?: string;
85958595- /**
85968596- * Always `file_citation`.
85978597- */
85988598- type: 'file_citation';
85988598+ end_index?: number;
85998599};
8600860086018601/**
···86048604 * A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file.
86058605 */
86068606export type MessageDeltaContentTextAnnotationsFilePathObject = {
86078607- end_index?: number;
86088608- file_path?: {
86098609- /**
86108610- * The ID of the file that was generated.
86118611- */
86128612- file_id?: string;
86138613- };
86148607 /**
86158608 * The index of the annotation in the text content part.
86168609 */
86178610 index: number;
86188618- start_index?: number;
86118611+ /**
86128612+ * Always `file_path`.
86138613+ */
86148614+ type: 'file_path';
86198615 /**
86208616 * The text in the message content that needs to be replaced.
86218617 */
86228618 text?: string;
86238623- /**
86248624- * Always `file_path`.
86258625- */
86268626- type: 'file_path';
86198619+ file_path?: {
86208620+ /**
86218621+ * The ID of the file that was generated.
86228622+ */
86238623+ file_id?: string;
86248624+ };
86258625+ start_index?: number;
86268626+ end_index?: number;
86278627};
8628862886298629/**
···86368636 * The index of the content part in the message.
86378637 */
86388638 index: number;
86398639+ /**
86408640+ * Always `text`.
86418641+ */
86428642+ type: 'text';
86398643 text?: {
86408640- annotations?: Array<TextAnnotationDelta>;
86418644 /**
86428645 * The data that makes up the text.
86438646 */
86448647 value?: string;
86488648+ annotations?: Array<TextAnnotationDelta>;
86458649 };
86468646- /**
86478647- * Always `text`.
86488648- */
86498649- type: 'text';
86508650};
8651865186528652/**
···86578657 */
86588658export type MessageDeltaObject = {
86598659 /**
86608660+ * The identifier of the message, which can be referenced in API endpoints.
86618661+ */
86628662+ id: string;
86638663+ /**
86648664+ * The object type, which is always `thread.message.delta`.
86658665+ */
86668666+ object: 'thread.message.delta';
86678667+ /**
86608668 * The delta containing the fields that have changed on the Message.
86618669 */
86628670 delta: {
86638671 /**
86728672+ * The entity that produced the message. One of `user` or `assistant`.
86738673+ */
86748674+ role?: 'user' | 'assistant';
86758675+ /**
86648676 * The content of the message in array of text and/or images.
86658677 */
86668678 content?: Array<MessageContentDelta>;
86678667- /**
86688668- * The entity that produced the message. One of `user` or `assistant`.
86698669- */
86708670- role?: 'user' | 'assistant';
86718679 };
86728672- /**
86738673- * The identifier of the message, which can be referenced in API endpoints.
86748674- */
86758675- id: string;
86768676- /**
86778677- * The object type, which is always `thread.message.delta`.
86788678- */
86798679- object: 'thread.message.delta';
86808680};
8681868186828682/**
···86868686 */
86878687export type MessageObject = {
86888688 /**
86898689- * If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) that authored this message.
86898689+ * The identifier, which can be referenced in API endpoints.
86908690 */
86918691- assistant_id: string;
86928692- /**
86938693- * A list of files attached to the message, and the tools they were added to.
86948694- */
86958695- attachments: Array<{
86968696- /**
86978697- * The ID of the file to attach to the message.
86988698- */
86998699- file_id?: string;
87008700- /**
87018701- * The tools to add this file to.
87028702- */
87038703- tools?: Array<AssistantToolsCode | AssistantToolsFileSearchTypeOnly>;
87048704- }>;
87058705- /**
87068706- * The Unix timestamp (in seconds) for when the message was completed.
87078707- */
87088708- completed_at: number;
86918691+ id: string;
87098692 /**
87108710- * The content of the message in array of text and/or images.
86938693+ * The object type, which is always `thread.message`.
87118694 */
87128712- content: Array<MessageContent>;
86958695+ object: 'thread.message';
87138696 /**
87148697 * The Unix timestamp (in seconds) for when the message was created.
87158698 */
87168699 created_at: number;
87178700 /**
87188718- * The identifier, which can be referenced in API endpoints.
87018701+ * The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to.
87198702 */
87208720- id: string;
87038703+ thread_id: string;
87218704 /**
87228722- * The Unix timestamp (in seconds) for when the message was marked as incomplete.
87058705+ * The status of the message, which can be either `in_progress`, `incomplete`, or `completed`.
87238706 */
87248724- incomplete_at: number;
87078707+ status: 'in_progress' | 'incomplete' | 'completed';
87258708 /**
87268709 * On an incomplete message, details about why the message is incomplete.
87278710 */
···87368719 | 'run_expired'
87378720 | 'run_failed';
87388721 };
87398739- metadata: Metadata;
87408722 /**
87418741- * The object type, which is always `thread.message`.
87238723+ * The Unix timestamp (in seconds) for when the message was completed.
87428724 */
87438743- object: 'thread.message';
87258725+ completed_at: number;
87268726+ /**
87278727+ * The Unix timestamp (in seconds) for when the message was marked as incomplete.
87288728+ */
87298729+ incomplete_at: number;
87448730 /**
87458731 * The entity that produced the message. One of `user` or `assistant`.
87468732 */
87478733 role: 'user' | 'assistant';
87488734 /**
87498749- * The ID of the [run](https://platform.openai.com/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints.
87358735+ * The content of the message in array of text and/or images.
87508736 */
87518751- run_id: string;
87378737+ content: Array<MessageContent>;
87528738 /**
87538753- * The status of the message, which can be either `in_progress`, `incomplete`, or `completed`.
87398739+ * If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) that authored this message.
87548740 */
87558755- status: 'in_progress' | 'incomplete' | 'completed';
87418741+ assistant_id: string;
87568742 /**
87578757- * The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to.
87438743+ * The ID of the [run](https://platform.openai.com/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints.
87588744 */
87598759- thread_id: string;
87458745+ run_id: string;
87468746+ /**
87478747+ * A list of files attached to the message, and the tools they were added to.
87488748+ */
87498749+ attachments: Array<{
87508750+ /**
87518751+ * The ID of the file to attach to the message.
87528752+ */
87538753+ file_id?: string;
87548754+ /**
87558755+ * The tools to add this file to.
87568756+ */
87578757+ tools?: Array<AssistantToolsCode | AssistantToolsFileSearchTypeOnly>;
87588758+ }>;
87598759+ metadata: Metadata;
87608760};
8761876187628762/**
···87668766 */
87678767export type MessageRequestContentTextObject = {
87688768 /**
87698769+ * Always `text`.
87708770+ */
87718771+ type: 'text';
87728772+ /**
87698773 * Text content to be sent to the model
87708774 */
87718775 text: string;
87728772- /**
87738773- * Always `text`.
87748774- */
87758775- type: 'text';
87768776};
8777877787788778export type MessageStreamEvent =
87798779 | {
87808780+ event: 'thread.message.created';
87808781 data: MessageObject;
87818781- event: 'thread.message.created';
87828782 }
87838783 | {
87848784- data: MessageObject;
87858784 event: 'thread.message.in_progress';
87858785+ data: MessageObject;
87868786 }
87878787 | {
87888788+ event: 'thread.message.delta';
87888789 data: MessageDeltaObject;
87898789- event: 'thread.message.delta';
87908790 }
87918791 | {
87928792- data: MessageObject;
87938792 event: 'thread.message.completed';
87938793+ data: MessageObject;
87948794 }
87958795 | {
87968796- data: MessageObject;
87978796 event: 'thread.message.incomplete';
87978797+ data: MessageObject;
87988798 };
8799879988008800/**
···88178817 */
88188818export type Model = {
88198819 /**
88208820- * The Unix timestamp (in seconds) when the model was created.
88218821- */
88228822- created: number;
88238823- /**
88248820 * The model identifier, which can be referenced in the API endpoints.
88258821 */
88268822 id: string;
88238823+ /**
88248824+ * The Unix timestamp (in seconds) when the model was created.
88258825+ */
88268826+ created: number;
88278827 /**
88288828 * The object type, which is always "model".
88298829 */
···88548854export type ModelResponseProperties = {
88558855 metadata?: Metadata;
88568856 /**
88578857- * Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
88588858- *
88598859- */
88608860- prompt_cache_key?: string;
88618861- /**
88628862- * A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.
88638863- * The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
88578857+ * An integer between 0 and 20 specifying the number of most likely tokens to
88588858+ * return at each token position, each with an associated log probability.
88648859 *
88658860 */
88668866- safety_identifier?: string;
88678867- service_tier?: ServiceTier;
88618861+ top_logprobs?: number;
88688862 /**
88698863 * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
88708864 * We generally recommend altering this or `top_p` but not both.
88718865 *
88728866 */
88738867 temperature?: number;
88748874- /**
88758875- * An integer between 0 and 20 specifying the number of most likely tokens to
88768876- * return at each token position, each with an associated log probability.
88778877- *
88788878- */
88798879- top_logprobs?: number;
88808868 /**
88818869 * An alternative to sampling with temperature, called nucleus sampling,
88828870 * where the model considers the results of the tokens with top_p probability
···88968884 * @deprecated
88978885 */
88988886 user?: string;
88998899-};
89008900-89018901-export type ModifyAssistantRequest = {
89028887 /**
89038903- * The description of the assistant. The maximum length is 512 characters.
88888888+ * A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.
88898889+ * The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
89048890 *
89058891 */
89068906- description?: string;
88928892+ safety_identifier?: string;
89078893 /**
89088908- * The system instructions that the assistant uses. The maximum length is 256,000 characters.
88948894+ * Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
89098895 *
89108896 */
89118911- instructions?: string;
89128912- metadata?: Metadata;
88978897+ prompt_cache_key?: string;
88988898+ service_tier?: ServiceTier;
88998899+};
89008900+89018901+export type ModifyAssistantRequest = {
89138902 /**
89148903 * ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them.
89158904 *
89168905 */
89178906 model?: string | AssistantSupportedModels;
89078907+ reasoning_effort?: ReasoningEffort;
89188908 /**
89198909 * The name of the assistant. The maximum length is 256 characters.
89208910 *
89218911 */
89228912 name?: string;
89238923- reasoning_effort?: ReasoningEffort;
89248924- response_format?: AssistantsApiResponseFormatOption;
89138913+ /**
89148914+ * The description of the assistant. The maximum length is 512 characters.
89158915+ *
89168916+ */
89178917+ description?: string;
89188918+ /**
89198919+ * The system instructions that the assistant uses. The maximum length is 256,000 characters.
89208920+ *
89218921+ */
89228922+ instructions?: string;
89258923 /**
89268926- * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
89248924+ * A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`.
89278925 *
89288926 */
89298929- temperature?: number;
89278927+ tools?: Array<AssistantTool>;
89308928 /**
89318929 * A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.
89328930 *
···89478945 vector_store_ids?: Array<string>;
89488946 };
89498947 };
89488948+ metadata?: Metadata;
89508949 /**
89518951- * A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`.
89508950+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
89528951 *
89538952 */
89548954- tools?: Array<AssistantTool>;
89538953+ temperature?: number;
89558954 /**
89568955 * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
89578956 *
···89598958 *
89608959 */
89618960 top_p?: number;
89618961+ response_format?: AssistantsApiResponseFormatOption;
89628962};
8963896389648964export type ModifyCertificateRequest = {
···89778977};
8978897889798979export type ModifyThreadRequest = {
89808980- metadata?: Metadata;
89818980 /**
89828981 * A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.
89838982 *
···89988997 vector_store_ids?: Array<string>;
89998998 };
90008999 };
90009000+ metadata?: Metadata;
90019001};
9002900290039003/**
···90329032 */
90339033export type OpenAiFile = {
90349034 /**
90359035+ * The file identifier, which can be referenced in the API endpoints.
90369036+ */
90379037+ id: string;
90389038+ /**
90359039 * The size of the file, in bytes.
90369040 */
90379041 bytes: number;
···90479051 * The name of the file.
90489052 */
90499053 filename: string;
90509050- /**
90519051- * The file identifier, which can be referenced in the API endpoints.
90529052- */
90539053- id: string;
90549054 /**
90559055 * The object type, which is always `file`.
90569056 */
···91009100 *
91019101 */
91029102export type OutputAudio = {
91039103+ /**
91049104+ * The type of the output audio. Always `output_audio`.
91059105+ *
91069106+ */
91079107+ type: 'output_audio';
91039108 /**
91049109 * Base64-encoded audio data from the model.
91059110 *
···91109115 *
91119116 */
91129117 transcript: string;
91139113- /**
91149114- * The type of the output audio. Always `output_audio`.
91159115- *
91169116- */
91179117- type: 'output_audio';
91189118};
9119911991209120export type OutputContent =
···91749174 */
91759175export type OutputMessage = {
91769176 /**
91779177- * The content of the output message.
91779177+ * The unique ID of the output message.
91789178 *
91799179 */
91809180- content: Array<OutputContent>;
91809180+ id: string;
91819181 /**
91829182- * The unique ID of the output message.
91829182+ * The type of the output message. Always `message`.
91839183 *
91849184 */
91859185- id: string;
91859185+ type: 'message';
91869186 /**
91879187 * The role of the output message. Always `assistant`.
91889188 *
91899189 */
91909190 role: 'assistant';
91919191 /**
91929192+ * The content of the output message.
91939193+ *
91949194+ */
91959195+ content: Array<OutputContent>;
91969196+ /**
91929197 * The status of the message input. One of `in_progress`, `completed`, or
91939198 * `incomplete`. Populated when input items are returned via API.
91949199 *
91959200 */
91969201 status: 'in_progress' | 'completed' | 'incomplete';
91979197- /**
91989198- * The type of the output message. Always `message`.
91999199- *
92009200- */
92019201- type: 'message';
92029202};
9203920392049204/**
···92269226 */
92279227export type PredictionContent = {
92289228 /**
92299229+ * The type of the predicted content you want to provide. This type is
92309230+ * currently always `content`.
92319231+ *
92329232+ */
92339233+ type: 'content';
92349234+ /**
92299235 * The content that should be matched when generating a model response.
92309236 * If generated tokens would match this content, the entire model response
92319237 * can be returned much more quickly.
92329238 *
92339239 */
92349240 content: string | Array<ChatCompletionRequestMessageContentPartText>;
92359235- /**
92369236- * The type of the predicted content you want to provide. This type is
92379237- * currently always `content`.
92389238- *
92399239- */
92409240- type: 'content';
92419241};
9242924292439243/**
···92459245 */
92469246export type Project = {
92479247 /**
92489248- * The Unix timestamp (in seconds) of when the project was archived or `null`.
92489248+ * The identifier, which can be referenced in API endpoints
92499249 */
92509250- archived_at?: number;
92509250+ id: string;
92519251 /**
92529252- * The Unix timestamp (in seconds) of when the project was created.
92529252+ * The object type, which is always `organization.project`
92539253 */
92549254- created_at: number;
92559255- /**
92569256- * The identifier, which can be referenced in API endpoints
92579257- */
92589258- id: string;
92549254+ object: 'organization.project';
92599255 /**
92609256 * The name of the project. This appears in reporting.
92619257 */
92629258 name: string;
92639259 /**
92649264- * The object type, which is always `organization.project`
92609260+ * The Unix timestamp (in seconds) of when the project was created.
92659261 */
92669266- object: 'organization.project';
92629262+ created_at: number;
92639263+ /**
92649264+ * The Unix timestamp (in seconds) of when the project was archived or `null`.
92659265+ */
92669266+ archived_at?: number;
92679267 /**
92689268 * `active` or `archived`
92699269 */
···92759275 */
92769276export type ProjectApiKey = {
92779277 /**
92789278- * The Unix timestamp (in seconds) of when the API key was created
92799279- */
92809280- created_at: number;
92819281- /**
92829282- * The identifier, which can be referenced in API endpoints
92789278+ * The object type, which is always `organization.project.api_key`
92839279 */
92849284- id: string;
92809280+ object: 'organization.project.api_key';
92859281 /**
92869286- * The Unix timestamp (in seconds) of when the API key was last used.
92829282+ * The redacted value of the API key
92879283 */
92889288- last_used_at: number;
92849284+ redacted_value: string;
92899285 /**
92909286 * The name of the API key
92919287 */
92929288 name: string;
92939289 /**
92949294- * The object type, which is always `organization.project.api_key`
92909290+ * The Unix timestamp (in seconds) of when the API key was created
92919291+ */
92929292+ created_at: number;
92939293+ /**
92949294+ * The Unix timestamp (in seconds) of when the API key was last used.
92959295 */
92969296- object: 'organization.project.api_key';
92969296+ last_used_at: number;
92979297+ /**
92989298+ * The identifier, which can be referenced in API endpoints
92999299+ */
93009300+ id: string;
92979301 owner: {
92989298- service_account?: ProjectServiceAccount;
92999302 /**
93009303 * `user` or `service_account`
93019304 */
93029305 type?: 'user' | 'service_account';
93039306 user?: ProjectUser;
93079307+ service_account?: ProjectServiceAccount;
93049308 };
93059305- /**
93069306- * The redacted value of the API key
93079307- */
93089308- redacted_value: string;
93099309};
9310931093119311export type ProjectApiKeyDeleteResponse = {
93129312- deleted: boolean;
93139313- id: string;
93149312 object: 'organization.project.api_key.deleted';
93139313+ id: string;
93149314+ deleted: boolean;
93159315};
9316931693179317export type ProjectApiKeyListResponse = {
93189318+ object: 'list';
93189319 data: Array<ProjectApiKey>;
93199320 first_id: string;
93209320- has_more: boolean;
93219321 last_id: string;
93229322- object: 'list';
93229322+ has_more: boolean;
93239323};
9324932493259325export type ProjectCreateRequest = {
···93309330};
9331933193329332export type ProjectListResponse = {
93339333+ object: 'list';
93339334 data: Array<Project>;
93349335 first_id: string;
93359335- has_more: boolean;
93369336 last_id: string;
93379337- object: 'list';
93379337+ has_more: boolean;
93389338};
9339933993409340/**
···93429342 */
93439343export type ProjectRateLimit = {
93449344 /**
93459345- * The maximum batch input tokens per day. Only present for relevant models.
93459345+ * The object type, which is always `project.rate_limit`
93469346 */
93479347- batch_1_day_max_input_tokens?: number;
93479347+ object: 'project.rate_limit';
93489348 /**
93499349 * The identifier, which can be referenced in API endpoints.
93509350 */
93519351 id: string;
93529352 /**
93539353- * The maximum audio megabytes per minute. Only present for relevant models.
93549354- */
93559355- max_audio_megabytes_per_1_minute?: number;
93569356- /**
93579357- * The maximum images per minute. Only present for relevant models.
93539353+ * The model this rate limit applies to.
93589354 */
93599359- max_images_per_1_minute?: number;
93609360- /**
93619361- * The maximum requests per day. Only present for relevant models.
93629362- */
93639363- max_requests_per_1_day?: number;
93559355+ model: string;
93649356 /**
93659357 * The maximum requests per minute.
93669358 */
···93709362 */
93719363 max_tokens_per_1_minute: number;
93729364 /**
93739373- * The model this rate limit applies to.
93659365+ * The maximum images per minute. Only present for relevant models.
93749366 */
93759375- model: string;
93679367+ max_images_per_1_minute?: number;
93769368 /**
93779377- * The object type, which is always `project.rate_limit`
93699369+ * The maximum audio megabytes per minute. Only present for relevant models.
93789370 */
93799379- object: 'project.rate_limit';
93719371+ max_audio_megabytes_per_1_minute?: number;
93729372+ /**
93739373+ * The maximum requests per day. Only present for relevant models.
93749374+ */
93759375+ max_requests_per_1_day?: number;
93769376+ /**
93779377+ * The maximum batch input tokens per day. Only present for relevant models.
93789378+ */
93799379+ batch_1_day_max_input_tokens?: number;
93809380};
9381938193829382export type ProjectRateLimitListResponse = {
93839383+ object: 'list';
93839384 data: Array<ProjectRateLimit>;
93849385 first_id: string;
93869386+ last_id: string;
93859387 has_more: boolean;
93869386- last_id: string;
93879387- object: 'list';
93889388};
9389938993909390export type ProjectRateLimitUpdateRequest = {
93919391 /**
93929392- * The maximum batch input tokens per day. Only relevant for certain models.
93929392+ * The maximum requests per minute.
93939393 */
93949394- batch_1_day_max_input_tokens?: number;
93949394+ max_requests_per_1_minute?: number;
93959395 /**
93969396- * The maximum audio megabytes per minute. Only relevant for certain models.
93969396+ * The maximum tokens per minute.
93979397 */
93989398- max_audio_megabytes_per_1_minute?: number;
93989398+ max_tokens_per_1_minute?: number;
93999399 /**
94009400 * The maximum images per minute. Only relevant for certain models.
94019401 */
94029402 max_images_per_1_minute?: number;
94039403 /**
94049404+ * The maximum audio megabytes per minute. Only relevant for certain models.
94059405+ */
94069406+ max_audio_megabytes_per_1_minute?: number;
94079407+ /**
94049408 * The maximum requests per day. Only relevant for certain models.
94059409 */
94069410 max_requests_per_1_day?: number;
94079411 /**
94089408- * The maximum requests per minute.
94129412+ * The maximum batch input tokens per day. Only relevant for certain models.
94099413 */
94109410- max_requests_per_1_minute?: number;
94119411- /**
94129412- * The maximum tokens per minute.
94139413- */
94149414- max_tokens_per_1_minute?: number;
94149414+ batch_1_day_max_input_tokens?: number;
94159415};
9416941694179417/**
···94199419 */
94209420export type ProjectServiceAccount = {
94219421 /**
94229422- * The Unix timestamp (in seconds) of when the service account was created
94229422+ * The object type, which is always `organization.project.service_account`
94239423 */
94249424- created_at: number;
94249424+ object: 'organization.project.service_account';
94259425 /**
94269426 * The identifier, which can be referenced in API endpoints
94279427 */
···94319431 */
94329432 name: string;
94339433 /**
94349434- * The object type, which is always `organization.project.service_account`
94359435- */
94369436- object: 'organization.project.service_account';
94379437- /**
94389434 * `owner` or `member`
94399435 */
94409436 role: 'owner' | 'member';
94379437+ /**
94389438+ * The Unix timestamp (in seconds) of when the service account was created
94399439+ */
94409440+ created_at: number;
94419441};
9442944294439443export type ProjectServiceAccountApiKey = {
94449444- created_at: number;
94459445- id: string;
94469446- name: string;
94479444 /**
94489445 * The object type, which is always `organization.project.service_account.api_key`
94499446 */
94509447 object: 'organization.project.service_account.api_key';
94519448 value: string;
94499449+ name: string;
94509450+ created_at: number;
94519451+ id: string;
94529452};
9453945394549454export type ProjectServiceAccountCreateRequest = {
···94599459};
9460946094619461export type ProjectServiceAccountCreateResponse = {
94629462- api_key: ProjectServiceAccountApiKey;
94639463- created_at: number;
94629462+ object: 'organization.project.service_account';
94649463 id: string;
94659464 name: string;
94669466- object: 'organization.project.service_account';
94679465 /**
94689466 * Service accounts can only have one role of type `member`
94699467 */
94709468 role: 'member';
94699469+ created_at: number;
94709470+ api_key: ProjectServiceAccountApiKey;
94719471};
9472947294739473export type ProjectServiceAccountDeleteResponse = {
94749474- deleted: boolean;
94749474+ object: 'organization.project.service_account.deleted';
94759475 id: string;
94769476- object: 'organization.project.service_account.deleted';
94769476+ deleted: boolean;
94779477};
9478947894799479export type ProjectServiceAccountListResponse = {
94809480+ object: 'list';
94809481 data: Array<ProjectServiceAccount>;
94819482 first_id: string;
94839483+ last_id: string;
94829484 has_more: boolean;
94839483- last_id: string;
94849484- object: 'list';
94859485};
9486948694879487export type ProjectUpdateRequest = {
···94969496 */
94979497export type ProjectUser = {
94989498 /**
94999499- * The Unix timestamp (in seconds) of when the project was added.
95009500- */
95019501- added_at: number;
95029502- /**
95039503- * The email address of the user
94999499+ * The object type, which is always `organization.project.user`
95049500 */
95059505- email: string;
95019501+ object: 'organization.project.user';
95069502 /**
95079503 * The identifier, which can be referenced in API endpoints
95089504 */
···95129508 */
95139509 name: string;
95149510 /**
95159515- * The object type, which is always `organization.project.user`
95119511+ * The email address of the user
95169512 */
95179517- object: 'organization.project.user';
95139513+ email: string;
95189514 /**
95199515 * `owner` or `member`
95209516 */
95219517 role: 'owner' | 'member';
95189518+ /**
95199519+ * The Unix timestamp (in seconds) of when the project was added.
95209520+ */
95219521+ added_at: number;
95229522};
9523952395249524export type ProjectUserCreateRequest = {
95259525 /**
95269526+ * The ID of the user.
95279527+ */
95289528+ user_id: string;
95299529+ /**
95269530 * `owner` or `member`
95279531 */
95289532 role: 'owner' | 'member';
95299529- /**
95309530- * The ID of the user.
95319531- */
95329532- user_id: string;
95339533};
9534953495359535export type ProjectUserDeleteResponse = {
95369536- deleted: boolean;
95369536+ object: 'organization.project.user.deleted';
95379537 id: string;
95389538- object: 'organization.project.user.deleted';
95389538+ deleted: boolean;
95399539};
9540954095419541export type ProjectUserListResponse = {
95429542+ object: string;
95429543 data: Array<ProjectUser>;
95439544 first_id: string;
95449544- has_more: boolean;
95459545 last_id: string;
95469546- object: string;
95469546+ has_more: boolean;
95479547};
9548954895499549export type ProjectUserUpdateRequest = {
···95639563 * The unique identifier of the prompt template to use.
95649564 */
95659565 id: string;
95669566- variables?: ResponsePromptVariables;
95679566 /**
95689567 * Optional version of the prompt template.
95699568 */
95709569 version?: string;
95709570+ variables?: ResponsePromptVariables;
95719571};
9572957295739573/**
···96279627 * Optional client-generated ID used to identify this event.
96289628 */
96299629 event_id?: string;
96309630- item: RealtimeConversationItem;
96309630+ /**
96319631+ * The event type, must be `conversation.item.create`.
96329632+ */
96339633+ type: 'conversation.item.create';
96319634 /**
96329635 * The ID of the preceding item after which the new item will be inserted.
96339636 * If not set, the new item will be appended to the end of the conversation.
···96379640 *
96389641 */
96399642 previous_item_id?: string;
96409640- /**
96419641- * The event type, must be `conversation.item.create`.
96429642- */
96439643- type: 'conversation.item.create';
96439643+ item: RealtimeConversationItem;
96449644};
9645964596469646/**
···96569656 */
96579657 event_id?: string;
96589658 /**
96599659- * The ID of the item to delete.
96609660- */
96619661- item_id: string;
96629662- /**
96639659 * The event type, must be `conversation.item.delete`.
96649660 */
96659661 type: 'conversation.item.delete';
96629662+ /**
96639663+ * The ID of the item to delete.
96649664+ */
96659665+ item_id: string;
96669666};
9667966796689668/**
···96789678 */
96799679 event_id?: string;
96809680 /**
96819681- * The ID of the item to retrieve.
96829682- */
96839683- item_id: string;
96849684- /**
96859681 * The event type, must be `conversation.item.retrieve`.
96869682 */
96879683 type: 'conversation.item.retrieve';
96849684+ /**
96859685+ * The ID of the item to retrieve.
96869686+ */
96879687+ item_id: string;
96889688};
9689968996909690/**
···97039703 */
97049704export type RealtimeClientEventConversationItemTruncate = {
97059705 /**
97069706- * Inclusive duration up to which audio is truncated, in milliseconds. If
97079707- * the audio_end_ms is greater than the actual audio duration, the server
97089708- * will respond with an error.
97099709- *
97069706+ * Optional client-generated ID used to identify this event.
97109707 */
97119711- audio_end_ms: number;
97129712- /**
97139713- * The index of the content part to truncate. Set this to 0.
97149714- */
97159715- content_index: number;
97089708+ event_id?: string;
97169709 /**
97179717- * Optional client-generated ID used to identify this event.
97109710+ * The event type, must be `conversation.item.truncate`.
97189711 */
97199719- event_id?: string;
97129712+ type: 'conversation.item.truncate';
97209713 /**
97219714 * The ID of the assistant message item to truncate. Only assistant message
97229715 * items can be truncated.
···97249717 */
97259718 item_id: string;
97269719 /**
97279727- * The event type, must be `conversation.item.truncate`.
97209720+ * The index of the content part to truncate. Set this to 0.
97219721+ */
97229722+ content_index: number;
97239723+ /**
97249724+ * Inclusive duration up to which audio is truncated, in milliseconds. If
97259725+ * the audio_end_ms is greater than the actual audio duration, the server
97269726+ * will respond with an error.
97279727+ *
97289728 */
97299729- type: 'conversation.item.truncate';
97299729+ audio_end_ms: number;
97309730};
9731973197329732/**
···97449744 */
97459745export type RealtimeClientEventInputAudioBufferAppend = {
97469746 /**
97479747- * Base64-encoded audio bytes. This must be in the format specified by the
97489748- * `input_audio_format` field in the session configuration.
97499749- *
97509750- */
97519751- audio: string;
97529752- /**
97539747 * Optional client-generated ID used to identify this event.
97549748 */
97559749 event_id?: string;
···97579751 * The event type, must be `input_audio_buffer.append`.
97589752 */
97599753 type: 'input_audio_buffer.append';
97549754+ /**
97559755+ * Base64-encoded audio bytes. This must be in the format specified by the
97569756+ * `input_audio_format` field in the session configuration.
97579757+ *
97589758+ */
97599759+ audio: string;
97609760};
9761976197629762/**
···98309830 */
98319831 event_id?: string;
98329832 /**
98339833+ * The event type, must be `response.cancel`.
98349834+ */
98359835+ type: 'response.cancel';
98369836+ /**
98339837 * A specific response ID to cancel - if not provided, will cancel an
98349838 * in-progress response in the default conversation.
98359839 *
98369840 */
98379841 response_id?: string;
98389838- /**
98399839- * The event type, must be `response.cancel`.
98409840- */
98419841- type: 'response.cancel';
98429842};
9843984398449844/**
···98649864 * Optional client-generated ID used to identify this event.
98659865 */
98669866 event_id?: string;
98679867- response?: RealtimeResponseCreateParams;
98689867 /**
98699868 * The event type, must be `response.create`.
98709869 */
98719870 type: 'response.create';
98719871+ response?: RealtimeResponseCreateParams;
98729872};
9873987398749874/**
···98899889 * Optional client-generated ID used to identify this event.
98909890 */
98919891 event_id?: string;
98929892- session: RealtimeSessionCreateRequest;
98939892 /**
98949893 * The event type, must be `session.update`.
98959894 */
98969895 type: 'session.update';
98969896+ session: RealtimeSessionCreateRequest;
98979897};
9898989898999899/**
···99059905 * Optional client-generated ID used to identify this event.
99069906 */
99079907 event_id?: string;
99089908- session: RealtimeTranscriptionSessionCreateRequest;
99099908 /**
99109909 * The event type, must be `transcription_session.update`.
99119910 */
99129911 type: 'transcription_session.update';
99129912+ session: RealtimeTranscriptionSessionCreateRequest;
99139913};
9914991499159915/**
···99179917 */
99189918export type RealtimeConversationItem = {
99199919 /**
99209920- * The arguments of the function call (for `function_call` items).
99209920+ * The unique ID of the item, this can be generated by the client to help
99219921+ * manage server-side context, but is not required because the server will
99229922+ * generate one if not provided.
99239923+ *
99249924+ */
99259925+ id?: string;
99269926+ /**
99279927+ * The type of the item (`message`, `function_call`, `function_call_output`).
99289928+ *
99299929+ */
99309930+ type?: 'message' | 'function_call' | 'function_call_output';
99319931+ /**
99329932+ * Identifier for the API object being returned - always `realtime.item`.
99339933+ *
99349934+ */
99359935+ object?: 'realtime.item';
99369936+ /**
99379937+ * The status of the item (`completed`, `incomplete`, `in_progress`). These have no effect
99389938+ * on the conversation, but are accepted for consistency with the
99399939+ * `conversation.item.created` event.
99219940 *
99229941 */
99239923- arguments?: string;
99429942+ status?: 'completed' | 'incomplete' | 'in_progress';
99249943 /**
99259925- * The ID of the function call (for `function_call` and
99269926- * `function_call_output` items). If passed on a `function_call_output`
99279927- * item, the server will check that a `function_call` item with the same
99289928- * ID exists in the conversation history.
99449944+ * The role of the message sender (`user`, `assistant`, `system`), only
99459945+ * applicable for `message` items.
99299946 *
99309947 */
99319931- call_id?: string;
99489948+ role?: 'user' | 'assistant' | 'system';
99329949 /**
99339950 * The content of the message, applicable for `message` items.
99349951 * - Message items of role `system` support only `input_text` content
···99399956 */
99409957 content?: Array<RealtimeConversationItemContent>;
99419958 /**
99429942- * The unique ID of the item, this can be generated by the client to help
99439943- * manage server-side context, but is not required because the server will
99449944- * generate one if not provided.
99599959+ * The ID of the function call (for `function_call` and
99609960+ * `function_call_output` items). If passed on a `function_call_output`
99619961+ * item, the server will check that a `function_call` item with the same
99629962+ * ID exists in the conversation history.
99459963 *
99469964 */
99479947- id?: string;
99659965+ call_id?: string;
99489966 /**
99499967 * The name of the function being called (for `function_call` items).
99509968 *
99519969 */
99529970 name?: string;
99539971 /**
99549954- * Identifier for the API object being returned - always `realtime.item`.
99729972+ * The arguments of the function call (for `function_call` items).
99559973 *
99569974 */
99579957- object?: 'realtime.item';
99759975+ arguments?: string;
99589976 /**
99599977 * The output of the function call (for `function_call_output` items).
99609978 *
99619979 */
99629980 output?: string;
99819981+};
99829982+99839983+/**
99849984+ * The item to add to the conversation.
99859985+ */
99869986+export type RealtimeConversationItemWithReference = {
99639987 /**
99649964- * The role of the message sender (`user`, `assistant`, `system`), only
99659965- * applicable for `message` items.
99889988+ * For an item of type (`message` | `function_call` | `function_call_output`)
99899989+ * this field allows the client to assign the unique ID of the item. It is
99909990+ * not required because the server will generate one if not provided.
99919991+ *
99929992+ * For an item of type `item_reference`, this field is required and is a
99939993+ * reference to any item that has previously existed in the conversation.
99669994 *
99679995 */
99689968- role?: 'user' | 'assistant' | 'system';
99969996+ id?: string;
99699997 /**
99709970- * The status of the item (`completed`, `incomplete`, `in_progress`). These have no effect
99719971- * on the conversation, but are accepted for consistency with the
99729972- * `conversation.item.created` event.
99989998+ * The type of the item (`message`, `function_call`, `function_call_output`, `item_reference`).
99739999 *
997410000 */
99759975- status?: 'completed' | 'incomplete' | 'in_progress';
1000110001+ type?:
1000210002+ | 'message'
1000310003+ | 'function_call'
1000410004+ | 'function_call_output'
1000510005+ | 'item_reference';
997610006 /**
99779977- * The type of the item (`message`, `function_call`, `function_call_output`).
1000710007+ * Identifier for the API object being returned - always `realtime.item`.
997810008 *
997910009 */
99809980- type?: 'message' | 'function_call' | 'function_call_output';
99819981-};
99829982-99839983-/**
99849984- * The item to add to the conversation.
99859985- */
99869986-export type RealtimeConversationItemWithReference = {
1001010010+ object?: 'realtime.item';
998710011 /**
99889988- * The arguments of the function call (for `function_call` items).
1001210012+ * The status of the item (`completed`, `incomplete`, `in_progress`). These have no effect
1001310013+ * on the conversation, but are accepted for consistency with the
1001410014+ * `conversation.item.created` event.
998910015 *
999010016 */
99919991- arguments?: string;
1001710017+ status?: 'completed' | 'incomplete' | 'in_progress';
999210018 /**
99939993- * The ID of the function call (for `function_call` and
99949994- * `function_call_output` items). If passed on a `function_call_output`
99959995- * item, the server will check that a `function_call` item with the same
99969996- * ID exists in the conversation history.
1001910019+ * The role of the message sender (`user`, `assistant`, `system`), only
1002010020+ * applicable for `message` items.
999710021 *
999810022 */
99999999- call_id?: string;
1002310023+ role?: 'user' | 'assistant' | 'system';
1000010024 /**
1000110025 * The content of the message, applicable for `message` items.
1000210026 * - Message items of role `system` support only `input_text` content
···1000710031 */
1000810032 content?: Array<{
1000910033 /**
1001010010- * Base64-encoded audio bytes, used for `input_audio` content type.
1003410034+ * The content type (`input_text`, `input_audio`, `item_reference`, `text`).
1003510035+ *
1003610036+ */
1003710037+ type?: 'input_text' | 'input_audio' | 'item_reference' | 'text';
1003810038+ /**
1003910039+ * The text content, used for `input_text` and `text` content types.
1001110040 *
1001210041 */
1001310013- audio?: string;
1004210042+ text?: string;
1001410043 /**
1001510044 * ID of a previous conversation item to reference (for `item_reference`
1001610045 * content types in `response.create` events). These can reference both
···1001910048 */
1002010049 id?: string;
1002110050 /**
1002210022- * The text content, used for `input_text` and `text` content types.
1005110051+ * Base64-encoded audio bytes, used for `input_audio` content type.
1002310052 *
1002410053 */
1002510025- text?: string;
1005410054+ audio?: string;
1002610055 /**
1002710056 * The transcript of the audio, used for `input_audio` content type.
1002810057 *
1002910058 */
1003010059 transcript?: string;
1003110031- /**
1003210032- * The content type (`input_text`, `input_audio`, `item_reference`, `text`).
1003310033- *
1003410034- */
1003510035- type?: 'input_text' | 'input_audio' | 'item_reference' | 'text';
1003610060 }>;
1003710061 /**
1003810038- * For an item of type (`message` | `function_call` | `function_call_output`)
1003910039- * this field allows the client to assign the unique ID of the item. It is
1004010040- * not required because the server will generate one if not provided.
1004110041- *
1004210042- * For an item of type `item_reference`, this field is required and is a
1004310043- * reference to any item that has previously existed in the conversation.
1006210062+ * The ID of the function call (for `function_call` and
1006310063+ * `function_call_output` items). If passed on a `function_call_output`
1006410064+ * item, the server will check that a `function_call` item with the same
1006510065+ * ID exists in the conversation history.
1004410066 *
1004510067 */
1004610046- id?: string;
1006810068+ call_id?: string;
1004710069 /**
1004810070 * The name of the function being called (for `function_call` items).
1004910071 *
1005010072 */
1005110073 name?: string;
1005210074 /**
1005310053- * Identifier for the API object being returned - always `realtime.item`.
1007510075+ * The arguments of the function call (for `function_call` items).
1005410076 *
1005510077 */
1005610056- object?: 'realtime.item';
1007810078+ arguments?: string;
1005710079 /**
1005810080 * The output of the function call (for `function_call_output` items).
1005910081 *
1006010082 */
1006110083 output?: string;
1006210062- /**
1006310063- * The role of the message sender (`user`, `assistant`, `system`), only
1006410064- * applicable for `message` items.
1006510065- *
1006610066- */
1006710067- role?: 'user' | 'assistant' | 'system';
1006810068- /**
1006910069- * The status of the item (`completed`, `incomplete`, `in_progress`). These have no effect
1007010070- * on the conversation, but are accepted for consistency with the
1007110071- * `conversation.item.created` event.
1007210072- *
1007310073- */
1007410074- status?: 'completed' | 'incomplete' | 'in_progress';
1007510075- /**
1007610076- * The type of the item (`message`, `function_call`, `function_call_output`, `item_reference`).
1007710077- *
1007810078- */
1007910079- type?:
1008010080- | 'message'
1008110081- | 'function_call'
1008210082- | 'function_call_output'
1008310083- | 'item_reference';
1008410084};
10085100851008610086/**
···1008810088 */
1008910089export type RealtimeResponse = {
1009010090 /**
1009110091- * Which conversation the response is added to, determined by the `conversation`
1009210092- * field in the `response.create` event. If `auto`, the response will be added to
1009310093- * the default conversation and the value of `conversation_id` will be an id like
1009410094- * `conv_1234`. If `none`, the response will not be added to any conversation and
1009510095- * the value of `conversation_id` will be `null`. If responses are being triggered
1009610096- * by server VAD, the response will be added to the default conversation, thus
1009710097- * the `conversation_id` will be an id like `conv_1234`.
1009810098- *
1009910099- */
1010010100- conversation_id?: string;
1010110101- /**
1010210091 * The unique ID of the response.
1010310092 */
1010410093 id?: string;
1010510094 /**
1010610106- * Maximum number of output tokens for a single assistant response,
1010710107- * inclusive of tool calls, that was used in this response.
1010810108- *
1010910109- */
1011010110- max_output_tokens?: number | 'inf';
1011110111- metadata?: Metadata;
1011210112- /**
1011310113- * The set of modalities the model used to respond. If there are multiple modalities,
1011410114- * the model will pick one, for example if `modalities` is `["text", "audio"]`, the model
1011510115- * could be responding in either text or audio.
1011610116- *
1011710117- */
1011810118- modalities?: Array<'text' | 'audio'>;
1011910119- /**
1012010095 * The object type, must be `realtime.response`.
1012110096 */
1012210097 object?: 'realtime.response';
1012310098 /**
1012410124- * The list of output items generated by the response.
1012510125- */
1012610126- output?: Array<RealtimeConversationItem>;
1012710127- /**
1012810128- * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
1012910129- *
1013010130- */
1013110131- output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
1013210132- /**
1013310099 * The final status of the response (`completed`, `cancelled`, `failed`, or
1013410100 * `incomplete`, `in_progress`).
1013510101 *
···1014010106 */
1014110107 status_details?: {
1014210108 /**
1014310143- * A description of the error that caused the response to fail,
1014410144- * populated when the `status` is `failed`.
1010910109+ * The type of error that caused the response to fail, corresponding
1011010110+ * with the `status` field (`completed`, `cancelled`, `incomplete`,
1011110111+ * `failed`).
1014510112 *
1014610113 */
1014710147- error?: {
1014810148- /**
1014910149- * Error code, if any.
1015010150- */
1015110151- code?: string;
1015210152- /**
1015310153- * The type of error.
1015410154- */
1015510155- type?: string;
1015610156- };
1011410114+ type?: 'completed' | 'cancelled' | 'incomplete' | 'failed';
1015710115 /**
1015810116 * The reason the Response did not complete. For a `cancelled` Response,
1015910117 * one of `turn_detected` (the server VAD detected a new start of speech)
···1016810126 | 'max_output_tokens'
1016910127 | 'content_filter';
1017010128 /**
1017110171- * The type of error that caused the response to fail, corresponding
1017210172- * with the `status` field (`completed`, `cancelled`, `incomplete`,
1017310173- * `failed`).
1012910129+ * A description of the error that caused the response to fail,
1013010130+ * populated when the `status` is `failed`.
1017410131 *
1017510132 */
1017610176- type?: 'completed' | 'cancelled' | 'incomplete' | 'failed';
1013310133+ error?: {
1013410134+ /**
1013510135+ * The type of error.
1013610136+ */
1013710137+ type?: string;
1013810138+ /**
1013910139+ * Error code, if any.
1014010140+ */
1014110141+ code?: string;
1014210142+ };
1017710143 };
1017810144 /**
1017910179- * Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.
1018010180- *
1014510145+ * The list of output items generated by the response.
1018110146 */
1018210182- temperature?: number;
1014710147+ output?: Array<RealtimeConversationItem>;
1014810148+ metadata?: Metadata;
1018310149 /**
1018410150 * Usage statistics for the Response, this will correspond to billing. A
1018510151 * Realtime API session will maintain a conversation context and append new
···1018910155 */
1019010156 usage?: {
1019110157 /**
1015810158+ * The total number of tokens in the Response including input and output
1015910159+ * text and audio tokens.
1016010160+ *
1016110161+ */
1016210162+ total_tokens?: number;
1016310163+ /**
1016410164+ * The number of input tokens used in the Response, including text and
1016510165+ * audio tokens.
1016610166+ *
1016710167+ */
1016810168+ input_tokens?: number;
1016910169+ /**
1017010170+ * The number of output tokens sent in the Response, including text and
1017110171+ * audio tokens.
1017210172+ *
1017310173+ */
1017410174+ output_tokens?: number;
1017510175+ /**
1019210176 * Details about the input tokens used in the Response.
1019310177 */
1019410178 input_token_details?: {
1019510179 /**
1019610196- * The number of audio tokens used in the Response.
1019710197- */
1019810198- audio_tokens?: number;
1019910199- /**
1020010180 * The number of cached tokens used in the Response.
1020110181 */
1020210182 cached_tokens?: number;
···1020410184 * The number of text tokens used in the Response.
1020510185 */
1020610186 text_tokens?: number;
1018710187+ /**
1018810188+ * The number of audio tokens used in the Response.
1018910189+ */
1019010190+ audio_tokens?: number;
1020710191 };
1020810192 /**
1020910209- * The number of input tokens used in the Response, including text and
1021010210- * audio tokens.
1021110211- *
1021210212- */
1021310213- input_tokens?: number;
1021410214- /**
1021510193 * Details about the output tokens used in the Response.
1021610194 */
1021710195 output_token_details?: {
1021810218- /**
1021910219- * The number of audio tokens used in the Response.
1022010220- */
1022110221- audio_tokens?: number;
1022210196 /**
1022310197 * The number of text tokens used in the Response.
1022410198 */
1022510199 text_tokens?: number;
1020010200+ /**
1020110201+ * The number of audio tokens used in the Response.
1020210202+ */
1020310203+ audio_tokens?: number;
1022610204 };
1022710227- /**
1022810228- * The number of output tokens sent in the Response, including text and
1022910229- * audio tokens.
1023010230- *
1023110231- */
1023210232- output_tokens?: number;
1023310233- /**
1023410234- * The total number of tokens in the Response including input and output
1023510235- * text and audio tokens.
1023610236- *
1023710237- */
1023810238- total_tokens?: number;
1023910205 };
1024010206 /**
1020710207+ * Which conversation the response is added to, determined by the `conversation`
1020810208+ * field in the `response.create` event. If `auto`, the response will be added to
1020910209+ * the default conversation and the value of `conversation_id` will be an id like
1021010210+ * `conv_1234`. If `none`, the response will not be added to any conversation and
1021110211+ * the value of `conversation_id` will be `null`. If responses are being triggered
1021210212+ * by server VAD, the response will be added to the default conversation, thus
1021310213+ * the `conversation_id` will be an id like `conv_1234`.
1021410214+ *
1021510215+ */
1021610216+ conversation_id?: string;
1021710217+ /**
1024110218 * The voice the model used to respond.
1024210219 * Current voice options are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`,
1024310220 * `shimmer`, and `verse`.
1024410221 *
1024510222 */
1024610223 voice?: VoiceIdsShared;
1022410224+ /**
1022510225+ * The set of modalities the model used to respond. If there are multiple modalities,
1022610226+ * the model will pick one, for example if `modalities` is `["text", "audio"]`, the model
1022710227+ * could be responding in either text or audio.
1022810228+ *
1022910229+ */
1023010230+ modalities?: Array<'text' | 'audio'>;
1023110231+ /**
1023210232+ * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
1023310233+ *
1023410234+ */
1023510235+ output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
1023610236+ /**
1023710237+ * Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.
1023810238+ *
1023910239+ */
1024010240+ temperature?: number;
1024110241+ /**
1024210242+ * Maximum number of output tokens for a single assistant response,
1024310243+ * inclusive of tool calls, that was used in this response.
1024410244+ *
1024510245+ */
1024610246+ max_output_tokens?: number | 'inf';
1024710247};
10248102481024910249/**
···1025110251 */
1025210252export type RealtimeResponseCreateParams = {
1025310253 /**
1025410254- * Controls which conversation the response is added to. Currently supports
1025510255- * `auto` and `none`, with `auto` as the default value. The `auto` value
1025610256- * means that the contents of the response will be added to the default
1025710257- * conversation. Set this to `none` to create an out-of-band response which
1025810258- * will not add items to default conversation.
1025910259- *
1026010260- */
1026110261- conversation?: string | 'auto' | 'none';
1026210262- /**
1026310263- * Input items to include in the prompt for the model. Using this field
1026410264- * creates a new context for this Response instead of using the default
1026510265- * conversation. An empty array `[]` will clear the context for this Response.
1026610266- * Note that this can include references to items from the default conversation.
1025410254+ * The set of modalities the model can respond with. To disable audio,
1025510255+ * set this to ["text"].
1026710256 *
1026810257 */
1026910269- input?: Array<RealtimeConversationItemWithReference>;
1025810258+ modalities?: Array<'text' | 'audio'>;
1027010259 /**
1027110260 * The default system instructions (i.e. system message) prepended to model
1027210261 * calls. This field allows the client to guide the model on desired
···1028410273 */
1028510274 instructions?: string;
1028610275 /**
1028710287- * Maximum number of output tokens for a single assistant response,
1028810288- * inclusive of tool calls. Provide an integer between 1 and 4096 to
1028910289- * limit output tokens, or `inf` for the maximum available tokens for a
1029010290- * given model. Defaults to `inf`.
1027610276+ * The voice the model uses to respond. Voice cannot be changed during the
1027710277+ * session once the model has responded with audio at least once. Current
1027810278+ * voice options are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`,
1027910279+ * `shimmer`, and `verse`.
1029110280 *
1029210281 */
1029310293- max_response_output_tokens?: number | 'inf';
1029410294- metadata?: Metadata;
1029510295- /**
1029610296- * The set of modalities the model can respond with. To disable audio,
1029710297- * set this to ["text"].
1029810298- *
1029910299- */
1030010300- modalities?: Array<'text' | 'audio'>;
1028210282+ voice?: VoiceIdsShared;
1030110283 /**
1030210284 * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
1030310285 *
1030410286 */
1030510287 output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
1030610288 /**
1030710307- * Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.
1030810308- *
1030910309- */
1031010310- temperature?: number;
1031110311- /**
1031210312- * How the model chooses tools. Options are `auto`, `none`, `required`, or
1031310313- * specify a function, like `{"type": "function", "function": {"name": "my_function"}}`.
1031410314- *
1031510315- */
1031610316- tool_choice?: string;
1031710317- /**
1031810289 * Tools (functions) available to the model.
1031910290 */
1032010291 tools?: Array<{
1032110292 /**
1029310293+ * The type of the tool, i.e. `function`.
1029410294+ */
1029510295+ type?: 'function';
1029610296+ /**
1029710297+ * The name of the function.
1029810298+ */
1029910299+ name?: string;
1030010300+ /**
1032210301 * The description of the function, including guidance on when and how
1032310302 * to call it, and guidance about what to tell the user when calling
1032410303 * (if anything).
···1032610305 */
1032710306 description?: string;
1032810307 /**
1032910329- * The name of the function.
1033010330- */
1033110331- name?: string;
1033210332- /**
1033310308 * Parameters of the function in JSON Schema.
1033410309 */
1033510310 parameters?: {
1033610311 [key: string]: unknown;
1033710312 };
1033810338- /**
1033910339- * The type of the tool, i.e. `function`.
1034010340- */
1034110341- type?: 'function';
1034210313 }>;
1034310314 /**
1034410344- * The voice the model uses to respond. Voice cannot be changed during the
1034510345- * session once the model has responded with audio at least once. Current
1034610346- * voice options are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`,
1034710347- * `shimmer`, and `verse`.
1031510315+ * How the model chooses tools. Options are `auto`, `none`, `required`, or
1031610316+ * specify a function, like `{"type": "function", "function": {"name": "my_function"}}`.
1031710317+ *
1031810318+ */
1031910319+ tool_choice?: string;
1032010320+ /**
1032110321+ * Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.
1032210322+ *
1032310323+ */
1032410324+ temperature?: number;
1032510325+ /**
1032610326+ * Maximum number of output tokens for a single assistant response,
1032710327+ * inclusive of tool calls. Provide an integer between 1 and 4096 to
1032810328+ * limit output tokens, or `inf` for the maximum available tokens for a
1032910329+ * given model. Defaults to `inf`.
1034810330 *
1034910331 */
1035010350- voice?: VoiceIdsShared;
1033210332+ max_response_output_tokens?: number | 'inf';
1033310333+ /**
1033410334+ * Controls which conversation the response is added to. Currently supports
1033510335+ * `auto` and `none`, with `auto` as the default value. The `auto` value
1033610336+ * means that the contents of the response will be added to the default
1033710337+ * conversation. Set this to `none` to create an out-of-band response which
1033810338+ * will not add items to default conversation.
1033910339+ *
1034010340+ */
1034110341+ conversation?: string | 'auto' | 'none';
1034210342+ metadata?: Metadata;
1034310343+ /**
1034410344+ * Input items to include in the prompt for the model. Using this field
1034510345+ * creates a new context for this Response instead of using the default
1034610346+ * conversation. An empty array `[]` will clear the context for this Response.
1034710347+ * Note that this can include references to items from the default conversation.
1034810348+ *
1034910349+ */
1035010350+ input?: Array<RealtimeConversationItemWithReference>;
1035110351};
10352103521035310353/**
···1046410464 */
1046510465export type RealtimeServerEventConversationCreated = {
1046610466 /**
1046710467+ * The unique ID of the server event.
1046810468+ */
1046910469+ event_id: string;
1047010470+ /**
1047110471+ * The event type, must be `conversation.created`.
1047210472+ */
1047310473+ type: 'conversation.created';
1047410474+ /**
1046710475 * The conversation resource.
1046810476 */
1046910477 conversation: {
···1047610484 */
1047710485 object?: 'realtime.conversation';
1047810486 };
1047910479- /**
1048010480- * The unique ID of the server event.
1048110481- */
1048210482- event_id: string;
1048310483- /**
1048410484- * The event type, must be `conversation.created`.
1048510485- */
1048610486- type: 'conversation.created';
1048710487};
10488104881048910489/**
···1050310503 * The unique ID of the server event.
1050410504 */
1050510505 event_id: string;
1050610506- item: RealtimeConversationItem;
1050610506+ /**
1050710507+ * The event type, must be `conversation.item.created`.
1050810508+ */
1050910509+ type: 'conversation.item.created';
1050710510 /**
1050810511 * The ID of the preceding item in the Conversation context, allows the
1050910512 * client to understand the order of the conversation. Can be `null` if the
···1051110514 *
1051210515 */
1051310516 previous_item_id?: string;
1051410514- /**
1051510515- * The event type, must be `conversation.item.created`.
1051610516- */
1051710517- type: 'conversation.item.created';
1051710517+ item: RealtimeConversationItem;
1051810518};
10519105191052010520/**
···1052910529 */
1053010530 event_id: string;
1053110531 /**
1053210532- * The ID of the item that was deleted.
1053310533- */
1053410534- item_id: string;
1053510535- /**
1053610532 * The event type, must be `conversation.item.deleted`.
1053710533 */
1053810534 type: 'conversation.item.deleted';
1053510535+ /**
1053610536+ * The ID of the item that was deleted.
1053710537+ */
1053810538+ item_id: string;
1053910539};
10540105401054110541/**
···1055410554export type RealtimeServerEventConversationItemInputAudioTranscriptionCompleted =
1055510555 {
1055610556 /**
1055710557- * The index of the content part containing the audio.
1055710557+ * The unique ID of the server event.
1055810558 */
1055910559- content_index: number;
1055910559+ event_id: string;
1056010560 /**
1056110561- * The unique ID of the server event.
1056110561+ * The event type, must be
1056210562+ * `conversation.item.input_audio_transcription.completed`.
1056310563+ *
1056210564 */
1056310563- event_id: string;
1056510565+ type: 'conversation.item.input_audio_transcription.completed';
1056410566 /**
1056510567 * The ID of the user message item containing the audio.
1056610568 */
1056710569 item_id: string;
1056810570 /**
1056910569- * The log probabilities of the transcription.
1057110571+ * The index of the content part containing the audio.
1057010572 */
1057110571- logprobs?: Array<LogProbProperties>;
1057310573+ content_index: number;
1057210574 /**
1057310575 * The transcribed text.
1057410576 */
1057510577 transcript: string;
1057610578 /**
1057710577- * The event type, must be
1057810578- * `conversation.item.input_audio_transcription.completed`.
1057910579- *
1057910579+ * The log probabilities of the transcription.
1058010580 */
1058110581- type: 'conversation.item.input_audio_transcription.completed';
1058110581+ logprobs?: Array<LogProbProperties>;
1058210582 /**
1058310583 * Usage statistics for the transcription.
1058410584 */
···1059110591 */
1059210592export type RealtimeServerEventConversationItemInputAudioTranscriptionDelta = {
1059310593 /**
1059410594- * The index of the content part in the item's content array.
1059510595- */
1059610596- content_index?: number;
1059710597- /**
1059810598- * The text delta.
1059410594+ * The unique ID of the server event.
1059910595 */
1060010600- delta?: string;
1059610596+ event_id: string;
1060110597 /**
1060210602- * The unique ID of the server event.
1059810598+ * The event type, must be `conversation.item.input_audio_transcription.delta`.
1060310599 */
1060410604- event_id: string;
1060010600+ type: 'conversation.item.input_audio_transcription.delta';
1060510601 /**
1060610602 * The ID of the item.
1060710603 */
1060810604 item_id: string;
1060910605 /**
1061010610- * The log probabilities of the transcription.
1060610606+ * The index of the content part in the item's content array.
1061110607 */
1061210612- logprobs?: Array<LogProbProperties>;
1060810608+ content_index?: number;
1061310609 /**
1061410614- * The event type, must be `conversation.item.input_audio_transcription.delta`.
1061010610+ * The text delta.
1061510611 */
1061610616- type: 'conversation.item.input_audio_transcription.delta';
1061210612+ delta?: string;
1061310613+ /**
1061410614+ * The log probabilities of the transcription.
1061510615+ */
1061610616+ logprobs?: Array<LogProbProperties>;
1061710617};
10618106181061910619/**
···1062410624 */
1062510625export type RealtimeServerEventConversationItemInputAudioTranscriptionFailed = {
1062610626 /**
1062710627+ * The unique ID of the server event.
1062810628+ */
1062910629+ event_id: string;
1063010630+ /**
1063110631+ * The event type, must be
1063210632+ * `conversation.item.input_audio_transcription.failed`.
1063310633+ *
1063410634+ */
1063510635+ type: 'conversation.item.input_audio_transcription.failed';
1063610636+ /**
1063710637+ * The ID of the user message item.
1063810638+ */
1063910639+ item_id: string;
1064010640+ /**
1062710641 * The index of the content part containing the audio.
1062810642 */
1062910643 content_index: number;
···1063210646 */
1063310647 error: {
1063410648 /**
1064910649+ * The type of error.
1065010650+ */
1065110651+ type?: string;
1065210652+ /**
1063510653 * Error code, if any.
1063610654 */
1063710655 code?: string;
···1064310661 * Parameter related to the error, if any.
1064410662 */
1064510663 param?: string;
1064610646- /**
1064710647- * The type of error.
1064810648- */
1064910649- type?: string;
1065010664 };
1065110651- /**
1065210652- * The unique ID of the server event.
1065310653- */
1065410654- event_id: string;
1065510655- /**
1065610656- * The ID of the user message item.
1065710657- */
1065810658- item_id: string;
1065910659- /**
1066010660- * The event type, must be
1066110661- * `conversation.item.input_audio_transcription.failed`.
1066210662- *
1066310663- */
1066410664- type: 'conversation.item.input_audio_transcription.failed';
1066510665};
10666106661066710667/**
···1067310673 * The unique ID of the server event.
1067410674 */
1067510675 event_id: string;
1067610676- item: RealtimeConversationItem;
1067710676 /**
1067810677 * The event type, must be `conversation.item.retrieved`.
1067910678 */
1068010679 type: 'conversation.item.retrieved';
1068010680+ item: RealtimeConversationItem;
1068110681};
10682106821068310683/**
···1069110691 */
1069210692export type RealtimeServerEventConversationItemTruncated = {
1069310693 /**
1069410694- * The duration up to which the audio was truncated, in milliseconds.
1069510695- *
1069410694+ * The unique ID of the server event.
1069610695 */
1069710697- audio_end_ms: number;
1069810698- /**
1069910699- * The index of the content part that was truncated.
1070010700- */
1070110701- content_index: number;
1069610696+ event_id: string;
1070210697 /**
1070310703- * The unique ID of the server event.
1069810698+ * The event type, must be `conversation.item.truncated`.
1070410699 */
1070510705- event_id: string;
1070010700+ type: 'conversation.item.truncated';
1070610701 /**
1070710702 * The ID of the assistant message item that was truncated.
1070810703 */
1070910704 item_id: string;
1071010705 /**
1071110711- * The event type, must be `conversation.item.truncated`.
1070610706+ * The index of the content part that was truncated.
1070710707+ */
1070810708+ content_index: number;
1070910709+ /**
1071010710+ * The duration up to which the audio was truncated, in milliseconds.
1071110711+ *
1071210712 */
1071310713- type: 'conversation.item.truncated';
1071310713+ audio_end_ms: number;
1071410714};
10715107151071610716/**
···1072110721 */
1072210722export type RealtimeServerEventError = {
1072310723 /**
1072410724+ * The unique ID of the server event.
1072510725+ */
1072610726+ event_id: string;
1072710727+ /**
1072810728+ * The event type, must be `error`.
1072910729+ */
1073010730+ type: 'error';
1073110731+ /**
1072410732 * Details of the error.
1072510733 */
1072610734 error: {
1072710735 /**
1073610736+ * The type of error (e.g., "invalid_request_error", "server_error").
1073710737+ *
1073810738+ */
1073910739+ type: string;
1074010740+ /**
1072810741 * Error code, if any.
1072910742 */
1073010743 code?: string;
1073110744 /**
1073210732- * The event_id of the client event that caused the error, if applicable.
1073310733- *
1073410734- */
1073510735- event_id?: string;
1073610736- /**
1073710745 * A human-readable error message.
1073810746 */
1073910747 message: string;
···1074210750 */
1074310751 param?: string;
1074410752 /**
1074510745- * The type of error (e.g., "invalid_request_error", "server_error").
1075310753+ * The event_id of the client event that caused the error, if applicable.
1074610754 *
1074710755 */
1074810748- type: string;
1075610756+ event_id?: string;
1074910757 };
1075010750- /**
1075110751- * The unique ID of the server event.
1075210752- */
1075310753- event_id: string;
1075410754- /**
1075510755- * The event type, must be `error`.
1075610756- */
1075710757- type: 'error';
1075810758};
10759107591076010760/**
···1078610786 */
1078710787 event_id: string;
1078810788 /**
1078910789- * The ID of the user message item that will be created.
1078910789+ * The event type, must be `input_audio_buffer.committed`.
1079010790 */
1079110791- item_id: string;
1079110791+ type: 'input_audio_buffer.committed';
1079210792 /**
1079310793 * The ID of the preceding item after which the new item will be inserted.
1079410794 * Can be `null` if the item has no predecessor.
···1079610796 */
1079710797 previous_item_id?: string;
1079810798 /**
1079910799- * The event type, must be `input_audio_buffer.committed`.
1079910799+ * The ID of the user message item that will be created.
1080010800 */
1080110801- type: 'input_audio_buffer.committed';
1080110801+ item_id: string;
1080210802};
10803108031080410804/**
···1081610816 */
1081710817export type RealtimeServerEventInputAudioBufferSpeechStarted = {
1081810818 /**
1081910819+ * The unique ID of the server event.
1082010820+ */
1082110821+ event_id: string;
1082210822+ /**
1082310823+ * The event type, must be `input_audio_buffer.speech_started`.
1082410824+ */
1082510825+ type: 'input_audio_buffer.speech_started';
1082610826+ /**
1081910827 * Milliseconds from the start of all audio written to the buffer during the
1082010828 * session when speech was first detected. This will correspond to the
1082110829 * beginning of audio sent to the model, and thus includes the
···1082410832 */
1082510833 audio_start_ms: number;
1082610834 /**
1082710827- * The unique ID of the server event.
1082810828- */
1082910829- event_id: string;
1083010830- /**
1083110835 * The ID of the user message item that will be created when speech stops.
1083210836 *
1083310837 */
1083410838 item_id: string;
1083510835- /**
1083610836- * The event type, must be `input_audio_buffer.speech_started`.
1083710837- */
1083810838- type: 'input_audio_buffer.speech_started';
1083910839};
10840108401084110841/**
···1084610846 */
1084710847export type RealtimeServerEventInputAudioBufferSpeechStopped = {
1084810848 /**
1084910849+ * The unique ID of the server event.
1085010850+ */
1085110851+ event_id: string;
1085210852+ /**
1085310853+ * The event type, must be `input_audio_buffer.speech_stopped`.
1085410854+ */
1085510855+ type: 'input_audio_buffer.speech_stopped';
1085610856+ /**
1084910857 * Milliseconds since the session started when speech stopped. This will
1085010858 * correspond to the end of audio sent to the model, and thus includes the
1085110859 * `min_silence_duration_ms` configured in the Session.
···1085310861 */
1085410862 audio_end_ms: number;
1085510863 /**
1085610856- * The unique ID of the server event.
1085710857- */
1085810858- event_id: string;
1085910859- /**
1086010864 * The ID of the user message item that will be created.
1086110865 */
1086210866 item_id: string;
1086310863- /**
1086410864- * The event type, must be `input_audio_buffer.speech_stopped`.
1086510865- */
1086610866- type: 'input_audio_buffer.speech_stopped';
1086710867};
10868108681086910869/**
···1088010880 */
1088110881 event_id: string;
1088210882 /**
1088310883- * The unique ID of the response that produced the audio.
1088410884- */
1088510885- response_id: string;
1088610886- /**
1088710883 * The event type, must be `output_audio_buffer.cleared`.
1088810884 */
1088910885 type: 'output_audio_buffer.cleared';
1088610886+ /**
1088710887+ * The unique ID of the response that produced the audio.
1088810888+ */
1088910889+ response_id: string;
1089010890};
10891108911089210892/**
···1090210902 */
1090310903 event_id: string;
1090410904 /**
1090510905- * The unique ID of the response that produced the audio.
1090610906- */
1090710907- response_id: string;
1090810908- /**
1090910905 * The event type, must be `output_audio_buffer.started`.
1091010906 */
1091110907 type: 'output_audio_buffer.started';
1090810908+ /**
1090910909+ * The unique ID of the response that produced the audio.
1091010910+ */
1091110911+ response_id: string;
1091210912};
10913109131091410914/**
···1092410924 */
1092510925 event_id: string;
1092610926 /**
1092710927- * The unique ID of the response that produced the audio.
1092810928- */
1092910929- response_id: string;
1093010930- /**
1093110927 * The event type, must be `output_audio_buffer.stopped`.
1093210928 */
1093310929 type: 'output_audio_buffer.stopped';
1093010930+ /**
1093110931+ * The unique ID of the response that produced the audio.
1093210932+ */
1093310933+ response_id: string;
1093410934};
10935109351093610936/**
···1094610946 */
1094710947 event_id: string;
1094810948 /**
1094910949+ * The event type, must be `rate_limits.updated`.
1095010950+ */
1095110951+ type: 'rate_limits.updated';
1095210952+ /**
1094910953 * List of rate limit information.
1095010954 */
1095110955 rate_limits: Array<{
1095210956 /**
1095310953- * The maximum allowed value for the rate limit.
1095410954- */
1095510955- limit?: number;
1095610956- /**
1095710957 * The name of the rate limit (`requests`, `tokens`).
1095810958 *
1095910959 */
1096010960 name?: 'requests' | 'tokens';
1096110961 /**
1096210962+ * The maximum allowed value for the rate limit.
1096310963+ */
1096410964+ limit?: number;
1096510965+ /**
1096210966 * The remaining value before the limit is reached.
1096310967 */
1096410968 remaining?: number;
···1096710971 */
1096810972 reset_seconds?: number;
1096910973 }>;
1097010970- /**
1097110971- * The event type, must be `rate_limits.updated`.
1097210972- */
1097310973- type: 'rate_limits.updated';
1097410974};
10975109751097610976/**
···1097810978 */
1097910979export type RealtimeServerEventResponseAudioDelta = {
1098010980 /**
1098110981- * The index of the content part in the item's content array.
1098110981+ * The unique ID of the server event.
1098210982 */
1098310983- content_index: number;
1098310983+ event_id: string;
1098410984 /**
1098510985- * Base64-encoded audio data delta.
1098510985+ * The event type, must be `response.audio.delta`.
1098610986 */
1098710987- delta: string;
1098710987+ type: 'response.audio.delta';
1098810988 /**
1098910989- * The unique ID of the server event.
1098910989+ * The ID of the response.
1099010990 */
1099110991- event_id: string;
1099110991+ response_id: string;
1099210992 /**
1099310993 * The ID of the item.
1099410994 */
···1099810998 */
1099910999 output_index: number;
1100011000 /**
1100111001- * The ID of the response.
1100111001+ * The index of the content part in the item's content array.
1100211002 */
1100311003- response_id: string;
1100311003+ content_index: number;
1100411004 /**
1100511005- * The event type, must be `response.audio.delta`.
1100511005+ * Base64-encoded audio data delta.
1100611006 */
1100711007- type: 'response.audio.delta';
1100711007+ delta: string;
1100811008};
11009110091101011010/**
···1101411014 */
1101511015export type RealtimeServerEventResponseAudioDone = {
1101611016 /**
1101711017- * The index of the content part in the item's content array.
1101711017+ * The unique ID of the server event.
1101811018+ */
1101911019+ event_id: string;
1102011020+ /**
1102111021+ * The event type, must be `response.audio.done`.
1101811022 */
1101911019- content_index: number;
1102311023+ type: 'response.audio.done';
1102011024 /**
1102111021- * The unique ID of the server event.
1102511025+ * The ID of the response.
1102211026 */
1102311023- event_id: string;
1102711027+ response_id: string;
1102411028 /**
1102511029 * The ID of the item.
1102611030 */
···1103011034 */
1103111035 output_index: number;
1103211036 /**
1103311033- * The ID of the response.
1103711037+ * The index of the content part in the item's content array.
1103411038 */
1103511035- response_id: string;
1103611036- /**
1103711037- * The event type, must be `response.audio.done`.
1103811038- */
1103911039- type: 'response.audio.done';
1103911039+ content_index: number;
1104011040};
11041110411104211042/**
···1104511045 */
1104611046export type RealtimeServerEventResponseAudioTranscriptDelta = {
1104711047 /**
1104811048- * The index of the content part in the item's content array.
1104811048+ * The unique ID of the server event.
1104911049 */
1105011050- content_index: number;
1105011050+ event_id: string;
1105111051 /**
1105211052- * The transcript delta.
1105211052+ * The event type, must be `response.audio_transcript.delta`.
1105311053 */
1105411054- delta: string;
1105411054+ type: 'response.audio_transcript.delta';
1105511055 /**
1105611056- * The unique ID of the server event.
1105611056+ * The ID of the response.
1105711057 */
1105811058- event_id: string;
1105811058+ response_id: string;
1105911059 /**
1106011060 * The ID of the item.
1106111061 */
···1106511065 */
1106611066 output_index: number;
1106711067 /**
1106811068- * The ID of the response.
1106811068+ * The index of the content part in the item's content array.
1106911069 */
1107011070- response_id: string;
1107011070+ content_index: number;
1107111071 /**
1107211072- * The event type, must be `response.audio_transcript.delta`.
1107211072+ * The transcript delta.
1107311073 */
1107411074- type: 'response.audio_transcript.delta';
1107411074+ delta: string;
1107511075};
11076110761107711077/**
···1108211082 */
1108311083export type RealtimeServerEventResponseAudioTranscriptDone = {
1108411084 /**
1108511085- * The index of the content part in the item's content array.
1108511085+ * The unique ID of the server event.
1108611086+ */
1108711087+ event_id: string;
1108811088+ /**
1108911089+ * The event type, must be `response.audio_transcript.done`.
1108611090 */
1108711087- content_index: number;
1109111091+ type: 'response.audio_transcript.done';
1108811092 /**
1108911089- * The unique ID of the server event.
1109311093+ * The ID of the response.
1109011094 */
1109111091- event_id: string;
1109511095+ response_id: string;
1109211096 /**
1109311097 * The ID of the item.
1109411098 */
···1109811102 */
1109911103 output_index: number;
1110011104 /**
1110111101- * The ID of the response.
1110511105+ * The index of the content part in the item's content array.
1110211106 */
1110311103- response_id: string;
1110711107+ content_index: number;
1110411108 /**
1110511109 * The final transcript of the audio.
1110611110 */
1110711111 transcript: string;
1110811108- /**
1110911109- * The event type, must be `response.audio_transcript.done`.
1111011110- */
1111111111- type: 'response.audio_transcript.done';
1111211112};
11113111131111411114/**
···1111811118 */
1111911119export type RealtimeServerEventResponseContentPartAdded = {
1112011120 /**
1112111121- * The index of the content part in the item's content array.
1112211122- */
1112311123- content_index: number;
1112411124- /**
1112511121 * The unique ID of the server event.
1112611122 */
1112711123 event_id: string;
1112811124 /**
1112511125+ * The event type, must be `response.content_part.added`.
1112611126+ */
1112711127+ type: 'response.content_part.added';
1112811128+ /**
1112911129+ * The ID of the response.
1113011130+ */
1113111131+ response_id: string;
1113211132+ /**
1112911133 * The ID of the item to which the content part was added.
1113011134 */
1113111135 item_id: string;
···1113411138 */
1113511139 output_index: number;
1113611140 /**
1114111141+ * The index of the content part in the item's content array.
1114211142+ */
1114311143+ content_index: number;
1114411144+ /**
1113711145 * The content part that was added.
1113811146 */
1113911147 part: {
1114011148 /**
1114111141- * Base64-encoded audio data (if type is "audio").
1114911149+ * The content type ("text", "audio").
1114211150 */
1114311143- audio?: string;
1115111151+ type?: 'text' | 'audio';
1114411152 /**
1114511153 * The text content (if type is "text").
1114611154 */
1114711155 text?: string;
1114811156 /**
1115711157+ * Base64-encoded audio data (if type is "audio").
1115811158+ */
1115911159+ audio?: string;
1116011160+ /**
1114911161 * The transcript of the audio (if type is "audio").
1115011162 */
1115111163 transcript?: string;
1115211152- /**
1115311153- * The content type ("text", "audio").
1115411154- */
1115511155- type?: 'text' | 'audio';
1115611164 };
1115711157- /**
1115811158- * The ID of the response.
1115911159- */
1116011160- response_id: string;
1116111161- /**
1116211162- * The event type, must be `response.content_part.added`.
1116311163- */
1116411164- type: 'response.content_part.added';
1116511165};
11166111661116711167/**
···1117111171 */
1117211172export type RealtimeServerEventResponseContentPartDone = {
1117311173 /**
1117411174- * The index of the content part in the item's content array.
1117411174+ * The unique ID of the server event.
1117511175+ */
1117611176+ event_id: string;
1117711177+ /**
1117811178+ * The event type, must be `response.content_part.done`.
1117511179 */
1117611176- content_index: number;
1118011180+ type: 'response.content_part.done';
1117711181 /**
1117811178- * The unique ID of the server event.
1118211182+ * The ID of the response.
1117911183 */
1118011180- event_id: string;
1118411184+ response_id: string;
1118111185 /**
1118211186 * The ID of the item.
1118311187 */
···1118711191 */
1118811192 output_index: number;
1118911193 /**
1119411194+ * The index of the content part in the item's content array.
1119511195+ */
1119611196+ content_index: number;
1119711197+ /**
1119011198 * The content part that is done.
1119111199 */
1119211200 part: {
1119311201 /**
1119411194- * Base64-encoded audio data (if type is "audio").
1120211202+ * The content type ("text", "audio").
1119511203 */
1119611196- audio?: string;
1120411204+ type?: 'text' | 'audio';
1119711205 /**
1119811206 * The text content (if type is "text").
1119911207 */
1120011208 text?: string;
1120111209 /**
1120211202- * The transcript of the audio (if type is "audio").
1121011210+ * Base64-encoded audio data (if type is "audio").
1120311211 */
1120411204- transcript?: string;
1121211212+ audio?: string;
1120511213 /**
1120611206- * The content type ("text", "audio").
1121411214+ * The transcript of the audio (if type is "audio").
1120711215 */
1120811208- type?: 'text' | 'audio';
1121611216+ transcript?: string;
1120911217 };
1121011210- /**
1121111211- * The ID of the response.
1121211212- */
1121311213- response_id: string;
1121411214- /**
1121511215- * The event type, must be `response.content_part.done`.
1121611216- */
1121711217- type: 'response.content_part.done';
1121811218};
11219112191122011220/**
···1122711227 * The unique ID of the server event.
1122811228 */
1122911229 event_id: string;
1123011230- response: RealtimeResponse;
1123111230 /**
1123211231 * The event type, must be `response.created`.
1123311232 */
1123411233 type: 'response.created';
1123411234+ response: RealtimeResponse;
1123511235};
11236112361123711237/**
···1124511245 * The unique ID of the server event.
1124611246 */
1124711247 event_id: string;
1124811248- response: RealtimeResponse;
1124911248 /**
1125011249 * The event type, must be `response.done`.
1125111250 */
1125211251 type: 'response.done';
1125211252+ response: RealtimeResponse;
1125311253};
11254112541125511255/**
···1125811258 */
1125911259export type RealtimeServerEventResponseFunctionCallArgumentsDelta = {
1126011260 /**
1126111261- * The ID of the function call.
1126111261+ * The unique ID of the server event.
1126211262 */
1126311263- call_id: string;
1126311263+ event_id: string;
1126411264 /**
1126511265- * The arguments delta as a JSON string.
1126511265+ * The event type, must be `response.function_call_arguments.delta`.
1126611266+ *
1126611267 */
1126711267- delta: string;
1126811268+ type: 'response.function_call_arguments.delta';
1126811269 /**
1126911269- * The unique ID of the server event.
1127011270+ * The ID of the response.
1127011271 */
1127111271- event_id: string;
1127211272+ response_id: string;
1127211273 /**
1127311274 * The ID of the function call item.
1127411275 */
···1127811279 */
1127911280 output_index: number;
1128011281 /**
1128111281- * The ID of the response.
1128211282+ * The ID of the function call.
1128211283 */
1128311283- response_id: string;
1128411284+ call_id: string;
1128411285 /**
1128511285- * The event type, must be `response.function_call_arguments.delta`.
1128611286- *
1128611286+ * The arguments delta as a JSON string.
1128711287 */
1128811288- type: 'response.function_call_arguments.delta';
1128811288+ delta: string;
1128911289};
11290112901129111291/**
···1129511295 */
1129611296export type RealtimeServerEventResponseFunctionCallArgumentsDone = {
1129711297 /**
1129811298- * The final arguments as a JSON string.
1129811298+ * The unique ID of the server event.
1129911299 */
1130011300- arguments: string;
1130011300+ event_id: string;
1130111301 /**
1130211302- * The ID of the function call.
1130211302+ * The event type, must be `response.function_call_arguments.done`.
1130311303+ *
1130311304 */
1130411304- call_id: string;
1130511305+ type: 'response.function_call_arguments.done';
1130511306 /**
1130611306- * The unique ID of the server event.
1130711307+ * The ID of the response.
1130711308 */
1130811308- event_id: string;
1130911309+ response_id: string;
1130911310 /**
1131011311 * The ID of the function call item.
1131111312 */
···1131511316 */
1131611317 output_index: number;
1131711318 /**
1131811318- * The ID of the response.
1131911319+ * The ID of the function call.
1131911320 */
1132011320- response_id: string;
1132111321+ call_id: string;
1132111322 /**
1132211322- * The event type, must be `response.function_call_arguments.done`.
1132311323- *
1132311323+ * The final arguments as a JSON string.
1132411324 */
1132511325- type: 'response.function_call_arguments.done';
1132511325+ arguments: string;
1132611326};
11327113271132811328/**
···1133311333 * The unique ID of the server event.
1133411334 */
1133511335 event_id: string;
1133611336- item: RealtimeConversationItem;
1133711336 /**
1133811338- * The index of the output item in the Response.
1133711337+ * The event type, must be `response.output_item.added`.
1133911338 */
1134011340- output_index: number;
1133911339+ type: 'response.output_item.added';
1134111340 /**
1134211341 * The ID of the Response to which the item belongs.
1134311342 */
1134411343 response_id: string;
1134511344 /**
1134611346- * The event type, must be `response.output_item.added`.
1134511345+ * The index of the output item in the Response.
1134711346 */
1134811348- type: 'response.output_item.added';
1134711347+ output_index: number;
1134811348+ item: RealtimeConversationItem;
1134911349};
11350113501135111351/**
···1135811358 * The unique ID of the server event.
1135911359 */
1136011360 event_id: string;
1136111361- item: RealtimeConversationItem;
1136211361 /**
1136311363- * The index of the output item in the Response.
1136211362+ * The event type, must be `response.output_item.done`.
1136411363 */
1136511365- output_index: number;
1136411364+ type: 'response.output_item.done';
1136611365 /**
1136711366 * The ID of the Response to which the item belongs.
1136811367 */
1136911368 response_id: string;
1137011369 /**
1137111371- * The event type, must be `response.output_item.done`.
1137011370+ * The index of the output item in the Response.
1137211371 */
1137311373- type: 'response.output_item.done';
1137211372+ output_index: number;
1137311373+ item: RealtimeConversationItem;
1137411374};
11375113751137611376/**
···1137811378 */
1137911379export type RealtimeServerEventResponseTextDelta = {
1138011380 /**
1138111381- * The index of the content part in the item's content array.
1138111381+ * The unique ID of the server event.
1138211382 */
1138311383- content_index: number;
1138311383+ event_id: string;
1138411384 /**
1138511385- * The text delta.
1138511385+ * The event type, must be `response.text.delta`.
1138611386 */
1138711387- delta: string;
1138711387+ type: 'response.text.delta';
1138811388 /**
1138911389- * The unique ID of the server event.
1138911389+ * The ID of the response.
1139011390 */
1139111391- event_id: string;
1139111391+ response_id: string;
1139211392 /**
1139311393 * The ID of the item.
1139411394 */
···1139811398 */
1139911399 output_index: number;
1140011400 /**
1140111401- * The ID of the response.
1140111401+ * The index of the content part in the item's content array.
1140211402 */
1140311403- response_id: string;
1140311403+ content_index: number;
1140411404 /**
1140511405- * The event type, must be `response.text.delta`.
1140511405+ * The text delta.
1140611406 */
1140711407- type: 'response.text.delta';
1140711407+ delta: string;
1140811408};
11409114091141011410/**
···1141411414 */
1141511415export type RealtimeServerEventResponseTextDone = {
1141611416 /**
1141711417- * The index of the content part in the item's content array.
1141711417+ * The unique ID of the server event.
1141811418+ */
1141911419+ event_id: string;
1142011420+ /**
1142111421+ * The event type, must be `response.text.done`.
1141811422 */
1141911419- content_index: number;
1142311423+ type: 'response.text.done';
1142011424 /**
1142111421- * The unique ID of the server event.
1142511425+ * The ID of the response.
1142211426 */
1142311423- event_id: string;
1142711427+ response_id: string;
1142411428 /**
1142511429 * The ID of the item.
1142611430 */
···1143011434 */
1143111435 output_index: number;
1143211436 /**
1143311433- * The ID of the response.
1143711437+ * The index of the content part in the item's content array.
1143411438 */
1143511435- response_id: string;
1143911439+ content_index: number;
1143611440 /**
1143711441 * The final text content.
1143811442 */
1143911443 text: string;
1144011440- /**
1144111441- * The event type, must be `response.text.done`.
1144211442- */
1144311443- type: 'response.text.done';
1144411444};
11445114451144611446/**
···1145411454 * The unique ID of the server event.
1145511455 */
1145611456 event_id: string;
1145711457- session: RealtimeSession;
1145811457 /**
1145911458 * The event type, must be `session.created`.
1146011459 */
1146111460 type: 'session.created';
1146111461+ session: RealtimeSession;
1146211462};
11463114631146411464/**
···1147111471 * The unique ID of the server event.
1147211472 */
1147311473 event_id: string;
1147411474- session: RealtimeSession;
1147511474 /**
1147611475 * The event type, must be `session.updated`.
1147711476 */
1147811477 type: 'session.updated';
1147811478+ session: RealtimeSession;
1147911479};
11480114801148111481/**
···1148811488 * The unique ID of the server event.
1148911489 */
1149011490 event_id: string;
1149111491- session: RealtimeTranscriptionSessionCreateResponse;
1149211491 /**
1149311492 * The event type, must be `transcription_session.updated`.
1149411493 */
1149511494 type: 'transcription_session.updated';
1149511495+ session: RealtimeTranscriptionSessionCreateResponse;
1149611496};
11497114971149811498/**
···1150511505 */
1150611506 id?: string;
1150711507 /**
1150811508- * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
1150911509- * For `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate,
1151011510- * single channel (mono), and little-endian byte order.
1150811508+ * The set of modalities the model can respond with. To disable audio,
1150911509+ * set this to ["text"].
1151111510 *
1151211511 */
1151311513- input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
1151211512+ modalities?: unknown;
1151411513 /**
1151511515- * Configuration for input audio noise reduction. This can be set to `null` to turn off.
1151611516- * Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model.
1151711517- * Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio.
1151411514+ * The Realtime model used for this session.
1151811515 *
1151911516 */
1152011520- input_audio_noise_reduction?: {
1152111521- /**
1152211522- * Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones.
1152311523- *
1152411524- */
1152511525- type?: 'near_field' | 'far_field';
1152611526- };
1152711527- /**
1152811528- * Configuration for input audio transcription, defaults to off and can be set to `null` to turn off once on. Input audio transcription is not native to the model, since the model consumes audio directly. Transcription runs asynchronously through [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription) and should be treated as guidance of input audio content rather than precisely what the model heard. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service.
1152911529- *
1153011530- */
1153111531- input_audio_transcription?: {
1153211532- /**
1153311533- * The language of the input audio. Supplying the input language in
1153411534- * [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format
1153511535- * will improve accuracy and latency.
1153611536- *
1153711537- */
1153811538- language?: string;
1153911539- /**
1154011540- * The model to use for transcription, current options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`.
1154111541- *
1154211542- */
1154311543- model?: string;
1154411544- /**
1154511545- * An optional text to guide the model's style or continue a previous audio
1154611546- * segment.
1154711547- * For `whisper-1`, the [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
1154811548- * For `gpt-4o-transcribe` models, the prompt is a free text string, for example "expect words related to technology".
1154911549- *
1155011550- */
1155111551- prompt?: string;
1155211552- };
1151711517+ model?:
1151811518+ | 'gpt-4o-realtime-preview'
1151911519+ | 'gpt-4o-realtime-preview-2024-10-01'
1152011520+ | 'gpt-4o-realtime-preview-2024-12-17'
1152111521+ | 'gpt-4o-realtime-preview-2025-06-03'
1152211522+ | 'gpt-4o-mini-realtime-preview'
1152311523+ | 'gpt-4o-mini-realtime-preview-2024-12-17';
1155311524 /**
1155411525 * The default system instructions (i.e. system message) prepended to model
1155511526 * calls. This field allows the client to guide the model on desired
···1156811539 */
1156911540 instructions?: string;
1157011541 /**
1157111571- * Maximum number of output tokens for a single assistant response,
1157211572- * inclusive of tool calls. Provide an integer between 1 and 4096 to
1157311573- * limit output tokens, or `inf` for the maximum available tokens for a
1157411574- * given model. Defaults to `inf`.
1157511575- *
1157611576- */
1157711577- max_response_output_tokens?: number | 'inf';
1157811578- /**
1157911579- * The set of modalities the model can respond with. To disable audio,
1158011580- * set this to ["text"].
1154211542+ * The voice the model uses to respond. Voice cannot be changed during the
1154311543+ * session once the model has responded with audio at least once. Current
1154411544+ * voice options are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`,
1154511545+ * `shimmer`, and `verse`.
1158111546 *
1158211547 */
1158311583- modalities?: unknown;
1154811548+ voice?: VoiceIdsShared;
1158411549 /**
1158511585- * The Realtime model used for this session.
1155011550+ * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
1155111551+ * For `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate,
1155211552+ * single channel (mono), and little-endian byte order.
1158611553 *
1158711554 */
1158811588- model?:
1158911589- | 'gpt-4o-realtime-preview'
1159011590- | 'gpt-4o-realtime-preview-2024-10-01'
1159111591- | 'gpt-4o-realtime-preview-2024-12-17'
1159211592- | 'gpt-4o-realtime-preview-2025-06-03'
1159311593- | 'gpt-4o-mini-realtime-preview'
1159411594- | 'gpt-4o-mini-realtime-preview-2024-12-17';
1155511555+ input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
1159511556 /**
1159611557 * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
1159711558 * For `pcm16`, output audio is sampled at a rate of 24kHz.
···1159911560 */
1160011561 output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
1160111562 /**
1160211602- * The speed of the model's spoken response. 1.0 is the default speed. 0.25 is
1160311603- * the minimum speed. 1.5 is the maximum speed. This value can only be changed
1160411604- * in between model turns, not while a response is in progress.
1156311563+ * Configuration for input audio transcription, defaults to off and can be set to `null` to turn off once on. Input audio transcription is not native to the model, since the model consumes audio directly. Transcription runs asynchronously through [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription) and should be treated as guidance of input audio content rather than precisely what the model heard. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service.
1160511564 *
1160611565 */
1160711607- speed?: number;
1160811608- /**
1160911609- * Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a temperature of 0.8 is highly recommended for best performance.
1161011610- *
1161111611- */
1161211612- temperature?: number;
1161311613- /**
1161411614- * How the model chooses tools. Options are `auto`, `none`, `required`, or
1161511615- * specify a function.
1161611616- *
1161711617- */
1161811618- tool_choice?: string;
1161911619- /**
1162011620- * Tools (functions) available to the model.
1162111621- */
1162211622- tools?: Array<{
1156611566+ input_audio_transcription?: {
1162311567 /**
1162411624- * The description of the function, including guidance on when and how
1162511625- * to call it, and guidance about what to tell the user when calling
1162611626- * (if anything).
1156811568+ * The model to use for transcription, current options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`.
1162711569 *
1162811570 */
1162911629- description?: string;
1157111571+ model?: string;
1163011572 /**
1163111631- * The name of the function.
1157311573+ * The language of the input audio. Supplying the input language in
1157411574+ * [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format
1157511575+ * will improve accuracy and latency.
1157611576+ *
1163211577 */
1163311633- name?: string;
1157811578+ language?: string;
1163411579 /**
1163511635- * Parameters of the function in JSON Schema.
1158011580+ * An optional text to guide the model's style or continue a previous audio
1158111581+ * segment.
1158211582+ * For `whisper-1`, the [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
1158311583+ * For `gpt-4o-transcribe` models, the prompt is a free text string, for example "expect words related to technology".
1158411584+ *
1163611585 */
1163711637- parameters?: {
1163811638- [key: string]: unknown;
1163911639- };
1164011640- /**
1164111641- * The type of the tool, i.e. `function`.
1164211642- */
1164311643- type?: 'function';
1164411644- }>;
1164511645- /**
1164611646- * Tracing Configuration
1164711647- *
1164811648- * Configuration options for tracing. Set to null to disable tracing. Once
1164911649- * tracing is enabled for a session, the configuration cannot be modified.
1165011650- *
1165111651- * `auto` will create a trace for the session with default values for the
1165211652- * workflow name, group id, and metadata.
1165311653- *
1165411654- */
1165511655- tracing?:
1165611656- | 'auto'
1165711657- | {
1165811658- /**
1165911659- * The group id to attach to this trace to enable filtering and
1166011660- * grouping in the traces dashboard.
1166111661- *
1166211662- */
1166311663- group_id?: string;
1166411664- /**
1166511665- * The arbitrary metadata to attach to this trace to enable
1166611666- * filtering in the traces dashboard.
1166711667- *
1166811668- */
1166911669- metadata?: {
1167011670- [key: string]: unknown;
1167111671- };
1167211672- /**
1167311673- * The name of the workflow to attach to this trace. This is used to
1167411674- * name the trace in the traces dashboard.
1167511675- *
1167611676- */
1167711677- workflow_name?: string;
1167811678- };
1158611586+ prompt?: string;
1158711587+ };
1167911588 /**
1168011589 * Configuration for turn detection, ether Server VAD or Semantic VAD. This can be set to `null` to turn off, in which case the client must manually trigger model response.
1168111590 * Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech.
···1168411593 */
1168511594 turn_detection?: {
1168611595 /**
1168711687- * Whether or not to automatically generate a response when a VAD stop event occurs.
1159611596+ * Type of turn detection.
1168811597 *
1168911598 */
1169011690- create_response?: boolean;
1159911599+ type?: 'server_vad' | 'semantic_vad';
1169111600 /**
1169211601 * Used only for `semantic_vad` mode. The eagerness of the model to respond. `low` will wait longer for the user to continue speaking, `high` will respond more quickly. `auto` is the default and is equivalent to `medium`.
1169311602 *
1169411603 */
1169511604 eagerness?: 'low' | 'medium' | 'high' | 'auto';
1169611605 /**
1169711697- * Whether or not to automatically interrupt any ongoing response with output to the default
1169811698- * conversation (i.e. `conversation` of `auto`) when a VAD start event occurs.
1160611606+ * Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A
1160711607+ * higher threshold will require louder audio to activate the model, and
1160811608+ * thus might perform better in noisy environments.
1169911609 *
1170011610 */
1170111701- interrupt_response?: boolean;
1161111611+ threshold?: number;
1170211612 /**
1170311613 * Used only for `server_vad` mode. Amount of audio to include before the VAD detected speech (in
1170411614 * milliseconds). Defaults to 300ms.
···1171311623 */
1171411624 silence_duration_ms?: number;
1171511625 /**
1171611716- * Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A
1171711717- * higher threshold will require louder audio to activate the model, and
1171811718- * thus might perform better in noisy environments.
1162611626+ * Whether or not to automatically generate a response when a VAD stop event occurs.
1171911627 *
1172011628 */
1172111721- threshold?: number;
1172211722- /**
1172311723- * Type of turn detection.
1172411724- *
1172511725- */
1172611726- type?: 'server_vad' | 'semantic_vad';
1172711727- };
1172811728- /**
1172911729- * The voice the model uses to respond. Voice cannot be changed during the
1173011730- * session once the model has responded with audio at least once. Current
1173111731- * voice options are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`,
1173211732- * `shimmer`, and `verse`.
1173311733- *
1173411734- */
1173511735- voice?: VoiceIdsShared;
1173611736-};
1173711737-1173811738-/**
1173911739- * Realtime session object configuration.
1174011740- */
1174111741-export type RealtimeSessionCreateRequest = {
1174211742- /**
1174311743- * Configuration options for the generated client secret.
1174411744- *
1174511745- */
1174611746- client_secret?: {
1162911629+ create_response?: boolean;
1174711630 /**
1174811748- * Configuration for the ephemeral token expiration.
1163111631+ * Whether or not to automatically interrupt any ongoing response with output to the default
1163211632+ * conversation (i.e. `conversation` of `auto`) when a VAD start event occurs.
1174911633 *
1175011634 */
1175111751- expires_after?: {
1175211752- /**
1175311753- * The anchor point for the ephemeral token expiration. Only `created_at` is currently supported.
1175411754- *
1175511755- */
1175611756- anchor: 'created_at';
1175711757- /**
1175811758- * The number of seconds from the anchor point to the expiration. Select a value between `10` and `7200`.
1175911759- *
1176011760- */
1176111761- seconds?: number;
1176211762- };
1163511635+ interrupt_response?: boolean;
1176311636 };
1176411637 /**
1176511765- * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
1176611766- * For `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate,
1176711767- * single channel (mono), and little-endian byte order.
1176811768- *
1176911769- */
1177011770- input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
1177111771- /**
1177211638 * Configuration for input audio noise reduction. This can be set to `null` to turn off.
1177311639 * Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model.
1177411640 * Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio.
···1178211648 type?: 'near_field' | 'far_field';
1178311649 };
1178411650 /**
1178511785- * Configuration for input audio transcription, defaults to off and can be set to `null` to turn off once on. Input audio transcription is not native to the model, since the model consumes audio directly. Transcription runs asynchronously through [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription) and should be treated as guidance of input audio content rather than precisely what the model heard. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service.
1165111651+ * The speed of the model's spoken response. 1.0 is the default speed. 0.25 is
1165211652+ * the minimum speed. 1.5 is the maximum speed. This value can only be changed
1165311653+ * in between model turns, not while a response is in progress.
1165411654+ *
1165511655+ */
1165611656+ speed?: number;
1165711657+ /**
1165811658+ * Tracing Configuration
1165911659+ *
1166011660+ * Configuration options for tracing. Set to null to disable tracing. Once
1166111661+ * tracing is enabled for a session, the configuration cannot be modified.
1166211662+ *
1166311663+ * `auto` will create a trace for the session with default values for the
1166411664+ * workflow name, group id, and metadata.
1178611665 *
1178711666 */
1178811788- input_audio_transcription?: {
1166711667+ tracing?:
1166811668+ | 'auto'
1166911669+ | {
1167011670+ /**
1167111671+ * The name of the workflow to attach to this trace. This is used to
1167211672+ * name the trace in the traces dashboard.
1167311673+ *
1167411674+ */
1167511675+ workflow_name?: string;
1167611676+ /**
1167711677+ * The group id to attach to this trace to enable filtering and
1167811678+ * grouping in the traces dashboard.
1167911679+ *
1168011680+ */
1168111681+ group_id?: string;
1168211682+ /**
1168311683+ * The arbitrary metadata to attach to this trace to enable
1168411684+ * filtering in the traces dashboard.
1168511685+ *
1168611686+ */
1168711687+ metadata?: {
1168811688+ [key: string]: unknown;
1168911689+ };
1169011690+ };
1169111691+ /**
1169211692+ * Tools (functions) available to the model.
1169311693+ */
1169411694+ tools?: Array<{
1178911695 /**
1179011790- * The language of the input audio. Supplying the input language in
1179111791- * [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format
1179211792- * will improve accuracy and latency.
1179311793- *
1169611696+ * The type of the tool, i.e. `function`.
1179411697 */
1179511795- language?: string;
1169811698+ type?: 'function';
1179611699 /**
1179711797- * The model to use for transcription, current options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`.
1170011700+ * The name of the function.
1170111701+ */
1170211702+ name?: string;
1170311703+ /**
1170411704+ * The description of the function, including guidance on when and how
1170511705+ * to call it, and guidance about what to tell the user when calling
1170611706+ * (if anything).
1179811707 *
1179911708 */
1180011800- model?: string;
1170911709+ description?: string;
1180111710 /**
1180211802- * An optional text to guide the model's style or continue a previous audio
1180311803- * segment.
1180411804- * For `whisper-1`, the [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
1180511805- * For `gpt-4o-transcribe` models, the prompt is a free text string, for example "expect words related to technology".
1180611806- *
1171111711+ * Parameters of the function in JSON Schema.
1180711712 */
1180811808- prompt?: string;
1180911809- };
1171311713+ parameters?: {
1171411714+ [key: string]: unknown;
1171511715+ };
1171611716+ }>;
1181011717 /**
1181111811- * The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior.
1171811718+ * How the model chooses tools. Options are `auto`, `none`, `required`, or
1171911719+ * specify a function.
1181211720 *
1181311813- * Note that the server sets default instructions which will be used if this field is not set and are visible in the `session.created` event at the start of the session.
1172111721+ */
1172211722+ tool_choice?: string;
1172311723+ /**
1172411724+ * Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a temperature of 0.8 is highly recommended for best performance.
1181411725 *
1181511726 */
1181611816- instructions?: string;
1172711727+ temperature?: number;
1181711728 /**
1181811729 * Maximum number of output tokens for a single assistant response,
1181911730 * inclusive of tool calls. Provide an integer between 1 and 4096 to
···1182211733 *
1182311734 */
1182411735 max_response_output_tokens?: number | 'inf';
1173611736+};
1173711737+1173811738+/**
1173911739+ * Realtime session object configuration.
1174011740+ */
1174111741+export type RealtimeSessionCreateRequest = {
1182511742 /**
1182611743 * The set of modalities the model can respond with. To disable audio,
1182711744 * set this to ["text"].
···1184011757 | 'gpt-4o-mini-realtime-preview'
1184111758 | 'gpt-4o-mini-realtime-preview-2024-12-17';
1184211759 /**
1184311843- * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
1184411844- * For `pcm16`, output audio is sampled at a rate of 24kHz.
1176011760+ * The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior.
1176111761+ *
1176211762+ * Note that the server sets default instructions which will be used if this field is not set and are visible in the `session.created` event at the start of the session.
1184511763 *
1184611764 */
1184711847- output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
1176511765+ instructions?: string;
1184811766 /**
1184911849- * The speed of the model's spoken response. 1.0 is the default speed. 0.25 is
1185011850- * the minimum speed. 1.5 is the maximum speed. This value can only be changed
1185111851- * in between model turns, not while a response is in progress.
1176711767+ * The voice the model uses to respond. Voice cannot be changed during the
1176811768+ * session once the model has responded with audio at least once. Current
1176911769+ * voice options are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`,
1177011770+ * `shimmer`, and `verse`.
1177111771+ *
1177211772+ */
1177311773+ voice?: VoiceIdsShared;
1177411774+ /**
1177511775+ * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
1177611776+ * For `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate,
1177711777+ * single channel (mono), and little-endian byte order.
1185211778 *
1185311779 */
1185411854- speed?: number;
1178011780+ input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
1185511781 /**
1185611856- * Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a temperature of 0.8 is highly recommended for best performance.
1178211782+ * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
1178311783+ * For `pcm16`, output audio is sampled at a rate of 24kHz.
1185711784 *
1185811785 */
1185911859- temperature?: number;
1178611786+ output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
1186011787 /**
1186111861- * How the model chooses tools. Options are `auto`, `none`, `required`, or
1186211862- * specify a function.
1178811788+ * Configuration for input audio transcription, defaults to off and can be set to `null` to turn off once on. Input audio transcription is not native to the model, since the model consumes audio directly. Transcription runs asynchronously through [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription) and should be treated as guidance of input audio content rather than precisely what the model heard. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service.
1186311789 *
1186411790 */
1186511865- tool_choice?: string;
1179111791+ input_audio_transcription?: {
1179211792+ /**
1179311793+ * The model to use for transcription, current options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`.
1179411794+ *
1179511795+ */
1179611796+ model?: string;
1179711797+ /**
1179811798+ * The language of the input audio. Supplying the input language in
1179911799+ * [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format
1180011800+ * will improve accuracy and latency.
1180111801+ *
1180211802+ */
1180311803+ language?: string;
1180411804+ /**
1180511805+ * An optional text to guide the model's style or continue a previous audio
1180611806+ * segment.
1180711807+ * For `whisper-1`, the [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
1180811808+ * For `gpt-4o-transcribe` models, the prompt is a free text string, for example "expect words related to technology".
1180911809+ *
1181011810+ */
1181111811+ prompt?: string;
1181211812+ };
1186611813 /**
1186711867- * Tools (functions) available to the model.
1181411814+ * Configuration for turn detection, ether Server VAD or Semantic VAD. This can be set to `null` to turn off, in which case the client must manually trigger model response.
1181511815+ * Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech.
1181611816+ * Semantic VAD is more advanced and uses a turn detection model (in conjunction with VAD) to semantically estimate whether the user has finished speaking, then dynamically sets a timeout based on this probability. For example, if user audio trails off with "uhhm", the model will score a low probability of turn end and wait longer for the user to continue speaking. This can be useful for more natural conversations, but may have a higher latency.
1181711817+ *
1186811818 */
1186911869- tools?: Array<{
1181911819+ turn_detection?: {
1182011820+ /**
1182111821+ * Type of turn detection.
1182211822+ *
1182311823+ */
1182411824+ type?: 'server_vad' | 'semantic_vad';
1187011825 /**
1187111871- * The description of the function, including guidance on when and how
1187211872- * to call it, and guidance about what to tell the user when calling
1187311873- * (if anything).
1182611826+ * Used only for `semantic_vad` mode. The eagerness of the model to respond. `low` will wait longer for the user to continue speaking, `high` will respond more quickly. `auto` is the default and is equivalent to `medium`.
1187411827 *
1187511828 */
1187611876- description?: string;
1182911829+ eagerness?: 'low' | 'medium' | 'high' | 'auto';
1183011830+ /**
1183111831+ * Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A
1183211832+ * higher threshold will require louder audio to activate the model, and
1183311833+ * thus might perform better in noisy environments.
1183411834+ *
1183511835+ */
1183611836+ threshold?: number;
1183711837+ /**
1183811838+ * Used only for `server_vad` mode. Amount of audio to include before the VAD detected speech (in
1183911839+ * milliseconds). Defaults to 300ms.
1184011840+ *
1184111841+ */
1184211842+ prefix_padding_ms?: number;
1184311843+ /**
1184411844+ * Used only for `server_vad` mode. Duration of silence to detect speech stop (in milliseconds). Defaults
1184511845+ * to 500ms. With shorter values the model will respond more quickly,
1184611846+ * but may jump in on short pauses from the user.
1184711847+ *
1184811848+ */
1184911849+ silence_duration_ms?: number;
1187711850 /**
1187811878- * The name of the function.
1185111851+ * Whether or not to automatically generate a response when a VAD stop event occurs.
1185211852+ *
1187911853 */
1188011880- name?: string;
1185411854+ create_response?: boolean;
1188111855 /**
1188211882- * Parameters of the function in JSON Schema.
1185611856+ * Whether or not to automatically interrupt any ongoing response with output to the default
1185711857+ * conversation (i.e. `conversation` of `auto`) when a VAD start event occurs.
1185811858+ *
1188311859 */
1188411884- parameters?: {
1188511885- [key: string]: unknown;
1188611886- };
1186011860+ interrupt_response?: boolean;
1186111861+ };
1186211862+ /**
1186311863+ * Configuration for input audio noise reduction. This can be set to `null` to turn off.
1186411864+ * Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model.
1186511865+ * Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio.
1186611866+ *
1186711867+ */
1186811868+ input_audio_noise_reduction?: {
1188711869 /**
1188811888- * The type of the tool, i.e. `function`.
1187011870+ * Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones.
1187111871+ *
1188911872 */
1189011890- type?: 'function';
1189111891- }>;
1187311873+ type?: 'near_field' | 'far_field';
1187411874+ };
1187511875+ /**
1187611876+ * The speed of the model's spoken response. 1.0 is the default speed. 0.25 is
1187711877+ * the minimum speed. 1.5 is the maximum speed. This value can only be changed
1187811878+ * in between model turns, not while a response is in progress.
1187911879+ *
1188011880+ */
1188111881+ speed?: number;
1189211882 /**
1189311883 * Tracing Configuration
1189411884 *
···1190211892 tracing?:
1190311893 | 'auto'
1190411894 | {
1189511895+ /**
1189611896+ * The name of the workflow to attach to this trace. This is used to
1189711897+ * name the trace in the traces dashboard.
1189811898+ *
1189911899+ */
1190011900+ workflow_name?: string;
1190511901 /**
1190611902 * The group id to attach to this trace to enable filtering and
1190711903 * grouping in the traces dashboard.
···1191611912 metadata?: {
1191711913 [key: string]: unknown;
1191811914 };
1191911919- /**
1192011920- * The name of the workflow to attach to this trace. This is used to
1192111921- * name the trace in the traces dashboard.
1192211922- *
1192311923- */
1192411924- workflow_name?: string;
1192511915 };
1192611916 /**
1192711927- * Configuration for turn detection, ether Server VAD or Semantic VAD. This can be set to `null` to turn off, in which case the client must manually trigger model response.
1192811928- * Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech.
1192911929- * Semantic VAD is more advanced and uses a turn detection model (in conjunction with VAD) to semantically estimate whether the user has finished speaking, then dynamically sets a timeout based on this probability. For example, if user audio trails off with "uhhm", the model will score a low probability of turn end and wait longer for the user to continue speaking. This can be useful for more natural conversations, but may have a higher latency.
1193011930- *
1191711917+ * Tools (functions) available to the model.
1193111918 */
1193211932- turn_detection?: {
1191911919+ tools?: Array<{
1193311920 /**
1193411934- * Whether or not to automatically generate a response when a VAD stop event occurs.
1193511935- *
1192111921+ * The type of the tool, i.e. `function`.
1193611922 */
1193711937- create_response?: boolean;
1192311923+ type?: 'function';
1193811924 /**
1193911939- * Used only for `semantic_vad` mode. The eagerness of the model to respond. `low` will wait longer for the user to continue speaking, `high` will respond more quickly. `auto` is the default and is equivalent to `medium`.
1194011940- *
1192511925+ * The name of the function.
1194111926 */
1194211942- eagerness?: 'low' | 'medium' | 'high' | 'auto';
1192711927+ name?: string;
1194311928 /**
1194411944- * Whether or not to automatically interrupt any ongoing response with output to the default
1194511945- * conversation (i.e. `conversation` of `auto`) when a VAD start event occurs.
1192911929+ * The description of the function, including guidance on when and how
1193011930+ * to call it, and guidance about what to tell the user when calling
1193111931+ * (if anything).
1194611932 *
1194711933 */
1194811948- interrupt_response?: boolean;
1193411934+ description?: string;
1194911935 /**
1195011950- * Used only for `server_vad` mode. Amount of audio to include before the VAD detected speech (in
1195111951- * milliseconds). Defaults to 300ms.
1195211952- *
1193611936+ * Parameters of the function in JSON Schema.
1195311937 */
1195411954- prefix_padding_ms?: number;
1193811938+ parameters?: {
1193911939+ [key: string]: unknown;
1194011940+ };
1194111941+ }>;
1194211942+ /**
1194311943+ * How the model chooses tools. Options are `auto`, `none`, `required`, or
1194411944+ * specify a function.
1194511945+ *
1194611946+ */
1194711947+ tool_choice?: string;
1194811948+ /**
1194911949+ * Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a temperature of 0.8 is highly recommended for best performance.
1195011950+ *
1195111951+ */
1195211952+ temperature?: number;
1195311953+ /**
1195411954+ * Maximum number of output tokens for a single assistant response,
1195511955+ * inclusive of tool calls. Provide an integer between 1 and 4096 to
1195611956+ * limit output tokens, or `inf` for the maximum available tokens for a
1195711957+ * given model. Defaults to `inf`.
1195811958+ *
1195911959+ */
1196011960+ max_response_output_tokens?: number | 'inf';
1196111961+ /**
1196211962+ * Configuration options for the generated client secret.
1196311963+ *
1196411964+ */
1196511965+ client_secret?: {
1195511966 /**
1195611956- * Used only for `server_vad` mode. Duration of silence to detect speech stop (in milliseconds). Defaults
1195711957- * to 500ms. With shorter values the model will respond more quickly,
1195811958- * but may jump in on short pauses from the user.
1196711967+ * Configuration for the ephemeral token expiration.
1195911968 *
1196011969 */
1196111961- silence_duration_ms?: number;
1196211962- /**
1196311963- * Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A
1196411964- * higher threshold will require louder audio to activate the model, and
1196511965- * thus might perform better in noisy environments.
1196611966- *
1196711967- */
1196811968- threshold?: number;
1196911969- /**
1197011970- * Type of turn detection.
1197111971- *
1197211972- */
1197311973- type?: 'server_vad' | 'semantic_vad';
1197011970+ expires_after?: {
1197111971+ /**
1197211972+ * The anchor point for the ephemeral token expiration. Only `created_at` is currently supported.
1197311973+ *
1197411974+ */
1197511975+ anchor: 'created_at';
1197611976+ /**
1197711977+ * The number of seconds from the anchor point to the expiration. Select a value between `10` and `7200`.
1197811978+ *
1197911979+ */
1198011980+ seconds?: number;
1198111981+ };
1197411982 };
1197511975- /**
1197611976- * The voice the model uses to respond. Voice cannot be changed during the
1197711977- * session once the model has responded with audio at least once. Current
1197811978- * voice options are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`,
1197911979- * `shimmer`, and `verse`.
1198011980- *
1198111981- */
1198211982- voice?: VoiceIdsShared;
1198311983};
11984119841198511985/**
···1199311993 */
1199411994 client_secret: {
1199511995 /**
1199611996- * Timestamp for when the token expires. Currently, all tokens expire
1199711997- * after one minute.
1199811998- *
1199911999- */
1200012000- expires_at: number;
1200112001- /**
1200211996 * Ephemeral key usable in client environments to authenticate connections
1200311997 * to the Realtime API. Use this in client-side environments rather than
1200411998 * a standard API token, which should only be used server-side.
1200511999 *
1200612000 */
1200712001 value: string;
1200812008- };
1200912009- /**
1201012010- * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
1201112011- *
1201212012- */
1201312013- input_audio_format?: string;
1201412014- /**
1201512015- * Configuration for input audio transcription, defaults to off and can be
1201612016- * set to `null` to turn off once on. Input audio transcription is not native
1201712017- * to the model, since the model consumes audio directly. Transcription runs
1201812018- * asynchronously and should be treated as rough guidance
1201912019- * rather than the representation understood by the model.
1202012020- *
1202112021- */
1202212022- input_audio_transcription?: {
1202312002 /**
1202412024- * The model to use for transcription.
1200312003+ * Timestamp for when the token expires. Currently, all tokens expire
1200412004+ * after one minute.
1202512005 *
1202612006 */
1202712027- model?: string;
1200712007+ expires_at: number;
1202812008 };
1200912009+ /**
1201012010+ * The set of modalities the model can respond with. To disable audio,
1201112011+ * set this to ["text"].
1201212012+ *
1201312013+ */
1201412014+ modalities?: unknown;
1202912015 /**
1203012016 * The default system instructions (i.e. system message) prepended to model
1203112017 * calls. This field allows the client to guide the model on desired
···1204312029 */
1204412030 instructions?: string;
1204512031 /**
1204612046- * Maximum number of output tokens for a single assistant response,
1204712047- * inclusive of tool calls. Provide an integer between 1 and 4096 to
1204812048- * limit output tokens, or `inf` for the maximum available tokens for a
1204912049- * given model. Defaults to `inf`.
1203212032+ * The voice the model uses to respond. Voice cannot be changed during the
1203312033+ * session once the model has responded with audio at least once. Current
1203412034+ * voice options are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`,
1203512035+ * `shimmer`, and `verse`.
1205012036 *
1205112037 */
1205212052- max_response_output_tokens?: number | 'inf';
1203812038+ voice?: VoiceIdsShared;
1205312039 /**
1205412054- * The set of modalities the model can respond with. To disable audio,
1205512055- * set this to ["text"].
1204012040+ * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
1205612041 *
1205712042 */
1205812058- modalities?: unknown;
1204312043+ input_audio_format?: string;
1205912044 /**
1206012045 * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
1206112046 *
1206212047 */
1206312048 output_audio_format?: string;
1206412049 /**
1205012050+ * Configuration for input audio transcription, defaults to off and can be
1205112051+ * set to `null` to turn off once on. Input audio transcription is not native
1205212052+ * to the model, since the model consumes audio directly. Transcription runs
1205312053+ * asynchronously and should be treated as rough guidance
1205412054+ * rather than the representation understood by the model.
1205512055+ *
1205612056+ */
1205712057+ input_audio_transcription?: {
1205812058+ /**
1205912059+ * The model to use for transcription.
1206012060+ *
1206112061+ */
1206212062+ model?: string;
1206312063+ };
1206412064+ /**
1206512065 * The speed of the model's spoken response. 1.0 is the default speed. 0.25 is
1206612066 * the minimum speed. 1.5 is the maximum speed. This value can only be changed
1206712067 * in between model turns, not while a response is in progress.
···1206912069 */
1207012070 speed?: number;
1207112071 /**
1207212072- * Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.
1207312073- *
1207412074- */
1207512075- temperature?: number;
1207612076- /**
1207712077- * How the model chooses tools. Options are `auto`, `none`, `required`, or
1207812078- * specify a function.
1207912079- *
1208012080- */
1208112081- tool_choice?: string;
1208212082- /**
1208312083- * Tools (functions) available to the model.
1208412084- */
1208512085- tools?: Array<{
1208612086- /**
1208712087- * The description of the function, including guidance on when and how
1208812088- * to call it, and guidance about what to tell the user when calling
1208912089- * (if anything).
1209012090- *
1209112091- */
1209212092- description?: string;
1209312093- /**
1209412094- * The name of the function.
1209512095- */
1209612096- name?: string;
1209712097- /**
1209812098- * Parameters of the function in JSON Schema.
1209912099- */
1210012100- parameters?: {
1210112101- [key: string]: unknown;
1210212102- };
1210312103- /**
1210412104- * The type of the tool, i.e. `function`.
1210512105- */
1210612106- type?: 'function';
1210712107- }>;
1210812108- /**
1210912072 * Tracing Configuration
1211012073 *
1211112074 * Configuration options for tracing. Set to null to disable tracing. Once
···1211812081 tracing?:
1211912082 | 'auto'
1212012083 | {
1208412084+ /**
1208512085+ * The name of the workflow to attach to this trace. This is used to
1208612086+ * name the trace in the traces dashboard.
1208712087+ *
1208812088+ */
1208912089+ workflow_name?: string;
1212112090 /**
1212212091 * The group id to attach to this trace to enable filtering and
1212312092 * grouping in the traces dashboard.
···1213212101 metadata?: {
1213312102 [key: string]: unknown;
1213412103 };
1213512135- /**
1213612136- * The name of the workflow to attach to this trace. This is used to
1213712137- * name the trace in the traces dashboard.
1213812138- *
1213912139- */
1214012140- workflow_name?: string;
1214112104 };
1214212105 /**
1214312106 * Configuration for turn detection. Can be set to `null` to turn off. Server
···1214712110 */
1214812111 turn_detection?: {
1214912112 /**
1211312113+ * Type of turn detection, only `server_vad` is currently supported.
1211412114+ *
1211512115+ */
1211612116+ type?: string;
1211712117+ /**
1211812118+ * Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A
1211912119+ * higher threshold will require louder audio to activate the model, and
1212012120+ * thus might perform better in noisy environments.
1212112121+ *
1212212122+ */
1212312123+ threshold?: number;
1212412124+ /**
1215012125 * Amount of audio to include before the VAD detected speech (in
1215112126 * milliseconds). Defaults to 300ms.
1215212127 *
···1215912134 *
1216012135 */
1216112136 silence_duration_ms?: number;
1213712137+ };
1213812138+ /**
1213912139+ * Tools (functions) available to the model.
1214012140+ */
1214112141+ tools?: Array<{
1216212142 /**
1216312163- * Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A
1216412164- * higher threshold will require louder audio to activate the model, and
1216512165- * thus might perform better in noisy environments.
1214312143+ * The type of the tool, i.e. `function`.
1214412144+ */
1214512145+ type?: 'function';
1214612146+ /**
1214712147+ * The name of the function.
1214812148+ */
1214912149+ name?: string;
1215012150+ /**
1215112151+ * The description of the function, including guidance on when and how
1215212152+ * to call it, and guidance about what to tell the user when calling
1215312153+ * (if anything).
1216612154 *
1216712155 */
1216812168- threshold?: number;
1215612156+ description?: string;
1216912157 /**
1217012170- * Type of turn detection, only `server_vad` is currently supported.
1217112171- *
1215812158+ * Parameters of the function in JSON Schema.
1217212159 */
1217312173- type?: string;
1217412174- };
1216012160+ parameters?: {
1216112161+ [key: string]: unknown;
1216212162+ };
1216312163+ }>;
1216412164+ /**
1216512165+ * How the model chooses tools. Options are `auto`, `none`, `required`, or
1216612166+ * specify a function.
1216712167+ *
1216812168+ */
1216912169+ tool_choice?: string;
1217512170 /**
1217612176- * The voice the model uses to respond. Voice cannot be changed during the
1217712177- * session once the model has responded with audio at least once. Current
1217812178- * voice options are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`,
1217912179- * `shimmer`, and `verse`.
1217112171+ * Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.
1218012172 *
1218112173 */
1218212182- voice?: VoiceIdsShared;
1217412174+ temperature?: number;
1217512175+ /**
1217612176+ * Maximum number of output tokens for a single assistant response,
1217712177+ * inclusive of tool calls. Provide an integer between 1 and 4096 to
1217812178+ * limit output tokens, or `inf` for the maximum available tokens for a
1217912179+ * given model. Defaults to `inf`.
1218012180+ *
1218112181+ */
1218212182+ max_response_output_tokens?: number | 'inf';
1218312183};
12184121841218512185/**
···1218712187 */
1218812188export type RealtimeTranscriptionSessionCreateRequest = {
1218912189 /**
1219012190- * Configuration options for the generated client secret.
1219012190+ * The set of modalities the model can respond with. To disable audio,
1219112191+ * set this to ["text"].
1219112192 *
1219212193 */
1219312193- client_secret?: {
1219412194- /**
1219512195- * Configuration for the ephemeral token expiration.
1219612196- *
1219712197- */
1219812198- expires_at?: {
1219912199- /**
1220012200- * The anchor point for the ephemeral token expiration. Only `created_at` is currently supported.
1220112201- *
1220212202- */
1220312203- anchor?: 'created_at';
1220412204- /**
1220512205- * The number of seconds from the anchor point to the expiration. Select a value between `10` and `7200`.
1220612206- *
1220712207- */
1220812208- seconds?: number;
1220912209- };
1221012210- };
1221112211- /**
1221212212- * The set of items to include in the transcription. Current available items are:
1221312213- * - `item.input_audio_transcription.logprobs`
1221412214- *
1221512215- */
1221612216- include?: Array<string>;
1219412194+ modalities?: unknown;
1221712195 /**
1221812196 * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
1221912197 * For `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate,
···1222212200 */
1222312201 input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
1222412202 /**
1222512225- * Configuration for input audio noise reduction. This can be set to `null` to turn off.
1222612226- * Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model.
1222712227- * Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio.
1220312203+ * Configuration for input audio transcription. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service.
1222812204 *
1222912205 */
1223012230- input_audio_noise_reduction?: {
1220612206+ input_audio_transcription?: {
1223112207 /**
1223212232- * Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones.
1220812208+ * The model to use for transcription, current options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`.
1223312209 *
1223412210 */
1223512235- type?: 'near_field' | 'far_field';
1223612236- };
1223712237- /**
1223812238- * Configuration for input audio transcription. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service.
1223912239- *
1224012240- */
1224112241- input_audio_transcription?: {
1221112211+ model?: 'gpt-4o-transcribe' | 'gpt-4o-mini-transcribe' | 'whisper-1';
1224212212 /**
1224312213 * The language of the input audio. Supplying the input language in
1224412214 * [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format
···1224712217 */
1224812218 language?: string;
1224912219 /**
1225012250- * The model to use for transcription, current options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`.
1225112251- *
1225212252- */
1225312253- model?: 'gpt-4o-transcribe' | 'gpt-4o-mini-transcribe' | 'whisper-1';
1225412254- /**
1225512220 * An optional text to guide the model's style or continue a previous audio
1225612221 * segment.
1225712222 * For `whisper-1`, the [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
···1226012225 */
1226112226 prompt?: string;
1226212227 };
1226312263- /**
1226412264- * The set of modalities the model can respond with. To disable audio,
1226512265- * set this to ["text"].
1226612266- *
1226712267- */
1226812268- modalities?: unknown;
1226912228 /**
1227012229 * Configuration for turn detection, ether Server VAD or Semantic VAD. This can be set to `null` to turn off, in which case the client must manually trigger model response.
1227112230 * Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech.
···1227412233 */
1227512234 turn_detection?: {
1227612235 /**
1227712277- * Whether or not to automatically generate a response when a VAD stop event occurs. Not available for transcription sessions.
1223612236+ * Type of turn detection.
1227812237 *
1227912238 */
1228012280- create_response?: boolean;
1223912239+ type?: 'server_vad' | 'semantic_vad';
1228112240 /**
1228212241 * Used only for `semantic_vad` mode. The eagerness of the model to respond. `low` will wait longer for the user to continue speaking, `high` will respond more quickly. `auto` is the default and is equivalent to `medium`.
1228312242 *
1228412243 */
1228512244 eagerness?: 'low' | 'medium' | 'high' | 'auto';
1228612245 /**
1228712287- * Whether or not to automatically interrupt any ongoing response with output to the default
1228812288- * conversation (i.e. `conversation` of `auto`) when a VAD start event occurs. Not available for transcription sessions.
1224612246+ * Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A
1224712247+ * higher threshold will require louder audio to activate the model, and
1224812248+ * thus might perform better in noisy environments.
1228912249 *
1229012250 */
1229112291- interrupt_response?: boolean;
1225112251+ threshold?: number;
1229212252 /**
1229312253 * Used only for `server_vad` mode. Amount of audio to include before the VAD detected speech (in
1229412254 * milliseconds). Defaults to 300ms.
···1230312263 */
1230412264 silence_duration_ms?: number;
1230512265 /**
1230612306- * Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A
1230712307- * higher threshold will require louder audio to activate the model, and
1230812308- * thus might perform better in noisy environments.
1226612266+ * Whether or not to automatically generate a response when a VAD stop event occurs. Not available for transcription sessions.
1226712267+ *
1226812268+ */
1226912269+ create_response?: boolean;
1227012270+ /**
1227112271+ * Whether or not to automatically interrupt any ongoing response with output to the default
1227212272+ * conversation (i.e. `conversation` of `auto`) when a VAD start event occurs. Not available for transcription sessions.
1230912273 *
1231012274 */
1231112311- threshold?: number;
1227512275+ interrupt_response?: boolean;
1227612276+ };
1227712277+ /**
1227812278+ * Configuration for input audio noise reduction. This can be set to `null` to turn off.
1227912279+ * Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model.
1228012280+ * Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio.
1228112281+ *
1228212282+ */
1228312283+ input_audio_noise_reduction?: {
1231212284 /**
1231312313- * Type of turn detection.
1228512285+ * Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones.
1231412286 *
1231512287 */
1231612316- type?: 'server_vad' | 'semantic_vad';
1228812288+ type?: 'near_field' | 'far_field';
1228912289+ };
1229012290+ /**
1229112291+ * The set of items to include in the transcription. Current available items are:
1229212292+ * - `item.input_audio_transcription.logprobs`
1229312293+ *
1229412294+ */
1229512295+ include?: Array<string>;
1229612296+ /**
1229712297+ * Configuration options for the generated client secret.
1229812298+ *
1229912299+ */
1230012300+ client_secret?: {
1230112301+ /**
1230212302+ * Configuration for the ephemeral token expiration.
1230312303+ *
1230412304+ */
1230512305+ expires_at?: {
1230612306+ /**
1230712307+ * The anchor point for the ephemeral token expiration. Only `created_at` is currently supported.
1230812308+ *
1230912309+ */
1231012310+ anchor?: 'created_at';
1231112311+ /**
1231212312+ * The number of seconds from the anchor point to the expiration. Select a value between `10` and `7200`.
1231312313+ *
1231412314+ */
1231512315+ seconds?: number;
1231612316+ };
1231712317 };
1231812318};
1231912319···1233312333 */
1233412334 client_secret: {
1233512335 /**
1233612336- * Timestamp for when the token expires. Currently, all tokens expire
1233712337- * after one minute.
1233812338- *
1233912339- */
1234012340- expires_at: number;
1234112341- /**
1234212336 * Ephemeral key usable in client environments to authenticate connections
1234312337 * to the Realtime API. Use this in client-side environments rather than
1234412338 * a standard API token, which should only be used server-side.
1234512339 *
1234612340 */
1234712341 value: string;
1234212342+ /**
1234312343+ * Timestamp for when the token expires. Currently, all tokens expire
1234412344+ * after one minute.
1234512345+ *
1234612346+ */
1234712347+ expires_at: number;
1234812348 };
1234912349+ /**
1235012350+ * The set of modalities the model can respond with. To disable audio,
1235112351+ * set this to ["text"].
1235212352+ *
1235312353+ */
1235412354+ modalities?: unknown;
1234912355 /**
1235012356 * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
1235112357 *
···1235712363 */
1235812364 input_audio_transcription?: {
1235912365 /**
1236612366+ * The model to use for transcription. Can be `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, or `whisper-1`.
1236712367+ *
1236812368+ */
1236912369+ model?: 'gpt-4o-transcribe' | 'gpt-4o-mini-transcribe' | 'whisper-1';
1237012370+ /**
1236012371 * The language of the input audio. Supplying the input language in
1236112372 * [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format
1236212373 * will improve accuracy and latency.
···1236412375 */
1236512376 language?: string;
1236612377 /**
1236712367- * The model to use for transcription. Can be `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, or `whisper-1`.
1236812368- *
1236912369- */
1237012370- model?: 'gpt-4o-transcribe' | 'gpt-4o-mini-transcribe' | 'whisper-1';
1237112371- /**
1237212378 * An optional text to guide the model's style or continue a previous audio
1237312379 * segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) should match
1237412380 * the audio language.
···1237712383 prompt?: string;
1237812384 };
1237912385 /**
1238012380- * The set of modalities the model can respond with. To disable audio,
1238112381- * set this to ["text"].
1238212382- *
1238312383- */
1238412384- modalities?: unknown;
1238512385- /**
1238612386 * Configuration for turn detection. Can be set to `null` to turn off. Server
1238712387 * VAD means that the model will detect the start and end of speech based on
1238812388 * audio volume and respond at the end of user speech.
···1239012390 */
1239112391 turn_detection?: {
1239212392 /**
1239312393- * Amount of audio to include before the VAD detected speech (in
1239412394- * milliseconds). Defaults to 300ms.
1239512395- *
1239612396- */
1239712397- prefix_padding_ms?: number;
1239812398- /**
1239912399- * Duration of silence to detect speech stop (in milliseconds). Defaults
1240012400- * to 500ms. With shorter values the model will respond more quickly,
1240112401- * but may jump in on short pauses from the user.
1239312393+ * Type of turn detection, only `server_vad` is currently supported.
1240212394 *
1240312395 */
1240412404- silence_duration_ms?: number;
1239612396+ type?: string;
1240512397 /**
1240612398 * Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A
1240712399 * higher threshold will require louder audio to activate the model, and
···1241012402 */
1241112403 threshold?: number;
1241212404 /**
1241312413- * Type of turn detection, only `server_vad` is currently supported.
1240512405+ * Amount of audio to include before the VAD detected speech (in
1240612406+ * milliseconds). Defaults to 300ms.
1240712407+ *
1240812408+ */
1240912409+ prefix_padding_ms?: number;
1241012410+ /**
1241112411+ * Duration of silence to detect speech stop (in milliseconds). Defaults
1241212412+ * to 500ms. With shorter values the model will respond more quickly,
1241312413+ * but may jump in on short pauses from the user.
1241412414 *
1241512415 */
1241612416- type?: string;
1241612416+ silence_duration_ms?: number;
1241712417 };
1241812418};
1241912419···1242912429export type Reasoning = {
1243012430 effort?: ReasoningEffort;
1243112431 /**
1243212432- * **Deprecated:** use `summary` instead.
1243312433- *
1243412432 * A summary of the reasoning performed by the model. This can be
1243512433 * useful for debugging and understanding the model's reasoning process.
1243612434 * One of `auto`, `concise`, or `detailed`.
1243712435 *
1243812438- *
1243912439- * @deprecated
1244012436 */
1244112441- generate_summary?: 'auto' | 'concise' | 'detailed';
1243712437+ summary?: 'auto' | 'concise' | 'detailed';
1244212438 /**
1243912439+ * **Deprecated:** use `summary` instead.
1244012440+ *
1244312441 * A summary of the reasoning performed by the model. This can be
1244412442 * useful for debugging and understanding the model's reasoning process.
1244512443 * One of `auto`, `concise`, or `detailed`.
1244612444 *
1244512445+ *
1244612446+ * @deprecated
1244712447 */
1244812448- summary?: 'auto' | 'concise' | 'detailed';
1244812448+ generate_summary?: 'auto' | 'concise' | 'detailed';
1244912449};
12450124501245112451/**
···1245712457 *
1245812458 */
1245912459export const ReasoningEffort = {
1246012460- HIGH: 'high',
1246012460+ MINIMAL: 'minimal',
1246112461 LOW: 'low',
1246212462 MEDIUM: 'medium',
1246312463- MINIMAL: 'minimal',
1246312463+ HIGH: 'high',
1246412464} as const;
12465124651246612466/**
···1248512485 */
1248612486export type ReasoningItem = {
1248712487 /**
1248812488- * Reasoning text content.
1248812488+ * The type of the object. Always `reasoning`.
1248912489 *
1249012490 */
1249112491- content?: Array<{
1249212492- /**
1249312493- * Reasoning text output from the model.
1249412494- *
1249512495- */
1249612496- text: string;
1249712497- /**
1249812498- * The type of the object. Always `reasoning_text`.
1249912499- *
1250012500- */
1250112501- type: 'reasoning_text';
1250212502- }>;
1250312503- /**
1250412504- * The encrypted content of the reasoning item - populated when a response is
1250512505- * generated with `reasoning.encrypted_content` in the `include` parameter.
1250612506- *
1250712507- */
1250812508- encrypted_content?: string;
1249112491+ type: 'reasoning';
1250912492 /**
1251012493 * The unique identifier of the reasoning content.
1251112494 *
1251212495 */
1251312496 id: string;
1251412497 /**
1251512515- * The status of the item. One of `in_progress`, `completed`, or
1251612516- * `incomplete`. Populated when items are returned via API.
1249812498+ * The encrypted content of the reasoning item - populated when a response is
1249912499+ * generated with `reasoning.encrypted_content` in the `include` parameter.
1251712500 *
1251812501 */
1251912519- status?: 'in_progress' | 'completed' | 'incomplete';
1250212502+ encrypted_content?: string;
1252012503 /**
1252112504 * Reasoning summary content.
1252212505 *
1252312506 */
1252412507 summary: Array<{
1252512508 /**
1250912509+ * The type of the object. Always `summary_text`.
1251012510+ *
1251112511+ */
1251212512+ type: 'summary_text';
1251312513+ /**
1252612514 * A summary of the reasoning output from the model so far.
1252712515 *
1252812516 */
1252912517 text: string;
1251812518+ }>;
1251912519+ /**
1252012520+ * Reasoning text content.
1252112521+ *
1252212522+ */
1252312523+ content?: Array<{
1253012524 /**
1253112531- * The type of the object. Always `summary_text`.
1252512525+ * The type of the object. Always `reasoning_text`.
1253212526 *
1253312527 */
1253412534- type: 'summary_text';
1252812528+ type: 'reasoning_text';
1252912529+ /**
1253012530+ * Reasoning text output from the model.
1253112531+ *
1253212532+ */
1253312533+ text: string;
1253512534 }>;
1253612535 /**
1253712537- * The type of the object. Always `reasoning`.
1253612536+ * The status of the item. One of `in_progress`, `completed`, or
1253712537+ * `incomplete`. Populated when items are returned via API.
1253812538 *
1253912539 */
1254012540- type: 'reasoning';
1254012540+ status?: 'in_progress' | 'completed' | 'incomplete';
1254112541};
12542125421254312543/**
···1254612546export type Response = ModelResponseProperties &
1254712547 ResponseProperties & {
1254812548 /**
1254912549- * Unix timestamp (in seconds) of when this Response was created.
1254912549+ * Unique identifier for this Response.
1255012550 *
1255112551 */
1255212552- created_at: number;
1255312553- error: ResponseError;
1255212552+ id: string;
1255412553 /**
1255512555- * Unique identifier for this Response.
1255412554+ * The object type of this resource - always set to `response`.
1255612555 *
1255712556 */
1255812558- id: string;
1255712557+ object: 'response';
1255812558+ /**
1255912559+ * The status of the response generation. One of `completed`, `failed`,
1256012560+ * `in_progress`, `cancelled`, `queued`, or `incomplete`.
1256112561+ *
1256212562+ */
1256312563+ status?:
1256412564+ | 'completed'
1256512565+ | 'failed'
1256612566+ | 'in_progress'
1256712567+ | 'cancelled'
1256812568+ | 'queued'
1256912569+ | 'incomplete';
1257012570+ /**
1257112571+ * Unix timestamp (in seconds) of when this Response was created.
1257212572+ *
1257312573+ */
1257412574+ created_at: number;
1257512575+ error: ResponseError;
1255912576 /**
1256012577 * Details about why the response is incomplete.
1256112578 *
···1256712584 reason?: 'max_output_tokens' | 'content_filter';
1256812585 };
1256912586 /**
1257012570- * A system (or developer) message inserted into the model's context.
1257112571- *
1257212572- * When using along with `previous_response_id`, the instructions from a previous
1257312573- * response will not be carried over to the next response. This makes it simple
1257412574- * to swap out system (or developer) messages in new responses.
1257512575- *
1257612576- */
1257712577- instructions: string | Array<InputItem>;
1257812578- /**
1257912579- * The object type of this resource - always set to `response`.
1258012580- *
1258112581- */
1258212582- object: 'response';
1258312583- /**
1258412587 * An array of content items generated by the model.
1258512588 *
1258612589 * - The length and order of items in the `output` array is dependent
···1259312596 */
1259412597 output: Array<OutputItem>;
1259512598 /**
1259912599+ * A system (or developer) message inserted into the model's context.
1260012600+ *
1260112601+ * When using along with `previous_response_id`, the instructions from a previous
1260212602+ * response will not be carried over to the next response. This makes it simple
1260312603+ * to swap out system (or developer) messages in new responses.
1260412604+ *
1260512605+ */
1260612606+ instructions: string | Array<InputItem>;
1260712607+ /**
1259612608 * SDK-only convenience property that contains the aggregated text output
1259712609 * from all `output_text` items in the `output` array, if any are present.
1259812610 * Supported in the Python and JavaScript SDKs.
1259912611 *
1260012612 */
1260112613 output_text?: string;
1261412614+ usage?: ResponseUsage;
1260212615 /**
1260312616 * Whether to allow the model to run tool calls in parallel.
1260412617 *
1260512618 */
1260612619 parallel_tool_calls: boolean;
1260712607- /**
1260812608- * The status of the response generation. One of `completed`, `failed`,
1260912609- * `in_progress`, `cancelled`, `queued`, or `incomplete`.
1261012610- *
1261112611- */
1261212612- status?:
1261312613- | 'completed'
1261412614- | 'failed'
1261512615- | 'in_progress'
1261612616- | 'cancelled'
1261712617- | 'queued'
1261812618- | 'incomplete';
1261912619- usage?: ResponseUsage;
1262012620 };
12621126211262212622/**
···1262412624 */
1262512625export type ResponseAudioDeltaEvent = {
1262612626 /**
1262712627- * A chunk of Base64 encoded response audio bytes.
1262712627+ * The type of the event. Always `response.audio.delta`.
1262812628 *
1262912629 */
1263012630- delta: string;
1263012630+ type: 'response.audio.delta';
1263112631 /**
1263212632 * A sequence number for this chunk of the stream response.
1263312633 *
1263412634 */
1263512635 sequence_number: number;
1263612636 /**
1263712637- * The type of the event. Always `response.audio.delta`.
1263712637+ * A chunk of Base64 encoded response audio bytes.
1263812638 *
1263912639 */
1264012640- type: 'response.audio.delta';
1264012640+ delta: string;
1264112641};
12642126421264312643/**
···1264512645 */
1264612646export type ResponseAudioDoneEvent = {
1264712647 /**
1264812648- * The sequence number of the delta.
1264812648+ * The type of the event. Always `response.audio.done`.
1264912649 *
1265012650 */
1265112651- sequence_number: number;
1265112651+ type: 'response.audio.done';
1265212652 /**
1265312653- * The type of the event. Always `response.audio.done`.
1265312653+ * The sequence number of the delta.
1265412654 *
1265512655 */
1265612656- type: 'response.audio.done';
1265612656+ sequence_number: number;
1265712657};
12658126581265912659/**
1266012660 * Emitted when there is a partial transcript of audio.
1266112661 */
1266212662export type ResponseAudioTranscriptDeltaEvent = {
1266312663+ /**
1266412664+ * The type of the event. Always `response.audio.transcript.delta`.
1266512665+ *
1266612666+ */
1266712667+ type: 'response.audio.transcript.delta';
1266312668 /**
1266412669 * The partial transcript of the audio response.
1266512670 *
···1266912674 * The sequence number of this event.
1267012675 */
1267112676 sequence_number: number;
1267212672- /**
1267312673- * The type of the event. Always `response.audio.transcript.delta`.
1267412674- *
1267512675- */
1267612676- type: 'response.audio.transcript.delta';
1267712677};
12678126781267912679/**
···1268112681 */
1268212682export type ResponseAudioTranscriptDoneEvent = {
1268312683 /**
1268412684- * The sequence number of this event.
1268512685- */
1268612686- sequence_number: number;
1268712687- /**
1268812684 * The type of the event. Always `response.audio.transcript.done`.
1268912685 *
1269012686 */
1269112687 type: 'response.audio.transcript.done';
1268812688+ /**
1268912689+ * The sequence number of this event.
1269012690+ */
1269112691+ sequence_number: number;
1269212692};
12693126931269412694/**
···1269612696 */
1269712697export type ResponseCodeInterpreterCallCodeDeltaEvent = {
1269812698 /**
1269912699- * The partial code snippet being streamed by the code interpreter.
1269912699+ * The type of the event. Always `response.code_interpreter_call_code.delta`.
1270012700+ */
1270112701+ type: 'response.code_interpreter_call_code.delta';
1270212702+ /**
1270312703+ * The index of the output item in the response for which the code is being streamed.
1270012704 */
1270112701- delta: string;
1270512705+ output_index: number;
1270212706 /**
1270312707 * The unique identifier of the code interpreter tool call item.
1270412708 */
1270512709 item_id: string;
1270612710 /**
1270712707- * The index of the output item in the response for which the code is being streamed.
1271112711+ * The partial code snippet being streamed by the code interpreter.
1270812712 */
1270912709- output_index: number;
1271312713+ delta: string;
1271012714 /**
1271112715 * The sequence number of this event, used to order streaming events.
1271212716 */
1271312717 sequence_number: number;
1271412714- /**
1271512715- * The type of the event. Always `response.code_interpreter_call_code.delta`.
1271612716- */
1271712717- type: 'response.code_interpreter_call_code.delta';
1271812718};
12719127191272012720/**
···1272212722 */
1272312723export type ResponseCodeInterpreterCallCodeDoneEvent = {
1272412724 /**
1272512725- * The final code snippet output by the code interpreter.
1272512725+ * The type of the event. Always `response.code_interpreter_call_code.done`.
1272612726+ */
1272712727+ type: 'response.code_interpreter_call_code.done';
1272812728+ /**
1272912729+ * The index of the output item in the response for which the code is finalized.
1272612730 */
1272712727- code: string;
1273112731+ output_index: number;
1272812732 /**
1272912733 * The unique identifier of the code interpreter tool call item.
1273012734 */
1273112735 item_id: string;
1273212736 /**
1273312733- * The index of the output item in the response for which the code is finalized.
1273712737+ * The final code snippet output by the code interpreter.
1273412738 */
1273512735- output_index: number;
1273912739+ code: string;
1273612740 /**
1273712741 * The sequence number of this event, used to order streaming events.
1273812742 */
1273912743 sequence_number: number;
1274012740- /**
1274112741- * The type of the event. Always `response.code_interpreter_call_code.done`.
1274212742- */
1274312743- type: 'response.code_interpreter_call_code.done';
1274412744};
12745127451274612746/**
···1274812748 */
1274912749export type ResponseCodeInterpreterCallCompletedEvent = {
1275012750 /**
1275112751- * The unique identifier of the code interpreter tool call item.
1275112751+ * The type of the event. Always `response.code_interpreter_call.completed`.
1275212752 */
1275312753- item_id: string;
1275312753+ type: 'response.code_interpreter_call.completed';
1275412754 /**
1275512755 * The index of the output item in the response for which the code interpreter call is completed.
1275612756 */
1275712757 output_index: number;
1275812758 /**
1275912759- * The sequence number of this event, used to order streaming events.
1275912759+ * The unique identifier of the code interpreter tool call item.
1276012760 */
1276112761- sequence_number: number;
1276112761+ item_id: string;
1276212762 /**
1276312763- * The type of the event. Always `response.code_interpreter_call.completed`.
1276312763+ * The sequence number of this event, used to order streaming events.
1276412764 */
1276512765- type: 'response.code_interpreter_call.completed';
1276512765+ sequence_number: number;
1276612766};
12767127671276812768/**
···1277012770 */
1277112771export type ResponseCodeInterpreterCallInProgressEvent = {
1277212772 /**
1277312773- * The unique identifier of the code interpreter tool call item.
1277312773+ * The type of the event. Always `response.code_interpreter_call.in_progress`.
1277412774 */
1277512775- item_id: string;
1277512775+ type: 'response.code_interpreter_call.in_progress';
1277612776 /**
1277712777 * The index of the output item in the response for which the code interpreter call is in progress.
1277812778 */
1277912779 output_index: number;
1278012780 /**
1278112781+ * The unique identifier of the code interpreter tool call item.
1278212782+ */
1278312783+ item_id: string;
1278412784+ /**
1278112785 * The sequence number of this event, used to order streaming events.
1278212786 */
1278312787 sequence_number: number;
1278412784- /**
1278512785- * The type of the event. Always `response.code_interpreter_call.in_progress`.
1278612786- */
1278712787- type: 'response.code_interpreter_call.in_progress';
1278812788};
12789127891279012790/**
···1279212792 */
1279312793export type ResponseCodeInterpreterCallInterpretingEvent = {
1279412794 /**
1279512795- * The unique identifier of the code interpreter tool call item.
1279512795+ * The type of the event. Always `response.code_interpreter_call.interpreting`.
1279612796 */
1279712797- item_id: string;
1279712797+ type: 'response.code_interpreter_call.interpreting';
1279812798 /**
1279912799 * The index of the output item in the response for which the code interpreter is interpreting code.
1280012800 */
1280112801 output_index: number;
1280212802+ /**
1280312803+ * The unique identifier of the code interpreter tool call item.
1280412804+ */
1280512805+ item_id: string;
1280212806 /**
1280312807 * The sequence number of this event, used to order streaming events.
1280412808 */
1280512809 sequence_number: number;
1280612806- /**
1280712807- * The type of the event. Always `response.code_interpreter_call.interpreting`.
1280812808- */
1280912809- type: 'response.code_interpreter_call.interpreting';
1281012810};
12811128111281212812/**
···1281412814 */
1281512815export type ResponseCompletedEvent = {
1281612816 /**
1281712817+ * The type of the event. Always `response.completed`.
1281812818+ *
1281912819+ */
1282012820+ type: 'response.completed';
1282112821+ /**
1281712822 * Properties of the completed response.
1281812823 *
1281912824 */
···1282212827 * The sequence number for this event.
1282312828 */
1282412829 sequence_number: number;
1282512825- /**
1282612826- * The type of the event. Always `response.completed`.
1282712827- *
1282812828- */
1282912829- type: 'response.completed';
1283012830};
12831128311283212832/**
···1283412834 */
1283512835export type ResponseContentPartAddedEvent = {
1283612836 /**
1283712837- * The index of the content part that was added.
1283712837+ * The type of the event. Always `response.content_part.added`.
1283812838 *
1283912839 */
1284012840- content_index: number;
1284012840+ type: 'response.content_part.added';
1284112841 /**
1284212842 * The ID of the output item that the content part was added to.
1284312843 *
···1284912849 */
1285012850 output_index: number;
1285112851 /**
1285212852+ * The index of the content part that was added.
1285312853+ *
1285412854+ */
1285512855+ content_index: number;
1285612856+ /**
1285212857 * The content part that was added.
1285312858 *
1285412859 */
···1285712862 * The sequence number of this event.
1285812863 */
1285912864 sequence_number: number;
1286012860- /**
1286112861- * The type of the event. Always `response.content_part.added`.
1286212862- *
1286312863- */
1286412864- type: 'response.content_part.added';
1286512865};
12866128661286712867/**
···1286912869 */
1287012870export type ResponseContentPartDoneEvent = {
1287112871 /**
1287212872- * The index of the content part that is done.
1287212872+ * The type of the event. Always `response.content_part.done`.
1287312873 *
1287412874 */
1287512875- content_index: number;
1287512875+ type: 'response.content_part.done';
1287612876 /**
1287712877 * The ID of the output item that the content part was added to.
1287812878 *
···1288412884 */
1288512885 output_index: number;
1288612886 /**
1288712887- * The content part that is done.
1288712887+ * The index of the content part that is done.
1288812888 *
1288912889 */
1289012890- part: OutputContent;
1289012890+ content_index: number;
1289112891 /**
1289212892 * The sequence number of this event.
1289312893 */
1289412894 sequence_number: number;
1289512895 /**
1289612896- * The type of the event. Always `response.content_part.done`.
1289612896+ * The content part that is done.
1289712897 *
1289812898 */
1289912899- type: 'response.content_part.done';
1289912899+ part: OutputContent;
1290012900};
12901129011290212902/**
···1290512905 */
1290612906export type ResponseCreatedEvent = {
1290712907 /**
1290812908+ * The type of the event. Always `response.created`.
1290912909+ *
1291012910+ */
1291112911+ type: 'response.created';
1291212912+ /**
1290812913 * The response that was created.
1290912914 *
1291012915 */
···1291312918 * The sequence number for this event.
1291412919 */
1291512920 sequence_number: number;
1291612916- /**
1291712917- * The type of the event. Always `response.created`.
1291812918- *
1291912919- */
1292012920- type: 'response.created';
1292112921};
12922129221292312923/**
···1292812928 */
1292912929export type ResponseCustomToolCallInputDeltaEvent = {
1293012930 /**
1293112931- * The incremental input data (delta) for the custom tool call.
1293112931+ * The event type identifier.
1293212932 */
1293312933- delta: string;
1293312933+ type: 'response.custom_tool_call_input.delta';
1293412934 /**
1293512935- * Unique identifier for the API item associated with this event.
1293512935+ * The sequence number of this event.
1293612936 */
1293712937- item_id: string;
1293712937+ sequence_number: number;
1293812938 /**
1293912939 * The index of the output this delta applies to.
1294012940 */
1294112941 output_index: number;
1294212942 /**
1294312943- * The sequence number of this event.
1294312943+ * Unique identifier for the API item associated with this event.
1294412944 */
1294512945- sequence_number: number;
1294512945+ item_id: string;
1294612946 /**
1294712947- * The event type identifier.
1294712947+ * The incremental input data (delta) for the custom tool call.
1294812948 */
1294912949- type: 'response.custom_tool_call_input.delta';
1294912949+ delta: string;
1295012950};
12951129511295212952/**
···1295712957 */
1295812958export type ResponseCustomToolCallInputDoneEvent = {
1295912959 /**
1296012960- * The complete input data for the custom tool call.
1296012960+ * The event type identifier.
1296112961 */
1296212962- input: string;
1296212962+ type: 'response.custom_tool_call_input.done';
1296312963 /**
1296412964- * Unique identifier for the API item associated with this event.
1296412964+ * The sequence number of this event.
1296512965 */
1296612966- item_id: string;
1296612966+ sequence_number: number;
1296712967 /**
1296812968 * The index of the output this event applies to.
1296912969 */
1297012970 output_index: number;
1297112971 /**
1297212972- * The sequence number of this event.
1297212972+ * Unique identifier for the API item associated with this event.
1297312973 */
1297412974- sequence_number: number;
1297412974+ item_id: string;
1297512975 /**
1297612976- * The event type identifier.
1297612976+ * The complete input data for the custom tool call.
1297712977 */
1297812978- type: 'response.custom_tool_call_input.done';
1297812978+ input: string;
1297912979};
12980129801298112981/**
···1299612996 *
1299712997 */
1299812998export const ResponseErrorCode = {
1299912999- EMPTY_IMAGE_FILE: 'empty_image_file',
1300013000- FAILED_TO_DOWNLOAD_IMAGE: 'failed_to_download_image',
1300113001- IMAGE_CONTENT_POLICY_VIOLATION: 'image_content_policy_violation',
1300213002- IMAGE_FILE_NOT_FOUND: 'image_file_not_found',
1300313003- IMAGE_FILE_TOO_LARGE: 'image_file_too_large',
1300413004- IMAGE_PARSE_ERROR: 'image_parse_error',
1300513005- IMAGE_TOO_LARGE: 'image_too_large',
1300613006- IMAGE_TOO_SMALL: 'image_too_small',
1300713007- INVALID_BASE64_IMAGE: 'invalid_base64_image',
1299912999+ SERVER_ERROR: 'server_error',
1300013000+ RATE_LIMIT_EXCEEDED: 'rate_limit_exceeded',
1300113001+ INVALID_PROMPT: 'invalid_prompt',
1300213002+ VECTOR_STORE_TIMEOUT: 'vector_store_timeout',
1300813003 INVALID_IMAGE: 'invalid_image',
1300913004 INVALID_IMAGE_FORMAT: 'invalid_image_format',
1301013010- INVALID_IMAGE_MODE: 'invalid_image_mode',
1300513005+ INVALID_BASE64_IMAGE: 'invalid_base64_image',
1301113006 INVALID_IMAGE_URL: 'invalid_image_url',
1301213012- INVALID_PROMPT: 'invalid_prompt',
1301313013- RATE_LIMIT_EXCEEDED: 'rate_limit_exceeded',
1301413014- SERVER_ERROR: 'server_error',
1300713007+ IMAGE_TOO_LARGE: 'image_too_large',
1300813008+ IMAGE_TOO_SMALL: 'image_too_small',
1300913009+ IMAGE_PARSE_ERROR: 'image_parse_error',
1301013010+ IMAGE_CONTENT_POLICY_VIOLATION: 'image_content_policy_violation',
1301113011+ INVALID_IMAGE_MODE: 'invalid_image_mode',
1301213012+ IMAGE_FILE_TOO_LARGE: 'image_file_too_large',
1301513013 UNSUPPORTED_IMAGE_MEDIA_TYPE: 'unsupported_image_media_type',
1301613016- VECTOR_STORE_TIMEOUT: 'vector_store_timeout',
1301413014+ EMPTY_IMAGE_FILE: 'empty_image_file',
1301513015+ FAILED_TO_DOWNLOAD_IMAGE: 'failed_to_download_image',
1301613016+ IMAGE_FILE_NOT_FOUND: 'image_file_not_found',
1301713017} as const;
13018130181301913019/**
···1302813028 */
1302913029export type ResponseErrorEvent = {
1303013030 /**
1303113031+ * The type of the event. Always `error`.
1303213032+ *
1303313033+ */
1303413034+ type: 'error';
1303513035+ /**
1303113036 * The error code.
1303213037 *
1303313038 */
···1304613051 * The sequence number of this event.
1304713052 */
1304813053 sequence_number: number;
1304913049- /**
1305013050- * The type of the event. Always `error`.
1305113051- *
1305213052- */
1305313053- type: 'error';
1305413054};
13055130551305613056/**
···1305913059 */
1306013060export type ResponseFailedEvent = {
1306113061 /**
1306213062- * The response that failed.
1306213062+ * The type of the event. Always `response.failed`.
1306313063 *
1306413064 */
1306513065- response: Response;
1306513065+ type: 'response.failed';
1306613066 /**
1306713067 * The sequence number of this event.
1306813068 */
1306913069 sequence_number: number;
1307013070 /**
1307113071- * The type of the event. Always `response.failed`.
1307113071+ * The response that failed.
1307213072 *
1307313073 */
1307413074- type: 'response.failed';
1307413074+ response: Response;
1307513075};
13076130761307713077/**
···1307913079 */
1308013080export type ResponseFileSearchCallCompletedEvent = {
1308113081 /**
1308213082- * The ID of the output item that the file search call is initiated.
1308213082+ * The type of the event. Always `response.file_search_call.completed`.
1308313083 *
1308413084 */
1308513085- item_id: string;
1308513085+ type: 'response.file_search_call.completed';
1308613086 /**
1308713087 * The index of the output item that the file search call is initiated.
1308813088 *
1308913089 */
1309013090 output_index: number;
1309113091 /**
1309213092- * The sequence number of this event.
1309213092+ * The ID of the output item that the file search call is initiated.
1309313093+ *
1309313094 */
1309413094- sequence_number: number;
1309513095+ item_id: string;
1309513096 /**
1309613096- * The type of the event. Always `response.file_search_call.completed`.
1309713097- *
1309713097+ * The sequence number of this event.
1309813098 */
1309913099- type: 'response.file_search_call.completed';
1309913099+ sequence_number: number;
1310013100};
13101131011310213102/**
···1310413104 */
1310513105export type ResponseFileSearchCallInProgressEvent = {
1310613106 /**
1310713107- * The ID of the output item that the file search call is initiated.
1310713107+ * The type of the event. Always `response.file_search_call.in_progress`.
1310813108 *
1310913109 */
1311013110- item_id: string;
1311013110+ type: 'response.file_search_call.in_progress';
1311113111 /**
1311213112 * The index of the output item that the file search call is initiated.
1311313113 *
1311413114 */
1311513115 output_index: number;
1311613116 /**
1311713117+ * The ID of the output item that the file search call is initiated.
1311813118+ *
1311913119+ */
1312013120+ item_id: string;
1312113121+ /**
1311713122 * The sequence number of this event.
1311813123 */
1311913124 sequence_number: number;
1312013120- /**
1312113121- * The type of the event. Always `response.file_search_call.in_progress`.
1312213122- *
1312313123- */
1312413124- type: 'response.file_search_call.in_progress';
1312513125};
13126131261312713127/**
···1312913129 */
1313013130export type ResponseFileSearchCallSearchingEvent = {
1313113131 /**
1313213132- * The ID of the output item that the file search call is initiated.
1313213132+ * The type of the event. Always `response.file_search_call.searching`.
1313313133 *
1313413134 */
1313513135- item_id: string;
1313513135+ type: 'response.file_search_call.searching';
1313613136 /**
1313713137 * The index of the output item that the file search call is searching.
1313813138 *
1313913139 */
1314013140 output_index: number;
1314113141 /**
1314213142+ * The ID of the output item that the file search call is initiated.
1314313143+ *
1314413144+ */
1314513145+ item_id: string;
1314613146+ /**
1314213147 * The sequence number of this event.
1314313148 */
1314413149 sequence_number: number;
1314513145- /**
1314613146- * The type of the event. Always `response.file_search_call.searching`.
1314713147- *
1314813148- */
1314913149- type: 'response.file_search_call.searching';
1315013150};
13151131511315213152/**
···1317313173 *
1317413174 */
1317513175export type ResponseFormatJsonSchema = {
1317613176+ /**
1317713177+ * The type of response format being defined. Always `json_schema`.
1317813178+ */
1317913179+ type: 'json_schema';
1317613180 /**
1317713181 * JSON schema
1317813182 *
···1320313207 */
1320413208 strict?: boolean;
1320513209 };
1320613206- /**
1320713207- * The type of response format being defined. Always `json_schema`.
1320813208- */
1320913209- type: 'json_schema';
1321013210};
13211132111321213212/**
···1324213242 */
1324313243export type ResponseFormatTextGrammar = {
1324413244 /**
1324513245- * The custom grammar for the model to follow.
1324613246- */
1324713247- grammar: string;
1324813248- /**
1324913245 * The type of response format being defined. Always `grammar`.
1325013246 */
1325113247 type: 'grammar';
1324813248+ /**
1324913249+ * The custom grammar for the model to follow.
1325013250+ */
1325113251+ grammar: string;
1325213252};
13253132531325413254/**
···1327013270 */
1327113271export type ResponseFunctionCallArgumentsDeltaEvent = {
1327213272 /**
1327313273- * The function-call arguments delta that is added.
1327313273+ * The type of the event. Always `response.function_call_arguments.delta`.
1327413274 *
1327513275 */
1327613276- delta: string;
1327613276+ type: 'response.function_call_arguments.delta';
1327713277 /**
1327813278 * The ID of the output item that the function-call arguments delta is added to.
1327913279 *
···1328913289 */
1329013290 sequence_number: number;
1329113291 /**
1329213292- * The type of the event. Always `response.function_call_arguments.delta`.
1329213292+ * The function-call arguments delta that is added.
1329313293 *
1329413294 */
1329513295- type: 'response.function_call_arguments.delta';
1329513295+ delta: string;
1329613296};
13297132971329813298/**
1329913299 * Emitted when function-call arguments are finalized.
1330013300 */
1330113301export type ResponseFunctionCallArgumentsDoneEvent = {
1330213302- /**
1330313303- * The function-call arguments.
1330413304- */
1330513305- arguments: string;
1330213302+ type: 'response.function_call_arguments.done';
1330613303 /**
1330713304 * The ID of the item.
1330813305 */
···1331513312 * The sequence number of this event.
1331613313 */
1331713314 sequence_number: number;
1331813318- type: 'response.function_call_arguments.done';
1331513315+ /**
1331613316+ * The function-call arguments.
1331713317+ */
1331813318+ arguments: string;
1331913319};
13320133201332113321/**
···1332613326 */
1332713327export type ResponseImageGenCallCompletedEvent = {
1332813328 /**
1332913329- * The unique identifier of the image generation item being processed.
1332913329+ * The type of the event. Always 'response.image_generation_call.completed'.
1333013330 */
1333113331- item_id: string;
1333113331+ type: 'response.image_generation_call.completed';
1333213332 /**
1333313333 * The index of the output item in the response's output array.
1333413334 */
···1333813338 */
1333913339 sequence_number: number;
1334013340 /**
1334113341- * The type of the event. Always 'response.image_generation_call.completed'.
1334113341+ * The unique identifier of the image generation item being processed.
1334213342 */
1334313343- type: 'response.image_generation_call.completed';
1334313343+ item_id: string;
1334413344};
13345133451334613346/**
···1335113351 */
1335213352export type ResponseImageGenCallGeneratingEvent = {
1335313353 /**
1335413354- * The unique identifier of the image generation item being processed.
1335413354+ * The type of the event. Always 'response.image_generation_call.generating'.
1335513355 */
1335613356- item_id: string;
1335613356+ type: 'response.image_generation_call.generating';
1335713357 /**
1335813358 * The index of the output item in the response's output array.
1335913359 */
1336013360 output_index: number;
1336113361 /**
1336213362- * The sequence number of the image generation item being processed.
1336213362+ * The unique identifier of the image generation item being processed.
1336313363 */
1336413364- sequence_number: number;
1336413364+ item_id: string;
1336513365 /**
1336613366- * The type of the event. Always 'response.image_generation_call.generating'.
1336613366+ * The sequence number of the image generation item being processed.
1336713367 */
1336813368- type: 'response.image_generation_call.generating';
1336813368+ sequence_number: number;
1336913369};
13370133701337113371/**
···1337613376 */
1337713377export type ResponseImageGenCallInProgressEvent = {
1337813378 /**
1337913379- * The unique identifier of the image generation item being processed.
1337913379+ * The type of the event. Always 'response.image_generation_call.in_progress'.
1338013380 */
1338113381- item_id: string;
1338113381+ type: 'response.image_generation_call.in_progress';
1338213382 /**
1338313383 * The index of the output item in the response's output array.
1338413384 */
1338513385 output_index: number;
1338613386 /**
1338713387+ * The unique identifier of the image generation item being processed.
1338813388+ */
1338913389+ item_id: string;
1339013390+ /**
1338713391 * The sequence number of the image generation item being processed.
1338813392 */
1338913393 sequence_number: number;
1339013390- /**
1339113391- * The type of the event. Always 'response.image_generation_call.in_progress'.
1339213392- */
1339313393- type: 'response.image_generation_call.in_progress';
1339413394};
13395133951339613396/**
···1340113401 */
1340213402export type ResponseImageGenCallPartialImageEvent = {
1340313403 /**
1340413404- * The unique identifier of the image generation item being processed.
1340413404+ * The type of the event. Always 'response.image_generation_call.partial_image'.
1340513405 */
1340613406- item_id: string;
1340613406+ type: 'response.image_generation_call.partial_image';
1340713407 /**
1340813408 * The index of the output item in the response's output array.
1340913409 */
1341013410 output_index: number;
1341113411 /**
1341213412- * Base64-encoded partial image data, suitable for rendering as an image.
1341313413- */
1341413414- partial_image_b64: string;
1341513415- /**
1341613416- * 0-based index for the partial image (backend is 1-based, but this is 0-based for the user).
1341213412+ * The unique identifier of the image generation item being processed.
1341713413 */
1341813418- partial_image_index: number;
1341413414+ item_id: string;
1341913415 /**
1342013416 * The sequence number of the image generation item being processed.
1342113417 */
1342213418 sequence_number: number;
1342313419 /**
1342413424- * The type of the event. Always 'response.image_generation_call.partial_image'.
1342013420+ * 0-based index for the partial image (backend is 1-based, but this is 0-based for the user).
1342113421+ */
1342213422+ partial_image_index: number;
1342313423+ /**
1342413424+ * Base64-encoded partial image data, suitable for rendering as an image.
1342513425 */
1342613426- type: 'response.image_generation_call.partial_image';
1342613426+ partial_image_b64: string;
1342713427};
13428134281342913429/**
···1343113431 */
1343213432export type ResponseInProgressEvent = {
1343313433 /**
1343413434+ * The type of the event. Always `response.in_progress`.
1343513435+ *
1343613436+ */
1343713437+ type: 'response.in_progress';
1343813438+ /**
1343413439 * The response that is in progress.
1343513440 *
1343613441 */
···1343913444 * The sequence number of this event.
1344013445 */
1344113446 sequence_number: number;
1344213442- /**
1344313443- * The type of the event. Always `response.in_progress`.
1344413444- *
1344513445- */
1344613446- type: 'response.in_progress';
1344713447};
13448134481344913449/**
···1345213452 */
1345313453export type ResponseIncompleteEvent = {
1345413454 /**
1345513455+ * The type of the event. Always `response.incomplete`.
1345613456+ *
1345713457+ */
1345813458+ type: 'response.incomplete';
1345913459+ /**
1345513460 * The response that was incomplete.
1345613461 *
1345713462 */
···1346013465 * The sequence number of this event.
1346113466 */
1346213467 sequence_number: number;
1346313463- /**
1346413464- * The type of the event. Always `response.incomplete`.
1346513465- *
1346613466- */
1346713467- type: 'response.incomplete';
1346813468};
13469134691347013470/**
···1347213472 */
1347313473export type ResponseItemList = {
1347413474 /**
1347513475+ * The type of object returned, must be `list`.
1347613476+ */
1347713477+ object: 'list';
1347813478+ /**
1347513479 * A list of items used to generate this response.
1347613480 */
1347713481 data: Array<ItemResource>;
1347813482 /**
1347913479- * The ID of the first item in the list.
1348013480- */
1348113481- first_id: string;
1348213482- /**
1348313483 * Whether there are more items available.
1348413484 */
1348513485 has_more: boolean;
1348613486+ /**
1348713487+ * The ID of the first item in the list.
1348813488+ */
1348913489+ first_id: string;
1348613490 /**
1348713491 * The ID of the last item in the list.
1348813492 */
1348913493 last_id: string;
1349013490- /**
1349113491- * The type of object returned, must be `list`.
1349213492- */
1349313493- object: 'list';
1349413494};
13495134951349613496/**
···1350113501 */
1350213502export type ResponseLogProb = {
1350313503 /**
1350413504+ * A possible text token.
1350513505+ */
1350613506+ token: string;
1350713507+ /**
1350413508 * The log probability of this token.
1350513509 *
1350613510 */
1350713511 logprob: number;
1350813512 /**
1350913509- * A possible text token.
1351013510- */
1351113511- token: string;
1351213512- /**
1351313513 * The log probability of the top 20 most likely tokens.
1351413514 *
1351513515 */
1351613516 top_logprobs?: Array<{
1351713517 /**
1351813518- * The log probability of this token.
1351913519- */
1352013520- logprob?: number;
1352113521- /**
1352213518 * A possible text token.
1352313519 */
1352413520 token?: string;
1352113521+ /**
1352213522+ * The log probability of this token.
1352313523+ */
1352413524+ logprob?: number;
1352513525 }>;
1352613526};
1352713527···1353313533 */
1353413534export type ResponseMcpCallArgumentsDeltaEvent = {
1353513535 /**
1353613536- * A JSON string containing the partial update to the arguments for the MCP tool call.
1353713537- *
1353613536+ * The type of the event. Always 'response.mcp_call_arguments.delta'.
1353713537+ */
1353813538+ type: 'response.mcp_call_arguments.delta';
1353913539+ /**
1354013540+ * The index of the output item in the response's output array.
1353813541 */
1353913539- delta: string;
1354213542+ output_index: number;
1354013543 /**
1354113544 * The unique identifier of the MCP tool call item being processed.
1354213545 */
1354313546 item_id: string;
1354413547 /**
1354513545- * The index of the output item in the response's output array.
1354813548+ * A JSON string containing the partial update to the arguments for the MCP tool call.
1354913549+ *
1354613550 */
1354713547- output_index: number;
1355113551+ delta: string;
1354813552 /**
1354913553 * The sequence number of this event.
1355013554 */
1355113555 sequence_number: number;
1355213552- /**
1355313553- * The type of the event. Always 'response.mcp_call_arguments.delta'.
1355413554- */
1355513555- type: 'response.mcp_call_arguments.delta';
1355613556};
13557135571355813558/**
···1356313563 */
1356413564export type ResponseMcpCallArgumentsDoneEvent = {
1356513565 /**
1356613566- * A JSON string containing the finalized arguments for the MCP tool call.
1356713567- *
1356613566+ * The type of the event. Always 'response.mcp_call_arguments.done'.
1356713567+ */
1356813568+ type: 'response.mcp_call_arguments.done';
1356913569+ /**
1357013570+ * The index of the output item in the response's output array.
1356813571 */
1356913569- arguments: string;
1357213572+ output_index: number;
1357013573 /**
1357113574 * The unique identifier of the MCP tool call item being processed.
1357213575 */
1357313576 item_id: string;
1357413577 /**
1357513575- * The index of the output item in the response's output array.
1357813578+ * A JSON string containing the finalized arguments for the MCP tool call.
1357913579+ *
1357613580 */
1357713577- output_index: number;
1358113581+ arguments: string;
1357813582 /**
1357913583 * The sequence number of this event.
1358013584 */
1358113585 sequence_number: number;
1358213582- /**
1358313583- * The type of the event. Always 'response.mcp_call_arguments.done'.
1358413584- */
1358513585- type: 'response.mcp_call_arguments.done';
1358613586};
13587135871358813588/**
···1359313593 */
1359413594export type ResponseMcpCallCompletedEvent = {
1359513595 /**
1359613596+ * The type of the event. Always 'response.mcp_call.completed'.
1359713597+ */
1359813598+ type: 'response.mcp_call.completed';
1359913599+ /**
1359613600 * The ID of the MCP tool call item that completed.
1359713601 */
1359813602 item_id: string;
···1360413608 * The sequence number of this event.
1360513609 */
1360613610 sequence_number: number;
1360713607- /**
1360813608- * The type of the event. Always 'response.mcp_call.completed'.
1360913609- */
1361013610- type: 'response.mcp_call.completed';
1361113611};
13612136121361313613/**
···1361813618 */
1361913619export type ResponseMcpCallFailedEvent = {
1362013620 /**
1362113621+ * The type of the event. Always 'response.mcp_call.failed'.
1362213622+ */
1362313623+ type: 'response.mcp_call.failed';
1362413624+ /**
1362113625 * The ID of the MCP tool call item that failed.
1362213626 */
1362313627 item_id: string;
···1362913633 * The sequence number of this event.
1363013634 */
1363113635 sequence_number: number;
1363213632- /**
1363313633- * The type of the event. Always 'response.mcp_call.failed'.
1363413634- */
1363513635- type: 'response.mcp_call.failed';
1363613636};
13637136371363813638/**
···1364313643 */
1364413644export type ResponseMcpCallInProgressEvent = {
1364513645 /**
1364613646- * The unique identifier of the MCP tool call item being processed.
1364613646+ * The type of the event. Always 'response.mcp_call.in_progress'.
1364713647 */
1364813648- item_id: string;
1364813648+ type: 'response.mcp_call.in_progress';
1364913649+ /**
1365013650+ * The sequence number of this event.
1365113651+ */
1365213652+ sequence_number: number;
1364913653 /**
1365013654 * The index of the output item in the response's output array.
1365113655 */
1365213656 output_index: number;
1365313657 /**
1365413654- * The sequence number of this event.
1365813658+ * The unique identifier of the MCP tool call item being processed.
1365513659 */
1365613656- sequence_number: number;
1365713657- /**
1365813658- * The type of the event. Always 'response.mcp_call.in_progress'.
1365913659- */
1366013660- type: 'response.mcp_call.in_progress';
1366013660+ item_id: string;
1366113661};
13662136621366313663/**
···1366713667 *
1366813668 */
1366913669export type ResponseMcpListToolsCompletedEvent = {
1367013670+ /**
1367113671+ * The type of the event. Always 'response.mcp_list_tools.completed'.
1367213672+ */
1367313673+ type: 'response.mcp_list_tools.completed';
1367013674 /**
1367113675 * The ID of the MCP tool call item that produced this output.
1367213676 */
···1367913683 * The sequence number of this event.
1368013684 */
1368113685 sequence_number: number;
1368213682- /**
1368313683- * The type of the event. Always 'response.mcp_list_tools.completed'.
1368413684- */
1368513685- type: 'response.mcp_list_tools.completed';
1368613686};
13687136871368813688/**
···1369313693 */
1369413694export type ResponseMcpListToolsFailedEvent = {
1369513695 /**
1369613696+ * The type of the event. Always 'response.mcp_list_tools.failed'.
1369713697+ */
1369813698+ type: 'response.mcp_list_tools.failed';
1369913699+ /**
1369613700 * The ID of the MCP tool call item that failed.
1369713701 */
1369813702 item_id: string;
···1370413708 * The sequence number of this event.
1370513709 */
1370613710 sequence_number: number;
1370713707- /**
1370813708- * The type of the event. Always 'response.mcp_list_tools.failed'.
1370913709- */
1371013710- type: 'response.mcp_list_tools.failed';
1371113711};
13712137121371313713/**
···1371713717 *
1371813718 */
1371913719export type ResponseMcpListToolsInProgressEvent = {
1372013720+ /**
1372113721+ * The type of the event. Always 'response.mcp_list_tools.in_progress'.
1372213722+ */
1372313723+ type: 'response.mcp_list_tools.in_progress';
1372013724 /**
1372113725 * The ID of the MCP tool call item that is being processed.
1372213726 */
···1372913733 * The sequence number of this event.
1373013734 */
1373113735 sequence_number: number;
1373213732- /**
1373313733- * The type of the event. Always 'response.mcp_list_tools.in_progress'.
1373413734- */
1373513735- type: 'response.mcp_list_tools.in_progress';
1373613736};
13737137371373813738/**
···1375513755 */
1375613756export type ResponseOutputItemAddedEvent = {
1375713757 /**
1375813758- * The output item that was added.
1375813758+ * The type of the event. Always `response.output_item.added`.
1375913759 *
1376013760 */
1376113761- item: OutputItem;
1376113761+ type: 'response.output_item.added';
1376213762 /**
1376313763 * The index of the output item that was added.
1376413764 *
···1377013770 */
1377113771 sequence_number: number;
1377213772 /**
1377313773- * The type of the event. Always `response.output_item.added`.
1377313773+ * The output item that was added.
1377413774 *
1377513775 */
1377613776- type: 'response.output_item.added';
1377613776+ item: OutputItem;
1377713777};
13778137781377913779/**
···1378113781 */
1378213782export type ResponseOutputItemDoneEvent = {
1378313783 /**
1378413784- * The output item that was marked done.
1378413784+ * The type of the event. Always `response.output_item.done`.
1378513785 *
1378613786 */
1378713787- item: OutputItem;
1378713787+ type: 'response.output_item.done';
1378813788 /**
1378913789 * The index of the output item that was marked done.
1379013790 *
···1379613796 */
1379713797 sequence_number: number;
1379813798 /**
1379913799- * The type of the event. Always `response.output_item.done`.
1379913799+ * The output item that was marked done.
1380013800 *
1380113801 */
1380213802- type: 'response.output_item.done';
1380213802+ item: OutputItem;
1380313803};
13804138041380513805/**
···1381013810 */
1381113811export type ResponseOutputTextAnnotationAddedEvent = {
1381213812 /**
1381313813- * The annotation object being added. (See annotation schema for details.)
1381313813+ * The type of the event. Always 'response.output_text.annotation.added'.
1381413814+ */
1381513815+ type: 'response.output_text.annotation.added';
1381613816+ /**
1381713817+ * The unique identifier of the item to which the annotation is being added.
1381413818 */
1381513815- annotation: {
1381613816- [key: string]: unknown;
1381713817- };
1381913819+ item_id: string;
1381813820 /**
1381913819- * The index of the annotation within the content part.
1382113821+ * The index of the output item in the response's output array.
1382013822 */
1382113821- annotation_index: number;
1382313823+ output_index: number;
1382213824 /**
1382313825 * The index of the content part within the output item.
1382413826 */
1382513827 content_index: number;
1382613828 /**
1382713827- * The unique identifier of the item to which the annotation is being added.
1382913829+ * The index of the annotation within the content part.
1382813830 */
1382913829- item_id: string;
1383013830- /**
1383113831- * The index of the output item in the response's output array.
1383213832- */
1383313833- output_index: number;
1383113831+ annotation_index: number;
1383413832 /**
1383513833 * The sequence number of this event.
1383613834 */
1383713835 sequence_number: number;
1383813836 /**
1383913839- * The type of the event. Always 'response.output_text.annotation.added'.
1383713837+ * The annotation object being added. (See annotation schema for details.)
1384013838 */
1384113841- type: 'response.output_text.annotation.added';
1383913839+ annotation: {
1384013840+ [key: string]: unknown;
1384113841+ };
1384213842};
13843138431384413844/**
···13859138591386013860export type ResponseProperties = {
1386113861 /**
1386213862+ * The unique ID of the previous response to the model. Use this to
1386313863+ * create multi-turn conversations. Learn more about
1386413864+ * [conversation state](https://platform.openai.com/docs/guides/conversation-state).
1386513865+ *
1386613866+ */
1386713867+ previous_response_id?: string;
1386813868+ /**
1386913869+ * Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI
1387013870+ * offers a wide range of models with different capabilities, performance
1387113871+ * characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)
1387213872+ * to browse and compare available models.
1387313873+ *
1387413874+ */
1387513875+ model?: ModelIdsResponses;
1387613876+ reasoning?: Reasoning;
1387713877+ /**
1386213878 * Whether to run the model response in the background.
1386313879 * [Learn more](https://platform.openai.com/docs/guides/background).
1386413880 *
···1387513891 */
1387613892 max_tool_calls?: number;
1387713893 /**
1387813878- * Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI
1387913879- * offers a wide range of models with different capabilities, performance
1388013880- * characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)
1388113881- * to browse and compare available models.
1388213882- *
1388313883- */
1388413884- model?: ModelIdsResponses;
1388513885- /**
1388613886- * The unique ID of the previous response to the model. Use this to
1388713887- * create multi-turn conversations. Learn more about
1388813888- * [conversation state](https://platform.openai.com/docs/guides/conversation-state).
1388913889- *
1389013890- */
1389113891- previous_response_id?: string;
1389213892- prompt?: Prompt;
1389313893- reasoning?: Reasoning;
1389413894- /**
1389513894 * Configuration options for a text response from the model. Can be plain
1389613895 * text or structured JSON data. Learn more:
1389713896 * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
···1390313902 verbosity?: Verbosity;
1390413903 };
1390513904 /**
1390613906- * How the model should select which tool (or tools) to use when generating
1390713907- * a response. See the `tools` parameter to see how to specify which tools
1390813908- * the model can call.
1390913909- *
1391013910- */
1391113911- tool_choice?:
1391213912- | ToolChoiceOptions
1391313913- | ToolChoiceAllowed
1391413914- | ToolChoiceTypes
1391513915- | ToolChoiceFunction
1391613916- | ToolChoiceMcp
1391713917- | ToolChoiceCustom;
1391813918- /**
1391913905 * An array of tools the model may call while generating a response. You
1392013906 * can specify which tool to use by setting the `tool_choice` parameter.
1392113907 *
···1393413920 */
1393513921 tools?: Array<Tool>;
1393613922 /**
1392313923+ * How the model should select which tool (or tools) to use when generating
1392413924+ * a response. See the `tools` parameter to see how to specify which tools
1392513925+ * the model can call.
1392613926+ *
1392713927+ */
1392813928+ tool_choice?:
1392913929+ | ToolChoiceOptions
1393013930+ | ToolChoiceAllowed
1393113931+ | ToolChoiceTypes
1393213932+ | ToolChoiceFunction
1393313933+ | ToolChoiceMcp
1393413934+ | ToolChoiceCustom;
1393513935+ prompt?: Prompt;
1393613936+ /**
1393713937 * The truncation strategy to use for the model response.
1393813938 * - `auto`: If the context of this response and previous ones exceeds
1393913939 * the model's context window size, the model will truncate the
···1395413954 */
1395513955export type ResponseQueuedEvent = {
1395613956 /**
1395713957+ * The type of the event. Always 'response.queued'.
1395813958+ */
1395913959+ type: 'response.queued';
1396013960+ /**
1395713961 * The full response object that is queued.
1395813962 */
1395913963 response: Response;
···1396113965 * The sequence number for this event.
1396213966 */
1396313967 sequence_number: number;
1396413964- /**
1396513965- * The type of the event. Always 'response.queued'.
1396613966- */
1396713967- type: 'response.queued';
1396813968};
13969139691397013970/**
···1397213972 */
1397313973export type ResponseReasoningSummaryPartAddedEvent = {
1397413974 /**
1397513975+ * The type of the event. Always `response.reasoning_summary_part.added`.
1397613976+ *
1397713977+ */
1397813978+ type: 'response.reasoning_summary_part.added';
1397913979+ /**
1397513980 * The ID of the item this summary part is associated with.
1397613981 *
1397713982 */
···1398213987 */
1398313988 output_index: number;
1398413989 /**
1398513985- * The summary part that was added.
1399013990+ * The index of the summary part within the reasoning summary.
1398613991 *
1398713992 */
1398813988- part: {
1398913989- /**
1399013990- * The text of the summary part.
1399113991- */
1399213992- text: string;
1399313993- /**
1399413994- * The type of the summary part. Always `summary_text`.
1399513995- */
1399613996- type: 'summary_text';
1399713997- };
1399313993+ summary_index: number;
1399813994 /**
1399913995 * The sequence number of this event.
1400013996 *
1400113997 */
1400213998 sequence_number: number;
1400313999 /**
1400414004- * The index of the summary part within the reasoning summary.
1400014000+ * The summary part that was added.
1400514001 *
1400614002 */
1400714007- summary_index: number;
1400814008- /**
1400914009- * The type of the event. Always `response.reasoning_summary_part.added`.
1401014010- *
1401114011- */
1401214012- type: 'response.reasoning_summary_part.added';
1400314003+ part: {
1400414004+ /**
1400514005+ * The type of the summary part. Always `summary_text`.
1400614006+ */
1400714007+ type: 'summary_text';
1400814008+ /**
1400914009+ * The text of the summary part.
1401014010+ */
1401114011+ text: string;
1401214012+ };
1401314013};
14014140141401514015/**
···1401714017 */
1401814018export type ResponseReasoningSummaryPartDoneEvent = {
1401914019 /**
1402014020+ * The type of the event. Always `response.reasoning_summary_part.done`.
1402114021+ *
1402214022+ */
1402314023+ type: 'response.reasoning_summary_part.done';
1402414024+ /**
1402014025 * The ID of the item this summary part is associated with.
1402114026 *
1402214027 */
···1402714032 */
1402814033 output_index: number;
1402914034 /**
1403014030- * The completed summary part.
1403514035+ * The index of the summary part within the reasoning summary.
1403114036 *
1403214037 */
1403314033- part: {
1403414034- /**
1403514035- * The text of the summary part.
1403614036- */
1403714037- text: string;
1403814038- /**
1403914039- * The type of the summary part. Always `summary_text`.
1404014040- */
1404114041- type: 'summary_text';
1404214042- };
1403814038+ summary_index: number;
1404314039 /**
1404414040 * The sequence number of this event.
1404514041 *
1404614042 */
1404714043 sequence_number: number;
1404814044 /**
1404914049- * The index of the summary part within the reasoning summary.
1405014050- *
1405114051- */
1405214052- summary_index: number;
1405314053- /**
1405414054- * The type of the event. Always `response.reasoning_summary_part.done`.
1404514045+ * The completed summary part.
1405514046 *
1405614047 */
1405714057- type: 'response.reasoning_summary_part.done';
1404814048+ part: {
1404914049+ /**
1405014050+ * The type of the summary part. Always `summary_text`.
1405114051+ */
1405214052+ type: 'summary_text';
1405314053+ /**
1405414054+ * The text of the summary part.
1405514055+ */
1405614056+ text: string;
1405714057+ };
1405814058};
14059140591406014060/**
···1406214062 */
1406314063export type ResponseReasoningSummaryTextDeltaEvent = {
1406414064 /**
1406514065- * The text delta that was added to the summary.
1406514065+ * The type of the event. Always `response.reasoning_summary_text.delta`.
1406614066 *
1406714067 */
1406814068- delta: string;
1406814068+ type: 'response.reasoning_summary_text.delta';
1406914069 /**
1407014070 * The ID of the item this summary text delta is associated with.
1407114071 *
···1407714077 */
1407814078 output_index: number;
1407914079 /**
1408014080- * The sequence number of this event.
1408014080+ * The index of the summary part within the reasoning summary.
1408114081 *
1408214082 */
1408314083- sequence_number: number;
1408314083+ summary_index: number;
1408414084 /**
1408514085- * The index of the summary part within the reasoning summary.
1408514085+ * The text delta that was added to the summary.
1408614086 *
1408714087 */
1408814088- summary_index: number;
1408814088+ delta: string;
1408914089 /**
1409014090- * The type of the event. Always `response.reasoning_summary_text.delta`.
1409014090+ * The sequence number of this event.
1409114091 *
1409214092 */
1409314093- type: 'response.reasoning_summary_text.delta';
1409314093+ sequence_number: number;
1409414094};
14095140951409614096/**
···1409814098 */
1409914099export type ResponseReasoningSummaryTextDoneEvent = {
1410014100 /**
1410114101+ * The type of the event. Always `response.reasoning_summary_text.done`.
1410214102+ *
1410314103+ */
1410414104+ type: 'response.reasoning_summary_text.done';
1410514105+ /**
1410114106 * The ID of the item this summary text is associated with.
1410214107 *
1410314108 */
···1410814113 */
1410914114 output_index: number;
1411014115 /**
1411114111- * The sequence number of this event.
1411214112- *
1411314113- */
1411414114- sequence_number: number;
1411514115- /**
1411614116 * The index of the summary part within the reasoning summary.
1411714117 *
1411814118 */
···1412314123 */
1412414124 text: string;
1412514125 /**
1412614126- * The type of the event. Always `response.reasoning_summary_text.done`.
1412614126+ * The sequence number of this event.
1412714127 *
1412814128 */
1412914129- type: 'response.reasoning_summary_text.done';
1412914129+ sequence_number: number;
1413014130};
14131141311413214132/**
···1413414134 */
1413514135export type ResponseReasoningTextDeltaEvent = {
1413614136 /**
1413714137- * The index of the reasoning content part this delta is associated with.
1413714137+ * The type of the event. Always `response.reasoning_text.delta`.
1413814138 *
1413914139 */
1414014140- content_index: number;
1414114141- /**
1414214142- * The text delta that was added to the reasoning content.
1414314143- *
1414414144- */
1414514145- delta: string;
1414014140+ type: 'response.reasoning_text.delta';
1414614141 /**
1414714142 * The ID of the item this reasoning text delta is associated with.
1414814143 *
···1415414149 */
1415514150 output_index: number;
1415614151 /**
1415714157- * The sequence number of this event.
1415214152+ * The index of the reasoning content part this delta is associated with.
1415814153 *
1415914154 */
1416014160- sequence_number: number;
1415514155+ content_index: number;
1416114156 /**
1416214162- * The type of the event. Always `response.reasoning_text.delta`.
1415714157+ * The text delta that was added to the reasoning content.
1416314158 *
1416414159 */
1416514165- type: 'response.reasoning_text.delta';
1416014160+ delta: string;
1416114161+ /**
1416214162+ * The sequence number of this event.
1416314163+ *
1416414164+ */
1416514165+ sequence_number: number;
1416614166};
14167141671416814168/**
···1417014170 */
1417114171export type ResponseReasoningTextDoneEvent = {
1417214172 /**
1417314173- * The index of the reasoning content part.
1417314173+ * The type of the event. Always `response.reasoning_text.done`.
1417414174 *
1417514175 */
1417614176- content_index: number;
1417614176+ type: 'response.reasoning_text.done';
1417714177 /**
1417814178 * The ID of the item this reasoning text is associated with.
1417914179 *
···1418514185 */
1418614186 output_index: number;
1418714187 /**
1418814188- * The sequence number of this event.
1418814188+ * The index of the reasoning content part.
1418914189 *
1419014190 */
1419114191- sequence_number: number;
1419114191+ content_index: number;
1419214192 /**
1419314193 * The full text of the completed reasoning content.
1419414194 *
1419514195 */
1419614196 text: string;
1419714197 /**
1419814198- * The type of the event. Always `response.reasoning_text.done`.
1419814198+ * The sequence number of this event.
1419914199 *
1420014200 */
1420114201- type: 'response.reasoning_text.done';
1420114201+ sequence_number: number;
1420214202};
14203142031420414204/**
···1420614206 */
1420714207export type ResponseRefusalDeltaEvent = {
1420814208 /**
1420914209- * The index of the content part that the refusal text is added to.
1420914209+ * The type of the event. Always `response.refusal.delta`.
1421014210 *
1421114211 */
1421214212- content_index: number;
1421314213- /**
1421414214- * The refusal text that is added.
1421514215- *
1421614216- */
1421714217- delta: string;
1421214212+ type: 'response.refusal.delta';
1421814213 /**
1421914214 * The ID of the output item that the refusal text is added to.
1422014215 *
···1422614221 */
1422714222 output_index: number;
1422814223 /**
1422914229- * The sequence number of this event.
1422414224+ * The index of the content part that the refusal text is added to.
1423014225 *
1423114226 */
1423214232- sequence_number: number;
1422714227+ content_index: number;
1423314228 /**
1423414234- * The type of the event. Always `response.refusal.delta`.
1422914229+ * The refusal text that is added.
1423514230 *
1423614231 */
1423714237- type: 'response.refusal.delta';
1423214232+ delta: string;
1423314233+ /**
1423414234+ * The sequence number of this event.
1423514235+ *
1423614236+ */
1423714237+ sequence_number: number;
1423814238};
14239142391424014240/**
···1424214242 */
1424314243export type ResponseRefusalDoneEvent = {
1424414244 /**
1424514245- * The index of the content part that the refusal text is finalized.
1424514245+ * The type of the event. Always `response.refusal.done`.
1424614246 *
1424714247 */
1424814248- content_index: number;
1424814248+ type: 'response.refusal.done';
1424914249 /**
1425014250 * The ID of the output item that the refusal text is finalized.
1425114251 *
···1425614256 *
1425714257 */
1425814258 output_index: number;
1425914259+ /**
1426014260+ * The index of the content part that the refusal text is finalized.
1426114261+ *
1426214262+ */
1426314263+ content_index: number;
1425914264 /**
1426014265 * The refusal text that is finalized.
1426114266 *
···1426614271 *
1426714272 */
1426814273 sequence_number: number;
1426914269- /**
1427014270- * The type of the event. Always `response.refusal.done`.
1427114271- *
1427214272- */
1427314273- type: 'response.refusal.done';
1427414274};
14275142751427614276export type ResponseStreamEvent =
···1445714457 */
1445814458export type ResponseTextDeltaEvent = {
1445914459 /**
1446014460- * The index of the content part that the text delta was added to.
1446014460+ * The type of the event. Always `response.output_text.delta`.
1446114461 *
1446214462 */
1446314463- content_index: number;
1446314463+ type: 'response.output_text.delta';
1446414464 /**
1446514465- * The text delta that was added.
1446514465+ * The ID of the output item that the text delta was added to.
1446614466 *
1446714467 */
1446814468- delta: string;
1446814468+ item_id: string;
1446914469 /**
1447014470- * The ID of the output item that the text delta was added to.
1447014470+ * The index of the output item that the text delta was added to.
1447114471 *
1447214472 */
1447314473- item_id: string;
1447314473+ output_index: number;
1447414474 /**
1447514475- * The log probabilities of the tokens in the delta.
1447514475+ * The index of the content part that the text delta was added to.
1447614476 *
1447714477 */
1447814478- logprobs: Array<ResponseLogProb>;
1447814478+ content_index: number;
1447914479 /**
1448014480- * The index of the output item that the text delta was added to.
1448014480+ * The text delta that was added.
1448114481 *
1448214482 */
1448314483- output_index: number;
1448314483+ delta: string;
1448414484 /**
1448514485 * The sequence number for this event.
1448614486 */
1448714487 sequence_number: number;
1448814488 /**
1448914489- * The type of the event. Always `response.output_text.delta`.
1448914489+ * The log probabilities of the tokens in the delta.
1449014490 *
1449114491 */
1449214492- type: 'response.output_text.delta';
1449214492+ logprobs: Array<ResponseLogProb>;
1449314493};
14494144941449514495/**
···1449714497 */
1449814498export type ResponseTextDoneEvent = {
1449914499 /**
1450014500- * The index of the content part that the text content is finalized.
1450014500+ * The type of the event. Always `response.output_text.done`.
1450114501 *
1450214502 */
1450314503- content_index: number;
1450314503+ type: 'response.output_text.done';
1450414504 /**
1450514505 * The ID of the output item that the text content is finalized.
1450614506 *
1450714507 */
1450814508 item_id: string;
1450914509 /**
1451014510- * The log probabilities of the tokens in the delta.
1451114511- *
1451214512- */
1451314513- logprobs: Array<ResponseLogProb>;
1451414514- /**
1451514510 * The index of the output item that the text content is finalized.
1451614511 *
1451714512 */
1451814513 output_index: number;
1451914514 /**
1452014520- * The sequence number for this event.
1451514515+ * The index of the content part that the text content is finalized.
1451614516+ *
1452114517 */
1452214522- sequence_number: number;
1451814518+ content_index: number;
1452314519 /**
1452414520 * The text content that is finalized.
1452514521 *
1452614522 */
1452714523 text: string;
1452814524 /**
1452914529- * The type of the event. Always `response.output_text.done`.
1452514525+ * The sequence number for this event.
1452614526+ */
1452714527+ sequence_number: number;
1452814528+ /**
1452914529+ * The log probabilities of the tokens in the delta.
1453014530 *
1453114531 */
1453214532- type: 'response.output_text.done';
1453214532+ logprobs: Array<ResponseLogProb>;
1453314533};
14534145341453514535/**
···1457714577 */
1457814578export type ResponseWebSearchCallCompletedEvent = {
1457914579 /**
1458014580- * Unique ID for the output item associated with the web search call.
1458014580+ * The type of the event. Always `response.web_search_call.completed`.
1458114581 *
1458214582 */
1458314583- item_id: string;
1458314583+ type: 'response.web_search_call.completed';
1458414584 /**
1458514585 * The index of the output item that the web search call is associated with.
1458614586 *
1458714587 */
1458814588 output_index: number;
1458914589 /**
1459014590+ * Unique ID for the output item associated with the web search call.
1459114591+ *
1459214592+ */
1459314593+ item_id: string;
1459414594+ /**
1459014595 * The sequence number of the web search call being processed.
1459114596 */
1459214597 sequence_number: number;
1459314593- /**
1459414594- * The type of the event. Always `response.web_search_call.completed`.
1459514595- *
1459614596- */
1459714597- type: 'response.web_search_call.completed';
1459814598};
14599145991460014600/**
···1460214602 */
1460314603export type ResponseWebSearchCallInProgressEvent = {
1460414604 /**
1460514605- * Unique ID for the output item associated with the web search call.
1460514605+ * The type of the event. Always `response.web_search_call.in_progress`.
1460614606 *
1460714607 */
1460814608- item_id: string;
1460814608+ type: 'response.web_search_call.in_progress';
1460914609 /**
1461014610 * The index of the output item that the web search call is associated with.
1461114611 *
1461214612 */
1461314613 output_index: number;
1461414614 /**
1461514615- * The sequence number of the web search call being processed.
1461514615+ * Unique ID for the output item associated with the web search call.
1461614616+ *
1461614617 */
1461714617- sequence_number: number;
1461814618+ item_id: string;
1461814619 /**
1461914619- * The type of the event. Always `response.web_search_call.in_progress`.
1462014620- *
1462014620+ * The sequence number of the web search call being processed.
1462114621 */
1462214622- type: 'response.web_search_call.in_progress';
1462214622+ sequence_number: number;
1462314623};
14624146241462514625/**
···1462714627 */
1462814628export type ResponseWebSearchCallSearchingEvent = {
1462914629 /**
1463014630- * Unique ID for the output item associated with the web search call.
1463014630+ * The type of the event. Always `response.web_search_call.searching`.
1463114631 *
1463214632 */
1463314633- item_id: string;
1463314633+ type: 'response.web_search_call.searching';
1463414634 /**
1463514635 * The index of the output item that the web search call is associated with.
1463614636 *
1463714637 */
1463814638 output_index: number;
1463914639+ /**
1464014640+ * Unique ID for the output item associated with the web search call.
1464114641+ *
1464214642+ */
1464314643+ item_id: string;
1463914644 /**
1464014645 * The sequence number of the web search call being processed.
1464114646 */
1464214647 sequence_number: number;
1464314643- /**
1464414644- * The type of the event. Always `response.web_search_call.searching`.
1464514645- *
1464614646- */
1464714647- type: 'response.web_search_call.searching';
1464814648};
14649146491465014650/**
···1470714707};
14708147081470914709export type RunGraderResponse = {
1471014710+ reward: number;
1471014711 metadata: {
1471214712+ name: string;
1471314713+ type: string;
1471114714 errors: {
1471214715 formula_parse_error: boolean;
1471614716+ sample_parse_error: boolean;
1471714717+ truncated_observation_error: boolean;
1471814718+ unresponsive_reward_error: boolean;
1471314719 invalid_variable_error: boolean;
1471414714- model_grader_parse_error: boolean;
1471514715- model_grader_refusal_error: boolean;
1471614716- model_grader_server_error: boolean;
1471714717- model_grader_server_error_details: string;
1471814720 other_error: boolean;
1471914719- python_grader_runtime_error: boolean;
1472014720- python_grader_runtime_error_details: string;
1472114721 python_grader_server_error: boolean;
1472214722 python_grader_server_error_type: string;
1472314723- sample_parse_error: boolean;
1472414724- truncated_observation_error: boolean;
1472514725- unresponsive_reward_error: boolean;
1472314723+ python_grader_runtime_error: boolean;
1472414724+ python_grader_runtime_error_details: string;
1472514725+ model_grader_server_error: boolean;
1472614726+ model_grader_refusal_error: boolean;
1472714727+ model_grader_parse_error: boolean;
1472814728+ model_grader_server_error_details: string;
1472614729 };
1472714730 execution_time: number;
1472814728- name: string;
1472914729- sampled_model_name: string;
1473014731 scores: {
1473114732 [key: string]: unknown;
1473214733 };
1473314734 token_usage: number;
1473414734- type: string;
1473514735+ sampled_model_name: string;
1473514736 };
1473614736- model_grader_token_usage_per_model: {
1473714737+ sub_rewards: {
1473714738 [key: string]: unknown;
1473814739 };
1473914739- reward: number;
1474014740- sub_rewards: {
1474014740+ model_grader_token_usage_per_model: {
1474114741 [key: string]: unknown;
1474214742 };
1474314743};
···1474914749 */
1475014750export type RunObject = {
1475114751 /**
1475214752- * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run.
1475214752+ * The identifier, which can be referenced in API endpoints.
1475314753 */
1475414754- assistant_id: string;
1475414754+ id: string;
1475514755 /**
1475614756- * The Unix timestamp (in seconds) for when the run was cancelled.
1475614756+ * The object type, which is always `thread.run`.
1475714757 */
1475814758- cancelled_at: number;
1475914759- /**
1476014760- * The Unix timestamp (in seconds) for when the run was completed.
1476114761- */
1476214762- completed_at: number;
1475814758+ object: 'thread.run';
1476314759 /**
1476414760 * The Unix timestamp (in seconds) for when the run was created.
1476514761 */
1476614762 created_at: number;
1476714763 /**
1476814768- * The Unix timestamp (in seconds) for when the run will expire.
1476414764+ * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run.
1476914765 */
1477014770- expires_at: number;
1476614766+ thread_id: string;
1477114767 /**
1477214772- * The Unix timestamp (in seconds) for when the run failed.
1476814768+ * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run.
1477314769 */
1477414774- failed_at: number;
1477014770+ assistant_id: string;
1477114771+ status: RunStatus;
1477514772 /**
1477614776- * The identifier, which can be referenced in API endpoints.
1477714777- */
1477814778- id: string;
1477914779- /**
1478014780- * Details on why the run is incomplete. Will be `null` if the run is not incomplete.
1477314773+ * Details on the action required to continue the run. Will be `null` if no action is required.
1478114774 */
1478214782- incomplete_details: {
1477514775+ required_action: {
1478314776 /**
1478414784- * The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run.
1477714777+ * For now, this is always `submit_tool_outputs`.
1478514778 */
1478614786- reason?: 'max_completion_tokens' | 'max_prompt_tokens';
1477914779+ type: 'submit_tool_outputs';
1478014780+ /**
1478114781+ * Details on the tool outputs needed for this run to continue.
1478214782+ */
1478314783+ submit_tool_outputs: {
1478414784+ /**
1478514785+ * A list of the relevant tool calls.
1478614786+ */
1478714787+ tool_calls: Array<RunToolCallObject>;
1478814788+ };
1478714789 };
1478814788- /**
1478914789- * The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run.
1479014790- */
1479114791- instructions: string;
1479214790 /**
1479314791 * The last error associated with this run. Will be `null` if there are no errors.
1479414792 */
···1480314801 message: string;
1480414802 };
1480514803 /**
1480614806- * The maximum number of completion tokens specified to have been used over the course of the run.
1480714807- *
1480414804+ * The Unix timestamp (in seconds) for when the run will expire.
1480514805+ */
1480614806+ expires_at: number;
1480714807+ /**
1480814808+ * The Unix timestamp (in seconds) for when the run was started.
1480814809 */
1480914809- max_completion_tokens: number;
1481014810+ started_at: number;
1481014811 /**
1481114811- * The maximum number of prompt tokens specified to have been used over the course of the run.
1481214812- *
1481214812+ * The Unix timestamp (in seconds) for when the run was cancelled.
1481314813 */
1481414814- max_prompt_tokens: number;
1481514815- metadata: Metadata;
1481414814+ cancelled_at: number;
1481614815 /**
1481714817- * The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run.
1481614816+ * The Unix timestamp (in seconds) for when the run failed.
1481814817 */
1481914819- model: string;
1481814818+ failed_at: number;
1482014819 /**
1482114821- * The object type, which is always `thread.run`.
1482014820+ * The Unix timestamp (in seconds) for when the run was completed.
1482214821 */
1482314823- object: 'thread.run';
1482414824- parallel_tool_calls: ParallelToolCalls;
1482214822+ completed_at: number;
1482514823 /**
1482614826- * Details on the action required to continue the run. Will be `null` if no action is required.
1482414824+ * Details on why the run is incomplete. Will be `null` if the run is not incomplete.
1482714825 */
1482814828- required_action: {
1482614826+ incomplete_details: {
1482914827 /**
1483014830- * Details on the tool outputs needed for this run to continue.
1482814828+ * The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run.
1483114829 */
1483214832- submit_tool_outputs: {
1483314833- /**
1483414834- * A list of the relevant tool calls.
1483514835- */
1483614836- tool_calls: Array<RunToolCallObject>;
1483714837- };
1483814838- /**
1483914839- * For now, this is always `submit_tool_outputs`.
1484014840- */
1484114841- type: 'submit_tool_outputs';
1483014830+ reason?: 'max_completion_tokens' | 'max_prompt_tokens';
1484214831 };
1484314843- response_format: AssistantsApiResponseFormatOption;
1484414832 /**
1484514845- * The Unix timestamp (in seconds) for when the run was started.
1483314833+ * The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run.
1484614834 */
1484714847- started_at: number;
1484814848- status: RunStatus;
1483514835+ model: string;
1484914836 /**
1485014850- * The sampling temperature used for this run. If not set, defaults to 1.
1485114851- */
1485214852- temperature?: number;
1485314853- /**
1485414854- * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run.
1483714837+ * The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run.
1485514838 */
1485614856- thread_id: string;
1485714857- tool_choice: AssistantsApiToolChoiceOption & unknown;
1483914839+ instructions: string;
1485814840 /**
1485914841 * The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run.
1486014842 */
1486114843 tools: Array<AssistantTool>;
1484414844+ metadata: Metadata;
1484514845+ usage: RunCompletionUsage;
1484614846+ /**
1484714847+ * The sampling temperature used for this run. If not set, defaults to 1.
1484814848+ */
1484914849+ temperature?: number;
1486214850 /**
1486314851 * The nucleus sampling value used for this run. If not set, defaults to 1.
1486414852 */
1486514853 top_p?: number;
1485414854+ /**
1485514855+ * The maximum number of prompt tokens specified to have been used over the course of the run.
1485614856+ *
1485714857+ */
1485814858+ max_prompt_tokens: number;
1485914859+ /**
1486014860+ * The maximum number of completion tokens specified to have been used over the course of the run.
1486114861+ *
1486214862+ */
1486314863+ max_completion_tokens: number;
1486614864 truncation_strategy: TruncationObject & unknown;
1486714867- usage: RunCompletionUsage;
1486514865+ tool_choice: AssistantsApiToolChoiceOption & unknown;
1486614866+ parallel_tool_calls: ParallelToolCalls;
1486714867+ response_format: AssistantsApiResponseFormatOption;
1486814868};
14869148691487014870/**
···1489214892 *
1489314893 */
1489414894export type RunStepDeltaObject = {
1489514895- delta: RunStepDeltaObjectDelta;
1489614895 /**
1489714896 * The identifier of the run step, which can be referenced in API endpoints.
1489814897 */
···1490114900 * The object type, which is always `thread.run.step.delta`.
1490214901 */
1490314902 object: 'thread.run.step.delta';
1490314903+ delta: RunStepDeltaObjectDelta;
1490414904};
14905149051490614906/**
···1490914909 * Details of the message creation by the run step.
1491014910 */
1491114911export type RunStepDeltaStepDetailsMessageCreationObject = {
1491214912+ /**
1491314913+ * Always `message_creation`.
1491414914+ */
1491514915+ type: 'message_creation';
1491214916 message_creation?: {
1491314917 /**
1491414918 * The ID of the message that was created by this run step.
1491514919 */
1491614920 message_id?: string;
1491714921 };
1491814918- /**
1491914919- * Always `message_creation`.
1492014920- */
1492114921- type: 'message_creation';
1492214922};
14923149231492414924/**
···1492814928 */
1492914929export type RunStepDeltaStepDetailsToolCallsCodeObject = {
1493014930 /**
1493114931+ * The index of the tool call in the tool calls array.
1493214932+ */
1493314933+ index: number;
1493414934+ /**
1493514935+ * The ID of the tool call.
1493614936+ */
1493714937+ id?: string;
1493814938+ /**
1493914939+ * The type of tool call. This is always going to be `code_interpreter` for this type of tool call.
1494014940+ */
1494114941+ type: 'code_interpreter';
1494214942+ /**
1493114943 * The Code Interpreter tool call definition.
1493214944 */
1493314945 code_interpreter?: {
···1494714959 } & RunStepDeltaStepDetailsToolCallsCodeOutputImageObject)
1494814960 >;
1494914961 };
1495014950- /**
1495114951- * The ID of the tool call.
1495214952- */
1495314953- id?: string;
1495414954- /**
1495514955- * The index of the tool call in the tool calls array.
1495614956- */
1495714957- index: number;
1495814958- /**
1495914959- * The type of tool call. This is always going to be `code_interpreter` for this type of tool call.
1496014960- */
1496114961- type: 'code_interpreter';
1496214962};
14963149631496414964/**
1496514965 * Code interpreter image output
1496614966 */
1496714967export type RunStepDeltaStepDetailsToolCallsCodeOutputImageObject = {
1496814968- image?: {
1496914969- /**
1497014970- * The [file](https://platform.openai.com/docs/api-reference/files) ID of the image.
1497114971- */
1497214972- file_id?: string;
1497314973- };
1497414968 /**
1497514969 * The index of the output in the outputs array.
1497614970 */
···1497914973 * Always `image`.
1498014974 */
1498114975 type: 'image';
1497614976+ image?: {
1497714977+ /**
1497814978+ * The [file](https://platform.openai.com/docs/api-reference/files) ID of the image.
1497914979+ */
1498014980+ file_id?: string;
1498114981+ };
1498214982};
14983149831498414984/**
···1499214992 */
1499314993 index: number;
1499414994 /**
1499514995- * The text output from the Code Interpreter tool call.
1499614996- */
1499714997- logs?: string;
1499814998- /**
1499914995 * Always `logs`.
1500014996 */
1500114997 type: 'logs';
1499814998+ /**
1499914999+ * The text output from the Code Interpreter tool call.
1500015000+ */
1500115001+ logs?: string;
1500215002};
15003150031500415004/**
···1500615006 */
1500715007export type RunStepDeltaStepDetailsToolCallsFileSearchObject = {
1500815008 /**
1500915009- * For now, this is always going to be an empty object.
1500915009+ * The index of the tool call in the tool calls array.
1501015010 */
1501115011- file_search: {
1501215012- [key: string]: unknown;
1501315013- };
1501115011+ index: number;
1501415012 /**
1501515013 * The ID of the tool call object.
1501615014 */
1501715015 id?: string;
1501815016 /**
1501915019- * The index of the tool call in the tool calls array.
1501715017+ * The type of tool call. This is always going to be `file_search` for this type of tool call.
1502015018 */
1502115021- index: number;
1501915019+ type: 'file_search';
1502215020 /**
1502315023- * The type of tool call. This is always going to be `file_search` for this type of tool call.
1502115021+ * For now, this is always going to be an empty object.
1502415022 */
1502515025- type: 'file_search';
1502315023+ file_search: {
1502415024+ [key: string]: unknown;
1502515025+ };
1502615026};
15027150271502815028/**
···1503015030 */
1503115031export type RunStepDeltaStepDetailsToolCallsFunctionObject = {
1503215032 /**
1503315033+ * The index of the tool call in the tool calls array.
1503415034+ */
1503515035+ index: number;
1503615036+ /**
1503715037+ * The ID of the tool call object.
1503815038+ */
1503915039+ id?: string;
1504015040+ /**
1504115041+ * The type of tool call. This is always going to be `function` for this type of tool call.
1504215042+ */
1504315043+ type: 'function';
1504415044+ /**
1503315045 * The definition of the function that was called.
1503415046 */
1503515047 function?: {
1503615048 /**
1503715037- * The arguments passed to the function.
1503815038- */
1503915039- arguments?: string;
1504015040- /**
1504115049 * The name of the function.
1504215050 */
1504315051 name?: string;
1505215052+ /**
1505315053+ * The arguments passed to the function.
1505415054+ */
1505515055+ arguments?: string;
1504415056 /**
1504515057 * The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet.
1504615058 */
1504715059 output?: string;
1504815060 };
1504915049- /**
1505015050- * The ID of the tool call object.
1505115051- */
1505215052- id?: string;
1505315053- /**
1505415054- * The index of the tool call in the tool calls array.
1505515055- */
1505615056- index: number;
1505715057- /**
1505815058- * The type of tool call. This is always going to be `function` for this type of tool call.
1505915059- */
1506015060- type: 'function';
1506115061};
15062150621506315063/**
···1506715067 */
1506815068export type RunStepDeltaStepDetailsToolCallsObject = {
1506915069 /**
1507015070+ * Always `tool_calls`.
1507115071+ */
1507215072+ type: 'tool_calls';
1507315073+ /**
1507015074 * An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`.
1507115075 *
1507215076 */
1507315077 tool_calls?: Array<RunStepDeltaStepDetailsToolCall>;
1507415074- /**
1507515075- * Always `tool_calls`.
1507615076- */
1507715077- type: 'tool_calls';
1507815078};
15079150791508015080/**
···1508315083 * Details of the message creation by the run step.
1508415084 */
1508515085export type RunStepDetailsMessageCreationObject = {
1508615086+ /**
1508715087+ * Always `message_creation`.
1508815088+ */
1508915089+ type: 'message_creation';
1508615090 message_creation: {
1508715091 /**
1508815092 * The ID of the message that was created by this run step.
1508915093 */
1509015094 message_id: string;
1509115095 };
1509215092- /**
1509315093- * Always `message_creation`.
1509415094- */
1509515095- type: 'message_creation';
1509615096};
15097150971509815098/**
···1510215102 */
1510315103export type RunStepDetailsToolCallsCodeObject = {
1510415104 /**
1510515105+ * The ID of the tool call.
1510615106+ */
1510715107+ id: string;
1510815108+ /**
1510915109+ * The type of tool call. This is always going to be `code_interpreter` for this type of tool call.
1511015110+ */
1511115111+ type: 'code_interpreter';
1511215112+ /**
1510515113 * The Code Interpreter tool call definition.
1510615114 */
1510715115 code_interpreter: {
···1512115129 } & RunStepDetailsToolCallsCodeOutputImageObject)
1512215130 >;
1512315131 };
1512415124- /**
1512515125- * The ID of the tool call.
1512615126- */
1512715127- id: string;
1512815128- /**
1512915129- * The type of tool call. This is always going to be `code_interpreter` for this type of tool call.
1513015130- */
1513115131- type: 'code_interpreter';
1513215132};
15133151331513415134/**
1513515135 * Code Interpreter image output
1513615136 */
1513715137export type RunStepDetailsToolCallsCodeOutputImageObject = {
1513815138+ /**
1513915139+ * Always `image`.
1514015140+ */
1514115141+ type: 'image';
1513815142 image: {
1513915143 /**
1514015144 * The [file](https://platform.openai.com/docs/api-reference/files) ID of the image.
1514115145 */
1514215146 file_id: string;
1514315147 };
1514415144- /**
1514515145- * Always `image`.
1514615146- */
1514715147- type: 'image';
1514815148};
15149151491515015150/**
···1515315153 * Text output from the Code Interpreter tool call as part of a run step.
1515415154 */
1515515155export type RunStepDetailsToolCallsCodeOutputLogsObject = {
1515615156- /**
1515715157- * The text output from the Code Interpreter tool call.
1515815158- */
1515915159- logs: string;
1516015156 /**
1516115157 * Always `logs`.
1516215158 */
1516315159 type: 'logs';
1516015160+ /**
1516115161+ * The text output from the Code Interpreter tool call.
1516215162+ */
1516315163+ logs: string;
1516415164};
15165151651516615166/**
···1516815168 */
1516915169export type RunStepDetailsToolCallsFileSearchObject = {
1517015170 /**
1517115171+ * The ID of the tool call object.
1517215172+ */
1517315173+ id: string;
1517415174+ /**
1517515175+ * The type of tool call. This is always going to be `file_search` for this type of tool call.
1517615176+ */
1517715177+ type: 'file_search';
1517815178+ /**
1517115179 * For now, this is always going to be an empty object.
1517215180 */
1517315181 file_search: {
···1517715185 */
1517815186 results?: Array<RunStepDetailsToolCallsFileSearchResultObject>;
1517915187 };
1518015180- /**
1518115181- * The ID of the tool call object.
1518215182- */
1518315183- id: string;
1518415184- /**
1518515185- * The type of tool call. This is always going to be `file_search` for this type of tool call.
1518615186- */
1518715187- type: 'file_search';
1518815188};
15189151891519015190/**
···1520715207 */
1520815208export type RunStepDetailsToolCallsFileSearchResultObject = {
1520915209 /**
1521015210- * The content of the result that was found. The content is only included if requested via the include query parameter.
1521115211- */
1521215212- content?: Array<{
1521315213- /**
1521415214- * The text content of the file.
1521515215- */
1521615216- text?: string;
1521715217- /**
1521815218- * The type of the content.
1521915219- */
1522015220- type?: 'text';
1522115221- }>;
1522215222- /**
1522315210 * The ID of the file that result was found in.
1522415211 */
1522515212 file_id: string;
···1523115218 * The score of the result. All values must be a floating point number between 0 and 1.
1523215219 */
1523315220 score: number;
1522115221+ /**
1522215222+ * The content of the result that was found. The content is only included if requested via the include query parameter.
1522315223+ */
1522415224+ content?: Array<{
1522515225+ /**
1522615226+ * The type of the content.
1522715227+ */
1522815228+ type?: 'text';
1522915229+ /**
1523015230+ * The text content of the file.
1523115231+ */
1523215232+ text?: string;
1523315233+ }>;
1523415234};
15235152351523615236/**
···1523815238 */
1523915239export type RunStepDetailsToolCallsFunctionObject = {
1524015240 /**
1524115241+ * The ID of the tool call object.
1524215242+ */
1524315243+ id: string;
1524415244+ /**
1524515245+ * The type of tool call. This is always going to be `function` for this type of tool call.
1524615246+ */
1524715247+ type: 'function';
1524815248+ /**
1524115249 * The definition of the function that was called.
1524215250 */
1524315251 function: {
1524415252 /**
1524515245- * The arguments passed to the function.
1524615246- */
1524715247- arguments: string;
1524815248- /**
1524915253 * The name of the function.
1525015254 */
1525115255 name: string;
1525615256+ /**
1525715257+ * The arguments passed to the function.
1525815258+ */
1525915259+ arguments: string;
1525215260 /**
1525315261 * The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet.
1525415262 */
1525515263 output: string;
1525615264 };
1525715257- /**
1525815258- * The ID of the tool call object.
1525915259- */
1526015260- id: string;
1526115261- /**
1526215262- * The type of tool call. This is always going to be `function` for this type of tool call.
1526315263- */
1526415264- type: 'function';
1526515265};
15266152661526715267/**
···1527115271 */
1527215272export type RunStepDetailsToolCallsObject = {
1527315273 /**
1527415274+ * Always `tool_calls`.
1527515275+ */
1527615276+ type: 'tool_calls';
1527715277+ /**
1527415278 * An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`.
1527515279 *
1527615280 */
1527715281 tool_calls: Array<RunStepDetailsToolCall>;
1527815278- /**
1527915279- * Always `tool_calls`.
1528015280- */
1528115281- type: 'tool_calls';
1528215282};
15283152831528415284/**
···1528915289 */
1529015290export type RunStepObject = {
1529115291 /**
1529215292- * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) associated with the run step.
1529215292+ * The identifier of the run step, which can be referenced in API endpoints.
1529315293 */
1529415294- assistant_id: string;
1529415294+ id: string;
1529515295 /**
1529615296- * The Unix timestamp (in seconds) for when the run step was cancelled.
1529715297- */
1529815298- cancelled_at: number;
1529915299- /**
1530015300- * The Unix timestamp (in seconds) for when the run step completed.
1529615296+ * The object type, which is always `thread.run.step`.
1530115297 */
1530215302- completed_at: number;
1529815298+ object: 'thread.run.step';
1530315299 /**
1530415300 * The Unix timestamp (in seconds) for when the run step was created.
1530515301 */
1530615302 created_at: number;
1530715303 /**
1530815308- * The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired.
1530415304+ * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) associated with the run step.
1530915305 */
1531015310- expired_at: number;
1530615306+ assistant_id: string;
1531115307 /**
1531215312- * The Unix timestamp (in seconds) for when the run step failed.
1530815308+ * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run.
1531315309 */
1531415314- failed_at: number;
1531015310+ thread_id: string;
1531515311 /**
1531615316- * The identifier of the run step, which can be referenced in API endpoints.
1531215312+ * The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that this run step is a part of.
1531715313 */
1531815318- id: string;
1531415314+ run_id: string;
1531515315+ /**
1531615316+ * The type of run step, which can be either `message_creation` or `tool_calls`.
1531715317+ */
1531815318+ type: 'message_creation' | 'tool_calls';
1531915319+ /**
1532015320+ * The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`.
1532115321+ */
1532215322+ status: 'in_progress' | 'cancelled' | 'failed' | 'completed' | 'expired';
1532315323+ /**
1532415324+ * The details of the run step.
1532515325+ */
1532615326+ step_details:
1532715327+ | ({
1532815328+ type?: 'RunStepDetailsMessageCreationObject';
1532915329+ } & RunStepDetailsMessageCreationObject)
1533015330+ | ({
1533115331+ type?: 'RunStepDetailsToolCallsObject';
1533215332+ } & RunStepDetailsToolCallsObject);
1531915333 /**
1532015334 * The last error associated with this run step. Will be `null` if there are no errors.
1532115335 */
···1532915343 */
1533015344 message: string;
1533115345 };
1533215332- metadata: Metadata;
1533315346 /**
1533415334- * The object type, which is always `thread.run.step`.
1534715347+ * The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired.
1533515348 */
1533615336- object: 'thread.run.step';
1534915349+ expired_at: number;
1533715350 /**
1533815338- * The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that this run step is a part of.
1535115351+ * The Unix timestamp (in seconds) for when the run step was cancelled.
1533915352 */
1534015340- run_id: string;
1535315353+ cancelled_at: number;
1534115354 /**
1534215342- * The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`.
1535515355+ * The Unix timestamp (in seconds) for when the run step failed.
1534315356 */
1534415344- status: 'in_progress' | 'cancelled' | 'failed' | 'completed' | 'expired';
1535715357+ failed_at: number;
1534515358 /**
1534615346- * The details of the run step.
1535915359+ * The Unix timestamp (in seconds) for when the run step completed.
1534715360 */
1534815348- step_details:
1534915349- | ({
1535015350- type?: 'RunStepDetailsMessageCreationObject';
1535115351- } & RunStepDetailsMessageCreationObject)
1535215352- | ({
1535315353- type?: 'RunStepDetailsToolCallsObject';
1535415354- } & RunStepDetailsToolCallsObject);
1535515355- /**
1535615356- * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run.
1535715357- */
1535815358- thread_id: string;
1535915359- /**
1536015360- * The type of run step, which can be either `message_creation` or `tool_calls`.
1536115361- */
1536215362- type: 'message_creation' | 'tool_calls';
1536115361+ completed_at: number;
1536215362+ metadata: Metadata;
1536315363 usage: RunStepCompletionUsage;
1536415364};
15365153651536615366export type RunStepStreamEvent =
1536715367 | {
1536815368+ event: 'thread.run.step.created';
1536815369 data: RunStepObject;
1536915369- event: 'thread.run.step.created';
1537015370 }
1537115371 | {
1537215372+ event: 'thread.run.step.in_progress';
1537215373 data: RunStepObject;
1537315373- event: 'thread.run.step.in_progress';
1537415374 }
1537515375 | {
1537615376+ event: 'thread.run.step.delta';
1537615377 data: RunStepDeltaObject;
1537715377- event: 'thread.run.step.delta';
1537815378 }
1537915379 | {
1538015380- data: RunStepObject;
1538115380 event: 'thread.run.step.completed';
1538115381+ data: RunStepObject;
1538215382 }
1538315383 | {
1538415384- data: RunStepObject;
1538515384 event: 'thread.run.step.failed';
1538515385+ data: RunStepObject;
1538615386 }
1538715387 | {
1538815388+ event: 'thread.run.step.cancelled';
1538815389 data: RunStepObject;
1538915389- event: 'thread.run.step.cancelled';
1539015390 }
1539115391 | {
1539215392- data: RunStepObject;
1539315392 event: 'thread.run.step.expired';
1539315393+ data: RunStepObject;
1539415394 };
15395153951539615396export type RunStreamEvent =
1539715397 | {
1539815398- data: RunObject;
1539915398 event: 'thread.run.created';
1539915399+ data: RunObject;
1540015400 }
1540115401 | {
1540215402- data: RunObject;
1540315402 event: 'thread.run.queued';
1540315403+ data: RunObject;
1540415404 }
1540515405 | {
1540615406+ event: 'thread.run.in_progress';
1540615407 data: RunObject;
1540715407- event: 'thread.run.in_progress';
1540815408 }
1540915409 | {
1541015410+ event: 'thread.run.requires_action';
1541015411 data: RunObject;
1541115411- event: 'thread.run.requires_action';
1541215412 }
1541315413 | {
1541415414- data: RunObject;
1541515414 event: 'thread.run.completed';
1541515415+ data: RunObject;
1541615416 }
1541715417 | {
1541815418- data: RunObject;
1541915418 event: 'thread.run.incomplete';
1541915419+ data: RunObject;
1542015420 }
1542115421 | {
1542215422+ event: 'thread.run.failed';
1542215423 data: RunObject;
1542315423- event: 'thread.run.failed';
1542415424 }
1542515425 | {
1542615426- data: RunObject;
1542715426 event: 'thread.run.cancelling';
1542715427+ data: RunObject;
1542815428 }
1542915429 | {
1543015430+ event: 'thread.run.cancelled';
1543015431 data: RunObject;
1543115431- event: 'thread.run.cancelled';
1543215432 }
1543315433 | {
1543415434- data: RunObject;
1543515434 event: 'thread.run.expired';
1543515435+ data: RunObject;
1543615436 };
15437154371543815438/**
···1544015440 */
1544115441export type RunToolCallObject = {
1544215442 /**
1544315443+ * The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint.
1544415444+ */
1544515445+ id: string;
1544615446+ /**
1544715447+ * The type of tool call the output is required for. For now, this is always `function`.
1544815448+ */
1544915449+ type: 'function';
1545015450+ /**
1544315451 * The function definition.
1544415452 */
1544515453 function: {
1544615454 /**
1545515455+ * The name of the function.
1545615456+ */
1545715457+ name: string;
1545815458+ /**
1544715459 * The arguments that the model expects you to pass to the function.
1544815460 */
1544915461 arguments: string;
1545015450- /**
1545115451- * The name of the function.
1545215452- */
1545315453- name: string;
1545415462 };
1545515455- /**
1545615456- * The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint.
1545715457- */
1545815458- id: string;
1545915459- /**
1546015460- * The type of tool call the output is required for. For now, this is always `function`.
1546115461- */
1546215462- type: 'function';
1546315463};
15464154641546515465/**
···1548515485 */
1548615486export type Scroll = {
1548715487 /**
1548815488- * The horizontal scroll distance.
1548915489- *
1549015490- */
1549115491- scroll_x: number;
1549215492- /**
1549315493- * The vertical scroll distance.
1549415494- *
1549515495- */
1549615496- scroll_y: number;
1549715497- /**
1549815488 * Specifies the event type. For a scroll action, this property is
1549915489 * always set to `scroll`.
1550015490 *
···1551015500 *
1551115501 */
1551215502 y: number;
1550315503+ /**
1550415504+ * The horizontal scroll distance.
1550515505+ *
1550615506+ */
1550715507+ scroll_x: number;
1550815508+ /**
1550915509+ * The vertical scroll distance.
1551015510+ *
1551115511+ */
1551215512+ scroll_y: number;
1551315513};
15514155141551515515/**
···1552615526 AUTO: 'auto',
1552715527 DEFAULT: 'default',
1552815528 FLEX: 'flex',
1552915529- PRIORITY: 'priority',
1553015529 SCALE: 'scale',
1553015530+ PRIORITY: 'priority',
1553115531} as const;
15532155321553315533/**
···1554715547 */
1554815548export type SpeechAudioDeltaEvent = {
1554915549 /**
1555015550- * A chunk of Base64-encoded audio data.
1555015550+ * The type of the event. Always `speech.audio.delta`.
1555115551 *
1555215552 */
1555315553- audio: string;
1555315553+ type: 'speech.audio.delta';
1555415554 /**
1555515555- * The type of the event. Always `speech.audio.delta`.
1555515555+ * A chunk of Base64-encoded audio data.
1555615556 *
1555715557 */
1555815558- type: 'speech.audio.delta';
1555815558+ audio: string;
1555915559};
15560155601556115561/**
···15589155891559015590export type StaticChunkingStrategy = {
1559115591 /**
1559215592+ * The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`.
1559315593+ */
1559415594+ max_chunk_size_tokens: number;
1559515595+ /**
1559215596 * The number of tokens that overlap between chunks. The default value is `400`.
1559315597 *
1559415598 * Note that the overlap must not exceed half of `max_chunk_size_tokens`.
1559515599 *
1559615600 */
1559715601 chunk_overlap_tokens: number;
1559815598- /**
1559915599- * The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`.
1560015600- */
1560115601- max_chunk_size_tokens: number;
1560215602};
15603156031560415604/**
···1560715607 * Customize your own chunking strategy by setting chunk size and chunk overlap.
1560815608 */
1560915609export type StaticChunkingStrategyRequestParam = {
1561015610- static: StaticChunkingStrategy;
1561115610 /**
1561215611 * Always `static`.
1561315612 */
1561415613 type: 'static';
1561415614+ static: StaticChunkingStrategy;
1561515615};
15616156161561715617/**
1561815618 * Static Chunking Strategy
1561915619 */
1562015620export type StaticChunkingStrategyResponseParam = {
1562115621- static: StaticChunkingStrategy;
1562215621 /**
1562315622 * Always `static`.
1562415623 */
1562515624 type: 'static';
1562515625+ static: StaticChunkingStrategy;
1562615626};
15627156271562815628/**
···15636156361563715637export type SubmitToolOutputsRunRequest = {
1563815638 /**
1563915639- * If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message.
1564015640- *
1564115641- */
1564215642- stream?: boolean;
1564315643- /**
1564415639 * A list of tools for which the outputs are being submitted.
1564515640 */
1564615641 tool_outputs: Array<{
1564715642 /**
1564815648- * The output of the tool call to be submitted to continue the run.
1564915649- */
1565015650- output?: string;
1565115651- /**
1565215643 * The ID of the tool call in the `required_action` object within the run object the output is being submitted for.
1565315644 */
1565415645 tool_call_id?: string;
1564615646+ /**
1564715647+ * The output of the tool call to be submitted to continue the run.
1564815648+ */
1564915649+ output?: string;
1565515650 }>;
1565115651+ /**
1565215652+ * If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message.
1565315653+ *
1565415654+ */
1565515655+ stream?: boolean;
1565615656};
15657156571565815658/**
···1569115691 */
1569215692export type TextResponseFormatJsonSchema = {
1569315693 /**
1569415694+ * The type of response format being defined. Always `json_schema`.
1569515695+ */
1569615696+ type: 'json_schema';
1569715697+ /**
1569415698 * A description of what the response format is for, used by the model to
1569515699 * determine how to respond in the format.
1569615700 *
···1571215716 *
1571315717 */
1571415718 strict?: boolean;
1571515715- /**
1571615716- * The type of response format being defined. Always `json_schema`.
1571715717- */
1571815718- type: 'json_schema';
1571915719};
15720157201572115721/**
···1572515725 */
1572615726export type ThreadObject = {
1572715727 /**
1572815728- * The Unix timestamp (in seconds) for when the thread was created.
1572915729- */
1573015730- created_at: number;
1573115731- /**
1573215728 * The identifier, which can be referenced in API endpoints.
1573315729 */
1573415730 id: string;
1573515735- metadata: Metadata;
1573615731 /**
1573715732 * The object type, which is always `thread`.
1573815733 */
1573915734 object: 'thread';
1573515735+ /**
1573615736+ * The Unix timestamp (in seconds) for when the thread was created.
1573715737+ */
1573815738+ created_at: number;
1574015739 /**
1574115740 * A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.
1574215741 *
···1575715756 vector_store_ids?: Array<string>;
1575815757 };
1575915758 };
1575915759+ metadata: Metadata;
1576015760};
15761157611576215762/**
1576315763 * Occurs when a new [thread](https://platform.openai.com/docs/api-reference/threads/object) is created.
1576415764 */
1576515765export type ThreadStreamEvent = {
1576615766- data: ThreadObject;
1576715766 /**
1576815767 * Whether to enable input audio transcription.
1576915768 */
1577015769 enabled?: boolean;
1577115770 event: 'thread.created';
1577115771+ data: ThreadObject;
1577215772};
15773157731577415774export type ToggleCertificatesRequest = {
···1581615816 */
1581715817export type ToolChoiceAllowed = {
1581815818 /**
1581915819+ * Allowed tool configuration type. Always `allowed_tools`.
1582015820+ */
1582115821+ type: 'allowed_tools';
1582215822+ /**
1581915823 * Constrains the tools available to the model to a pre-defined set.
1582015824 *
1582115825 * `auto` allows the model to pick from among the allowed tools and generate a
···1584115845 tools: Array<{
1584215846 [key: string]: unknown;
1584315847 }>;
1584415844- /**
1584515845- * Allowed tool configuration type. Always `allowed_tools`.
1584615846- */
1584715847- type: 'allowed_tools';
1584815848};
15849158491585015850/**
···1585515855 */
1585615856export type ToolChoiceCustom = {
1585715857 /**
1585815858- * The name of the custom tool to call.
1585815858+ * For custom tool calling, the type is always `custom`.
1585915859 */
1586015860- name: string;
1586015860+ type: 'custom';
1586115861 /**
1586215862- * For custom tool calling, the type is always `custom`.
1586215862+ * The name of the custom tool to call.
1586315863 */
1586415864- type: 'custom';
1586415864+ name: string;
1586515865};
15866158661586715867/**
···1587215872 */
1587315873export type ToolChoiceFunction = {
1587415874 /**
1587515875+ * For function calling, the type is always `function`.
1587615876+ */
1587715877+ type: 'function';
1587815878+ /**
1587515879 * The name of the function to call.
1587615880 */
1587715881 name: string;
1587815878- /**
1587915879- * For function calling, the type is always `function`.
1588015880- */
1588115881- type: 'function';
1588215882};
15883158831588415884/**
···1588915889 */
1589015890export type ToolChoiceMcp = {
1589115891 /**
1589215892- * The name of the tool to call on the server.
1589315893- *
1589215892+ * For MCP tools, the type is always `mcp`.
1589415893 */
1589515895- name?: string;
1589415894+ type: 'mcp';
1589615895 /**
1589715896 * The label of the MCP server to use.
1589815897 *
1589915898 */
1590015899 server_label: string;
1590115900 /**
1590215902- * For MCP tools, the type is always `mcp`.
1590115901+ * The name of the tool to call on the server.
1590215902+ *
1590315903 */
1590415904- type: 'mcp';
1590415904+ name?: string;
1590515905};
15906159061590715907/**
···1591815918 *
1591915919 */
1592015920export const ToolChoiceOptions = {
1592115921- AUTO: 'auto',
1592215921 NONE: 'none',
1592215922+ AUTO: 'auto',
1592315923 REQUIRED: 'required',
1592415924} as const;
1592515925···1597315973 */
1597415974export type TranscriptTextDeltaEvent = {
1597515975 /**
1597615976+ * The type of the event. Always `transcript.text.delta`.
1597715977+ *
1597815978+ */
1597915979+ type: 'transcript.text.delta';
1598015980+ /**
1597615981 * The text delta that was additionally transcribed.
1597715982 *
1597815983 */
···1598315988 */
1598415989 logprobs?: Array<{
1598515990 /**
1598615986- * The bytes that were used to generate the log probability.
1599115991+ * The token that was used to generate the log probability.
1598715992 *
1598815993 */
1598915989- bytes?: Array<number>;
1599415994+ token?: string;
1599015995 /**
1599115996 * The log probability of the token.
1599215997 *
1599315998 */
1599415999 logprob?: number;
1599516000 /**
1599615996- * The token that was used to generate the log probability.
1600116001+ * The bytes that were used to generate the log probability.
1599716002 *
1599816003 */
1599915999- token?: string;
1600416004+ bytes?: Array<number>;
1600016005 }>;
1600116001- /**
1600216002- * The type of the event. Always `transcript.text.delta`.
1600316003- *
1600416004- */
1600516005- type: 'transcript.text.delta';
1600616006};
16007160071600816008/**
···1601016010 */
1601116011export type TranscriptTextDoneEvent = {
1601216012 /**
1601316013+ * The type of the event. Always `transcript.text.done`.
1601416014+ *
1601516015+ */
1601616016+ type: 'transcript.text.done';
1601716017+ /**
1601816018+ * The text that was transcribed.
1601916019+ *
1602016020+ */
1602116021+ text: string;
1602216022+ /**
1601316023 * The log probabilities of the individual tokens in the transcription. Only included if you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `include[]` parameter set to `logprobs`.
1601416024 *
1601516025 */
1601616026 logprobs?: Array<{
1601716027 /**
1601816018- * The bytes that were used to generate the log probability.
1602816028+ * The token that was used to generate the log probability.
1601916029 *
1602016030 */
1602116021- bytes?: Array<number>;
1603116031+ token?: string;
1602216032 /**
1602316033 * The log probability of the token.
1602416034 *
1602516035 */
1602616036 logprob?: number;
1602716037 /**
1602816028- * The token that was used to generate the log probability.
1603816038+ * The bytes that were used to generate the log probability.
1602916039 *
1603016040 */
1603116031- token?: string;
1604116041+ bytes?: Array<number>;
1603216042 }>;
1603316033- /**
1603416034- * The text that was transcribed.
1603516035- *
1603616036- */
1603716037- text: string;
1603816038- /**
1603916039- * The type of the event. Always `transcript.text.done`.
1604016040- *
1604116041- */
1604216042- type: 'transcript.text.done';
1604316043 usage?: TranscriptTextUsageTokens;
1604416044};
1604516045···1604916049 * Usage statistics for models billed by audio input duration.
1605016050 */
1605116051export type TranscriptTextUsageDuration = {
1605216052- /**
1605316053- * Duration of the input audio in seconds.
1605416054- */
1605516055- seconds: number;
1605616052 /**
1605716053 * The type of the usage object. Always `duration` for this variant.
1605816054 */
1605916055 type: 'duration';
1605616056+ /**
1605716057+ * Duration of the input audio in seconds.
1605816058+ */
1605916059+ seconds: number;
1606016060};
16061160611606216062/**
···1606616066 */
1606716067export type TranscriptTextUsageTokens = {
1606816068 /**
1606916069+ * The type of the usage object. Always `tokens` for this variant.
1607016070+ */
1607116071+ type: 'tokens';
1607216072+ /**
1607316073+ * Number of input tokens billed for this request.
1607416074+ */
1607516075+ input_tokens: number;
1607616076+ /**
1606916077 * Details about the input tokens billed for this request.
1607016078 */
1607116079 input_token_details?: {
1607216080 /**
1607316073- * Number of audio tokens billed for this request.
1607416074- */
1607516075- audio_tokens?: number;
1607616076- /**
1607716081 * Number of text tokens billed for this request.
1607816082 */
1607916083 text_tokens?: number;
1608416084+ /**
1608516085+ * Number of audio tokens billed for this request.
1608616086+ */
1608716087+ audio_tokens?: number;
1608016088 };
1608116089 /**
1608216082- * Number of input tokens billed for this request.
1608316083- */
1608416084- input_tokens: number;
1608516085- /**
1608616090 * Number of output tokens generated.
1608716091 */
1608816092 output_tokens: number;
···1609016094 * Total number of tokens used (input + output).
1609116095 */
1609216096 total_tokens: number;
1609316093- /**
1609416094- * The type of the usage object. Always `tokens` for this variant.
1609516095- */
1609616096- type: 'tokens';
1609716097};
16098160981609916099/**
···16110161101611116111export type TranscriptionSegment = {
1611216112 /**
1611316113- * Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.
1611416114- */
1611516115- avg_logprob: number;
1611616116- /**
1611716117- * Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.
1611816118- */
1611916119- compression_ratio: number;
1612016120- /**
1612116121- * End time of the segment in seconds.
1612216122- */
1612316123- end: number;
1612416124- /**
1612516113 * Unique identifier of the segment.
1612616114 */
1612716115 id: number;
1612816116 /**
1612916129- * 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.
1613016130- */
1613116131- no_speech_prob: number;
1613216132- /**
1613316117 * Seek offset of the segment.
1613416118 */
1613516119 seek: number;
···1613816122 */
1613916123 start: number;
1614016124 /**
1614116141- * Temperature parameter used for generating the segment.
1612516125+ * End time of the segment in seconds.
1614216126 */
1614316143- temperature: number;
1612716127+ end: number;
1614416128 /**
1614516129 * Text content of the segment.
1614616130 */
···1614916133 * Array of token IDs for the text content.
1615016134 */
1615116135 tokens: Array<number>;
1613616136+ /**
1613716137+ * Temperature parameter used for generating the segment.
1613816138+ */
1613916139+ temperature: number;
1614016140+ /**
1614116141+ * Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.
1614216142+ */
1614316143+ avg_logprob: number;
1614416144+ /**
1614516145+ * Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.
1614616146+ */
1614716147+ compression_ratio: number;
1614816148+ /**
1614916149+ * 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.
1615016150+ */
1615116151+ no_speech_prob: number;
1615216152};
16153161531615416154export type TranscriptionWord = {
1615516155 /**
1615616156- * End time of the word in seconds.
1615616156+ * The text content of the word.
1615716157 */
1615816158- end: number;
1615816158+ word: string;
1615916159 /**
1616016160 * Start time of the word in seconds.
1616116161 */
1616216162 start: number;
1616316163 /**
1616416164- * The text content of the word.
1616416164+ * End time of the word in seconds.
1616516165 */
1616616166- word: string;
1616616166+ end: number;
1616716167};
16168161681616916169/**
···1617316173 */
1617416174export type TruncationObject = {
1617516175 /**
1617616176+ * The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`.
1617716177+ */
1617816178+ type: 'auto' | 'last_messages';
1617916179+ /**
1617616180 * The number of most recent messages from the thread when constructing the context for the run.
1617716181 */
1617816182 last_messages?: number;
1617916179- /**
1618016180- * The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`.
1618116181- */
1618216182- type: 'auto' | 'last_messages';
1618316183};
16184161841618516185/**
···1619016190 */
1619116191export type Type = {
1619216192 /**
1619316193- * The text to type.
1619416194- *
1619516195- */
1619616196- text: string;
1619716197- /**
1619816193 * Specifies the event type. For a type action, this property is
1619916194 * always set to `type`.
1620016195 *
1620116196 */
1620216197 type: 'type';
1619816198+ /**
1619916199+ * The text to type.
1620016200+ *
1620116201+ */
1620216202+ text: string;
1620316203};
16204162041620516205export type UpdateVectorStoreFileAttributesRequest = {
···1620716207};
16208162081620916209export type UpdateVectorStoreRequest = {
1621016210- expires_after?: VectorStoreExpirationAfter & unknown;
1621116211- metadata?: Metadata;
1621216210 /**
1621316211 * The name of the vector store.
1621416212 */
1621516213 name?: string;
1621416214+ expires_after?: VectorStoreExpirationAfter & unknown;
1621516215+ metadata?: Metadata;
1621616216};
16217162171621816218/**
···1622316223 */
1622416224export type Upload = {
1622516225 /**
1622616226- * The intended number of bytes to be uploaded.
1622616226+ * The Upload unique identifier, which can be referenced in API endpoints.
1622716227 */
1622816228- bytes: number;
1622816228+ id: string;
1622916229 /**
1623016230 * The Unix timestamp (in seconds) for when the Upload was created.
1623116231 */
1623216232 created_at: number;
1623316233- /**
1623416234- * The Unix timestamp (in seconds) for when the Upload will expire.
1623516235- */
1623616236- expires_at: number;
1623716237- file?: OpenAiFile & unknown;
1623816233 /**
1623916234 * The name of the file to be uploaded.
1624016235 */
1624116236 filename: string;
1624216237 /**
1624316243- * The Upload unique identifier, which can be referenced in API endpoints.
1623816238+ * The intended number of bytes to be uploaded.
1624416239 */
1624516245- id: string;
1624616246- /**
1624716247- * The object type, which is always "upload".
1624816248- */
1624916249- object: 'upload';
1624016240+ bytes: number;
1625016241 /**
1625116242 * The intended purpose of the file. [Please refer here](https://platform.openai.com/docs/api-reference/files/object#files/object-purpose) for acceptable values.
1625216243 */
···1625516246 * The status of the Upload.
1625616247 */
1625716248 status: 'pending' | 'completed' | 'cancelled' | 'expired';
1624916249+ /**
1625016250+ * The Unix timestamp (in seconds) for when the Upload will expire.
1625116251+ */
1625216252+ expires_at: number;
1625316253+ /**
1625416254+ * The object type, which is always "upload".
1625516255+ */
1625616256+ object: 'upload';
1625716257+ file?: OpenAiFile & unknown;
1625816258};
16259162591626016260export type UploadCertificateRequest = {
1626116261+ /**
1626216262+ * An optional name for the certificate
1626316263+ */
1626416264+ name?: string;
1626116265 /**
1626216266 * The certificate content in PEM format
1626316267 */
1626416268 content: string;
1626516265- /**
1626616266- * An optional name for the certificate
1626716267- */
1626816268- name?: string;
1626916269};
16270162701627116271/**
···1627616276 */
1627716277export type UploadPart = {
1627816278 /**
1627916279+ * The upload Part unique identifier, which can be referenced in API endpoints.
1628016280+ */
1628116281+ id: string;
1628216282+ /**
1627916283 * The Unix timestamp (in seconds) for when the Part was created.
1628016284 */
1628116285 created_at: number;
1628216286 /**
1628316283- * The upload Part unique identifier, which can be referenced in API endpoints.
1628716287+ * The ID of the Upload object that this Part was added to.
1628416288 */
1628516285- id: string;
1628916289+ upload_id: string;
1628616290 /**
1628716291 * The object type, which is always `upload.part`.
1628816292 */
1628916293 object: 'upload.part';
1629016290- /**
1629116291- * The ID of the Upload object that this Part was added to.
1629216292- */
1629316293- upload_id: string;
1629416294};
16295162951629616296/**
1629716297 * The aggregated audio speeches usage details of the specific time bucket.
1629816298 */
1629916299export type UsageAudioSpeechesResult = {
1630016300- /**
1630116301- * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
1630216302- */
1630316303- api_key_id?: string;
1630016300+ object: 'organization.usage.audio_speeches.result';
1630416301 /**
1630516302 * The number of characters processed.
1630616303 */
1630716304 characters: number;
1630816305 /**
1630916309- * When `group_by=model`, this field provides the model name of the grouped usage result.
1631016310- */
1631116311- model?: string;
1631216312- /**
1631316306 * The count of requests made to the model.
1631416307 */
1631516308 num_model_requests: number;
1631616316- object: 'organization.usage.audio_speeches.result';
1631716309 /**
1631816310 * When `group_by=project_id`, this field provides the project ID of the grouped usage result.
1631916311 */
···1632216314 * When `group_by=user_id`, this field provides the user ID of the grouped usage result.
1632316315 */
1632416316 user_id?: string;
1631716317+ /**
1631816318+ * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
1631916319+ */
1632016320+ api_key_id?: string;
1632116321+ /**
1632216322+ * When `group_by=model`, this field provides the model name of the grouped usage result.
1632316323+ */
1632416324+ model?: string;
1632516325};
16326163261632716327/**
1632816328 * The aggregated audio transcriptions usage details of the specific time bucket.
1632916329 */
1633016330export type UsageAudioTranscriptionsResult = {
1633116331+ object: 'organization.usage.audio_transcriptions.result';
1633116332 /**
1633216332- * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
1633316333- */
1633416334- api_key_id?: string;
1633516335- /**
1633616336- * When `group_by=model`, this field provides the model name of the grouped usage result.
1633316333+ * The number of seconds processed.
1633716334 */
1633816338- model?: string;
1633516335+ seconds: number;
1633916336 /**
1634016337 * The count of requests made to the model.
1634116338 */
1634216339 num_model_requests: number;
1634316343- object: 'organization.usage.audio_transcriptions.result';
1634416340 /**
1634516341 * When `group_by=project_id`, this field provides the project ID of the grouped usage result.
1634616342 */
1634716343 project_id?: string;
1634816344 /**
1634916349- * The number of seconds processed.
1635016350- */
1635116351- seconds: number;
1635216352- /**
1635316345 * When `group_by=user_id`, this field provides the user ID of the grouped usage result.
1635416346 */
1635516347 user_id?: string;
1634816348+ /**
1634916349+ * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
1635016350+ */
1635116351+ api_key_id?: string;
1635216352+ /**
1635316353+ * When `group_by=model`, this field provides the model name of the grouped usage result.
1635416354+ */
1635516355+ model?: string;
1635616356};
16357163571635816358/**
1635916359 * The aggregated code interpreter sessions usage details of the specific time bucket.
1636016360 */
1636116361export type UsageCodeInterpreterSessionsResult = {
1636216362+ object: 'organization.usage.code_interpreter_sessions.result';
1636216363 /**
1636316364 * The number of code interpreter sessions.
1636416365 */
1636516366 num_sessions?: number;
1636616366- object: 'organization.usage.code_interpreter_sessions.result';
1636716367 /**
1636816368 * When `group_by=project_id`, this field provides the project ID of the grouped usage result.
1636916369 */
···1637416374 * The aggregated completions usage details of the specific time bucket.
1637516375 */
1637616376export type UsageCompletionsResult = {
1637716377+ object: 'organization.usage.completions.result';
1637716378 /**
1637816378- * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
1637916379+ * The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.
1637916380 */
1638016380- api_key_id?: string;
1638116381- /**
1638216382- * When `group_by=batch`, this field tells whether the grouped usage result is batch or not.
1638316383- */
1638416384- batch?: boolean;
1638516385- /**
1638616386- * The aggregated number of audio input tokens used, including cached tokens.
1638716387- */
1638816388- input_audio_tokens?: number;
1638116381+ input_tokens: number;
1638916382 /**
1639016383 * The aggregated number of text input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens.
1639116384 */
1639216385 input_cached_tokens?: number;
1639316386 /**
1639416394- * The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.
1638716387+ * The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.
1639516388 */
1639616396- input_tokens: number;
1638916389+ output_tokens: number;
1639716390 /**
1639816398- * When `group_by=model`, this field provides the model name of the grouped usage result.
1639116391+ * The aggregated number of audio input tokens used, including cached tokens.
1639916392 */
1640016400- model?: string;
1640116401- /**
1640216402- * The count of requests made to the model.
1640316403- */
1640416404- num_model_requests: number;
1640516405- object: 'organization.usage.completions.result';
1639316393+ input_audio_tokens?: number;
1640616394 /**
1640716395 * The aggregated number of audio output tokens used.
1640816396 */
1640916397 output_audio_tokens?: number;
1641016398 /**
1641116411- * The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.
1639916399+ * The count of requests made to the model.
1641216400 */
1641316413- output_tokens: number;
1640116401+ num_model_requests: number;
1641416402 /**
1641516403 * When `group_by=project_id`, this field provides the project ID of the grouped usage result.
1641616404 */
···1641916407 * When `group_by=user_id`, this field provides the user ID of the grouped usage result.
1642016408 */
1642116409 user_id?: string;
1641016410+ /**
1641116411+ * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
1641216412+ */
1641316413+ api_key_id?: string;
1641416414+ /**
1641516415+ * When `group_by=model`, this field provides the model name of the grouped usage result.
1641616416+ */
1641716417+ model?: string;
1641816418+ /**
1641916419+ * When `group_by=batch`, this field tells whether the grouped usage result is batch or not.
1642016420+ */
1642116421+ batch?: boolean;
1642216422};
16423164231642416424/**
1642516425 * The aggregated embeddings usage details of the specific time bucket.
1642616426 */
1642716427export type UsageEmbeddingsResult = {
1642816428- /**
1642916429- * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
1643016430- */
1643116431- api_key_id?: string;
1642816428+ object: 'organization.usage.embeddings.result';
1643216429 /**
1643316430 * The aggregated number of input tokens used.
1643416431 */
1643516432 input_tokens: number;
1643616433 /**
1643716437- * When `group_by=model`, this field provides the model name of the grouped usage result.
1643816438- */
1643916439- model?: string;
1644016440- /**
1644116434 * The count of requests made to the model.
1644216435 */
1644316436 num_model_requests: number;
1644416444- object: 'organization.usage.embeddings.result';
1644516437 /**
1644616438 * When `group_by=project_id`, this field provides the project ID of the grouped usage result.
1644716439 */
···1645016442 * When `group_by=user_id`, this field provides the user ID of the grouped usage result.
1645116443 */
1645216444 user_id?: string;
1644516445+ /**
1644616446+ * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
1644716447+ */
1644816448+ api_key_id?: string;
1644916449+ /**
1645016450+ * When `group_by=model`, this field provides the model name of the grouped usage result.
1645116451+ */
1645216452+ model?: string;
1645316453};
16454164541645516455/**
1645616456 * The aggregated images usage details of the specific time bucket.
1645716457 */
1645816458export type UsageImagesResult = {
1645916459- /**
1646016460- * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
1646116461- */
1646216462- api_key_id?: string;
1645916459+ object: 'organization.usage.images.result';
1646316460 /**
1646416461 * The number of images processed.
1646516462 */
1646616463 images: number;
1646716464 /**
1646816468- * When `group_by=model`, this field provides the model name of the grouped usage result.
1646916469- */
1647016470- model?: string;
1647116471- /**
1647216465 * The count of requests made to the model.
1647316466 */
1647416467 num_model_requests: number;
1647516475- object: 'organization.usage.images.result';
1647616468 /**
1647716477- * When `group_by=project_id`, this field provides the project ID of the grouped usage result.
1646916469+ * When `group_by=source`, this field provides the source of the grouped usage result, possible values are `image.generation`, `image.edit`, `image.variation`.
1647816470 */
1647916479- project_id?: string;
1647116471+ source?: string;
1648016472 /**
1648116473 * When `group_by=size`, this field provides the image size of the grouped usage result.
1648216474 */
1648316475 size?: string;
1648416476 /**
1648516485- * When `group_by=source`, this field provides the source of the grouped usage result, possible values are `image.generation`, `image.edit`, `image.variation`.
1647716477+ * When `group_by=project_id`, this field provides the project ID of the grouped usage result.
1648616478 */
1648716487- source?: string;
1647916479+ project_id?: string;
1648816480 /**
1648916481 * When `group_by=user_id`, this field provides the user ID of the grouped usage result.
1649016482 */
1649116483 user_id?: string;
1648416484+ /**
1648516485+ * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
1648616486+ */
1648716487+ api_key_id?: string;
1648816488+ /**
1648916489+ * When `group_by=model`, this field provides the model name of the grouped usage result.
1649016490+ */
1649116491+ model?: string;
1649216492};
16493164931649416494/**
1649516495 * The aggregated moderations usage details of the specific time bucket.
1649616496 */
1649716497export type UsageModerationsResult = {
1649816498- /**
1649916499- * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
1650016500- */
1650116501- api_key_id?: string;
1649816498+ object: 'organization.usage.moderations.result';
1650216499 /**
1650316500 * The aggregated number of input tokens used.
1650416501 */
1650516502 input_tokens: number;
1650616503 /**
1650716507- * When `group_by=model`, this field provides the model name of the grouped usage result.
1650816508- */
1650916509- model?: string;
1651016510- /**
1651116504 * The count of requests made to the model.
1651216505 */
1651316506 num_model_requests: number;
1651416514- object: 'organization.usage.moderations.result';
1651516507 /**
1651616508 * When `group_by=project_id`, this field provides the project ID of the grouped usage result.
1651716509 */
···1652016512 * When `group_by=user_id`, this field provides the user ID of the grouped usage result.
1652116513 */
1652216514 user_id?: string;
1651516515+ /**
1651616516+ * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
1651716517+ */
1651816518+ api_key_id?: string;
1651916519+ /**
1652016520+ * When `group_by=model`, this field provides the model name of the grouped usage result.
1652116521+ */
1652216522+ model?: string;
1652316523};
16524165241652516525export type UsageResponse = {
1652616526+ object: 'page';
1652616527 data: Array<UsageTimeBucket>;
1652716528 has_more: boolean;
1652816529 next_page: string;
1652916529- object: 'page';
1653016530};
16531165311653216532export type UsageTimeBucket = {
1653316533+ object: 'bucket';
1653416534+ start_time: number;
1653316535 end_time: number;
1653416534- object: 'bucket';
1653516536 result: Array<
1653616537 | ({
1653716538 object?: 'UsageCompletionsResult';
···1656116562 object?: 'CostsResult';
1656216563 } & CostsResult)
1656316564 >;
1656416564- start_time: number;
1656516565};
16566165661656716567/**
···1657016570export type UsageVectorStoresResult = {
1657116571 object: 'organization.usage.vector_stores.result';
1657216572 /**
1657316573+ * The vector stores usage in bytes.
1657416574+ */
1657516575+ usage_bytes: number;
1657616576+ /**
1657316577 * When `group_by=project_id`, this field provides the project ID of the grouped usage result.
1657416578 */
1657516579 project_id?: string;
1657616576- /**
1657716577- * The vector stores usage in bytes.
1657816578- */
1657916579- usage_bytes: number;
1658016580};
16581165811658216582/**
···1658416584 */
1658516585export type User = {
1658616586 /**
1658716587- * The Unix timestamp (in seconds) of when the user was added.
1658716587+ * The object type, which is always `organization.user`
1658816588 */
1658916589- added_at: number;
1659016590- /**
1659116591- * The email address of the user
1659216592- */
1659316593- email: string;
1658916589+ object: 'organization.user';
1659416590 /**
1659516591 * The identifier, which can be referenced in API endpoints
1659616592 */
···1660016596 */
1660116597 name: string;
1660216598 /**
1660316603- * The object type, which is always `organization.user`
1659916599+ * The email address of the user
1660416600 */
1660516605- object: 'organization.user';
1660116601+ email: string;
1660616602 /**
1660716603 * `owner` or `reader`
1660816604 */
1660916605 role: 'owner' | 'reader';
1660616606+ /**
1660716607+ * The Unix timestamp (in seconds) of when the user was added.
1660816608+ */
1660916609+ added_at: number;
1661016610};
16611166111661216612export type UserDeleteResponse = {
1661316613+ object: 'organization.user.deleted';
1661416614+ id: string;
1661316615 deleted: boolean;
1661416614- id: string;
1661516615- object: 'organization.user.deleted';
1661616616};
16617166171661816618export type UserListResponse = {
1661916619+ object: 'list';
1661916620 data: Array<User>;
1662016621 first_id: string;
1662116621- has_more: boolean;
1662216622 last_id: string;
1662316623- object: 'list';
1662316623+ has_more: boolean;
1662416624};
16625166251662616626export type UserRoleUpdateRequest = {
···16632166321663316633export type VadConfig = {
1663416634 /**
1663516635+ * Must be set to `server_vad` to enable manual chunking using server side VAD.
1663616636+ */
1663716637+ type: 'server_vad';
1663816638+ /**
1663516639 * Amount of audio to include before the VAD detected speech (in
1663616640 * milliseconds).
1663716641 *
···1665116655 *
1665216656 */
1665316657 threshold?: number;
1665416654- /**
1665516655- * Must be set to `server_vad` to enable manual chunking using server side VAD.
1665616656- */
1665716657- type: 'server_vad';
1665816658};
16659166591666016660/**
···1672216722 */
1672316723export type VectorStoreFileBatchObject = {
1672416724 /**
1672516725+ * The identifier, which can be referenced in API endpoints.
1672616726+ */
1672716727+ id: string;
1672816728+ /**
1672916729+ * The object type, which is always `vector_store.file_batch`.
1673016730+ */
1673116731+ object: 'vector_store.files_batch';
1673216732+ /**
1672516733 * The Unix timestamp (in seconds) for when the vector store files batch was created.
1672616734 */
1672716735 created_at: number;
1673616736+ /**
1673716737+ * The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) that the [File](https://platform.openai.com/docs/api-reference/files) is attached to.
1673816738+ */
1673916739+ vector_store_id: string;
1674016740+ /**
1674116741+ * The status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`.
1674216742+ */
1674316743+ status: 'in_progress' | 'completed' | 'cancelled' | 'failed';
1672816744 file_counts: {
1672916745 /**
1673016730- * The number of files that where cancelled.
1674616746+ * The number of files that are currently being processed.
1673116747 */
1673216732- cancelled: number;
1674816748+ in_progress: number;
1673316749 /**
1673416750 * The number of files that have been processed.
1673516751 */
···1673916755 */
1674016756 failed: number;
1674116757 /**
1674216742- * The number of files that are currently being processed.
1675816758+ * The number of files that where cancelled.
1674316759 */
1674416744- in_progress: number;
1676016760+ cancelled: number;
1674516761 /**
1674616762 * The total number of files.
1674716763 */
1674816764 total: number;
1674916765 };
1675016750- /**
1675116751- * The identifier, which can be referenced in API endpoints.
1675216752- */
1675316753- id: string;
1675416754- /**
1675516755- * The object type, which is always `vector_store.file_batch`.
1675616756- */
1675716757- object: 'vector_store.files_batch';
1675816758- /**
1675916759- * The status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`.
1676016760- */
1676116761- status: 'in_progress' | 'completed' | 'cancelled' | 'failed';
1676216762- /**
1676316763- * The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) that the [File](https://platform.openai.com/docs/api-reference/files) is attached to.
1676416764- */
1676516765- vector_store_id: string;
1676616766};
16767167671676816768/**
1676916769 * Represents the parsed content of a vector store file.
1677016770 */
1677116771export type VectorStoreFileContentResponse = {
1677216772+ /**
1677316773+ * The object type, which is always `vector_store.file_content.page`
1677416774+ */
1677516775+ object: 'vector_store.file_content.page';
1677216776 /**
1677316777 * Parsed content of the file.
1677416778 */
1677516779 data: Array<{
1677616780 /**
1677716777- * The text content
1677816778- */
1677916779- text?: string;
1678016780- /**
1678116781 * The content type (currently only `"text"`)
1678216782 */
1678316783 type?: string;
1678416784+ /**
1678516785+ * The text content
1678616786+ */
1678716787+ text?: string;
1678416788 }>;
1678516789 /**
1678616790 * Indicates if there are more content pages to fetch.
···1679016794 * The token for the next page, if any.
1679116795 */
1679216796 next_page: string;
1679316793- /**
1679416794- * The object type, which is always `vector_store.file_content.page`
1679516795- */
1679616796- object: 'vector_store.file_content.page';
1679716797};
16798167981679916799/**
···1680216802 * A list of files attached to a vector store.
1680316803 */
1680416804export type VectorStoreFileObject = {
1680516805- attributes?: VectorStoreFileAttributes;
1680616806- chunking_strategy?: ChunkingStrategyResponse;
1680516805+ /**
1680616806+ * The identifier, which can be referenced in API endpoints.
1680716807+ */
1680816808+ id: string;
1680916809+ /**
1681016810+ * The object type, which is always `vector_store.file`.
1681116811+ */
1681216812+ object: 'vector_store.file';
1681316813+ /**
1681416814+ * The total vector store usage in bytes. Note that this may be different from the original file size.
1681516815+ */
1681616816+ usage_bytes: number;
1680716817 /**
1680816818 * The Unix timestamp (in seconds) for when the vector store file was created.
1680916819 */
1681016820 created_at: number;
1681116821 /**
1681216812- * The identifier, which can be referenced in API endpoints.
1682216822+ * The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) that the [File](https://platform.openai.com/docs/api-reference/files) is attached to.
1682316823+ */
1682416824+ vector_store_id: string;
1682516825+ /**
1682616826+ * The status of the vector store file, which can be either `in_progress`, `completed`, `cancelled`, or `failed`. The status `completed` indicates that the vector store file is ready for use.
1681316827 */
1681416814- id: string;
1682816828+ status: 'in_progress' | 'completed' | 'cancelled' | 'failed';
1681516829 /**
1681616830 * The last error associated with this vector store file. Will be `null` if there are no errors.
1681716831 */
···1682516839 */
1682616840 message: string;
1682716841 };
1682816828- /**
1682916829- * The object type, which is always `vector_store.file`.
1683016830- */
1683116831- object: 'vector_store.file';
1683216832- /**
1683316833- * The status of the vector store file, which can be either `in_progress`, `completed`, `cancelled`, or `failed`. The status `completed` indicates that the vector store file is ready for use.
1683416834- */
1683516835- status: 'in_progress' | 'completed' | 'cancelled' | 'failed';
1683616836- /**
1683716837- * The total vector store usage in bytes. Note that this may be different from the original file size.
1683816838- */
1683916839- usage_bytes: number;
1684016840- /**
1684116841- * The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) that the [File](https://platform.openai.com/docs/api-reference/files) is attached to.
1684216842- */
1684316843- vector_store_id: string;
1684216842+ chunking_strategy?: ChunkingStrategyResponse;
1684316843+ attributes?: VectorStoreFileAttributes;
1684416844};
16845168451684616846/**
···1685016850 */
1685116851export type VectorStoreObject = {
1685216852 /**
1685316853+ * The identifier, which can be referenced in API endpoints.
1685416854+ */
1685516855+ id: string;
1685616856+ /**
1685716857+ * The object type, which is always `vector_store`.
1685816858+ */
1685916859+ object: 'vector_store';
1686016860+ /**
1685316861 * The Unix timestamp (in seconds) for when the vector store was created.
1685416862 */
1685516863 created_at: number;
1685616856- expires_after?: VectorStoreExpirationAfter;
1686416864+ /**
1686516865+ * The name of the vector store.
1686616866+ */
1686716867+ name: string;
1685716868 /**
1685816858- * The Unix timestamp (in seconds) for when the vector store will expire.
1686916869+ * The total number of bytes used by the files in the vector store.
1685916870 */
1686016860- expires_at?: number;
1687116871+ usage_bytes: number;
1686116872 file_counts: {
1686216873 /**
1686316863- * The number of files that were cancelled.
1687416874+ * The number of files that are currently being processed.
1686416875 */
1686516865- cancelled: number;
1687616876+ in_progress: number;
1686616877 /**
1686716878 * The number of files that have been successfully processed.
1686816879 */
···1687216883 */
1687316884 failed: number;
1687416885 /**
1687516875- * The number of files that are currently being processed.
1688616886+ * The number of files that were cancelled.
1687616887 */
1687716877- in_progress: number;
1688816888+ cancelled: number;
1687816889 /**
1687916890 * The total number of files.
1688016891 */
1688116892 total: number;
1688216893 };
1688316894 /**
1688416884- * The identifier, which can be referenced in API endpoints.
1689516895+ * The status of the vector store, which can be either `expired`, `in_progress`, or `completed`. A status of `completed` indicates that the vector store is ready for use.
1689616896+ */
1689716897+ status: 'expired' | 'in_progress' | 'completed';
1689816898+ expires_after?: VectorStoreExpirationAfter;
1689916899+ /**
1690016900+ * The Unix timestamp (in seconds) for when the vector store will expire.
1688516901 */
1688616886- id: string;
1690216902+ expires_at?: number;
1688716903 /**
1688816904 * The Unix timestamp (in seconds) for when the vector store was last active.
1688916905 */
1689016906 last_active_at: number;
1689116907 metadata: Metadata;
1689216892- /**
1689316893- * The name of the vector store.
1689416894- */
1689516895- name: string;
1689616896- /**
1689716897- * The object type, which is always `vector_store`.
1689816898- */
1689916899- object: 'vector_store';
1690016900- /**
1690116901- * The status of the vector store, which can be either `expired`, `in_progress`, or `completed`. A status of `completed` indicates that the vector store is ready for use.
1690216902- */
1690316903- status: 'expired' | 'in_progress' | 'completed';
1690416904- /**
1690516905- * The total number of bytes used by the files in the vector store.
1690616906- */
1690716907- usage_bytes: number;
1690816908};
16909169091691016910export type VectorStoreSearchRequest = {
1691116911 /**
1691216912- * A filter to apply based on file attributes.
1691216912+ * A query string for a search
1691316913+ */
1691416914+ query: string | Array<string>;
1691516915+ /**
1691616916+ * Whether to rewrite the natural language query for vector search.
1691316917 */
1691416914- filters?: ComparisonFilter | CompoundFilter;
1691816918+ rewrite_query?: boolean;
1691516919 /**
1691616920 * The maximum number of results to return. This number should be between 1 and 50 inclusive.
1691716921 */
1691816922 max_num_results?: number;
1691916923 /**
1692016920- * A query string for a search
1692416924+ * A filter to apply based on file attributes.
1692116925 */
1692216922- query: string | Array<string>;
1692616926+ filters?: ComparisonFilter | CompoundFilter;
1692316927 /**
1692416928 * Ranking options for search.
1692516929 */
···1693016934 ranker?: 'none' | 'auto' | 'default-2024-11-15';
1693116935 score_threshold?: number;
1693216936 };
1693316933- /**
1693416934- * Whether to rewrite the natural language query for vector search.
1693516935- */
1693616936- rewrite_query?: boolean;
1693716937};
16938169381693916939export type VectorStoreSearchResultContentObject = {
1694016940 /**
1694116941- * The text content returned from search.
1694216942- */
1694316943- text: string;
1694416944- /**
1694516941 * The type of content.
1694616942 */
1694716943 type: 'text';
1694416944+ /**
1694516945+ * The text content returned from search.
1694616946+ */
1694716947+ text: string;
1694816948};
16949169491695016950export type VectorStoreSearchResultItem = {
1695116951- attributes: VectorStoreFileAttributes;
1695216952- /**
1695316953- * Content chunks from the file.
1695416954- */
1695516955- content: Array<VectorStoreSearchResultContentObject>;
1695616951 /**
1695716952 * The ID of the vector store file.
1695816953 */
···1696516960 * The similarity score for the result.
1696616961 */
1696716962 score: number;
1696316963+ attributes: VectorStoreFileAttributes;
1696416964+ /**
1696516965+ * Content chunks from the file.
1696616966+ */
1696716967+ content: Array<VectorStoreSearchResultContentObject>;
1696816968};
16969169691697016970export type VectorStoreSearchResultsPage = {
1697116971+ /**
1697216972+ * The object type, which is always `vector_store.search_results.page`
1697316973+ */
1697416974+ object: 'vector_store.search_results.page';
1697516975+ search_query: Array<string>;
1697116976 /**
1697216977 * The list of search result items.
1697316978 */
···1698016985 * The token for the next page, if any.
1698116986 */
1698216987 next_page: string;
1698316983- /**
1698416984- * The object type, which is always `vector_store.search_results.page`
1698516985- */
1698616986- object: 'vector_store.search_results.page';
1698716987- search_query: Array<string>;
1698816988};
16989169891699016990/**
···1699416994 *
1699516995 */
1699616996export const Verbosity = {
1699716997- HIGH: 'high',
1699816997 LOW: 'low',
1699916998 MEDIUM: 'medium',
1699916999+ HIGH: 'high',
1700017000} as const;
17001170011700217002/**
···1704117041 */
1704217042export type WebSearchActionFind = {
1704317043 /**
1704417044- * The pattern or text to search for within the page.
1704517045- *
1704617046- */
1704717047- pattern: string;
1704817048- /**
1704917044 * The action type.
1705017045 *
1705117046 */
···1705517050 *
1705617051 */
1705717052 url: string;
1705317053+ /**
1705417054+ * The pattern or text to search for within the page.
1705517055+ *
1705617056+ */
1705717057+ pattern: string;
1705817058};
17059170591706017060/**
···1708417084 */
1708517085export type WebSearchActionSearch = {
1708617086 /**
1708717087- * The search query.
1708717087+ * The action type.
1708817088 *
1708917089 */
1709017090- query: string;
1709017090+ type: 'search';
1709117091 /**
1709217092- * The action type.
1709217092+ * The search query.
1709317093 *
1709417094 */
1709517095- type: 'search';
1709517095+ query: string;
1709617096};
17097170971709817098/**
···1710117101 *
1710217102 */
1710317103export const WebSearchContextSize = {
1710417104- HIGH: 'high',
1710517104 LOW: 'low',
1710617105 MEDIUM: 'medium',
1710617106+ HIGH: 'high',
1710717107} as const;
17108171081710917109/**
···1712117121 */
1712217122export type WebSearchLocation = {
1712317123 /**
1712417124- * Free text input for the city of the user, e.g. `San Francisco`.
1712517125- *
1712617126- */
1712717127- city?: string;
1712817128- /**
1712917124 * The two-letter
1713017125 * [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user,
1713117126 * e.g. `US`.
···1713817133 */
1713917134 region?: string;
1714017135 /**
1713617136+ * Free text input for the city of the user, e.g. `San Francisco`.
1713717137+ *
1713817138+ */
1713917139+ city?: string;
1714017140+ /**
1714117141 * The [IANA timezone](https://timeapi.io/documentation/iana-timezones)
1714217142 * of the user, e.g. `America/Los_Angeles`.
1714317143 *
···1715417154 */
1715517155export type WebSearchToolCall = {
1715617156 /**
1715717157+ * The unique ID of the web search tool call.
1715817158+ *
1715917159+ */
1716017160+ id: string;
1716117161+ /**
1716217162+ * The type of the web search tool call. Always `web_search_call`.
1716317163+ *
1716417164+ */
1716517165+ type: 'web_search_call';
1716617166+ /**
1716717167+ * The status of the web search tool call.
1716817168+ *
1716917169+ */
1717017170+ status: 'in_progress' | 'searching' | 'completed' | 'failed';
1717117171+ /**
1715717172 * An object describing the specific action taken in this web search call.
1715817173 * Includes details on how the model used the web (search, open_page, find).
1715917174 *
···1716817183 | ({
1716917184 type?: 'WebSearchActionFind';
1717017185 } & WebSearchActionFind);
1717117171- /**
1717217172- * The unique ID of the web search tool call.
1717317173- *
1717417174- */
1717517175- id: string;
1717617176- /**
1717717177- * The status of the web search tool call.
1717817178- *
1717917179- */
1718017180- status: 'in_progress' | 'searching' | 'completed' | 'failed';
1718117181- /**
1718217182- * The type of the web search tool call. Always `web_search_call`.
1718317183- *
1718417184- */
1718517185- type: 'web_search_call';
1718617186};
17187171871718817188/**
···1719817198 */
1719917199 created_at: number;
1720017200 /**
1720117201+ * The unique ID of the event.
1720217202+ *
1720317203+ */
1720417204+ id: string;
1720517205+ /**
1720117206 * Event data payload.
1720217207 *
1720317208 */
···1720917214 id: string;
1721017215 };
1721117216 /**
1721217212- * The unique ID of the event.
1721317213- *
1721417214- */
1721517215- id: string;
1721617216- /**
1721717217 * The object of the event. Always `event`.
1721817218 *
1721917219 */
···1723817238 */
1723917239 created_at: number;
1724017240 /**
1724117241+ * The unique ID of the event.
1724217242+ *
1724317243+ */
1724417244+ id: string;
1724517245+ /**
1724117246 * Event data payload.
1724217247 *
1724317248 */
···1724917254 id: string;
1725017255 };
1725117256 /**
1725217252- * The unique ID of the event.
1725317253- *
1725417254- */
1725517255- id: string;
1725617256- /**
1725717257 * The object of the event. Always `event`.
1725817258 *
1725917259 */
···1727817278 */
1727917279 created_at: number;
1728017280 /**
1728117281+ * The unique ID of the event.
1728217282+ *
1728317283+ */
1728417284+ id: string;
1728517285+ /**
1728117286 * Event data payload.
1728217287 *
1728317288 */
···1728917294 id: string;
1729017295 };
1729117296 /**
1729217292- * The unique ID of the event.
1729317293- *
1729417294- */
1729517295- id: string;
1729617296- /**
1729717297 * The object of the event. Always `event`.
1729817298 *
1729917299 */
···1731817318 */
1731917319 created_at: number;
1732017320 /**
1732117321+ * The unique ID of the event.
1732217322+ *
1732317323+ */
1732417324+ id: string;
1732517325+ /**
1732117326 * Event data payload.
1732217327 *
1732317328 */
···1732917334 id: string;
1733017335 };
1733117336 /**
1733217332- * The unique ID of the event.
1733317333- *
1733417334- */
1733517335- id: string;
1733617336- /**
1733717337 * The object of the event. Always `event`.
1733817338 *
1733917339 */
···1735817358 */
1735917359 created_at: number;
1736017360 /**
1736117361+ * The unique ID of the event.
1736217362+ *
1736317363+ */
1736417364+ id: string;
1736517365+ /**
1736117366 * Event data payload.
1736217367 *
1736317368 */
···1736917374 id: string;
1737017375 };
1737117376 /**
1737217372- * The unique ID of the event.
1737317373- *
1737417374- */
1737517375- id: string;
1737617376- /**
1737717377 * The object of the event. Always `event`.
1737817378 *
1737917379 */
···1739817398 */
1739917399 created_at: number;
1740017400 /**
1740117401+ * The unique ID of the event.
1740217402+ *
1740317403+ */
1740417404+ id: string;
1740517405+ /**
1740117406 * Event data payload.
1740217407 *
1740317408 */
···1740817413 */
1740917414 id: string;
1741017415 };
1741117411- /**
1741217412- * The unique ID of the event.
1741317413- *
1741417414- */
1741517415- id: string;
1741617416 /**
1741717417 * The object of the event. Always `event`.
1741817418 *
···1743817438 */
1743917439 created_at: number;
1744017440 /**
1744117441+ * The unique ID of the event.
1744217442+ *
1744317443+ */
1744417444+ id: string;
1744517445+ /**
1744117446 * Event data payload.
1744217447 *
1744317448 */
···1744817453 */
1744917454 id: string;
1745017455 };
1745117451- /**
1745217452- * The unique ID of the event.
1745317453- *
1745417454- */
1745517455- id: string;
1745617456 /**
1745717457 * The object of the event. Always `event`.
1745817458 *
···1747817478 */
1747917479 created_at: number;
1748017480 /**
1748117481+ * The unique ID of the event.
1748217482+ *
1748317483+ */
1748417484+ id: string;
1748517485+ /**
1748117486 * Event data payload.
1748217487 *
1748317488 */
···1748817493 */
1748917494 id: string;
1749017495 };
1749117491- /**
1749217492- * The unique ID of the event.
1749317493- *
1749417494- */
1749517495- id: string;
1749617496 /**
1749717497 * The object of the event. Always `event`.
1749817498 *
···1751817518 */
1751917519 created_at: number;
1752017520 /**
1752117521+ * The unique ID of the event.
1752217522+ *
1752317523+ */
1752417524+ id: string;
1752517525+ /**
1752117526 * Event data payload.
1752217527 *
1752317528 */
···1752817533 */
1752917534 id: string;
1753017535 };
1753117531- /**
1753217532- * The unique ID of the event.
1753317533- *
1753417534- */
1753517535- id: string;
1753617536 /**
1753717537 * The object of the event. Always `event`.
1753817538 *
···1755817558 */
1755917559 created_at: number;
1756017560 /**
1756117561+ * The unique ID of the event.
1756217562+ *
1756317563+ */
1756417564+ id: string;
1756517565+ /**
1756117566 * Event data payload.
1756217567 *
1756317568 */
···1756817573 */
1756917574 id: string;
1757017575 };
1757117571- /**
1757217572- * The unique ID of the event.
1757317573- *
1757417574- */
1757517575- id: string;
1757617576 /**
1757717577 * The object of the event. Always `event`.
1757817578 *
···1759817598 */
1759917599 created_at: number;
1760017600 /**
1760117601+ * The unique ID of the event.
1760217602+ *
1760317603+ */
1760417604+ id: string;
1760517605+ /**
1760117606 * Event data payload.
1760217607 *
1760317608 */
···1760817613 */
1760917614 id: string;
1761017615 };
1761117611- /**
1761217612- * The unique ID of the event.
1761317613- *
1761417614- */
1761517615- id: string;
1761617616 /**
1761717617 * The object of the event. Always `event`.
1761817618 *
···1763817638 */
1763917639 created_at: number;
1764017640 /**
1764117641+ * The unique ID of the event.
1764217642+ *
1764317643+ */
1764417644+ id: string;
1764517645+ /**
1764117646 * Event data payload.
1764217647 *
1764317648 */
···1764817653 */
1764917654 id: string;
1765017655 };
1765117651- /**
1765217652- * The unique ID of the event.
1765317653- *
1765417654- */
1765517655- id: string;
1765617656 /**
1765717657 * The object of the event. Always `event`.
1765817658 *
···1767817678 */
1767917679 created_at: number;
1768017680 /**
1768117681+ * The unique ID of the event.
1768217682+ *
1768317683+ */
1768417684+ id: string;
1768517685+ /**
1768117686 * Event data payload.
1768217687 *
1768317688 */
···1768817693 */
1768917694 id: string;
1769017695 };
1769117691- /**
1769217692- * The unique ID of the event.
1769317693- *
1769417694- */
1769517695- id: string;
1769617696 /**
1769717697 * The object of the event. Always `event`.
1769817698 *
···1771817718 */
1771917719 created_at: number;
1772017720 /**
1772117721+ * The unique ID of the event.
1772217722+ *
1772317723+ */
1772417724+ id: string;
1772517725+ /**
1772117726 * Event data payload.
1772217727 *
1772317728 */
···1772817733 */
1772917734 id: string;
1773017735 };
1773117731- /**
1773217732- * The unique ID of the event.
1773317733- *
1773417734- */
1773517735- id: string;
1773617736 /**
1773717737 * The object of the event. Always `event`.
1773817738 *
···1775217752 */
1775317753export type InputTextContent = {
1775417754 /**
1775517755+ * The type of the input item. Always `input_text`.
1775617756+ */
1775717757+ type: 'input_text';
1775817758+ /**
1775517759 * The text input to the model.
1775617760 */
1775717761 text: string;
1775817758- /**
1775917759- * The type of the input item. Always `input_text`.
1776017760- */
1776117761- type: 'input_text';
1776217762};
17763177631776417764/**
···1776817768 */
1776917769export type InputImageContent = {
1777017770 /**
1777117771- * The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
1777117771+ * The type of the input item. Always `input_image`.
1777217772 */
1777317773- detail: 'low' | 'high' | 'auto';
1777317773+ type: 'input_image';
1777417774+ image_url?: string | null;
1777417775 file_id?: string | null;
1777517775- image_url?: string | null;
1777617776 /**
1777717777- * The type of the input item. Always `input_image`.
1777717777+ * The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
1777817778 */
1777917779- type: 'input_image';
1777917779+ detail: 'low' | 'high' | 'auto';
1778017780};
17781177811778217782/**
···1778617786 */
1778717787export type InputFileContent = {
1778817788 /**
1778917789- * The content of the file to be sent to the model.
1779017790- *
1778917789+ * The type of the input item. Always `input_file`.
1779117790 */
1779217792- file_data?: string;
1779117791+ type: 'input_file';
1779317792 file_id?: string | null;
1779417794- /**
1779517795- * The URL of the file to be sent to the model.
1779617796- */
1779717797- file_url?: string;
1779817793 /**
1779917794 * The name of the file to be sent to the model.
1780017795 */
1780117796 filename?: string;
1780217797 /**
1780317803- * The type of the input item. Always `input_file`.
1779817798+ * The URL of the file to be sent to the model.
1780417799 */
1780517805- type: 'input_file';
1780017800+ file_url?: string;
1780117801+ /**
1780217802+ * The content of the file to be sent to the model.
1780317803+ *
1780417804+ */
1780517805+ file_data?: string;
1780617806};
17807178071780817808/**
···1781117811 * Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling).
1781217812 */
1781317813export type FunctionTool = {
1781417814- description?: string | null;
1781417814+ /**
1781517815+ * The type of the function tool. Always `function`.
1781617816+ */
1781717817+ type: 'function';
1781517818 /**
1781617819 * The name of the function to call.
1781717820 */
1781817821 name: string;
1782217822+ description?: string | null;
1781917823 parameters: {
1782017824 [key: string]: unknown;
1782117825 } | null;
1782217826 strict: boolean | null;
1782317823- /**
1782417824- * The type of the function tool. Always `function`.
1782517825- */
1782617826- type: 'function';
1782717827};
17828178281782917829export type RankingOptions = {
···1784517845 * A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).
1784617846 */
1784717847export type FileSearchTool = {
1784817848- filters?: Filters | null;
1784917849- /**
1785017850- * The maximum number of results to return. This number should be between 1 and 50 inclusive.
1785117851- */
1785217852- max_num_results?: number;
1785317853- /**
1785417854- * Ranking options for search.
1785517855- */
1785617856- ranking_options?: RankingOptions;
1785717848 /**
1785817849 * The type of the file search tool. Always `file_search`.
1785917850 */
···1786217853 * The IDs of the vector stores to search.
1786317854 */
1786417855 vector_store_ids: Array<string>;
1785617856+ /**
1785717857+ * The maximum number of results to return. This number should be between 1 and 50 inclusive.
1785817858+ */
1785917859+ max_num_results?: number;
1786017860+ /**
1786117861+ * Ranking options for search.
1786217862+ */
1786317863+ ranking_options?: RankingOptions;
1786417864+ filters?: Filters | null;
1786517865};
17866178661786717867export type ApproximateLocation = {
1786817868- city?: string | null;
1786917869- country?: string | null;
1787017870- region?: string | null;
1787117871- timezone?: string | null;
1787217868 /**
1787317869 * The type of location approximation. Always `approximate`.
1787417870 */
1787517871 type: 'approximate';
1787217872+ country?: string | null;
1787317873+ region?: string | null;
1787417874+ city?: string | null;
1787517875+ timezone?: string | null;
1787617876};
17877178771787817878/**
···1788217882 */
1788317883export type WebSearchPreviewTool = {
1788417884 /**
1788517885- * High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.
1788617886- */
1788717887- search_context_size?: 'low' | 'medium' | 'high';
1788817888- /**
1788917885 * The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.
1789017886 */
1789117887 type: 'web_search_preview' | 'web_search_preview_2025_03_11';
1789217888 user_location?: ApproximateLocation | null;
1788917889+ /**
1789017890+ * High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.
1789117891+ */
1789217892+ search_context_size?: 'low' | 'medium' | 'high';
1789317893};
17894178941789517895/**
···1789917899 */
1790017900export type ComputerUsePreviewTool = {
1790117901 /**
1790217902- * The height of the computer display.
1790217902+ * The type of the computer use tool. Always `computer_use_preview`.
1790317903+ */
1790417904+ type: 'computer_use_preview';
1790517905+ /**
1790617906+ * The type of computer environment to control.
1790317907 */
1790417904- display_height: number;
1790817908+ environment: 'windows' | 'mac' | 'linux' | 'ubuntu' | 'browser';
1790517909 /**
1790617910 * The width of the computer display.
1790717911 */
1790817912 display_width: number;
1790917913 /**
1791017910- * The type of computer environment to control.
1791117911- */
1791217912- environment: 'windows' | 'mac' | 'linux' | 'ubuntu' | 'browser';
1791317913- /**
1791417914- * The type of the computer use tool. Always `computer_use_preview`.
1791417914+ * The height of the computer display.
1791517915 */
1791617916- type: 'computer_use_preview';
1791617916+ display_height: number;
1791717917};
17918179181791917919/**
···1792217922 * The input tokens detailed information for the image generation.
1792317923 */
1792417924export type ImageGenInputUsageDetails = {
1792517925- /**
1792617926- * The number of image tokens in the input prompt.
1792717927- */
1792817928- image_tokens: number;
1792917925 /**
1793017926 * The number of text tokens in the input prompt.
1793117927 */
1793217928 text_tokens: number;
1792917929+ /**
1793017930+ * The number of image tokens in the input prompt.
1793117931+ */
1793217932+ image_tokens: number;
1793317933};
17934179341793517935/**
···1794217942 * The number of tokens (images and text) in the input prompt.
1794317943 */
1794417944 input_tokens: number;
1794517945- input_tokens_details: ImageGenInputUsageDetails;
1794517945+ /**
1794617946+ * The total number of tokens (images and text) used for the image generation.
1794717947+ */
1794817948+ total_tokens: number;
1794617949 /**
1794717950 * The number of output tokens generated by the model.
1794817951 */
1794917952 output_tokens: number;
1795017950- /**
1795117951- * The total number of tokens (images and text) used for the image generation.
1795217952- */
1795317953- total_tokens: number;
1795317953+ input_tokens_details: ImageGenInputUsageDetails;
1795417954};
17955179551795617956/**
···1796017960 */
1796117961export type FileCitationBody = {
1796217962 /**
1796317963+ * The type of the file citation. Always `file_citation`.
1796417964+ */
1796517965+ type: 'file_citation';
1796617966+ /**
1796317967 * The ID of the file.
1796417968 */
1796517969 file_id: string;
1796617970 /**
1796717967- * The filename of the file cited.
1796817968- */
1796917969- filename: string;
1797017970- /**
1797117971 * The index of the file in the list of files.
1797217972 */
1797317973 index: number;
1797417974 /**
1797517975- * The type of the file citation. Always `file_citation`.
1797517975+ * The filename of the file cited.
1797617976 */
1797717977- type: 'file_citation';
1797717977+ filename: string;
1797817978};
17979179791798017980/**
···1798417984 */
1798517985export type UrlCitationBody = {
1798617986 /**
1798717987- * The index of the last character of the URL citation in the message.
1798717987+ * The type of the URL citation. Always `url_citation`.
1798817988 */
1798917989- end_index: number;
1798917989+ type: 'url_citation';
1799017990+ /**
1799117991+ * The URL of the web resource.
1799217992+ */
1799317993+ url: string;
1799017994 /**
1799117995 * The index of the first character of the URL citation in the message.
1799217996 */
1799317997 start_index: number;
1799417998 /**
1799917999+ * The index of the last character of the URL citation in the message.
1800018000+ */
1800118001+ end_index: number;
1800218002+ /**
1799518003 * The title of the web resource.
1799618004 */
1799718005 title: string;
1799817998- /**
1799917999- * The type of the URL citation. Always `url_citation`.
1800018000- */
1800118001- type: 'url_citation';
1800218002- /**
1800318003- * The URL of the web resource.
1800418004- */
1800518005- url: string;
1800618006};
18007180071800818008/**
···1801218012 */
1801318013export type ContainerFileCitationBody = {
1801418014 /**
1801518015- * The ID of the container file.
1801518015+ * The type of the container file citation. Always `container_file_citation`.
1801618016 */
1801718017- container_id: string;
1801718017+ type: 'container_file_citation';
1801818018 /**
1801918019- * The index of the last character of the container file citation in the message.
1801918019+ * The ID of the container file.
1802018020 */
1802118021- end_index: number;
1802118021+ container_id: string;
1802218022 /**
1802318023 * The ID of the file.
1802418024 */
1802518025 file_id: string;
1802618026 /**
1802718027- * The filename of the container file cited.
1802818028- */
1802918029- filename: string;
1803018030- /**
1803118027 * The index of the first character of the container file citation in the message.
1803218028 */
1803318029 start_index: number;
1803418030 /**
1803518035- * The type of the container file citation. Always `container_file_citation`.
1803118031+ * The index of the last character of the container file citation in the message.
1803618032 */
1803718037- type: 'container_file_citation';
1803318033+ end_index: number;
1803418034+ /**
1803518035+ * The filename of the container file cited.
1803618036+ */
1803718037+ filename: string;
1803818038};
18039180391804018040export type Annotation =
···1805718057 * The top log probability of a token.
1805818058 */
1805918059export type TopLogProb = {
1806018060- bytes: Array<number>;
1806018060+ token: string;
1806118061 logprob: number;
1806218062- token: string;
1806218062+ bytes: Array<number>;
1806318063};
18064180641806518065/**
···1806818068 * The log probability of a token.
1806918069 */
1807018070export type LogProb = {
1807118071- bytes: Array<number>;
1807218072- logprob: number;
1807318071 token: string;
1807218072+ logprob: number;
1807318073+ bytes: Array<number>;
1807418074 top_logprobs: Array<TopLogProb>;
1807518075};
1807618076···1808118081 */
1808218082export type OutputTextContent = {
1808318083 /**
1808418084- * The annotations of the text output.
1808418084+ * The type of the output text. Always `output_text`.
1808518085 */
1808618086- annotations: Array<Annotation>;
1808718087- logprobs?: Array<LogProb>;
1808618086+ type: 'output_text';
1808818087 /**
1808918088 * The text output from the model.
1809018089 */
1809118090 text: string;
1809218091 /**
1809318093- * The type of the output text. Always `output_text`.
1809218092+ * The annotations of the text output.
1809418093 */
1809518095- type: 'output_text';
1809418094+ annotations: Array<Annotation>;
1809518095+ logprobs?: Array<LogProb>;
1809618096};
18097180971809818098/**
···1810218102 */
1810318103export type RefusalContent = {
1810418104 /**
1810518105- * The refusal explanation from the model.
1810618106- */
1810718107- refusal: string;
1810818108- /**
1810918105 * The type of the refusal. Always `refusal`.
1811018106 */
1811118107 type: 'refusal';
1810818108+ /**
1810918109+ * The refusal explanation from the model.
1811018110+ */
1811118111+ refusal: string;
1811218112};
18113181131811418114/**
1811518115 * A pending safety check for the computer call.
1811618116 */
1811718117export type ComputerCallSafetyCheckParam = {
1811818118- code?: string | null;
1811918118 /**
1812018119 * The ID of the pending safety check.
1812118120 */
1812218121 id: string;
1812218122+ code?: string | null;
1812318123 message?: string | null;
1812418124};
1812518125···1812918129 * The output of a computer tool call.
1813018130 */
1813118131export type ComputerCallOutputItemParam = {
1813218132- acknowledged_safety_checks?: Array<ComputerCallSafetyCheckParam> | null;
1813218132+ id?: string | null;
1813318133 /**
1813418134 * The ID of the computer tool call that produced the output.
1813518135 */
1813618136 call_id: string;
1813718137- id?: string | null;
1813818138- output: ComputerScreenshotImage;
1813918139- status?: 'in_progress' | 'completed' | 'incomplete' | null;
1814018137 /**
1814118138 * The type of the computer tool call output. Always `computer_call_output`.
1814218139 */
1814318140 type: 'computer_call_output';
1814118141+ output: ComputerScreenshotImage;
1814218142+ acknowledged_safety_checks?: Array<ComputerCallSafetyCheckParam> | null;
1814318143+ status?: 'in_progress' | 'completed' | 'incomplete' | null;
1814418144};
18145181451814618146/**
···1814918149 * The output of a function tool call.
1815018150 */
1815118151export type FunctionCallOutputItemParam = {
1815218152+ id?: string | null;
1815218153 /**
1815318154 * The unique ID of the function tool call generated by the model.
1815418155 */
1815518156 call_id: string;
1815618156- id?: string | null;
1815718157+ /**
1815818158+ * The type of the function tool call output. Always `function_call_output`.
1815918159+ */
1816018160+ type: 'function_call_output';
1815718161 /**
1815818162 * A JSON string of the output of the function tool call.
1815918163 */
1816018164 output: string;
1816118165 status?: 'in_progress' | 'completed' | 'incomplete' | null;
1816218162- /**
1816318163- * The type of the function tool call output. Always `function_call_output`.
1816418164- */
1816518165- type: 'function_call_output';
1816618166};
18167181671816818168/**
···1817118171 * An internal identifier for an item to reference.
1817218172 */
1817318173export type ItemReferenceParam = {
1817418174+ type?: 'item_reference' | null;
1817418175 /**
1817518176 * The ID of the item to reference.
1817618177 */
1817718178 id: string;
1817818178- type?: 'item_reference' | null;
1817918179};
18180181801818118181export type RealtimeConversationItemContent = {
1818218182 /**
1818318183- * Base64-encoded audio bytes, used for `input_audio` content type.
1818318183+ * The content type (`input_text`, `input_audio`, `item_reference`, `text`, `audio`).
1818418184 *
1818518185 */
1818618186- audio?: string;
1818618186+ type?: 'input_text' | 'input_audio' | 'item_reference' | 'text' | 'audio';
1818718187+ /**
1818818188+ * The text content, used for `input_text` and `text` content types.
1818918189+ *
1819018190+ */
1819118191+ text?: string;
1818718192 /**
1818818193 * ID of a previous conversation item to reference (for `item_reference`
1818918194 * content types in `response.create` events). These can reference both
···1819218197 */
1819318198 id?: string;
1819418199 /**
1819518195- * The text content, used for `input_text` and `text` content types.
1820018200+ * Base64-encoded audio bytes, used for `input_audio` content type.
1819618201 *
1819718202 */
1819818198- text?: string;
1820318203+ audio?: string;
1819918204 /**
1820018205 * The transcript of the audio, used for `input_audio` and `audio`
1820118206 * content types.
1820218207 *
1820318208 */
1820418209 transcript?: string;
1820518205- /**
1820618206- * The content type (`input_text`, `input_audio`, `item_reference`, `text`, `audio`).
1820718207- *
1820818208- */
1820918209- type?: 'input_text' | 'input_audio' | 'item_reference' | 'text' | 'audio';
1821018210};
18211182111821218212export type RealtimeConnectParams = {
···1821818218 */
1821918219export type ModerationImageUrlInput = {
1822018220 /**
1822118221+ * Always `image_url`.
1822218222+ */
1822318223+ type: 'image_url';
1822418224+ /**
1822118225 * Contains either an image URL or a data URL for a base64 encoded image.
1822218226 */
1822318227 image_url: {
···1822618230 */
1822718231 url: string;
1822818232 };
1822918229- /**
1823018230- * Always `image_url`.
1823118231- */
1823218232- type: 'image_url';
1823318233};
18234182341823518235/**
1823618236 * An object describing text to classify.
1823718237 */
1823818238export type ModerationTextInput = {
1823918239+ /**
1824018240+ * Always `text`.
1824118241+ */
1824218242+ type: 'text';
1823918243 /**
1824018244 * A string of text to classify.
1824118245 */
1824218246 text: string;
1824318243- /**
1824418244- * Always `text`.
1824518245- */
1824618246- type: 'text';
1824718247};
18248182481824918249/**
···1826418264export const FilePurpose = {
1826518265 ASSISTANTS: 'assistants',
1826618266 BATCH: 'batch',
1826718267- EVALS: 'evals',
1826818267 FINE_TUNE: 'fine-tune',
1826818268+ VISION: 'vision',
1826918269 USER_DATA: 'user_data',
1827018270- VISION: 'vision',
1827018270+ EVALS: 'evals',
1827118271} as const;
18272182721827318273/**
···1828218282 */
1828318283 code?: string;
1828418284 /**
1828518285- * The line number of the input file where the error occurred, if applicable.
1828618286- */
1828718287- line?: number;
1828818288- /**
1828918285 * A human-readable message providing more details about the error.
1829018286 */
1829118287 message?: string;
···1829318289 * The name of the parameter that caused the error, if applicable.
1829418290 */
1829518291 param?: string;
1829218292+ /**
1829318293+ * The line number of the input file where the error occurred, if applicable.
1829418294+ */
1829518295+ line?: number;
1829618296};
18297182971829818298/**
···1830018300 */
1830118301export type BatchRequestCounts = {
1830218302 /**
1830318303+ * Total number of requests in the batch.
1830418304+ */
1830518305+ total: number;
1830618306+ /**
1830318307 * Number of requests that have been completed successfully.
1830418308 */
1830518309 completed: number;
···1830718311 * Number of requests that have failed.
1830818312 */
1830918313 failed: number;
1831018310- /**
1831118311- * Total number of requests in the batch.
1831218312- */
1831318313- total: number;
1831418314};
18315183151831618316export type AssistantTool =
···1839118391 } & MessageDeltaContentImageUrlObject);
18392183921839318393export const ChatModel = {
1839418394+ GPT_5: 'gpt-5',
1839518395+ GPT_5_MINI: 'gpt-5-mini',
1839618396+ GPT_5_NANO: 'gpt-5-nano',
1839718397+ GPT_5_2025_08_07: 'gpt-5-2025-08-07',
1839818398+ GPT_5_MINI_2025_08_07: 'gpt-5-mini-2025-08-07',
1839918399+ GPT_5_NANO_2025_08_07: 'gpt-5-nano-2025-08-07',
1840018400+ GPT_5_CHAT_LATEST: 'gpt-5-chat-latest',
1840118401+ GPT_4_1: 'gpt-4.1',
1840218402+ GPT_4_1_MINI: 'gpt-4.1-mini',
1840318403+ GPT_4_1_NANO: 'gpt-4.1-nano',
1840418404+ GPT_4_1_2025_04_14: 'gpt-4.1-2025-04-14',
1840518405+ GPT_4_1_MINI_2025_04_14: 'gpt-4.1-mini-2025-04-14',
1840618406+ GPT_4_1_NANO_2025_04_14: 'gpt-4.1-nano-2025-04-14',
1840718407+ O4_MINI: 'o4-mini',
1840818408+ O4_MINI_2025_04_16: 'o4-mini-2025-04-16',
1840918409+ O3: 'o3',
1841018410+ O3_2025_04_16: 'o3-2025-04-16',
1841118411+ O3_MINI: 'o3-mini',
1841218412+ O3_MINI_2025_01_31: 'o3-mini-2025-01-31',
1841318413+ O1: 'o1',
1841418414+ O1_2024_12_17: 'o1-2024-12-17',
1841518415+ O1_PREVIEW: 'o1-preview',
1841618416+ O1_PREVIEW_2024_09_12: 'o1-preview-2024-09-12',
1841718417+ O1_MINI: 'o1-mini',
1841818418+ O1_MINI_2024_09_12: 'o1-mini-2024-09-12',
1839418419 GPT_4O: 'gpt-4o',
1839518395- CHATGPT_4O_LATEST: 'chatgpt-4o-latest',
1839618396- GPT_4O_2024_05_13: 'gpt-4o-2024-05-13',
1839718397- CODEX_MINI_LATEST: 'codex-mini-latest',
1842018420+ GPT_4O_2024_11_20: 'gpt-4o-2024-11-20',
1839818421 GPT_4O_2024_08_06: 'gpt-4o-2024-08-06',
1839918399- GPT_4O_2024_11_20: 'gpt-4o-2024-11-20',
1842218422+ GPT_4O_2024_05_13: 'gpt-4o-2024-05-13',
1840018423 GPT_4O_AUDIO_PREVIEW: 'gpt-4o-audio-preview',
1840118424 GPT_4O_AUDIO_PREVIEW_2024_10_01: 'gpt-4o-audio-preview-2024-10-01',
1840218425 GPT_4O_AUDIO_PREVIEW_2024_12_17: 'gpt-4o-audio-preview-2024-12-17',
1840318403- GPT_4: 'gpt-4',
1840418426 GPT_4O_AUDIO_PREVIEW_2025_06_03: 'gpt-4o-audio-preview-2025-06-03',
1840518405- GPT_4O_MINI: 'gpt-4o-mini',
1840618406- GPT_4O_MINI_2024_07_18: 'gpt-4o-mini-2024-07-18',
1840718427 GPT_4O_MINI_AUDIO_PREVIEW: 'gpt-4o-mini-audio-preview',
1840818428 GPT_4O_MINI_AUDIO_PREVIEW_2024_12_17: 'gpt-4o-mini-audio-preview-2024-12-17',
1840918409- GPT_3_5_TURBO: 'gpt-3.5-turbo',
1841018410- GPT_4_1: 'gpt-4.1',
1841118411- GPT_3_5_TURBO_0301: 'gpt-3.5-turbo-0301',
1841218412- GPT_4_1_2025_04_14: 'gpt-4.1-2025-04-14',
1841318413- GPT_3_5_TURBO_0613: 'gpt-3.5-turbo-0613',
1841418414- GPT_4_1_MINI: 'gpt-4.1-mini',
1841518415- GPT_3_5_TURBO_0125: 'gpt-3.5-turbo-0125',
1841618416- GPT_4_1_MINI_2025_04_14: 'gpt-4.1-mini-2025-04-14',
1841718417- GPT_3_5_TURBO_1106: 'gpt-3.5-turbo-1106',
1841818418- GPT_4_1_NANO: 'gpt-4.1-nano',
1841918419- GPT_3_5_TURBO_16K: 'gpt-3.5-turbo-16k',
1842018420- GPT_4_1_NANO_2025_04_14: 'gpt-4.1-nano-2025-04-14',
1842118421- GPT_3_5_TURBO_16K_0613: 'gpt-3.5-turbo-16k-0613',
1842218422- GPT_5: 'gpt-5',
1842918429+ GPT_4O_SEARCH_PREVIEW: 'gpt-4o-search-preview',
1842318430 GPT_4O_MINI_SEARCH_PREVIEW: 'gpt-4o-mini-search-preview',
1842418424- GPT_5_2025_08_07: 'gpt-5-2025-08-07',
1843118431+ GPT_4O_SEARCH_PREVIEW_2025_03_11: 'gpt-4o-search-preview-2025-03-11',
1842518432 GPT_4O_MINI_SEARCH_PREVIEW_2025_03_11:
1842618433 'gpt-4o-mini-search-preview-2025-03-11',
1842718427- GPT_5_CHAT_LATEST: 'gpt-5-chat-latest',
1842818428- GPT_4O_SEARCH_PREVIEW: 'gpt-4o-search-preview',
1842918429- GPT_5_MINI: 'gpt-5-mini',
1843018430- GPT_4O_SEARCH_PREVIEW_2025_03_11: 'gpt-4o-search-preview-2025-03-11',
1843118431- GPT_5_MINI_2025_08_07: 'gpt-5-mini-2025-08-07',
1843418434+ CHATGPT_4O_LATEST: 'chatgpt-4o-latest',
1843518435+ CODEX_MINI_LATEST: 'codex-mini-latest',
1843618436+ GPT_4O_MINI: 'gpt-4o-mini',
1843718437+ GPT_4O_MINI_2024_07_18: 'gpt-4o-mini-2024-07-18',
1843818438+ GPT_4_TURBO: 'gpt-4-turbo',
1843918439+ GPT_4_TURBO_2024_04_09: 'gpt-4-turbo-2024-04-09',
1843218440 GPT_4_0125_PREVIEW: 'gpt-4-0125-preview',
1843318433- GPT_5_NANO: 'gpt-5-nano',
1844118441+ GPT_4_TURBO_PREVIEW: 'gpt-4-turbo-preview',
1844218442+ GPT_4_1106_PREVIEW: 'gpt-4-1106-preview',
1844318443+ GPT_4_VISION_PREVIEW: 'gpt-4-vision-preview',
1844418444+ GPT_4: 'gpt-4',
1843418445 GPT_4_0314: 'gpt-4-0314',
1843518435- GPT_5_NANO_2025_08_07: 'gpt-5-nano-2025-08-07',
1843618446 GPT_4_0613: 'gpt-4-0613',
1843718437- O1: 'o1',
1843818438- GPT_4_1106_PREVIEW: 'gpt-4-1106-preview',
1843918439- O1_2024_12_17: 'o1-2024-12-17',
1844018447 GPT_4_32K: 'gpt-4-32k',
1844118441- O1_MINI: 'o1-mini',
1844218448 GPT_4_32K_0314: 'gpt-4-32k-0314',
1844318443- O3: 'o3',
1844418449 GPT_4_32K_0613: 'gpt-4-32k-0613',
1844518445- O3_2025_04_16: 'o3-2025-04-16',
1844618446- GPT_4_TURBO: 'gpt-4-turbo',
1844718447- O4_MINI: 'o4-mini',
1844818448- GPT_4_TURBO_2024_04_09: 'gpt-4-turbo-2024-04-09',
1844918449- O4_MINI_2025_04_16: 'o4-mini-2025-04-16',
1845018450- GPT_4_TURBO_PREVIEW: 'gpt-4-turbo-preview',
1845118451- O3_MINI: 'o3-mini',
1845218452- GPT_4_VISION_PREVIEW: 'gpt-4-vision-preview',
1845318453- O3_MINI_2025_01_31: 'o3-mini-2025-01-31',
1845418454- O1_MINI_2024_09_12: 'o1-mini-2024-09-12',
1845518455- O1_PREVIEW: 'o1-preview',
1845618456- O1_PREVIEW_2024_09_12: 'o1-preview-2024-09-12',
1845018450+ GPT_3_5_TURBO: 'gpt-3.5-turbo',
1845118451+ GPT_3_5_TURBO_16K: 'gpt-3.5-turbo-16k',
1845218452+ GPT_3_5_TURBO_0301: 'gpt-3.5-turbo-0301',
1845318453+ GPT_3_5_TURBO_0613: 'gpt-3.5-turbo-0613',
1845418454+ GPT_3_5_TURBO_1106: 'gpt-3.5-turbo-1106',
1845518455+ GPT_3_5_TURBO_0125: 'gpt-3.5-turbo-0125',
1845618456+ GPT_3_5_TURBO_16K_0613: 'gpt-3.5-turbo-16k-0613',
1845718457} as const;
18458184581845918459export type ChatModel = (typeof ChatModel)[keyof typeof ChatModel];
···1846318463 * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run.
1846418464 */
1846518465 assistant_id: string;
1846618466- /**
1846718467- * Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis.
1846818468- */
1846918469- instructions?: string;
1847018470- /**
1847118471- * The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.
1847218472- *
1847318473- */
1847418474- max_completion_tokens?: number;
1847518475- /**
1847618476- * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.
1847718477- *
1847818478- */
1847918479- max_prompt_tokens?: number;
1848018480- metadata?: Metadata;
1846618466+ thread?: CreateThreadRequest;
1848118467 /**
1848218468 * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used.
1848318469 */
···1852118507 | 'gpt-3.5-turbo-1106'
1852218508 | 'gpt-3.5-turbo-0125'
1852318509 | 'gpt-3.5-turbo-16k-0613';
1852418524- parallel_tool_calls?: ParallelToolCalls;
1852518525- response_format?: AssistantsApiResponseFormatOption;
1852618510 /**
1852718527- * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
1852818528- *
1851118511+ * Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis.
1852918512 */
1853018530- temperature?: number;
1853118531- thread?: CreateThreadRequest;
1853218532- tool_choice?: AssistantsApiToolChoiceOption & unknown;
1851318513+ instructions?: string;
1851418514+ /**
1851518515+ * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
1851618516+ */
1851718517+ tools?: Array<AssistantTool>;
1853318518 /**
1853418519 * A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.
1853518520 *
···1855018535 vector_store_ids?: Array<string>;
1855118536 };
1855218537 };
1853818538+ metadata?: Metadata;
1855318539 /**
1855418554- * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
1854018540+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
1854118541+ *
1855518542 */
1855618556- tools?: Array<AssistantTool>;
1854318543+ temperature?: number;
1855718544 /**
1855818545 * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
1855918546 *
···1856118548 *
1856218549 */
1856318550 top_p?: number;
1855118551+ /**
1855218552+ * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.
1855318553+ *
1855418554+ */
1855518555+ max_prompt_tokens?: number;
1855618556+ /**
1855718557+ * The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.
1855818558+ *
1855918559+ */
1856018560+ max_completion_tokens?: number;
1856418561 truncation_strategy?: TruncationObject & unknown;
1856218562+ tool_choice?: AssistantsApiToolChoiceOption & unknown;
1856318563+ parallel_tool_calls?: ParallelToolCalls;
1856418564+ response_format?: AssistantsApiResponseFormatOption;
1856518565};
18566185661856718567export type CreateRunRequestWithoutStream = {
1856818568 /**
1856918569- * Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions.
1856918569+ * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run.
1857018570 */
1857118571- additional_instructions?: string;
1857118571+ assistant_id: string;
1857218572 /**
1857318573- * Adds additional messages to the thread before creating the run.
1857318573+ * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used.
1857418574 */
1857518575- additional_messages?: Array<CreateMessageRequest>;
1857618576- /**
1857718577- * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run.
1857818578- */
1857918579- assistant_id: string;
1857518575+ model?: string | AssistantSupportedModels;
1857618576+ reasoning_effort?: ReasoningEffort;
1858018577 /**
1858118578 * Overrides the [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis.
1858218579 */
1858318580 instructions?: string;
1858418581 /**
1858518585- * The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.
1858618586- *
1858218582+ * Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions.
1858718583 */
1858818588- max_completion_tokens?: number;
1858418584+ additional_instructions?: string;
1858918585 /**
1859018590- * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.
1859118591- *
1858618586+ * Adds additional messages to the thread before creating the run.
1859218587 */
1859318593- max_prompt_tokens?: number;
1859418594- metadata?: Metadata;
1858818588+ additional_messages?: Array<CreateMessageRequest>;
1859518589 /**
1859618596- * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used.
1859018590+ * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
1859718591 */
1859818598- model?: string | AssistantSupportedModels;
1859918599- parallel_tool_calls?: ParallelToolCalls;
1860018600- reasoning_effort?: ReasoningEffort;
1860118601- response_format?: AssistantsApiResponseFormatOption;
1859218592+ tools?: Array<AssistantTool>;
1859318593+ metadata?: Metadata;
1860218594 /**
1860318595 * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
1860418596 *
1860518597 */
1860618598 temperature?: number;
1860718607- tool_choice?: AssistantsApiToolChoiceOption & unknown;
1860818608- /**
1860918609- * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
1861018610- */
1861118611- tools?: Array<AssistantTool>;
1861218599 /**
1861318600 * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
1861418601 *
···1861618603 *
1861718604 */
1861818605 top_p?: number;
1860618606+ /**
1860718607+ * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.
1860818608+ *
1860918609+ */
1861018610+ max_prompt_tokens?: number;
1861118611+ /**
1861218612+ * The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.
1861318613+ *
1861418614+ */
1861518615+ max_completion_tokens?: number;
1861918616 truncation_strategy?: TruncationObject & unknown;
1861718617+ tool_choice?: AssistantsApiToolChoiceOption & unknown;
1861818618+ parallel_tool_calls?: ParallelToolCalls;
1861918619+ response_format?: AssistantsApiResponseFormatOption;
1862018620};
18621186211862218622export type SubmitToolOutputsRunRequestWithoutStream = {
···1862518625 */
1862618626 tool_outputs: Array<{
1862718627 /**
1862818628- * The output of the tool call to be submitted to continue the run.
1862918629- */
1863018630- output?: string;
1863118631- /**
1863218628 * The ID of the tool call in the `required_action` object within the run object the output is being submitted for.
1863318629 */
1863418630 tool_call_id?: string;
1863118631+ /**
1863218632+ * The output of the tool call to be submitted to continue the run.
1863318633+ */
1863418634+ output?: string;
1863518635 }>;
1863618636};
1863718637···1863918639 * The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`.
1864018640 */
1864118641export const RunStatus = {
1864218642- CANCELLED: 'cancelled',
1864218642+ QUEUED: 'queued',
1864318643+ IN_PROGRESS: 'in_progress',
1864418644+ REQUIRES_ACTION: 'requires_action',
1864318645 CANCELLING: 'cancelling',
1864418644- COMPLETED: 'completed',
1864518645- EXPIRED: 'expired',
1864618646+ CANCELLED: 'cancelled',
1864618647 FAILED: 'failed',
1864818648+ COMPLETED: 'completed',
1864718649 INCOMPLETE: 'incomplete',
1864818648- IN_PROGRESS: 'in_progress',
1864918649- QUEUED: 'queued',
1865018650- REQUIRES_ACTION: 'requires_action',
1865018650+ EXPIRED: 'expired',
1865118651} as const;
18652186521865318653/**
···1867618676 path?: never;
1867718677 query?: {
1867818678 /**
1867918679- * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
1867918679+ * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
1868018680 *
1868118681 */
1868218682- after?: string;
1868218682+ limit?: number;
1868318683 /**
1868418684- * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
1868418684+ * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
1868518685 *
1868618686 */
1868718687- before?: string;
1868718687+ order?: 'asc' | 'desc';
1868818688 /**
1868918689- * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
1868918689+ * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
1869018690 *
1869118691 */
1869218692- limit?: number;
1869218692+ after?: string;
1869318693 /**
1869418694- * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
1869418694+ * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
1869518695 *
1869618696 */
1869718697- order?: 'asc' | 'desc';
1869718697+ before?: string;
1869818698 };
1869918699 url: '/assistants';
1870018700};
···1887418874export type CreateBatchData = {
1887518875 body: {
1887618876 /**
1887718877- * The time frame within which the batch should be processed. Currently only `24h` is supported.
1887718877+ * The ID of an uploaded file that contains requests for the new batch.
1887818878+ *
1887918879+ * See [upload file](https://platform.openai.com/docs/api-reference/files/create) for how to upload a file.
1888018880+ *
1888118881+ * Your input file must be formatted as a [JSONL file](https://platform.openai.com/docs/api-reference/batch/request-input), and must be uploaded with the purpose `batch`. The file can contain up to 50,000 requests, and can be up to 200 MB in size.
1888218882+ *
1887818883 */
1887918879- completion_window: '24h';
1888418884+ input_file_id: string;
1888018885 /**
1888118886 * The endpoint to be used for all requests in the batch. Currently `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions` are supported. Note that `/v1/embeddings` batches are also restricted to a maximum of 50,000 embedding inputs across all requests in the batch.
1888218887 */
···1888618891 | '/v1/embeddings'
1888718892 | '/v1/completions';
1888818893 /**
1888918889- * The ID of an uploaded file that contains requests for the new batch.
1889018890- *
1889118891- * See [upload file](https://platform.openai.com/docs/api-reference/files/create) for how to upload a file.
1889218892- *
1889318893- * Your input file must be formatted as a [JSONL file](https://platform.openai.com/docs/api-reference/batch/request-input), and must be uploaded with the purpose `batch`. The file can contain up to 50,000 requests, and can be up to 200 MB in size.
1889418894- *
1889418894+ * The time frame within which the batch should be processed. Currently only `24h` is supported.
1889518895 */
1889618896- input_file_id: string;
1889618896+ completion_window: '24h';
1889718897 metadata?: Metadata;
1889818898 output_expires_after?: BatchFileExpirationAfter;
1889918899 };
···1896118961 path?: never;
1896218962 query?: {
1896318963 /**
1896418964- * Identifier for the last chat completion from the previous pagination request.
1896518965- */
1896618966- after?: string;
1896718967- /**
1896818968- * Number of Chat Completions to retrieve.
1896418964+ * The model used to generate the Chat Completions.
1896918965 */
1897018970- limit?: number;
1896618966+ model?: string;
1897118967 /**
1897218968 * A list of metadata keys to filter the Chat Completions by. Example:
1897318969 *
···1897618972 */
1897718973 metadata?: Metadata;
1897818974 /**
1897918979- * The model used to generate the Chat Completions.
1897518975+ * Identifier for the last chat completion from the previous pagination request.
1897618976+ */
1897718977+ after?: string;
1897818978+ /**
1897918979+ * Number of Chat Completions to retrieve.
1898018980 */
1898118981- model?: string;
1898118981+ limit?: number;
1898218982 /**
1898318983 * Sort order for Chat Completions by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.
1898418984 */
···1913919139 path?: never;
1914019140 query?: {
1914119141 /**
1914219142- * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
1914319143- *
1914419144- */
1914519145- after?: string;
1914619146- /**
1914719142 * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
1914819143 *
1914919144 */
···1915319148 *
1915419149 */
1915519150 order?: 'asc' | 'desc';
1915119151+ /**
1915219152+ * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
1915319153+ *
1915419154+ */
1915519155+ after?: string;
1915619156 };
1915719157 url: '/containers';
1915819158};
···1922919229 };
1923019230 query?: {
1923119231 /**
1923219232- * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
1923319233- *
1923419234- */
1923519235- after?: string;
1923619236- /**
1923719232 * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
1923819233 *
1923919234 */
···1924319238 *
1924419239 */
1924519240 order?: 'asc' | 'desc';
1924119241+ /**
1924219242+ * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
1924319243+ *
1924419244+ */
1924519245+ after?: string;
1924619246 };
1924719247 url: '/containers/{container_id}/files';
1924819248};
···1942419424 * Successfully deleted the evaluation.
1942519425 */
1942619426 200: {
1942719427+ object: string;
1942719428 deleted: boolean;
1942819429 eval_id: string;
1942919429- object: string;
1943019430 };
1943119431};
1943219432···1945819458 * Request to update an evaluation
1945919459 */
1946019460 body: {
1946119461- metadata?: Metadata;
1946219461 /**
1946319462 * Rename the evaluation.
1946419463 */
1946519464 name?: string;
1946519465+ metadata?: Metadata;
1946619466 };
1946719467 path: {
1946819468 /**
···1958319583 * Successfully deleted the eval run
1958419584 */
1958519585 200: {
1958619586- deleted?: boolean;
1958719586 object?: string;
1958719587+ deleted?: boolean;
1958819588 run_id?: string;
1958919589 };
1959019590};
···1966419664 * Number of output items to retrieve.
1966519665 */
1966619666 limit?: number;
1966719667- /**
1966819668- * Sort order for output items by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.
1966919669- */
1967019670- order?: 'asc' | 'desc';
1967119667 /**
1967219668 * Filter output items by status. Use `failed` to filter by failed output
1967319669 * items or `pass` to filter by passed output items.
1967419670 *
1967519671 */
1967619672 status?: 'fail' | 'pass';
1967319673+ /**
1967419674+ * Sort order for output items by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.
1967519675+ */
1967619676+ order?: 'asc' | 'desc';
1967719677 };
1967819678 url: '/evals/{eval_id}/runs/{run_id}/output_items';
1967919679};
···1969619696 */
1969719697 eval_id: string;
1969819698 /**
1969919699- * The ID of the output item to retrieve.
1970019700- */
1970119701- output_item_id: string;
1970219702- /**
1970319699 * The ID of the run to retrieve.
1970419700 */
1970519701 run_id: string;
1970219702+ /**
1970319703+ * The ID of the output item to retrieve.
1970419704+ */
1970519705+ output_item_id: string;
1970619706 };
1970719707 query?: never;
1970819708 url: '/evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}';
···1972319723 path?: never;
1972419724 query?: {
1972519725 /**
1972619726- * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
1972719727- *
1972619726+ * Only return files with the given purpose.
1972819727 */
1972919729- after?: string;
1972819728+ purpose?: string;
1973019729 /**
1973119730 * A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000.
1973219731 *
···1973819737 */
1973919738 order?: 'asc' | 'desc';
1974019739 /**
1974119741- * Only return files with the given purpose.
1974019740+ * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
1974119741+ *
1974219742 */
1974319743- purpose?: string;
1974319743+ after?: string;
1974419744 };
1974519745 url: '/files';
1974619746};
···1988019880 };
1988119881 query?: {
1988219882 /**
1988319883+ * The ID of the project to get permissions for.
1988419884+ */
1988519885+ project_id?: string;
1988619886+ /**
1988319887 * Identifier for the last permission ID from the previous pagination request.
1988419888 */
1988519889 after?: string;
···1989119895 * The order in which to retrieve permissions.
1989219896 */
1989319897 order?: 'ascending' | 'descending';
1989419894- /**
1989519895- * The ID of the project to get permissions for.
1989619896- */
1989719897- project_id?: string;
1989819898 };
1989919899 url: '/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions';
1990019900};
···2030420304 */
2030520305 after?: string;
2030620306 /**
2030720307- * Maximum number of keys to return.
2030820308- */
2030920309- limit?: number;
2031020310- /**
2031120307 * Order results by creation time, ascending or descending.
2031220308 */
2031320309 order?: 'asc' | 'desc';
2031020310+ /**
2031120311+ * Maximum number of keys to return.
2031220312+ */
2031320313+ limit?: number;
2031420314 };
2031520315 url: '/organization/admin_api_keys';
2031620316};
···2036120361 * Confirmation that the API key was deleted.
2036220362 */
2036320363 200: {
2036420364- deleted?: boolean;
2036520364 id?: string;
2036620365 object?: string;
2036620366+ deleted?: boolean;
2036720367 };
2036820368};
2036920369···2039720397 path?: never;
2039820398 query?: {
2039920399 /**
2040020400- * Return only events performed by users with these emails.
2040120401- */
2040220402- 'actor_emails[]'?: Array<string>;
2040320403- /**
2040420404- * Return only events performed by these actors. Can be a user ID, a service account ID, or an api key tracking ID.
2040520405- */
2040620406- 'actor_ids[]'?: Array<string>;
2040720407- /**
2040820408- * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2040920409- *
2041020410- */
2041120411- after?: string;
2041220412- /**
2041320413- * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
2041420414- *
2041520415- */
2041620416- before?: string;
2041720417- /**
2041820400 * Return only events whose `effective_at` (Unix seconds) is in this range.
2041920401 */
2042020402 effective_at?: {
···2043620418 lte?: number;
2043720419 };
2043820420 /**
2042120421+ * Return only events for these projects.
2042220422+ */
2042320423+ 'project_ids[]'?: Array<string>;
2042420424+ /**
2043920425 * Return only events with a `type` in one of these values. For example, `project.created`. For all options, see the documentation for the [audit log object](https://platform.openai.com/docs/api-reference/audit-logs/object).
2044020426 */
2044120427 'event_types[]'?: Array<AuditLogEventType>;
2044220428 /**
2042920429+ * Return only events performed by these actors. Can be a user ID, a service account ID, or an api key tracking ID.
2043020430+ */
2043120431+ 'actor_ids[]'?: Array<string>;
2043220432+ /**
2043320433+ * Return only events performed by users with these emails.
2043420434+ */
2043520435+ 'actor_emails[]'?: Array<string>;
2043620436+ /**
2043720437+ * Return only events performed on these targets. For example, a project ID updated.
2043820438+ */
2043920439+ 'resource_ids[]'?: Array<string>;
2044020440+ /**
2044320441 * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2044420442 *
2044520443 */
2044620444 limit?: number;
2044720445 /**
2044820448- * Return only events for these projects.
2044620446+ * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2044720447+ *
2044920448 */
2045020450- 'project_ids[]'?: Array<string>;
2044920449+ after?: string;
2045120450 /**
2045220452- * Return only events performed on these targets. For example, a project ID updated.
2045120451+ * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
2045220452+ *
2045320453 */
2045420454- 'resource_ids[]'?: Array<string>;
2045420454+ before?: string;
2045520455 };
2045620456 url: '/organization/audit_logs';
2045720457};
···2047120471 path?: never;
2047220472 query?: {
2047320473 /**
2047420474- * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2047420474+ * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2047520475 *
2047620476 */
2047720477- after?: string;
2047720477+ limit?: number;
2047820478 /**
2047920479- * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2047920479+ * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2048020480 *
2048120481 */
2048220482- limit?: number;
2048220482+ after?: string;
2048320483 /**
2048420484 * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
2048520485 *
···2062820628 path?: never;
2062920629 query: {
2063020630 /**
2063120631+ * Start time (Unix seconds) of the query time range, inclusive.
2063220632+ */
2063320633+ start_time: number;
2063420634+ /**
2063520635+ * End time (Unix seconds) of the query time range, exclusive.
2063620636+ */
2063720637+ end_time?: number;
2063820638+ /**
2063120639 * Width of each time bucket in response. Currently only `1d` is supported, default to `1d`.
2063220640 */
2063320641 bucket_width?: '1d';
2063420642 /**
2063520635- * End time (Unix seconds) of the query time range, exclusive.
2064320643+ * Return only costs for these projects.
2063620644 */
2063720637- end_time?: number;
2064520645+ project_ids?: Array<string>;
2063820646 /**
2063920647 * Group the costs by the specified fields. Support fields include `project_id`, `line_item` and any combination of them.
2064020648 */
···2064820656 * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response.
2064920657 */
2065020658 page?: string;
2065120651- /**
2065220652- * Return only costs for these projects.
2065320653- */
2065420654- project_ids?: Array<string>;
2065520655- /**
2065620656- * Start time (Unix seconds) of the query time range, inclusive.
2065720657- */
2065820658- start_time: number;
2065920659 };
2066020660 url: '/organization/costs';
2066120661};
···2067420674 path?: never;
2067520675 query?: {
2067620676 /**
2067720677- * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2067720677+ * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2067820678 *
2067920679 */
2068020680- after?: string;
2068020680+ limit?: number;
2068120681 /**
2068220682- * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2068220682+ * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2068320683 *
2068420684 */
2068520685- limit?: number;
2068520685+ after?: string;
2068620686 };
2068720687 url: '/organization/invites';
2068820688};
···2076520765 path?: never;
2076620766 query?: {
2076720767 /**
2076820768+ * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2076920769+ *
2077020770+ */
2077120771+ limit?: number;
2077220772+ /**
2076820773 * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2076920774 *
2077020775 */
···2077320778 * If `true` returns all projects including those that have been `archived`. Archived projects are not included by default.
2077420779 */
2077520780 include_archived?: boolean;
2077620776- /**
2077720777- * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2077820778- *
2077920779- */
2078020780- limit?: number;
2078120781 };
2078220782 url: '/organization/projects';
2078320783};
···2087820878 };
2087920879 query?: {
2088020880 /**
2088120881- * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2088120881+ * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2088220882 *
2088320883 */
2088420884- after?: string;
2088420884+ limit?: number;
2088520885 /**
2088620886- * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2088620886+ * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2088720887 *
2088820888 */
2088920889- limit?: number;
2088920889+ after?: string;
2089020890 };
2089120891 url: '/organization/projects/{project_id}/api_keys';
2089220892};
···2090520905 body?: never;
2090620906 path: {
2090720907 /**
2090820908+ * The ID of the project.
2090920909+ */
2091020910+ project_id: string;
2091120911+ /**
2090820912 * The ID of the API key.
2090920913 */
2091020914 key_id: string;
2091120911- /**
2091220912- * The ID of the project.
2091320913- */
2091420914- project_id: string;
2091520915 };
2091620916 query?: never;
2091720917 url: '/organization/projects/{project_id}/api_keys/{key_id}';
···2094120941 body?: never;
2094220942 path: {
2094320943 /**
2094420944- * The ID of the API key.
2094520945- */
2094620946- key_id: string;
2094720947- /**
2094820944 * The ID of the project.
2094920945 */
2095020946 project_id: string;
2094720947+ /**
2094820948+ * The ID of the API key.
2094920949+ */
2095020950+ key_id: string;
2095120951 };
2095220952 query?: never;
2095320953 url: '/organization/projects/{project_id}/api_keys/{key_id}';
···2099520995 };
2099620996 query?: {
2099720997 /**
2099820998- * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2099820998+ * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2099920999 *
2100021000 */
2100121001- after?: string;
2100121001+ limit?: number;
2100221002 /**
2100321003- * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2100321003+ * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2100421004 *
2100521005 */
2100621006- limit?: number;
2100621006+ after?: string;
2100721007 /**
2100821008 * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
2100921009 *
···2108321083 };
2108421084 query?: {
2108521085 /**
2108621086+ * A limit on the number of objects to be returned. The default is 100.
2108721087+ *
2108821088+ */
2108921089+ limit?: number;
2109021090+ /**
2108621091 * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2108721092 *
2108821093 */
···2109221097 *
2109321098 */
2109421099 before?: string;
2109521095- /**
2109621096- * A limit on the number of objects to be returned. The default is 100.
2109721097- *
2109821098- */
2109921099- limit?: number;
2110021100 };
2110121101 url: '/organization/projects/{project_id}/rate_limits';
2110221102};
···2116021160 };
2116121161 query?: {
2116221162 /**
2116321163- * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2116321163+ * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2116421164 *
2116521165 */
2116621166- after?: string;
2116621166+ limit?: number;
2116721167 /**
2116821168- * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2116821168+ * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2116921169 *
2117021170 */
2117121171- limit?: number;
2117121171+ after?: string;
2117221172 };
2117321173 url: '/organization/projects/{project_id}/service_accounts';
2117421174};
···2129021290 };
2129121291 query?: {
2129221292 /**
2129321293- * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2129321293+ * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2129421294 *
2129521295 */
2129621296- after?: string;
2129621296+ limit?: number;
2129721297 /**
2129821298- * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2129821298+ * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2129921299 *
2130021300 */
2130121301- limit?: number;
2130121301+ after?: string;
2130221302 };
2130321303 url: '/organization/projects/{project_id}/users';
2130421304};
···2146421464 path?: never;
2146521465 query: {
2146621466 /**
2146721467- * Return only usage for these API keys.
2146721467+ * Start time (Unix seconds) of the query time range, inclusive.
2146821468 */
2146921469- api_key_ids?: Array<string>;
2146921469+ start_time: number;
2147021470+ /**
2147121471+ * End time (Unix seconds) of the query time range, exclusive.
2147221472+ */
2147321473+ end_time?: number;
2147021474 /**
2147121475 * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`.
2147221476 */
2147321477 bucket_width?: '1m' | '1h' | '1d';
2147421478 /**
2147521475- * End time (Unix seconds) of the query time range, exclusive.
2147921479+ * Return only usage for these projects.
2147621480 */
2147721477- end_time?: number;
2148121481+ project_ids?: Array<string>;
2148221482+ /**
2148321483+ * Return only usage for these users.
2148421484+ */
2148521485+ user_ids?: Array<string>;
2148621486+ /**
2148721487+ * Return only usage for these API keys.
2148821488+ */
2148921489+ api_key_ids?: Array<string>;
2149021490+ /**
2149121491+ * Return only usage for these models.
2149221492+ */
2149321493+ models?: Array<string>;
2147821494 /**
2147921495 * Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them.
2148021496 */
···2148721503 *
2148821504 */
2148921505 limit?: number;
2149021490- /**
2149121491- * Return only usage for these models.
2149221492- */
2149321493- models?: Array<string>;
2149421506 /**
2149521507 * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response.
2149621508 */
2149721509 page?: string;
2149821498- /**
2149921499- * Return only usage for these projects.
2150021500- */
2150121501- project_ids?: Array<string>;
2150221502- /**
2150321503- * Start time (Unix seconds) of the query time range, inclusive.
2150421504- */
2150521505- start_time: number;
2150621506- /**
2150721507- * Return only usage for these users.
2150821508- */
2150921509- user_ids?: Array<string>;
2151021510 };
2151121511 url: '/organization/usage/audio_speeches';
2151221512};
···2152621526 path?: never;
2152721527 query: {
2152821528 /**
2152921529- * Return only usage for these API keys.
2152921529+ * Start time (Unix seconds) of the query time range, inclusive.
2153021530+ */
2153121531+ start_time: number;
2153221532+ /**
2153321533+ * End time (Unix seconds) of the query time range, exclusive.
2153021534 */
2153121531- api_key_ids?: Array<string>;
2153521535+ end_time?: number;
2153221536 /**
2153321537 * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`.
2153421538 */
2153521539 bucket_width?: '1m' | '1h' | '1d';
2153621540 /**
2153721537- * End time (Unix seconds) of the query time range, exclusive.
2154121541+ * Return only usage for these projects.
2153821542 */
2153921539- end_time?: number;
2154321543+ project_ids?: Array<string>;
2154421544+ /**
2154521545+ * Return only usage for these users.
2154621546+ */
2154721547+ user_ids?: Array<string>;
2154821548+ /**
2154921549+ * Return only usage for these API keys.
2155021550+ */
2155121551+ api_key_ids?: Array<string>;
2155221552+ /**
2155321553+ * Return only usage for these models.
2155421554+ */
2155521555+ models?: Array<string>;
2154021556 /**
2154121557 * Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them.
2154221558 */
···2155021566 */
2155121567 limit?: number;
2155221568 /**
2155321553- * Return only usage for these models.
2155421554- */
2155521555- models?: Array<string>;
2155621556- /**
2155721569 * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response.
2155821570 */
2155921571 page?: string;
2156021560- /**
2156121561- * Return only usage for these projects.
2156221562- */
2156321563- project_ids?: Array<string>;
2156421564- /**
2156521565- * Start time (Unix seconds) of the query time range, inclusive.
2156621566- */
2156721567- start_time: number;
2156821568- /**
2156921569- * Return only usage for these users.
2157021570- */
2157121571- user_ids?: Array<string>;
2157221572 };
2157321573 url: '/organization/usage/audio_transcriptions';
2157421574};
···2158821588 path?: never;
2158921589 query: {
2159021590 /**
2159121591+ * Start time (Unix seconds) of the query time range, inclusive.
2159221592+ */
2159321593+ start_time: number;
2159421594+ /**
2159521595+ * End time (Unix seconds) of the query time range, exclusive.
2159621596+ */
2159721597+ end_time?: number;
2159821598+ /**
2159121599 * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`.
2159221600 */
2159321601 bucket_width?: '1m' | '1h' | '1d';
2159421602 /**
2159521595- * End time (Unix seconds) of the query time range, exclusive.
2160321603+ * Return only usage for these projects.
2159621604 */
2159721597- end_time?: number;
2160521605+ project_ids?: Array<string>;
2159821606 /**
2159921607 * Group the usage data by the specified fields. Support fields include `project_id`.
2160021608 */
···2161121619 * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response.
2161221620 */
2161321621 page?: string;
2161421614- /**
2161521615- * Return only usage for these projects.
2161621616- */
2161721617- project_ids?: Array<string>;
2161821618- /**
2161921619- * Start time (Unix seconds) of the query time range, inclusive.
2162021620- */
2162121621- start_time: number;
2162221622 };
2162321623 url: '/organization/usage/code_interpreter_sessions';
2162421624};
···2163821638 path?: never;
2163921639 query: {
2164021640 /**
2164121641- * Return only usage for these API keys.
2164121641+ * Start time (Unix seconds) of the query time range, inclusive.
2164221642 */
2164321643- api_key_ids?: Array<string>;
2164321643+ start_time: number;
2164421644 /**
2164521645- * If `true`, return batch jobs only. If `false`, return non-batch jobs only. By default, return both.
2164621646- *
2164521645+ * End time (Unix seconds) of the query time range, exclusive.
2164721646 */
2164821648- batch?: boolean;
2164721647+ end_time?: number;
2164921648 /**
2165021649 * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`.
2165121650 */
2165221651 bucket_width?: '1m' | '1h' | '1d';
2165321652 /**
2165421654- * End time (Unix seconds) of the query time range, exclusive.
2165321653+ * Return only usage for these projects.
2165521654 */
2165621656- end_time?: number;
2165521655+ project_ids?: Array<string>;
2165621656+ /**
2165721657+ * Return only usage for these users.
2165821658+ */
2165921659+ user_ids?: Array<string>;
2166021660+ /**
2166121661+ * Return only usage for these API keys.
2166221662+ */
2166321663+ api_key_ids?: Array<string>;
2166421664+ /**
2166521665+ * Return only usage for these models.
2166621666+ */
2166721667+ models?: Array<string>;
2166821668+ /**
2166921669+ * If `true`, return batch jobs only. If `false`, return non-batch jobs only. By default, return both.
2167021670+ *
2167121671+ */
2167221672+ batch?: boolean;
2165721673 /**
2165821674 * Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model`, `batch` or any combination of them.
2165921675 */
···2166921685 */
2167021686 limit?: number;
2167121687 /**
2167221672- * Return only usage for these models.
2167321673- */
2167421674- models?: Array<string>;
2167521675- /**
2167621688 * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response.
2167721689 */
2167821690 page?: string;
2167921679- /**
2168021680- * Return only usage for these projects.
2168121681- */
2168221682- project_ids?: Array<string>;
2168321683- /**
2168421684- * Start time (Unix seconds) of the query time range, inclusive.
2168521685- */
2168621686- start_time: number;
2168721687- /**
2168821688- * Return only usage for these users.
2168921689- */
2169021690- user_ids?: Array<string>;
2169121691 };
2169221692 url: '/organization/usage/completions';
2169321693};
···2170721707 path?: never;
2170821708 query: {
2170921709 /**
2171021710- * Return only usage for these API keys.
2171021710+ * Start time (Unix seconds) of the query time range, inclusive.
2171121711+ */
2171221712+ start_time: number;
2171321713+ /**
2171421714+ * End time (Unix seconds) of the query time range, exclusive.
2171121715 */
2171221712- api_key_ids?: Array<string>;
2171621716+ end_time?: number;
2171321717 /**
2171421718 * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`.
2171521719 */
2171621720 bucket_width?: '1m' | '1h' | '1d';
2171721721 /**
2171821718- * End time (Unix seconds) of the query time range, exclusive.
2172221722+ * Return only usage for these projects.
2172321723+ */
2172421724+ project_ids?: Array<string>;
2172521725+ /**
2172621726+ * Return only usage for these users.
2172721727+ */
2172821728+ user_ids?: Array<string>;
2172921729+ /**
2173021730+ * Return only usage for these API keys.
2173121731+ */
2173221732+ api_key_ids?: Array<string>;
2173321733+ /**
2173421734+ * Return only usage for these models.
2171921735 */
2172021720- end_time?: number;
2173621736+ models?: Array<string>;
2172121737 /**
2172221738 * Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them.
2172321739 */
···2173121747 */
2173221748 limit?: number;
2173321749 /**
2173421734- * Return only usage for these models.
2173521735- */
2173621736- models?: Array<string>;
2173721737- /**
2173821750 * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response.
2173921751 */
2174021752 page?: string;
2174121741- /**
2174221742- * Return only usage for these projects.
2174321743- */
2174421744- project_ids?: Array<string>;
2174521745- /**
2174621746- * Start time (Unix seconds) of the query time range, inclusive.
2174721747- */
2174821748- start_time: number;
2174921749- /**
2175021750- * Return only usage for these users.
2175121751- */
2175221752- user_ids?: Array<string>;
2175321753 };
2175421754 url: '/organization/usage/embeddings';
2175521755};
···2176921769 path?: never;
2177021770 query: {
2177121771 /**
2177221772- * Return only usage for these API keys.
2177221772+ * Start time (Unix seconds) of the query time range, inclusive.
2177321773+ */
2177421774+ start_time: number;
2177521775+ /**
2177621776+ * End time (Unix seconds) of the query time range, exclusive.
2177321777 */
2177421774- api_key_ids?: Array<string>;
2177821778+ end_time?: number;
2177521779 /**
2177621780 * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`.
2177721781 */
2177821782 bucket_width?: '1m' | '1h' | '1d';
2177921783 /**
2178021780- * End time (Unix seconds) of the query time range, exclusive.
2178421784+ * Return only usages for these sources. Possible values are `image.generation`, `image.edit`, `image.variation` or any combination of them.
2178121785 */
2178221782- end_time?: number;
2178621786+ sources?: Array<'image.generation' | 'image.edit' | 'image.variation'>;
2178321787 /**
2178421784- * Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model`, `size`, `source` or any combination of them.
2178821788+ * Return only usages for these image sizes. Possible values are `256x256`, `512x512`, `1024x1024`, `1792x1792`, `1024x1792` or any combination of them.
2178521789 */
2178621786- group_by?: Array<
2178721787- 'project_id' | 'user_id' | 'api_key_id' | 'model' | 'size' | 'source'
2179021790+ sizes?: Array<
2179121791+ '256x256' | '512x512' | '1024x1024' | '1792x1792' | '1024x1792'
2178821792 >;
2178921793 /**
2179021790- * Specifies the number of buckets to return.
2179121791- * - `bucket_width=1d`: default: 7, max: 31
2179221792- * - `bucket_width=1h`: default: 24, max: 168
2179321793- * - `bucket_width=1m`: default: 60, max: 1440
2179421794- *
2179421794+ * Return only usage for these projects.
2179521795 */
2179621796- limit?: number;
2179621796+ project_ids?: Array<string>;
2179721797 /**
2179821798- * Return only usage for these models.
2179821798+ * Return only usage for these users.
2179921799 */
2180021800- models?: Array<string>;
2180021800+ user_ids?: Array<string>;
2180121801 /**
2180221802- * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response.
2180221802+ * Return only usage for these API keys.
2180321803 */
2180421804- page?: string;
2180421804+ api_key_ids?: Array<string>;
2180521805 /**
2180621806- * Return only usage for these projects.
2180621806+ * Return only usage for these models.
2180721807 */
2180821808- project_ids?: Array<string>;
2180821808+ models?: Array<string>;
2180921809 /**
2181021810- * Return only usages for these image sizes. Possible values are `256x256`, `512x512`, `1024x1024`, `1792x1792`, `1024x1792` or any combination of them.
2181021810+ * Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model`, `size`, `source` or any combination of them.
2181121811 */
2181221812- sizes?: Array<
2181321813- '256x256' | '512x512' | '1024x1024' | '1792x1792' | '1024x1792'
2181221812+ group_by?: Array<
2181321813+ 'project_id' | 'user_id' | 'api_key_id' | 'model' | 'size' | 'source'
2181421814 >;
2181521815 /**
2181621816- * Return only usages for these sources. Possible values are `image.generation`, `image.edit`, `image.variation` or any combination of them.
2181721817- */
2181821818- sources?: Array<'image.generation' | 'image.edit' | 'image.variation'>;
2181921819- /**
2182021820- * Start time (Unix seconds) of the query time range, inclusive.
2181621816+ * Specifies the number of buckets to return.
2181721817+ * - `bucket_width=1d`: default: 7, max: 31
2181821818+ * - `bucket_width=1h`: default: 24, max: 168
2181921819+ * - `bucket_width=1m`: default: 60, max: 1440
2182021820+ *
2182121821 */
2182221822- start_time: number;
2182221822+ limit?: number;
2182321823 /**
2182421824- * Return only usage for these users.
2182421824+ * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response.
2182521825 */
2182621826- user_ids?: Array<string>;
2182621826+ page?: string;
2182721827 };
2182821828 url: '/organization/usage/images';
2182921829};
···2184321843 path?: never;
2184421844 query: {
2184521845 /**
2184621846- * Return only usage for these API keys.
2184621846+ * Start time (Unix seconds) of the query time range, inclusive.
2184721847+ */
2184821848+ start_time: number;
2184921849+ /**
2185021850+ * End time (Unix seconds) of the query time range, exclusive.
2184721851 */
2184821848- api_key_ids?: Array<string>;
2185221852+ end_time?: number;
2184921853 /**
2185021854 * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`.
2185121855 */
2185221856 bucket_width?: '1m' | '1h' | '1d';
2185321857 /**
2185421854- * End time (Unix seconds) of the query time range, exclusive.
2185821858+ * Return only usage for these projects.
2185521859 */
2185621856- end_time?: number;
2186021860+ project_ids?: Array<string>;
2186121861+ /**
2186221862+ * Return only usage for these users.
2186321863+ */
2186421864+ user_ids?: Array<string>;
2186521865+ /**
2186621866+ * Return only usage for these API keys.
2186721867+ */
2186821868+ api_key_ids?: Array<string>;
2186921869+ /**
2187021870+ * Return only usage for these models.
2187121871+ */
2187221872+ models?: Array<string>;
2185721873 /**
2185821874 * Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them.
2185921875 */
···2186721883 */
2186821884 limit?: number;
2186921885 /**
2187021870- * Return only usage for these models.
2187121871- */
2187221872- models?: Array<string>;
2187321873- /**
2187421886 * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response.
2187521887 */
2187621888 page?: string;
2187721877- /**
2187821878- * Return only usage for these projects.
2187921879- */
2188021880- project_ids?: Array<string>;
2188121881- /**
2188221882- * Start time (Unix seconds) of the query time range, inclusive.
2188321883- */
2188421884- start_time: number;
2188521885- /**
2188621886- * Return only usage for these users.
2188721887- */
2188821888- user_ids?: Array<string>;
2188921889 };
2189021890 url: '/organization/usage/moderations';
2189121891};
···2190521905 path?: never;
2190621906 query: {
2190721907 /**
2190821908+ * Start time (Unix seconds) of the query time range, inclusive.
2190921909+ */
2191021910+ start_time: number;
2191121911+ /**
2191221912+ * End time (Unix seconds) of the query time range, exclusive.
2191321913+ */
2191421914+ end_time?: number;
2191521915+ /**
2190821916 * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`.
2190921917 */
2191021918 bucket_width?: '1m' | '1h' | '1d';
2191121919 /**
2191221912- * End time (Unix seconds) of the query time range, exclusive.
2192021920+ * Return only usage for these projects.
2191321921 */
2191421914- end_time?: number;
2192221922+ project_ids?: Array<string>;
2191521923 /**
2191621924 * Group the usage data by the specified fields. Support fields include `project_id`.
2191721925 */
···2192821936 * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response.
2192921937 */
2193021938 page?: string;
2193121931- /**
2193221932- * Return only usage for these projects.
2193321933- */
2193421934- project_ids?: Array<string>;
2193521935- /**
2193621936- * Start time (Unix seconds) of the query time range, inclusive.
2193721937- */
2193821938- start_time: number;
2193921939 };
2194021940 url: '/organization/usage/vector_stores';
2194121941};
···2195521955 path?: never;
2195621956 query?: {
2195721957 /**
2195821958+ * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2195921959+ *
2196021960+ */
2196121961+ limit?: number;
2196221962+ /**
2195821963 * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2195921964 *
2196021965 */
···2196321968 * Filter by the email address of users.
2196421969 */
2196521970 emails?: Array<string>;
2196621966- /**
2196721967- * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2196821968- *
2196921969- */
2197021970- limit?: number;
2197121971 };
2197221972 url: '/organization/users';
2197321973};
···2215022150 */
2215122151 include?: Array<Includable>;
2215222152 /**
2215322153+ * If set to true, the model response data will be streamed to the client
2215422154+ * as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
2215522155+ * See the [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming)
2215622156+ * for more information.
2215722157+ *
2215822158+ */
2215922159+ stream?: boolean;
2216022160+ /**
2216122161+ * The sequence number of the event after which to start streaming.
2216222162+ *
2216322163+ */
2216422164+ starting_after?: number;
2216522165+ /**
2215322166 * When true, stream obfuscation will be enabled. Stream obfuscation adds
2215422167 * random characters to an `obfuscation` field on streaming delta events
2215522168 * to normalize payload sizes as a mitigation to certain side-channel
···2216022173 *
2216122174 */
2216222175 include_obfuscation?: boolean;
2216322163- /**
2216422164- * The sequence number of the event after which to start streaming.
2216522165- *
2216622166- */
2216722167- starting_after?: number;
2216822168- /**
2216922169- * If set to true, the model response data will be streamed to the client
2217022170- * as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).
2217122171- * See the [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming)
2217222172- * for more information.
2217322173- *
2217422174- */
2217522175- stream?: boolean;
2217622176 };
2217722177 url: '/responses/{response_id}';
2217822178};
···2222922229 };
2223022230 query?: {
2223122231 /**
2223222232+ * A limit on the number of objects to be returned. Limit can range between
2223322233+ * 1 and 100, and the default is 20.
2223422234+ *
2223522235+ */
2223622236+ limit?: number;
2223722237+ /**
2223822238+ * The order to return the input items in. Default is `desc`.
2223922239+ * - `asc`: Return the input items in ascending order.
2224022240+ * - `desc`: Return the input items in descending order.
2224122241+ *
2224222242+ */
2224322243+ order?: 'asc' | 'desc';
2224422244+ /**
2223222245 * An item ID to list items after, used in pagination.
2223322246 *
2223422247 */
···2224422257 *
2224522258 */
2224622259 include?: Array<Includable>;
2224722247- /**
2224822248- * A limit on the number of objects to be returned. Limit can range between
2224922249- * 1 and 100, and the default is 20.
2225022250- *
2225122251- */
2225222252- limit?: number;
2225322253- /**
2225422254- * The order to return the input items in. Default is `desc`.
2225522255- * - `asc`: Return the input items in ascending order.
2225622256- * - `desc`: Return the input items in descending order.
2225722257- *
2225822258- */
2225922259- order?: 'asc' | 'desc';
2226022260 };
2226122261 url: '/responses/{response_id}/input_items';
2226222262};
···2238022380 };
2238122381 query?: {
2238222382 /**
2238322383- * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2238322383+ * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2238422384 *
2238522385 */
2238622386- after?: string;
2238622386+ limit?: number;
2238722387 /**
2238822388- * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
2238822388+ * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
2238922389 *
2239022390 */
2239122391- before?: string;
2239122391+ order?: 'asc' | 'desc';
2239222392 /**
2239322393- * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2239322393+ * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2239422394 *
2239522395 */
2239622396- limit?: number;
2239622396+ after?: string;
2239722397 /**
2239822398- * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
2239822398+ * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
2239922399 *
2240022400 */
2240122401- order?: 'asc' | 'desc';
2240122401+ before?: string;
2240222402 /**
2240322403 * Filter messages by the run ID that generated them.
2240422404 *
···2244422444 body?: never;
2244522445 path: {
2244622446 /**
2244722447- * The ID of the message to delete.
2244822448- */
2244922449- message_id: string;
2245022450- /**
2245122447 * The ID of the thread to which this message belongs.
2245222448 */
2245322449 thread_id: string;
2245022450+ /**
2245122451+ * The ID of the message to delete.
2245222452+ */
2245322453+ message_id: string;
2245422454 };
2245522455 query?: never;
2245622456 url: '/threads/{thread_id}/messages/{message_id}';
···2247022470 body?: never;
2247122471 path: {
2247222472 /**
2247322473- * The ID of the message to retrieve.
2247322473+ * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) to which this message belongs.
2247422474 */
2247522475- message_id: string;
2247522475+ thread_id: string;
2247622476 /**
2247722477- * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) to which this message belongs.
2247722477+ * The ID of the message to retrieve.
2247822478 */
2247922479- thread_id: string;
2247922479+ message_id: string;
2248022480 };
2248122481 query?: never;
2248222482 url: '/threads/{thread_id}/messages/{message_id}';
···2249522495 body: ModifyMessageRequest;
2249622496 path: {
2249722497 /**
2249822498+ * The ID of the thread to which this message belongs.
2249922499+ */
2250022500+ thread_id: string;
2250122501+ /**
2249822502 * The ID of the message to modify.
2249922503 */
2250022504 message_id: string;
2250122501- /**
2250222502- * The ID of the thread to which this message belongs.
2250322503- */
2250422504- thread_id: string;
2250522505 };
2250622506 query?: never;
2250722507 url: '/threads/{thread_id}/messages/{message_id}';
···2252722527 };
2252822528 query?: {
2252922529 /**
2253022530- * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2253022530+ * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2253122531 *
2253222532 */
2253322533- after?: string;
2253322533+ limit?: number;
2253422534 /**
2253522535- * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
2253522535+ * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
2253622536 *
2253722537 */
2253822538- before?: string;
2253822538+ order?: 'asc' | 'desc';
2253922539 /**
2254022540- * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2254022540+ * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2254122541 *
2254222542 */
2254322543- limit?: number;
2254322543+ after?: string;
2254422544 /**
2254522545- * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
2254522545+ * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
2254622546 *
2254722547 */
2254822548- order?: 'asc' | 'desc';
2254822548+ before?: string;
2254922549 };
2255022550 url: '/threads/{thread_id}/runs';
2255122551};
···2259222592 body?: never;
2259322593 path: {
2259422594 /**
2259522595- * The ID of the run to retrieve.
2259622596- */
2259722597- run_id: string;
2259822598- /**
2259922595 * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run.
2260022596 */
2260122597 thread_id: string;
2259822598+ /**
2259922599+ * The ID of the run to retrieve.
2260022600+ */
2260122601+ run_id: string;
2260222602 };
2260322603 query?: never;
2260422604 url: '/threads/{thread_id}/runs/{run_id}';
···2261722617 body: ModifyRunRequest;
2261822618 path: {
2261922619 /**
2262022620- * The ID of the run to modify.
2262122621- */
2262222622- run_id: string;
2262322623- /**
2262422620 * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run.
2262522621 */
2262622622 thread_id: string;
2262322623+ /**
2262422624+ * The ID of the run to modify.
2262522625+ */
2262622626+ run_id: string;
2262722627 };
2262822628 query?: never;
2262922629 url: '/threads/{thread_id}/runs/{run_id}';
···2264222642 body?: never;
2264322643 path: {
2264422644 /**
2264522645- * The ID of the run to cancel.
2264622646- */
2264722647- run_id: string;
2264822648- /**
2264922645 * The ID of the thread to which this run belongs.
2265022646 */
2265122647 thread_id: string;
2264822648+ /**
2264922649+ * The ID of the run to cancel.
2265022650+ */
2265122651+ run_id: string;
2265222652 };
2265322653 query?: never;
2265422654 url: '/threads/{thread_id}/runs/{run_id}/cancel';
···2266722667 body?: never;
2266822668 path: {
2266922669 /**
2267022670+ * The ID of the thread the run and run steps belong to.
2267122671+ */
2267222672+ thread_id: string;
2267322673+ /**
2267022674 * The ID of the run the run steps belong to.
2267122675 */
2267222676 run_id: string;
2267722677+ };
2267822678+ query?: {
2267322679 /**
2267422674- * The ID of the thread the run and run steps belong to.
2268022680+ * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2268122681+ *
2268222682+ */
2268322683+ limit?: number;
2268422684+ /**
2268522685+ * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
2268622686+ *
2267522687 */
2267622676- thread_id: string;
2267722677- };
2267822678- query?: {
2268822688+ order?: 'asc' | 'desc';
2267922689 /**
2268022690 * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2268122691 *
···2269322703 *
2269422704 */
2269522705 'include[]'?: Array<'step_details.tool_calls[*].file_search.results[*].content'>;
2269622696- /**
2269722697- * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2269822698- *
2269922699- */
2270022700- limit?: number;
2270122701- /**
2270222702- * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
2270322703- *
2270422704- */
2270522705- order?: 'asc' | 'desc';
2270622706 };
2270722707 url: '/threads/{thread_id}/runs/{run_id}/steps';
2270822708};
···2272122721 body?: never;
2272222722 path: {
2272322723 /**
2272422724+ * The ID of the thread to which the run and run step belongs.
2272522725+ */
2272622726+ thread_id: string;
2272722727+ /**
2272422728 * The ID of the run to which the run step belongs.
2272522729 */
2272622730 run_id: string;
···2272822732 * The ID of the run step to retrieve.
2272922733 */
2273022734 step_id: string;
2273122731- /**
2273222732- * The ID of the thread to which the run and run step belongs.
2273322733- */
2273422734- thread_id: string;
2273522735 };
2273622736 query?: {
2273722737 /**
···2275822758 body: SubmitToolOutputsRunRequest;
2275922759 path: {
2276022760 /**
2276122761- * The ID of the run that requires the tool output submission.
2276222762- */
2276322763- run_id: string;
2276422764- /**
2276522761 * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) to which this run belongs.
2276622762 */
2276722763 thread_id: string;
2276422764+ /**
2276522765+ * The ID of the run that requires the tool output submission.
2276622766+ */
2276722767+ run_id: string;
2276822768 };
2276922769 query?: never;
2277022770 url: '/threads/{thread_id}/runs/{run_id}/submit_tool_outputs';
···2287122871 path?: never;
2287222872 query?: {
2287322873 /**
2287422874- * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2287422874+ * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2287522875 *
2287622876 */
2287722877- after?: string;
2287722877+ limit?: number;
2287822878 /**
2287922879- * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
2287922879+ * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
2288022880 *
2288122881 */
2288222882- before?: string;
2288222882+ order?: 'asc' | 'desc';
2288322883 /**
2288422884- * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2288422884+ * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2288522885 *
2288622886 */
2288722887- limit?: number;
2288722887+ after?: string;
2288822888 /**
2288922889- * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
2288922889+ * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
2289022890 *
2289122891 */
2289222892- order?: 'asc' | 'desc';
2289222892+ before?: string;
2289322893 };
2289422894 url: '/vector_stores';
2289522895};
···2301423014 body?: never;
2301523015 path: {
2301623016 /**
2301723017- * The ID of the file batch being retrieved.
2301823018- */
2301923019- batch_id: string;
2302023020- /**
2302123017 * The ID of the vector store that the file batch belongs to.
2302223018 */
2302323019 vector_store_id: string;
2302023020+ /**
2302123021+ * The ID of the file batch being retrieved.
2302223022+ */
2302323023+ batch_id: string;
2302423024 };
2302523025 query?: never;
2302623026 url: '/vector_stores/{vector_store_id}/file_batches/{batch_id}';
···2304023040 body?: never;
2304123041 path: {
2304223042 /**
2304323043- * The ID of the file batch to cancel.
2304423044- */
2304523045- batch_id: string;
2304623046- /**
2304723043 * The ID of the vector store that the file batch belongs to.
2304823044 */
2304923045 vector_store_id: string;
2304623046+ /**
2304723047+ * The ID of the file batch to cancel.
2304823048+ */
2304923049+ batch_id: string;
2305023050 };
2305123051 query?: never;
2305223052 url: '/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel';
···2306623066 body?: never;
2306723067 path: {
2306823068 /**
2306923069+ * The ID of the vector store that the files belong to.
2307023070+ */
2307123071+ vector_store_id: string;
2307223072+ /**
2306923073 * The ID of the file batch that the files belong to.
2307023074 */
2307123075 batch_id: string;
2307623076+ };
2307723077+ query?: {
2307223078 /**
2307323073- * The ID of the vector store that the files belong to.
2307923079+ * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2308023080+ *
2308123081+ */
2308223082+ limit?: number;
2308323083+ /**
2308423084+ * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
2308523085+ *
2307423086 */
2307523075- vector_store_id: string;
2307623076- };
2307723077- query?: {
2308723087+ order?: 'asc' | 'desc';
2307823088 /**
2307923089 * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2308023090 *
···2308923099 * Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`.
2309023100 */
2309123101 filter?: 'in_progress' | 'completed' | 'failed' | 'cancelled';
2309223092- /**
2309323093- * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2309423094- *
2309523095- */
2309623096- limit?: number;
2309723097- /**
2309823098- * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
2309923099- *
2310023100- */
2310123101- order?: 'asc' | 'desc';
2310223102 };
2310323103 url: '/vector_stores/{vector_store_id}/file_batches/{batch_id}/files';
2310423104};
···2312323123 };
2312423124 query?: {
2312523125 /**
2312623126+ * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2312723127+ *
2312823128+ */
2312923129+ limit?: number;
2313023130+ /**
2313123131+ * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
2313223132+ *
2313323133+ */
2313423134+ order?: 'asc' | 'desc';
2313523135+ /**
2312623136 * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
2312723137 *
2312823138 */
···2313623146 * Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`.
2313723147 */
2313823148 filter?: 'in_progress' | 'completed' | 'failed' | 'cancelled';
2313923139- /**
2314023140- * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
2314123141- *
2314223142- */
2314323143- limit?: number;
2314423144- /**
2314523145- * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
2314623146- *
2314723147- */
2314823148- order?: 'asc' | 'desc';
2314923149 };
2315023150 url: '/vector_stores/{vector_store_id}/files';
2315123151};
···2318723187 body?: never;
2318823188 path: {
2318923189 /**
2319023190- * The ID of the file to delete.
2319123191- */
2319223192- file_id: string;
2319323193- /**
2319423190 * The ID of the vector store that the file belongs to.
2319523191 */
2319623192 vector_store_id: string;
2319323193+ /**
2319423194+ * The ID of the file to delete.
2319523195+ */
2319623196+ file_id: string;
2319723197 };
2319823198 query?: never;
2319923199 url: '/vector_stores/{vector_store_id}/files/{file_id}';
···2321223212export type GetVectorStoreFileData = {
2321323213 body?: never;
2321423214 path: {
2321523215+ /**
2321623216+ * The ID of the vector store that the file belongs to.
2321723217+ */
2321823218+ vector_store_id: string;
2321523219 /**
2321623220 * The ID of the file being retrieved.
2321723221 */
2321823222 file_id: string;
2321923219- /**
2322023220- * The ID of the vector store that the file belongs to.
2322123221- */
2322223222- vector_store_id: string;
2322323223 };
2322423224 query?: never;
2322523225 url: '/vector_stores/{vector_store_id}/files/{file_id}';
···2323923239 body: UpdateVectorStoreFileAttributesRequest;
2324023240 path: {
2324123241 /**
2324223242- * The ID of the file to update attributes.
2324323243- */
2324423244- file_id: string;
2324523245- /**
2324623242 * The ID of the vector store the file belongs to.
2324723243 */
2324823244 vector_store_id: string;
2324523245+ /**
2324623246+ * The ID of the file to update attributes.
2324723247+ */
2324823248+ file_id: string;
2324923249 };
2325023250 query?: never;
2325123251 url: '/vector_stores/{vector_store_id}/files/{file_id}';
···2326523265 body?: never;
2326623266 path: {
2326723267 /**
2326823268- * The ID of the file within the vector store.
2326923269- */
2327023270- file_id: string;
2327123271- /**
2327223268 * The ID of the vector store.
2327323269 */
2327423270 vector_store_id: string;
2327123271+ /**
2327223272+ * The ID of the file within the vector store.
2327323273+ */
2327423274+ file_id: string;
2327523275 };
2327623276 query?: never;
2327723277 url: '/vector_stores/{vector_store_id}/files/{file_id}/content';