@effect/ai-openai 0.16.4 → 0.16.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/Generated.ts CHANGED
@@ -293,18 +293,21 @@ export class DeleteAssistantResponse extends S.Class<DeleteAssistantResponse>("D
293
293
  "object": DeleteAssistantResponseObject
294
294
  }) {}
295
295
 
296
- export class CreateSpeechRequestModelEnum extends S.Literal("tts-1", "tts-1-hd") {}
296
+ export class CreateSpeechRequestModelEnum extends S.Literal("tts-1", "tts-1-hd", "gpt-4o-mini-tts") {}
297
297
 
298
- export class CreateSpeechRequestVoice
299
- extends S.Literal("alloy", "ash", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer")
298
+ export class VoiceIdsSharedEnum
299
+ extends S.Literal("alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse")
300
300
  {}
301
301
 
302
+ export class VoiceIdsShared extends S.Union(S.String, VoiceIdsSharedEnum) {}
303
+
302
304
  export class CreateSpeechRequestResponseFormat extends S.Literal("mp3", "opus", "aac", "flac", "wav", "pcm") {}
303
305
 
304
306
  export class CreateSpeechRequest extends S.Class<CreateSpeechRequest>("CreateSpeechRequest")({
305
307
  "model": S.Union(S.String, CreateSpeechRequestModelEnum),
306
308
  "input": S.String.pipe(S.maxLength(4096)),
307
- "voice": CreateSpeechRequestVoice,
309
+ "instructions": S.optionalWith(S.String.pipe(S.maxLength(4096)), { nullable: true }),
310
+ "voice": VoiceIdsShared,
308
311
  "response_format": S.optionalWith(CreateSpeechRequestResponseFormat, {
309
312
  nullable: true,
310
313
  default: () => "mp3" as const
@@ -315,8 +318,15 @@ export class CreateSpeechRequest extends S.Class<CreateSpeechRequest>("CreateSpe
315
318
  })
316
319
  }) {}
317
320
 
321
+ export class LogProbProperties extends S.Struct({
322
+ "token": S.String,
323
+ "logprob": S.Number,
324
+ "bytes": S.Array(S.Int)
325
+ }) {}
326
+
318
327
  export class CreateTranscriptionResponseJson extends S.Struct({
319
- "text": S.String
328
+ "text": S.String,
329
+ "logprobs": S.optionalWith(S.Array(LogProbProperties), { nullable: true })
320
330
  }) {}
321
331
 
322
332
  export class TranscriptionWord extends S.Struct({
@@ -438,7 +448,7 @@ export class ListBatchesResponse extends S.Class<ListBatchesResponse>("ListBatch
438
448
  }) {}
439
449
 
440
450
  export class CreateBatchRequestEndpoint
441
- extends S.Literal("/v1/chat/completions", "/v1/embeddings", "/v1/completions")
451
+ extends S.Literal("/v1/responses", "/v1/chat/completions", "/v1/embeddings", "/v1/completions")
442
452
  {}
443
453
 
444
454
  export class CreateBatchRequestCompletionWindow extends S.Literal("24h") {}
@@ -555,10 +565,15 @@ export class CreateChatCompletionResponse extends S.Struct({
555
565
  "finish_reason": S.Literal("stop", "length", "tool_calls", "content_filter", "function_call"),
556
566
  "index": S.Int,
557
567
  "message": ChatCompletionResponseMessage,
558
- "logprobs": S.NullOr(S.Struct({
559
- "content": S.NullOr(S.Array(ChatCompletionTokenLogprob)),
560
- "refusal": S.NullOr(S.Array(ChatCompletionTokenLogprob))
561
- }))
568
+ // TODO: change this once the following upstream issue has been closed
569
+ // https://github.com/openai/openai-openapi/issues/433
570
+ "logprobs": S.optionalWith(
571
+ S.Struct({
572
+ "content": S.NullOr(S.Array(ChatCompletionTokenLogprob)),
573
+ "refusal": S.NullOr(S.Array(ChatCompletionTokenLogprob))
574
+ }),
575
+ { nullable: true }
576
+ )
562
577
  })),
563
578
  "created": S.Int,
564
579
  "model": S.String,
@@ -633,7 +648,7 @@ export class ChatCompletionRequestMessageContentPartFileType extends S.Literal("
633
648
  export class ChatCompletionRequestMessageContentPartFile extends S.Struct({
634
649
  "type": ChatCompletionRequestMessageContentPartFileType,
635
650
  "file": S.Struct({
636
- "file_name": S.optionalWith(S.String, { nullable: true }),
651
+ "filename": S.optionalWith(S.String, { nullable: true }),
637
652
  "file_data": S.optionalWith(S.String, { nullable: true }),
638
653
  "file_id": S.optionalWith(S.String, { nullable: true })
639
654
  })
@@ -717,6 +732,54 @@ export class ChatCompletionRequestMessage extends S.Union(
717
732
  ChatCompletionRequestFunctionMessage
718
733
  ) {}
719
734
 
735
+ export class ModelIdsSharedEnum extends S.Literal(
736
+ "o3-mini",
737
+ "o3-mini-2025-01-31",
738
+ "o1",
739
+ "o1-2024-12-17",
740
+ "o1-preview",
741
+ "o1-preview-2024-09-12",
742
+ "o1-mini",
743
+ "o1-mini-2024-09-12",
744
+ "gpt-4o",
745
+ "gpt-4o-2024-11-20",
746
+ "gpt-4o-2024-08-06",
747
+ "gpt-4o-2024-05-13",
748
+ "gpt-4o-audio-preview",
749
+ "gpt-4o-audio-preview-2024-10-01",
750
+ "gpt-4o-audio-preview-2024-12-17",
751
+ "gpt-4o-mini-audio-preview",
752
+ "gpt-4o-mini-audio-preview-2024-12-17",
753
+ "gpt-4o-search-preview",
754
+ "gpt-4o-mini-search-preview",
755
+ "gpt-4o-search-preview-2025-03-11",
756
+ "gpt-4o-mini-search-preview-2025-03-11",
757
+ "chatgpt-4o-latest",
758
+ "gpt-4o-mini",
759
+ "gpt-4o-mini-2024-07-18",
760
+ "gpt-4-turbo",
761
+ "gpt-4-turbo-2024-04-09",
762
+ "gpt-4-0125-preview",
763
+ "gpt-4-turbo-preview",
764
+ "gpt-4-1106-preview",
765
+ "gpt-4-vision-preview",
766
+ "gpt-4",
767
+ "gpt-4-0314",
768
+ "gpt-4-0613",
769
+ "gpt-4-32k",
770
+ "gpt-4-32k-0314",
771
+ "gpt-4-32k-0613",
772
+ "gpt-3.5-turbo",
773
+ "gpt-3.5-turbo-16k",
774
+ "gpt-3.5-turbo-0301",
775
+ "gpt-3.5-turbo-0613",
776
+ "gpt-3.5-turbo-1106",
777
+ "gpt-3.5-turbo-0125",
778
+ "gpt-3.5-turbo-16k-0613"
779
+ ) {}
780
+
781
+ export class ModelIdsShared extends S.Union(S.String, ModelIdsSharedEnum) {}
782
+
720
783
  export class ResponseModalities extends S.Array(S.Literal("text", "audio")) {}
721
784
 
722
785
  export class CreateChatCompletionRequestWebSearchOptionsUserLocationType extends S.Literal("approximate") {}
@@ -732,10 +795,6 @@ export class WebSearchContextSize extends S.Literal("low", "medium", "high") {}
732
795
 
733
796
  export class CreateChatCompletionRequestServiceTier extends S.Literal("auto", "default") {}
734
797
 
735
- export class CreateChatCompletionRequestAudioVoice
736
- extends S.Literal("alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse")
737
- {}
738
-
739
798
  export class CreateChatCompletionRequestAudioFormat extends S.Literal("wav", "mp3", "flac", "opus", "pcm16") {}
740
799
 
741
800
  export class StopConfiguration extends S.Union(S.String, S.Array(S.String).pipe(S.minItems(1), S.maxItems(4))) {}
@@ -787,55 +846,9 @@ export class ChatCompletionFunctions extends S.Struct({
787
846
  "parameters": S.optionalWith(FunctionParameters, { nullable: true })
788
847
  }) {}
789
848
 
790
- export class CreateChatCompletionRequestModelEnum extends S.Literal(
791
- "o3-mini",
792
- "o3-mini-2025-01-31",
793
- "o1",
794
- "o1-2024-12-17",
795
- "o1-preview",
796
- "o1-preview-2024-09-12",
797
- "o1-mini",
798
- "o1-mini-2024-09-12",
799
- "computer-use-preview",
800
- "computer-use-preview-2025-02-04",
801
- "computer-use-preview-2025-03-11",
802
- "gpt-4.5-preview",
803
- "gpt-4.5-preview-2025-02-27",
804
- "gpt-4o",
805
- "gpt-4o-2024-11-20",
806
- "gpt-4o-2024-08-06",
807
- "gpt-4o-2024-05-13",
808
- "gpt-4o-audio-preview",
809
- "gpt-4o-audio-preview-2024-10-01",
810
- "gpt-4o-audio-preview-2024-12-17",
811
- "gpt-4o-mini-audio-preview",
812
- "gpt-4o-mini-audio-preview-2024-12-17",
813
- "chatgpt-4o-latest",
814
- "gpt-4o-mini",
815
- "gpt-4o-mini-2024-07-18",
816
- "gpt-4-turbo",
817
- "gpt-4-turbo-2024-04-09",
818
- "gpt-4-0125-preview",
819
- "gpt-4-turbo-preview",
820
- "gpt-4-1106-preview",
821
- "gpt-4-vision-preview",
822
- "gpt-4",
823
- "gpt-4-0314",
824
- "gpt-4-0613",
825
- "gpt-4-32k",
826
- "gpt-4-32k-0314",
827
- "gpt-4-32k-0613",
828
- "gpt-3.5-turbo",
829
- "gpt-3.5-turbo-16k",
830
- "gpt-3.5-turbo-0301",
831
- "gpt-3.5-turbo-0613",
832
- "gpt-3.5-turbo-1106",
833
- "gpt-3.5-turbo-0125",
834
- "gpt-3.5-turbo-16k-0613"
835
- ) {}
836
-
837
849
  export class CreateChatCompletionRequest extends S.Class<CreateChatCompletionRequest>("CreateChatCompletionRequest")({
838
850
  "messages": S.NonEmptyArray(ChatCompletionRequestMessage),
851
+ "model": ModelIdsShared,
839
852
  "modalities": S.optionalWith(ResponseModalities, { nullable: true }),
840
853
  "reasoning_effort": S.optionalWith(ReasoningEffort, { nullable: true, default: () => "medium" as const }),
841
854
  "max_completion_tokens": S.optionalWith(S.Int, { nullable: true }),
@@ -870,7 +883,7 @@ export class CreateChatCompletionRequest extends S.Class<CreateChatCompletionReq
870
883
  }),
871
884
  "audio": S.optionalWith(
872
885
  S.Struct({
873
- "voice": CreateChatCompletionRequestAudioVoice,
886
+ "voice": VoiceIdsShared,
874
887
  "format": CreateChatCompletionRequestAudioFormat
875
888
  }),
876
889
  { nullable: true }
@@ -886,10 +899,7 @@ export class CreateChatCompletionRequest extends S.Class<CreateChatCompletionReq
886
899
  default: () => 1 as const
887
900
  }),
888
901
  "prediction": S.optionalWith(PredictionContent, { nullable: true }),
889
- "seed": S.optionalWith(
890
- S.Int.pipe(S.greaterThanOrEqualTo(-9223372036854776000), S.lessThanOrEqualTo(9223372036854776000)),
891
- { nullable: true }
892
- ),
902
+ "seed": S.optionalWith(S.Int, { nullable: true }),
893
903
  "stream_options": S.optionalWith(S.NullOr(ChatCompletionStreamOptions), { default: () => null }),
894
904
  "tools": S.optionalWith(S.Array(ChatCompletionTool), { nullable: true }),
895
905
  "tool_choice": S.optionalWith(ChatCompletionToolChoiceOption, { nullable: true }),
@@ -901,7 +911,6 @@ export class CreateChatCompletionRequest extends S.Class<CreateChatCompletionReq
901
911
  "functions": S.optionalWith(S.Array(ChatCompletionFunctions).pipe(S.minItems(1), S.maxItems(128)), {
902
912
  nullable: true
903
913
  }),
904
- "model": S.Union(S.String, CreateChatCompletionRequestModelEnum),
905
914
  "metadata": S.optionalWith(Metadata, { nullable: true }),
906
915
  "temperature": S.optionalWith(S.Number.pipe(S.greaterThanOrEqualTo(0), S.lessThanOrEqualTo(2)), {
907
916
  nullable: true,
@@ -1142,6 +1151,55 @@ export class DeleteFileResponse extends S.Class<DeleteFileResponse>("DeleteFileR
1142
1151
 
1143
1152
  export class DownloadFile200 extends S.String {}
1144
1153
 
1154
+ export class ListFineTuningCheckpointPermissionsParamsOrder extends S.Literal("ascending", "descending") {}
1155
+
1156
+ export class ListFineTuningCheckpointPermissionsParams extends S.Struct({
1157
+ "project_id": S.optionalWith(S.String, { nullable: true }),
1158
+ "after": S.optionalWith(S.String, { nullable: true }),
1159
+ "limit": S.optionalWith(S.Int, { nullable: true, default: () => 10 as const }),
1160
+ "order": S.optionalWith(ListFineTuningCheckpointPermissionsParamsOrder, {
1161
+ nullable: true,
1162
+ default: () => "descending" as const
1163
+ })
1164
+ }) {}
1165
+
1166
+ export class FineTuningCheckpointPermissionObject extends S.Literal("checkpoint.permission") {}
1167
+
1168
+ export class FineTuningCheckpointPermission extends S.Struct({
1169
+ "id": S.String,
1170
+ "created_at": S.Int,
1171
+ "project_id": S.String,
1172
+ "object": FineTuningCheckpointPermissionObject
1173
+ }) {}
1174
+
1175
+ export class ListFineTuningCheckpointPermissionResponseObject extends S.Literal("list") {}
1176
+
1177
+ export class ListFineTuningCheckpointPermissionResponse
1178
+ extends S.Class<ListFineTuningCheckpointPermissionResponse>("ListFineTuningCheckpointPermissionResponse")({
1179
+ "data": S.Array(FineTuningCheckpointPermission),
1180
+ "object": ListFineTuningCheckpointPermissionResponseObject,
1181
+ "first_id": S.optionalWith(S.String, { nullable: true }),
1182
+ "last_id": S.optionalWith(S.String, { nullable: true }),
1183
+ "has_more": S.Boolean
1184
+ })
1185
+ {}
1186
+
1187
+ export class CreateFineTuningCheckpointPermissionRequest
1188
+ extends S.Class<CreateFineTuningCheckpointPermissionRequest>("CreateFineTuningCheckpointPermissionRequest")({
1189
+ "project_ids": S.Array(S.String)
1190
+ })
1191
+ {}
1192
+
1193
+ export class DeleteFineTuningCheckpointPermissionResponseObject extends S.Literal("checkpoint.permission") {}
1194
+
1195
+ export class DeleteFineTuningCheckpointPermissionResponse
1196
+ extends S.Class<DeleteFineTuningCheckpointPermissionResponse>("DeleteFineTuningCheckpointPermissionResponse")({
1197
+ "id": S.String,
1198
+ "object": DeleteFineTuningCheckpointPermissionResponseObject,
1199
+ "deleted": S.Boolean
1200
+ })
1201
+ {}
1202
+
1145
1203
  export class ListPaginatedFineTuningJobsParams extends S.Struct({
1146
1204
  "after": S.optionalWith(S.String, { nullable: true }),
1147
1205
  "limit": S.optionalWith(S.Int, { nullable: true, default: () => 20 as const }),
@@ -2580,23 +2638,31 @@ export class RealtimeSessionCreateRequestModel extends S.Literal(
2580
2638
  "gpt-4o-mini-realtime-preview-2024-12-17"
2581
2639
  ) {}
2582
2640
 
2583
- export class RealtimeSessionCreateRequestVoice
2584
- extends S.Literal("alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse")
2585
- {}
2586
-
2587
2641
  export class RealtimeSessionCreateRequestInputAudioFormat extends S.Literal("pcm16", "g711_ulaw", "g711_alaw") {}
2588
2642
 
2589
2643
  export class RealtimeSessionCreateRequestOutputAudioFormat extends S.Literal("pcm16", "g711_ulaw", "g711_alaw") {}
2590
2644
 
2645
+ export class RealtimeSessionCreateRequestTurnDetectionType extends S.Literal("server_vad", "semantic_vad") {}
2646
+
2647
+ export class RealtimeSessionCreateRequestTurnDetectionEagerness extends S.Literal("low", "medium", "high", "auto") {}
2648
+
2649
+ export class RealtimeSessionCreateRequestInputAudioNoiseReductionType extends S.Literal("near_field", "far_field") {}
2650
+
2591
2651
  export class RealtimeSessionCreateRequestMaxResponseOutputTokensEnum extends S.Literal("inf") {}
2592
2652
 
2593
2653
  export class RealtimeSessionCreateRequest
2594
2654
  extends S.Class<RealtimeSessionCreateRequest>("RealtimeSessionCreateRequest")({
2595
2655
  "model": S.optionalWith(RealtimeSessionCreateRequestModel, { nullable: true }),
2596
2656
  "instructions": S.optionalWith(S.String, { nullable: true }),
2597
- "voice": S.optionalWith(RealtimeSessionCreateRequestVoice, { nullable: true }),
2598
- "input_audio_format": S.optionalWith(RealtimeSessionCreateRequestInputAudioFormat, { nullable: true }),
2599
- "output_audio_format": S.optionalWith(RealtimeSessionCreateRequestOutputAudioFormat, { nullable: true }),
2657
+ "voice": S.optionalWith(VoiceIdsShared, { nullable: true }),
2658
+ "input_audio_format": S.optionalWith(RealtimeSessionCreateRequestInputAudioFormat, {
2659
+ nullable: true,
2660
+ default: () => "pcm16" as const
2661
+ }),
2662
+ "output_audio_format": S.optionalWith(RealtimeSessionCreateRequestOutputAudioFormat, {
2663
+ nullable: true,
2664
+ default: () => "pcm16" as const
2665
+ }),
2600
2666
  "input_audio_transcription": S.optionalWith(
2601
2667
  S.Struct({
2602
2668
  "model": S.optionalWith(S.String, { nullable: true }),
@@ -2607,7 +2673,14 @@ export class RealtimeSessionCreateRequest
2607
2673
  ),
2608
2674
  "turn_detection": S.optionalWith(
2609
2675
  S.Struct({
2610
- "type": S.optionalWith(S.String, { nullable: true }),
2676
+ "type": S.optionalWith(RealtimeSessionCreateRequestTurnDetectionType, {
2677
+ nullable: true,
2678
+ default: () => "server_vad" as const
2679
+ }),
2680
+ "eagerness": S.optionalWith(RealtimeSessionCreateRequestTurnDetectionEagerness, {
2681
+ nullable: true,
2682
+ default: () => "auto" as const
2683
+ }),
2611
2684
  "threshold": S.optionalWith(S.Number, { nullable: true }),
2612
2685
  "prefix_padding_ms": S.optionalWith(S.Int, { nullable: true }),
2613
2686
  "silence_duration_ms": S.optionalWith(S.Int, { nullable: true }),
@@ -2616,6 +2689,12 @@ export class RealtimeSessionCreateRequest
2616
2689
  }),
2617
2690
  { nullable: true }
2618
2691
  ),
2692
+ "input_audio_noise_reduction": S.optionalWith(
2693
+ S.NullOr(S.Struct({
2694
+ "type": S.optionalWith(RealtimeSessionCreateRequestInputAudioNoiseReductionType, { nullable: true })
2695
+ })),
2696
+ { default: () => null }
2697
+ ),
2619
2698
  "tools": S.optionalWith(
2620
2699
  S.Array(S.Struct({
2621
2700
  "type": S.optionalWith(S.Literal("function"), { nullable: true }),
@@ -2625,8 +2704,8 @@ export class RealtimeSessionCreateRequest
2625
2704
  })),
2626
2705
  { nullable: true }
2627
2706
  ),
2628
- "tool_choice": S.optionalWith(S.String, { nullable: true }),
2629
- "temperature": S.optionalWith(S.Number, { nullable: true }),
2707
+ "tool_choice": S.optionalWith(S.String, { nullable: true, default: () => "auto" as const }),
2708
+ "temperature": S.optionalWith(S.Number, { nullable: true, default: () => 0.8 as const }),
2630
2709
  "max_response_output_tokens": S.optionalWith(
2631
2710
  S.Union(S.Int, RealtimeSessionCreateRequestMaxResponseOutputTokensEnum),
2632
2711
  { nullable: true }
@@ -2634,10 +2713,6 @@ export class RealtimeSessionCreateRequest
2634
2713
  })
2635
2714
  {}
2636
2715
 
2637
- export class RealtimeSessionCreateResponseVoice
2638
- extends S.Literal("alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse")
2639
- {}
2640
-
2641
2716
  export class RealtimeSessionCreateResponseMaxResponseOutputTokensEnum extends S.Literal("inf") {}
2642
2717
 
2643
2718
  export class RealtimeSessionCreateResponse
@@ -2647,7 +2722,7 @@ export class RealtimeSessionCreateResponse
2647
2722
  "expires_at": S.Int
2648
2723
  }),
2649
2724
  "instructions": S.optionalWith(S.String, { nullable: true }),
2650
- "voice": S.optionalWith(RealtimeSessionCreateResponseVoice, { nullable: true }),
2725
+ "voice": S.optionalWith(VoiceIdsShared, { nullable: true }),
2651
2726
  "input_audio_format": S.optionalWith(S.String, { nullable: true }),
2652
2727
  "output_audio_format": S.optionalWith(S.String, { nullable: true }),
2653
2728
  "input_audio_transcription": S.optionalWith(
@@ -2683,6 +2758,105 @@ export class RealtimeSessionCreateResponse
2683
2758
  })
2684
2759
  {}
2685
2760
 
2761
+ export class RealtimeTranscriptionSessionCreateRequestInputAudioFormat
2762
+ extends S.Literal("pcm16", "g711_ulaw", "g711_alaw")
2763
+ {}
2764
+
2765
+ export class RealtimeTranscriptionSessionCreateRequestInputAudioTranscriptionModel
2766
+ extends S.Literal("gpt-4o-transcribe", "gpt-4o-mini-transcribe", "whisper-1")
2767
+ {}
2768
+
2769
+ export class RealtimeTranscriptionSessionCreateRequestTurnDetectionType
2770
+ extends S.Literal("server_vad", "semantic_vad")
2771
+ {}
2772
+
2773
+ export class RealtimeTranscriptionSessionCreateRequestTurnDetectionEagerness
2774
+ extends S.Literal("low", "medium", "high", "auto")
2775
+ {}
2776
+
2777
+ export class RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReductionType
2778
+ extends S.Literal("near_field", "far_field")
2779
+ {}
2780
+
2781
+ export class RealtimeTranscriptionSessionCreateRequest
2782
+ extends S.Class<RealtimeTranscriptionSessionCreateRequest>("RealtimeTranscriptionSessionCreateRequest")({
2783
+ "input_audio_format": S.optionalWith(RealtimeTranscriptionSessionCreateRequestInputAudioFormat, {
2784
+ nullable: true,
2785
+ default: () => "pcm16" as const
2786
+ }),
2787
+ "input_audio_transcription": S.optionalWith(
2788
+ S.Struct({
2789
+ "model": S.optionalWith(RealtimeTranscriptionSessionCreateRequestInputAudioTranscriptionModel, {
2790
+ nullable: true
2791
+ }),
2792
+ "language": S.optionalWith(S.String, { nullable: true }),
2793
+ "prompt": S.optionalWith(S.String, { nullable: true })
2794
+ }),
2795
+ { nullable: true }
2796
+ ),
2797
+ "turn_detection": S.optionalWith(
2798
+ S.Struct({
2799
+ "type": S.optionalWith(RealtimeTranscriptionSessionCreateRequestTurnDetectionType, {
2800
+ nullable: true,
2801
+ default: () => "server_vad" as const
2802
+ }),
2803
+ "eagerness": S.optionalWith(RealtimeTranscriptionSessionCreateRequestTurnDetectionEagerness, {
2804
+ nullable: true,
2805
+ default: () => "auto" as const
2806
+ }),
2807
+ "threshold": S.optionalWith(S.Number, { nullable: true }),
2808
+ "prefix_padding_ms": S.optionalWith(S.Int, { nullable: true }),
2809
+ "silence_duration_ms": S.optionalWith(S.Int, { nullable: true }),
2810
+ "create_response": S.optionalWith(S.Boolean, { nullable: true, default: () => true as const }),
2811
+ "interrupt_response": S.optionalWith(S.Boolean, { nullable: true, default: () => true as const })
2812
+ }),
2813
+ { nullable: true }
2814
+ ),
2815
+ "input_audio_noise_reduction": S.optionalWith(
2816
+ S.NullOr(S.Struct({
2817
+ "type": S.optionalWith(RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReductionType, {
2818
+ nullable: true
2819
+ })
2820
+ })),
2821
+ { default: () => null }
2822
+ ),
2823
+ "include": S.optionalWith(S.Array(S.String), { nullable: true })
2824
+ })
2825
+ {}
2826
+
2827
+ export class RealtimeTranscriptionSessionCreateResponseInputAudioTranscriptionModel
2828
+ extends S.Literal("gpt-4o-transcribe", "gpt-4o-mini-transcribe", "whisper-1")
2829
+ {}
2830
+
2831
+ export class RealtimeTranscriptionSessionCreateResponse
2832
+ extends S.Class<RealtimeTranscriptionSessionCreateResponse>("RealtimeTranscriptionSessionCreateResponse")({
2833
+ "client_secret": S.Struct({
2834
+ "value": S.String,
2835
+ "expires_at": S.Int
2836
+ }),
2837
+ "input_audio_format": S.optionalWith(S.String, { nullable: true }),
2838
+ "input_audio_transcription": S.optionalWith(
2839
+ S.Struct({
2840
+ "model": S.optionalWith(RealtimeTranscriptionSessionCreateResponseInputAudioTranscriptionModel, {
2841
+ nullable: true
2842
+ }),
2843
+ "language": S.optionalWith(S.String, { nullable: true }),
2844
+ "prompt": S.optionalWith(S.String, { nullable: true })
2845
+ }),
2846
+ { nullable: true }
2847
+ ),
2848
+ "turn_detection": S.optionalWith(
2849
+ S.Struct({
2850
+ "type": S.optionalWith(S.String, { nullable: true }),
2851
+ "threshold": S.optionalWith(S.Number, { nullable: true }),
2852
+ "prefix_padding_ms": S.optionalWith(S.Int, { nullable: true }),
2853
+ "silence_duration_ms": S.optionalWith(S.Int, { nullable: true })
2854
+ }),
2855
+ { nullable: true }
2856
+ )
2857
+ })
2858
+ {}
2859
+
2686
2860
  export class EasyInputMessageRole extends S.Literal("user", "assistant", "system", "developer") {}
2687
2861
 
2688
2862
  export class InputTextType extends S.Literal("input_text") {}
@@ -2959,7 +3133,7 @@ export class FunctionToolCallType extends S.Literal("function_call") {}
2959
3133
  export class FunctionToolCallStatus extends S.Literal("in_progress", "completed", "incomplete") {}
2960
3134
 
2961
3135
  export class FunctionToolCall extends S.Struct({
2962
- "id": S.String,
3136
+ "id": S.optionalWith(S.String, { nullable: true }),
2963
3137
  "type": FunctionToolCallType,
2964
3138
  "call_id": S.String,
2965
3139
  "name": S.String,
@@ -2986,8 +3160,8 @@ export class ReasoningItemStatus extends S.Literal("in_progress", "completed", "
2986
3160
  export class ReasoningItem extends S.Struct({
2987
3161
  "type": ReasoningItemType,
2988
3162
  "id": S.String,
2989
- "content": S.Array(S.Struct({
2990
- "type": S.Literal("reasoning_summary"),
3163
+ "summary": S.Array(S.Struct({
3164
+ "type": S.Literal("summary_text"),
2991
3165
  "text": S.String
2992
3166
  })),
2993
3167
  "status": S.optionalWith(ReasoningItemStatus, { nullable: true })
@@ -3012,10 +3186,16 @@ export class Includable extends S.Literal(
3012
3186
  "computer_call_output.output.image_url"
3013
3187
  ) {}
3014
3188
 
3189
+ export class ModelIdsResponsesEnum
3190
+ extends S.Literal("o1-pro", "o1-pro-2025-03-19", "computer-use-preview", "computer-use-preview-2025-03-11")
3191
+ {}
3192
+
3193
+ export class ModelIdsResponses extends S.Union(ModelIdsShared, ModelIdsResponsesEnum) {}
3194
+
3015
3195
  export class ReasoningGenerateSummary extends S.Literal("concise", "detailed") {}
3016
3196
 
3017
3197
  export class Reasoning extends S.Struct({
3018
- "effort": S.NullOr(ReasoningEffort).pipe(S.propertySignature, S.withConstructorDefault(() => "medium" as const)),
3198
+ "effort": S.optionalWith(ReasoningEffort, { nullable: true, default: () => "medium" as const }),
3019
3199
  "generate_summary": S.optionalWith(ReasoningGenerateSummary, { nullable: true })
3020
3200
  }) {}
3021
3201
 
@@ -3047,7 +3227,7 @@ export class CompoundFilterType extends S.Literal("and", "or") {}
3047
3227
 
3048
3228
  export class CompoundFilter extends S.Struct({
3049
3229
  "type": CompoundFilterType,
3050
- "filters": S.Array(ComparisonFilter)
3230
+ "filters": S.Array(S.Union(ComparisonFilter, S.Record({ key: S.String, value: S.Unknown })))
3051
3231
  }) {}
3052
3232
 
3053
3233
  export class FileSearchToolRankingOptionsRanker extends S.Literal("auto", "default-2024-11-15") {}
@@ -3079,7 +3259,7 @@ export class FunctionTool extends S.Struct({
3079
3259
  "strict": S.Boolean
3080
3260
  }) {}
3081
3261
 
3082
- export class ComputerToolType extends S.Literal("computer-preview") {}
3262
+ export class ComputerToolType extends S.Literal("computer_use_preview") {}
3083
3263
 
3084
3264
  export class ComputerToolEnvironment extends S.Literal("mac", "windows", "ubuntu", "browser") {}
3085
3265
 
@@ -3129,53 +3309,6 @@ export class ToolChoiceFunction extends S.Struct({
3129
3309
 
3130
3310
  export class CreateResponseTruncation extends S.Literal("auto", "disabled") {}
3131
3311
 
3132
- export class CreateResponseModelEnum extends S.Literal(
3133
- "o3-mini",
3134
- "o3-mini-2025-01-31",
3135
- "o1",
3136
- "o1-2024-12-17",
3137
- "o1-preview",
3138
- "o1-preview-2024-09-12",
3139
- "o1-mini",
3140
- "o1-mini-2024-09-12",
3141
- "computer-use-preview",
3142
- "computer-use-preview-2025-02-04",
3143
- "computer-use-preview-2025-03-11",
3144
- "gpt-4.5-preview",
3145
- "gpt-4.5-preview-2025-02-27",
3146
- "gpt-4o",
3147
- "gpt-4o-2024-11-20",
3148
- "gpt-4o-2024-08-06",
3149
- "gpt-4o-2024-05-13",
3150
- "gpt-4o-audio-preview",
3151
- "gpt-4o-audio-preview-2024-10-01",
3152
- "gpt-4o-audio-preview-2024-12-17",
3153
- "gpt-4o-mini-audio-preview",
3154
- "gpt-4o-mini-audio-preview-2024-12-17",
3155
- "chatgpt-4o-latest",
3156
- "gpt-4o-mini",
3157
- "gpt-4o-mini-2024-07-18",
3158
- "gpt-4-turbo",
3159
- "gpt-4-turbo-2024-04-09",
3160
- "gpt-4-0125-preview",
3161
- "gpt-4-turbo-preview",
3162
- "gpt-4-1106-preview",
3163
- "gpt-4-vision-preview",
3164
- "gpt-4",
3165
- "gpt-4-0314",
3166
- "gpt-4-0613",
3167
- "gpt-4-32k",
3168
- "gpt-4-32k-0314",
3169
- "gpt-4-32k-0613",
3170
- "gpt-3.5-turbo",
3171
- "gpt-3.5-turbo-16k",
3172
- "gpt-3.5-turbo-0301",
3173
- "gpt-3.5-turbo-0613",
3174
- "gpt-3.5-turbo-1106",
3175
- "gpt-3.5-turbo-0125",
3176
- "gpt-3.5-turbo-16k-0613"
3177
- ) {}
3178
-
3179
3312
  export class CreateResponse extends S.Class<CreateResponse>("CreateResponse")({
3180
3313
  "input": S.Union(S.String, S.Array(InputItem)),
3181
3314
  "include": S.optionalWith(S.Array(Includable), { nullable: true }),
@@ -3183,6 +3316,7 @@ export class CreateResponse extends S.Class<CreateResponse>("CreateResponse")({
3183
3316
  "store": S.optionalWith(S.Boolean, { nullable: true, default: () => true as const }),
3184
3317
  "stream": S.optionalWith(S.Boolean, { nullable: true, default: () => false as const }),
3185
3318
  "previous_response_id": S.optionalWith(S.String, { nullable: true }),
3319
+ "model": ModelIdsResponses,
3186
3320
  "reasoning": S.optionalWith(Reasoning, { nullable: true }),
3187
3321
  "max_output_tokens": S.optionalWith(S.Int, { nullable: true }),
3188
3322
  "instructions": S.optionalWith(S.String, { nullable: true }),
@@ -3195,7 +3329,6 @@ export class CreateResponse extends S.Class<CreateResponse>("CreateResponse")({
3195
3329
  "tools": S.optionalWith(S.Array(Tool), { nullable: true }),
3196
3330
  "tool_choice": S.optionalWith(S.Union(ToolChoiceOptions, ToolChoiceTypes, ToolChoiceFunction), { nullable: true }),
3197
3331
  "truncation": S.optionalWith(CreateResponseTruncation, { nullable: true, default: () => "disabled" as const }),
3198
- "model": S.Union(S.String, CreateResponseModelEnum),
3199
3332
  "metadata": S.optionalWith(Metadata, { nullable: true }),
3200
3333
  "temperature": S.optionalWith(S.Number.pipe(S.greaterThanOrEqualTo(0), S.lessThanOrEqualTo(2)), {
3201
3334
  nullable: true,
@@ -3251,6 +3384,9 @@ export class OutputItem extends S.Union(
3251
3384
 
3252
3385
  export class ResponseUsage extends S.Struct({
3253
3386
  "input_tokens": S.Int,
3387
+ "input_tokens_details": S.Struct({
3388
+ "cached_tokens": S.Int
3389
+ }),
3254
3390
  "output_tokens": S.Int,
3255
3391
  "output_tokens_details": S.Struct({
3256
3392
  "reasoning_tokens": S.Int
@@ -3260,53 +3396,6 @@ export class ResponseUsage extends S.Struct({
3260
3396
 
3261
3397
  export class ResponseTruncation extends S.Literal("auto", "disabled") {}
3262
3398
 
3263
- export class ResponseModelEnum extends S.Literal(
3264
- "o3-mini",
3265
- "o3-mini-2025-01-31",
3266
- "o1",
3267
- "o1-2024-12-17",
3268
- "o1-preview",
3269
- "o1-preview-2024-09-12",
3270
- "o1-mini",
3271
- "o1-mini-2024-09-12",
3272
- "computer-use-preview",
3273
- "computer-use-preview-2025-02-04",
3274
- "computer-use-preview-2025-03-11",
3275
- "gpt-4.5-preview",
3276
- "gpt-4.5-preview-2025-02-27",
3277
- "gpt-4o",
3278
- "gpt-4o-2024-11-20",
3279
- "gpt-4o-2024-08-06",
3280
- "gpt-4o-2024-05-13",
3281
- "gpt-4o-audio-preview",
3282
- "gpt-4o-audio-preview-2024-10-01",
3283
- "gpt-4o-audio-preview-2024-12-17",
3284
- "gpt-4o-mini-audio-preview",
3285
- "gpt-4o-mini-audio-preview-2024-12-17",
3286
- "chatgpt-4o-latest",
3287
- "gpt-4o-mini",
3288
- "gpt-4o-mini-2024-07-18",
3289
- "gpt-4-turbo",
3290
- "gpt-4-turbo-2024-04-09",
3291
- "gpt-4-0125-preview",
3292
- "gpt-4-turbo-preview",
3293
- "gpt-4-1106-preview",
3294
- "gpt-4-vision-preview",
3295
- "gpt-4",
3296
- "gpt-4-0314",
3297
- "gpt-4-0613",
3298
- "gpt-4-32k",
3299
- "gpt-4-32k-0314",
3300
- "gpt-4-32k-0613",
3301
- "gpt-3.5-turbo",
3302
- "gpt-3.5-turbo-16k",
3303
- "gpt-3.5-turbo-0301",
3304
- "gpt-3.5-turbo-0613",
3305
- "gpt-3.5-turbo-1106",
3306
- "gpt-3.5-turbo-0125",
3307
- "gpt-3.5-turbo-16k-0613"
3308
- ) {}
3309
-
3310
3399
  export class Response extends S.Class<Response>("Response")({
3311
3400
  "id": S.String,
3312
3401
  "object": ResponseObject,
@@ -3321,6 +3410,7 @@ export class Response extends S.Class<Response>("Response")({
3321
3410
  "usage": S.optionalWith(ResponseUsage, { nullable: true }),
3322
3411
  "parallel_tool_calls": S.Boolean.pipe(S.propertySignature, S.withConstructorDefault(() => true as const)),
3323
3412
  "previous_response_id": S.optionalWith(S.String, { nullable: true }),
3413
+ "model": ModelIdsResponses,
3324
3414
  "reasoning": S.optionalWith(Reasoning, { nullable: true }),
3325
3415
  "max_output_tokens": S.optionalWith(S.Int, { nullable: true }),
3326
3416
  "instructions": S.NullOr(S.String),
@@ -3333,7 +3423,6 @@ export class Response extends S.Class<Response>("Response")({
3333
3423
  "tools": S.Array(Tool),
3334
3424
  "tool_choice": S.Union(ToolChoiceOptions, ToolChoiceTypes, ToolChoiceFunction),
3335
3425
  "truncation": S.optionalWith(ResponseTruncation, { nullable: true, default: () => "disabled" as const }),
3336
- "model": S.Union(S.String, ResponseModelEnum),
3337
3426
  "metadata": S.NullOr(Metadata),
3338
3427
  "temperature": S.NullOr(S.Number.pipe(S.greaterThanOrEqualTo(0), S.lessThanOrEqualTo(2))).pipe(
3339
3428
  S.propertySignature,
@@ -3391,6 +3480,19 @@ export class ComputerToolCallOutputResource extends S.Struct({
3391
3480
  "status": S.optionalWith(ComputerToolCallOutputResourceStatus, { nullable: true })
3392
3481
  }) {}
3393
3482
 
3483
+ export class FunctionToolCallResourceType extends S.Literal("function_call") {}
3484
+
3485
+ export class FunctionToolCallResourceStatus extends S.Literal("in_progress", "completed", "incomplete") {}
3486
+
3487
+ export class FunctionToolCallResource extends S.Struct({
3488
+ "id": S.String,
3489
+ "type": FunctionToolCallResourceType,
3490
+ "call_id": S.String,
3491
+ "name": S.String,
3492
+ "arguments": S.String,
3493
+ "status": S.optionalWith(FunctionToolCallResourceStatus, { nullable: true })
3494
+ }) {}
3495
+
3394
3496
  export class FunctionToolCallOutputResourceType extends S.Literal("function_call_output") {}
3395
3497
 
3396
3498
  export class FunctionToolCallOutputResourceStatus extends S.Literal("in_progress", "completed", "incomplete") {}
@@ -3410,7 +3512,7 @@ export class ItemResource extends S.Union(
3410
3512
  ComputerToolCall,
3411
3513
  ComputerToolCallOutputResource,
3412
3514
  WebSearchToolCall,
3413
- FunctionToolCall,
3515
+ FunctionToolCallResource,
3414
3516
  FunctionToolCallOutputResource
3415
3517
  ) {}
3416
3518
 
@@ -4882,6 +4984,63 @@ export const make = (
4882
4984
  ))
4883
4985
  )
4884
4986
  ),
4987
+ "listFineTuningCheckpointPermissions": (permissionId, options) =>
4988
+ HttpClientRequest.make("GET")(`/fine_tuning/checkpoints/${permissionId}/permissions`).pipe(
4989
+ HttpClientRequest.setUrlParams({
4990
+ "project_id": options["project_id"] as UrlParams.Coercible,
4991
+ "after": options["after"] as UrlParams.Coercible,
4992
+ "limit": options["limit"] as UrlParams.Coercible,
4993
+ "order": options["order"] as UrlParams.Coercible
4994
+ }),
4995
+ Effect.succeed,
4996
+ Effect.flatMap((request) =>
4997
+ Effect.flatMap(
4998
+ applyClientTransform(httpClient),
4999
+ (httpClient) =>
5000
+ Effect.flatMap(
5001
+ httpClient.execute(request),
5002
+ HttpClientResponse.matchStatus({
5003
+ "200": (r) => HttpClientResponse.schemaBodyJson(ListFineTuningCheckpointPermissionResponse)(r),
5004
+ orElse: (response) => unexpectedStatus(request, response)
5005
+ })
5006
+ )
5007
+ )
5008
+ )
5009
+ ),
5010
+ "createFineTuningCheckpointPermission": (permissionId, options) =>
5011
+ HttpClientRequest.make("POST")(`/fine_tuning/checkpoints/${permissionId}/permissions`).pipe(
5012
+ (req) => Effect.orDie(HttpClientRequest.bodyJson(req, options)),
5013
+ Effect.flatMap((request) =>
5014
+ Effect.flatMap(
5015
+ applyClientTransform(httpClient),
5016
+ (httpClient) =>
5017
+ Effect.flatMap(
5018
+ httpClient.execute(request),
5019
+ HttpClientResponse.matchStatus({
5020
+ "200": (r) => HttpClientResponse.schemaBodyJson(ListFineTuningCheckpointPermissionResponse)(r),
5021
+ orElse: (response) => unexpectedStatus(request, response)
5022
+ })
5023
+ )
5024
+ )
5025
+ )
5026
+ ),
5027
+ "deleteFineTuningCheckpointPermission": (permissionId) =>
5028
+ HttpClientRequest.make("DELETE")(`/fine_tuning/checkpoints/${permissionId}/permissions`).pipe(
5029
+ Effect.succeed,
5030
+ Effect.flatMap((request) =>
5031
+ Effect.flatMap(
5032
+ applyClientTransform(httpClient),
5033
+ (httpClient) =>
5034
+ Effect.flatMap(
5035
+ httpClient.execute(request),
5036
+ HttpClientResponse.matchStatus({
5037
+ "200": (r) => HttpClientResponse.schemaBodyJson(DeleteFineTuningCheckpointPermissionResponse)(r),
5038
+ orElse: (response) => unexpectedStatus(request, response)
5039
+ })
5040
+ )
5041
+ )
5042
+ )
5043
+ ),
4885
5044
  "listPaginatedFineTuningJobs": (options) =>
4886
5045
  HttpClientRequest.make("GET")(`/fine_tuning/jobs`).pipe(
4887
5046
  HttpClientRequest.setUrlParams({
@@ -5888,6 +6047,23 @@ export const make = (
5888
6047
  ))
5889
6048
  )
5890
6049
  ),
6050
+ "createRealtimeTranscriptionSession": (options) =>
6051
+ HttpClientRequest.make("POST")(`/realtime/transcription_sessions`).pipe(
6052
+ (req) => Effect.orDie(HttpClientRequest.bodyJson(req, options)),
6053
+ Effect.flatMap((request) =>
6054
+ Effect.flatMap(
6055
+ applyClientTransform(httpClient),
6056
+ (httpClient) =>
6057
+ Effect.flatMap(
6058
+ httpClient.execute(request),
6059
+ HttpClientResponse.matchStatus({
6060
+ "200": (r) => HttpClientResponse.schemaBodyJson(RealtimeTranscriptionSessionCreateResponse)(r),
6061
+ orElse: (response) => unexpectedStatus(request, response)
6062
+ })
6063
+ )
6064
+ )
6065
+ )
6066
+ ),
5891
6067
  "createResponse": (options) =>
5892
6068
  HttpClientRequest.make("POST")(`/responses`).pipe(
5893
6069
  (req) => Effect.orDie(HttpClientRequest.bodyJson(req, options)),
@@ -6668,6 +6844,26 @@ export interface Client {
6668
6844
  readonly "downloadFile": (
6669
6845
  fileId: string
6670
6846
  ) => Effect.Effect<typeof DownloadFile200.Type, HttpClientError.HttpClientError | ParseError>
6847
+ readonly "listFineTuningCheckpointPermissions": (
6848
+ permissionId: string,
6849
+ options: typeof ListFineTuningCheckpointPermissionsParams.Encoded
6850
+ ) => Effect.Effect<
6851
+ typeof ListFineTuningCheckpointPermissionResponse.Type,
6852
+ HttpClientError.HttpClientError | ParseError
6853
+ >
6854
+ readonly "createFineTuningCheckpointPermission": (
6855
+ permissionId: string,
6856
+ options: typeof CreateFineTuningCheckpointPermissionRequest.Encoded
6857
+ ) => Effect.Effect<
6858
+ typeof ListFineTuningCheckpointPermissionResponse.Type,
6859
+ HttpClientError.HttpClientError | ParseError
6860
+ >
6861
+ readonly "deleteFineTuningCheckpointPermission": (
6862
+ permissionId: string
6863
+ ) => Effect.Effect<
6864
+ typeof DeleteFineTuningCheckpointPermissionResponse.Type,
6865
+ HttpClientError.HttpClientError | ParseError
6866
+ >
6671
6867
  readonly "listPaginatedFineTuningJobs": (
6672
6868
  options: typeof ListPaginatedFineTuningJobsParams.Encoded
6673
6869
  ) => Effect.Effect<typeof ListPaginatedFineTuningJobsResponse.Type, HttpClientError.HttpClientError | ParseError>
@@ -6872,6 +7068,12 @@ export interface Client {
6872
7068
  readonly "createRealtimeSession": (
6873
7069
  options: typeof RealtimeSessionCreateRequest.Encoded
6874
7070
  ) => Effect.Effect<typeof RealtimeSessionCreateResponse.Type, HttpClientError.HttpClientError | ParseError>
7071
+ readonly "createRealtimeTranscriptionSession": (
7072
+ options: typeof RealtimeTranscriptionSessionCreateRequest.Encoded
7073
+ ) => Effect.Effect<
7074
+ typeof RealtimeTranscriptionSessionCreateResponse.Type,
7075
+ HttpClientError.HttpClientError | ParseError
7076
+ >
6875
7077
  readonly "createResponse": (
6876
7078
  options: typeof CreateResponse.Encoded
6877
7079
  ) => Effect.Effect<typeof Response.Type, HttpClientError.HttpClientError | ParseError>