22
33from __future__ import annotations
44
5+ from typing_extensions import Literal
6+
57import httpx
68
79from ..types import batch_create_params
@@ -46,7 +48,7 @@ def with_streaming_response(self) -> BatchesResourceWithStreamingResponse:
4648 def create (
4749 self ,
4850 * ,
49- endpoint : str ,
51+ endpoint : Literal [ "/v1/chat/completions" , "/v1/audio/transcriptions" , "/v1/audio/translations" ] ,
5052 input_file_id : str ,
5153 completion_window : str | Omit = omit ,
5254 model_id : str | Omit = omit ,
@@ -62,7 +64,13 @@ def create(
6264 Create a new batch job with the given input file and endpoint
6365
6466 Args:
65- endpoint: The endpoint to use for batch processing
67+ endpoint: The endpoint to use for batch processing. Each line of the uploaded input file
68+ is dispatched against this endpoint.
69+
70+ - `/v1/chat/completions` — chat completion batches
71+ - `/v1/audio/transcriptions` — audio transcription batches (e.g.
72+ `openai/whisper-large-v3`)
73+ - `/v1/audio/translations` — audio translation batches
6674
6775 input_file_id: ID of the uploaded input file containing batch requests
6876
@@ -211,7 +219,7 @@ def with_streaming_response(self) -> AsyncBatchesResourceWithStreamingResponse:
211219 async def create (
212220 self ,
213221 * ,
214- endpoint : str ,
222+ endpoint : Literal [ "/v1/chat/completions" , "/v1/audio/transcriptions" , "/v1/audio/translations" ] ,
215223 input_file_id : str ,
216224 completion_window : str | Omit = omit ,
217225 model_id : str | Omit = omit ,
@@ -227,7 +235,13 @@ async def create(
227235 Create a new batch job with the given input file and endpoint
228236
229237 Args:
230- endpoint: The endpoint to use for batch processing
238+ endpoint: The endpoint to use for batch processing. Each line of the uploaded input file
239+ is dispatched against this endpoint.
240+
241+ - `/v1/chat/completions` — chat completion batches
242+ - `/v1/audio/transcriptions` — audio transcription batches (e.g.
243+ `openai/whisper-large-v3`)
244+ - `/v1/audio/translations` — audio translation batches
231245
232246 input_file_id: ID of the uploaded input file containing batch requests
233247
0 commit comments