Unofficial Creem.io Python SDK
A comfy python wrapper around the Creem REST API.
Will hopefully be official at some point.
Installing
Requires Python 3.11+.
pip install creem
For development, install from the repo with test tooling:
pip install -e ".[dev]"
Quickstart
Grab your API key from the dashboard, then:
from creem import Creem
creem = Creem() # reads CREEM_API_KEY from the environment
Test keys (creem_test_...) automatically target the sandbox at test-api.creem.io — no config needed. Live keys (creem_...) hit production. Async backends use AsyncCreem — same API, everything awaited (await creem.checkouts.create(...)).
Sell something. Create a checkout session and send your customer to the hosted payment page:
checkout = creem.checkouts.create({
"product_id": "prod_abc123",
"success_url": "https://yourapp.com/success",
"metadata": {"userId": "user_123"}, # flows through to webhooks
})
print(checkout["checkout_url"]) # redirect the customer here
Know when it's paid. Handle the checkout.completed (one-time) and subscription.paid (recurring) webhooks to grant access — the payloads carry your metadata back. Signatures are verified for you:
from creem import WebhookHandler
handler = WebhookHandler(secret="your webhook secret")
handler.on("subscription.paid", grant_access)
handler.on("subscription.canceled", revoke_access)
# FastAPI: handler.handle(await request.body(), request.headers.get("creem-signature"))
# Async callbacks: await handler.ahandle(...)
Keep customers happy. Cancel at period end, not instantly:
creem.subscriptions.cancel("sub_abc123", {"mode": "scheduled"})
Every response is a typed dict with full field hints (models import from the top level: from creem import Checkout, Subscription, ...). When the API complains, you get a CreemAPIError carrying the trace_id — include it when contacting support.
Retries are automatic: rate limits (429), server errors, and network failures are retried up to 3 times with exponential backoff and jitter — when it's safe to do so (GETs and requests carrying request_id, idempotency_key, or an Idempotency-Key header). Pass max_retries=0 to Creem(...) to disable.
Examples
Runnable scripts live in examples/ — set CREEM_API_KEY (test keys target the sandbox) and run them directly:
| Example | What it shows |
|---|---|
checkout_flow.py |
Create a product, create a checkout, print the payment URL |
subscription_management.py |
Search, scheduled cancel, pause, resume |
webhook_server.py |
FastAPI endpoint with signature verification and grant/revoke dispatch |
customer_credits.py |
Wallet: create account, credit, balance |
browse_and_paginate.py |
Pagination iterators over products and transactions |
async_checkout_flow.py |
The same flow with AsyncCreem — for async backends |
CREEM_API_KEY=creem_test_... python examples/checkout_flow.py
API Reference
See the full reference in API_REFERENCE
Documentation for Agents
AI agents integrating or extending this SDK should read docs/for-agents.md — it covers the mental model, conventions, integration flows, and gotchas. For the complete API contract, see API_REFERENCE.md. Release history: CHANGELOG.md.
Metadata
Release files for creem 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| creem-0.4.0.tar.gz | 46.9 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| creem-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 85.3 kB
Release files / creem-0.4.0.tar.gz
| Download URL | creem-0.4.0.tar.gz |
|---|---|
| Size | 46.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4f3c9169a664db988e022ad664ba440e99feab960f9e6d51367705bb43d29429
|
|
BLAKE2b-256 checksum How to use checksums |
89c832a738c06c115deb5756f8151ab313309aebd5f69bc6bdcc6f514768bf20
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.
Transparency logRelease files / creem-0.4.0-py3-none-any.whl
| Download URL | creem-0.4.0-py3-none-any.whl |
|---|---|
| Size | 38.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8e17f6ba5a1bc7d12b03c9e629b5d8ce9ebd86c5faa65a3d16892a4691217418
|
|
BLAKE2b-256 checksum How to use checksums |
b6119156ca9f7c4a5d50afce00b2225b73c91abaca8eb51a85960db7702437a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.
Transparency logSecurity for creem 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for creem-0.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.