Official Python SDK for the Aletheia Rights API
Project description
Aletheia Python SDK
Official Python SDK for the Aletheia Rights API — clear AI voice rights and pay creators instantly.
Installation
pip install aletheia
Requires Python 3.9+ and httpx.
Quick start
from aletheia import Aletheia
client = Aletheia(api_key="ak_live_...")
# Clear rights for a voice creator
result = client.clear("Sarah Collins", "commercial_ad", amount=10.00)
if result.is_cleared:
print(f"License ID: {result.license_id}")
print(f"Verify at: {result.verification_url}")
elif result.is_escrow:
print(f"Payment held in escrow — {result.estimated_resolution}")
elif result.is_unresolved:
print(f"Creator not found. Attempt logged: {result.clearance_attempt_id}")
Methods
client.clear(creator_name, use_type, *, creator_id=None, generation_id=None, amount=None)
Clears commercial rights for a voice creator. Posts to POST /v1/clear.
| Parameter | Type | Required | Description |
|---|---|---|---|
creator_name |
str | ✓ | Full name of the voice creator |
use_type |
str | ✓ | One of: commercial_ad, voiceover, podcast, video, other |
creator_id |
str | UUID of a registered creator (speeds up lookup) | |
generation_id |
str | ID of the AI-generated audio asset | |
amount |
float | Override the creator's default rate (USD) |
Returns a ClearanceResponse with .is_cleared, .is_escrow, .is_unresolved convenience properties.
client.get_license(license_id)
Retrieves a clearance record. Maps to GET /v1/licenses/{license_id}.
license = client.get_license("lic-uuid")
print(license.status, license.creator_name, license.amount_charged)
client.creators.list(*, category=None, min_rate=None, max_rate=None)
Lists approved voice creators. Maps to GET /v1/creators.
creators = client.creators.list(category="voice", min_rate=5, max_rate=50)
for c in creators.creators:
print(c.name, c.rate_per_use, c.currency)
client.verify(certificate_id)
Publicly verifies a compliance certificate. Maps to GET /verify/{certificate_id}. No API key required — this endpoint is open so anyone can confirm a certificate is genuine.
cert = client.verify("cert-uuid")
print(cert.valid, cert.record_type) # True, "license_certificate"
client.list_licenses()
Not yet implemented — raises NotImplementedError("Available in v0.2.0").
Response models
| Model | Returned by |
|---|---|
ClearanceResponse |
clear() |
LicenseRecord |
get_license() |
CreatorsListResponse |
creators.list() |
VerifyResponse |
verify() |
Error handling
from aletheia import (
AuthenticationError, # 401 — invalid API key
NotFoundError, # 404 — resource not found
RateLimitError, # 429 — slow down
ValidationError, # 422 — bad request body
AletheiaAPIError, # any other HTTP error
)
try:
result = client.clear("Sarah Collins", "commercial_ad")
except AuthenticationError:
print("Check your API key")
except RateLimitError:
print("Rate limited — retry later")
Context manager
with Aletheia(api_key="ak_live_...") as client:
result = client.clear("Sarah Collins", "voiceover")
Running tests
pip install respx pytest
pytest tests/ -v
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aletheia_rights-0.1.0.tar.gz.
File metadata
- Download URL: aletheia_rights-0.1.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a98a2f30777545c8288098c7a03eed51083fb2d7695d3ceaf0da083f33a67f2
|
|
| MD5 |
83c64330142f9c99b1d77718b7b9f856
|
|
| BLAKE2b-256 |
af6ff557281d3cf702c385d60d9c23a57b4e082cb3014553f070453080e36c72
|
File details
Details for the file aletheia_rights-0.1.0-py3-none-any.whl.
File metadata
- Download URL: aletheia_rights-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbdf8b5a7a616126674edd50eeb78cc5dcfb2389ccc441e848eeee5f67bc95b2
|
|
| MD5 |
073bd40a477ac8cc9663bcdaf58ba1fd
|
|
| BLAKE2b-256 |
9ffcae8ea4d16d185ce75e75ffdaaa7508d832c926573eddb238c1d579ce9021
|