Python client library for the Portkey API - Control Panel for AI Apps with unified API signature, automated fallbacks, retries, load balancing, semantic caching, virtual keys, and comprehensive observability features.
—
File upload, management, and processing capabilities including support for assistants, fine-tuning, and batch operations.
class MainFiles:
def create(self, **kwargs): ...
def list(self, **kwargs): ...
def retrieve(self, **kwargs): ...
def delete(self, **kwargs): ...
class Uploads:
def create(self, **kwargs): ...
parts: Parts
class Parts:
def create(self, **kwargs): ...from portkey_ai import Portkey
portkey = Portkey(
api_key="PORTKEY_API_KEY",
virtual_key="VIRTUAL_KEY"
)
# Upload file
file_response = portkey.files.create(
file=open("document.pdf", "rb"),
purpose="assistants"
)
# List files
files = portkey.files.list()
# Delete file
portkey.files.delete(file_response.id)Install with Tessl CLI
npx tessl i tessl/pypi-portkey-aidocs