CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-portkey-ai

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.

Pending
Overview
Eval results
Files

multimodal-apis.mddocs/

Multimodal APIs

Image generation, audio processing (speech-to-text, text-to-speech, translation), and content moderation capabilities with OpenAI compatibility.

Capabilities

Image Generation

class Images:
    def generate(self, **kwargs): ...
    def create_variation(self, **kwargs): ...
    def edit(self, **kwargs): ...

Audio Processing

class Audio:
    transcriptions: Transcriptions
    translations: Translations
    speech: Speech

class Transcriptions:
    def create(self, **kwargs): ...

class Translations:
    def create(self, **kwargs): ...

class Speech:
    def create(self, **kwargs): ...

Content Moderation

class Moderations:
    def create(self, **kwargs): ...

Usage Examples

from portkey_ai import Portkey

portkey = Portkey(
    api_key="PORTKEY_API_KEY",
    virtual_key="VIRTUAL_KEY"
)

# Generate image
image = portkey.images.generate(
    prompt="A cat in a spacesuit",
    model="dall-e-3",
    size="1024x1024"
)

# Transcribe audio
transcription = portkey.audio.transcriptions.create(
    file=open("audio.mp3", "rb"),
    model="whisper-1"
)

# Moderate content
moderation = portkey.moderations.create(
    input="This is a test message"
)

Install with Tessl CLI

npx tessl i tessl/pypi-portkey-ai

docs

administration.md

assistants-threads.md

batch-processing.md

beta-realtime.md

chat-completions.md

configuration-management.md

container-content.md

core-client.md

embeddings.md

evaluation-testing.md

feedback-collections.md

file-management.md

fine-tuning.md

framework-integrations.md

index.md

key-management.md

models.md

multimodal-apis.md

observability-analytics.md

prompt-management.md

provider-integration.md

text-completions.md

uploads.md

vector-stores.md

tile.json