Promptly Python SDK
Official Python SDK - the fastest way to get started
Install the Promptly SDK and start saving in 30 seconds. Extends the OpenAI client with smart defaults - no base_url needed.
Setup Guide
Install the SDK
One dependency. No extra configuration.
pip install promptly-sdkCreate a Client
Promptly extends OpenAI - every feature (streaming, function calling, vision) works out of the box.
from promptly import Promptly
client = Promptly(api_key="sk-promptly-...")
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)Or Wrap an Existing Client
Already have an OpenAI client? Wrap it to route through Promptly without changing any other code.
from promptly import wrap
from openai import OpenAI
client = wrap(OpenAI(api_key="sk-promptly-..."))
# All existing code works unchangedWhy Use Promptly with Promptly Python SDK?
- One-line install - pip install promptly-sdk
- Extends OpenAI SDK - all features supported
- wrap() existing clients with zero code changes
- Streaming, function calling, vision all work
- Roll back to direct OpenAI by removing one import
Start optimizing Promptly Python SDK costs
Sign up, grab your API key, and change your base URL. Under 2 minutes.
Other Integrations
Promptly Node.js SDK
Official Node.js SDK - TypeScript-first, zero config
LangChain
Use Promptly as your LLM backend in LangChain
Vercel AI SDK
Optimize AI SDK streaming responses with Promptly
LlamaIndex
Optimize your RAG pipeline costs with Promptly
OpenAI Python SDK
Drop-in optimization for the official OpenAI Python library