Axlet Python SDK
Server-side Python client for the Axlet subscription, entitlement, credits, and purchase APIs. Python 3.10 or later; no runtime dependencies.
pip install axlet
import os
from axlet import AxletClient, AxletApiError
client = AxletClient(
api_key=os.environ["AXLET_API_KEY"],
base_url=os.environ.get("AXLET_API_URL", "http://127.0.0.1:4310"),
)
print(client.get_plans())
Use an Axlet API server you operate or have access to. axlet.app is a website, not a hosted public API endpoint. This package does not include the API server. Keep operator API keys on your server.
Usage
Methods use Python snake_case names. Input and response dictionaries preserve API camelCase fields:
customer = client.create_customer(
{"name": "Example", "email": "user@example.com", "externalId": "user-123"},
idempotency_key="create-user-123",
)
access = client.get_access(customer["id"], "report")
# For each paid operation, confirm successful consumption before doing the work.
usage = client.consume_usage(
customer["id"],
{"feature": "report", "operationId": "report-job-123"},
idempotency_key="consume-job-123",
)
Every mutation requires an idempotency key. Keys and operation IDs must contain 8–100 ASCII letters, digits, underscores, or hyphens. Reuse them only for retries of the same operation; generate new IDs for new work. The customer must have the required subscription or credits before consuming paid usage.
Supported methods: get_plans, set_plan, create_customer, register_billing, subscribe, cancel, refund, retry, get_entitlement, get_credits, get_access, consume_usage, cancel_usage, create_purchase, get_purchase, confirm_purchase, sync_purchase, refund_purchase, advance_demo, and run_jobs.
HTTP failures and invalid successful responses raise AxletApiError with status and body. Invalid keys raise ValueError. Network errors use the standard library's exceptions. Socket operations use a 75-second timeout, configurable with timeout=. Requests are synchronous, redirects are rejected, and no automatic retries are performed. Payment behavior depends on the API server configuration; installing this client does not enable production payments.
License
All rights reserved. This release does not grant an open-source license.
Release files for axlet 0.1.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 | |
|---|---|---|---|
| axlet-0.1.0.tar.gz | 3.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| axlet-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.0 kB
Release files / axlet-0.1.0.tar.gz
| Download URL | axlet-0.1.0.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
461e16538f2f5b9ebbcc46087540cd882037ba6f4e36c0063baae519f5c69c0a
|
|
BLAKE2b-256 checksum How to use checksums |
4889a163d88246763be64c2a40745559aa985de317e2c597db4d3d6559bc09e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.3
|
Release files / axlet-0.1.0-py3-none-any.whl
| Download URL | axlet-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
297a17e18f344cea01f418603376504ee4fa6448c66bdfe67d40dd66869039bb
|
|
BLAKE2b-256 checksum How to use checksums |
fd3cf7f252a295884031e4a167d461b06d89f25aa02fc327017a517c97511727
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.3
|