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

1

Install the SDK

One dependency. No extra configuration.

bash
pip install promptly-sdk
2

Create a Client

Promptly extends OpenAI - every feature (streaming, function calling, vision) works out of the box.

python
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)
3

Or Wrap an Existing Client

Already have an OpenAI client? Wrap it to route through Promptly without changing any other code.

python
from promptly import wrap
from openai import OpenAI

client = wrap(OpenAI(api_key="sk-promptly-..."))
# All existing code works unchanged

Why 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.