from portkey_ai import Portkey# Initialize the Portkey clientportkey = Portkey( api_key="PORTKEY_API_KEY", # Replace with your Portkey API key provider="@PROVIDER")start_batch_response = portkey.batches.create( input_file_id="file_id", # file id of the input file endpoint="endpoint", # ex: /v1/chat/completions completion_window="completion_window", # ex: 24h metadata={} # metadata for the batch)print(start_batch_response)
from portkey_ai import Portkey# Initialize the Portkey clientportkey = Portkey( api_key="PORTKEY_API_KEY", # Replace with your Portkey API key provider="@PROVIDER")batches = portkey.batches.list()print(batches)
from portkey_ai import Portkey# Initialize the Portkey clientportkey = Portkey( api_key="PORTKEY_API_KEY", # Replace with your Portkey API key provider="@PROVIDER")batch = portkey.batches.retrieve(batch_id="batch_id")print(batch)
from portkey_ai import Portkey# Initialize the Portkey clientportkey = Portkey( api_key="PORTKEY_API_KEY", # Replace with your Portkey API key provider="@PROVIDER")batches = portkey.batches.list()print(batches)
from portkey_ai import Portkey# Initialize the Portkey clientportkey = Portkey( api_key="PORTKEY_API_KEY", # Replace with your Portkey API key provider="@PROVIDER")cancel_batch_response = portkey.batches.cancel(batch_id="batch_id")print(cancel_batch_response)