portkey-python-sdk
Portkey Python SDK
The Portkey Python SDK provides a unified interface to 200+ LLMs through the Portkey AI Gateway. Built on top of the OpenAI SDK for seamless compatibility, it adds production-grade features: automatic fallbacks, retries, load balancing, semantic caching, guardrails, and comprehensive observability.
Additional References:
- API Reference - Response structures, error handling
- Advanced Features - Tool calling, embeddings, audio, images
- Framework Integrations - LangChain, LlamaIndex, Strands, Google ADK
- Provider Configuration - Azure, AWS Bedrock, Vertex AI setup
Installation
pip install portkey-ai
More from portkey-ai/skills
portkey-typescript-sdk
Integrate Portkey AI Gateway into TypeScript/JavaScript applications. Use when building LLM apps with observability, caching, fallbacks, load balancing, or routing across 200+ LLM providers.
39migrate-litellm-to-portkey
Migrate Python applications from LiteLLM to Portkey AI Gateway. Covers litellm.completion, Router, Proxy, fallbacks, caching, retries, callbacks, embeddings, and image generation. Use when the user wants to replace LiteLLM with Portkey or switch from LiteLLM to Portkey.
9