Chisle
The coding-agent plugin that bills 52% of a bare model across 20 live tasks. Terse persona + tool-output compressor + context diet.
翻訳待ち
The Python SDK for the Anis Partner API — signed requests, verified responses, typed operations. PyPI: anis-partners
翻訳待ち
Loading the full README.
Read the full README ↗The Python client for the Anis Partner API. It signs every request, verifies every answer Anis signs, and gives each operation a typed result. The details that can cause duplicate purchases or expose unverified credentials are handled explicitly: caller-owned order ids, recovery outcomes, and response verification have no silent shortcuts.
Disclaimer. This SDK is an optional helper provided free of charge under the MIT License, "as is", without warranty of any kind. Anis (Aniscom for Technical Services) accepts no responsibility or liability for its use or for any loss arising from it. You remain responsible for your own integration — recording orders before you send them, recovery, key custody and testing. The source code is public: read it to understand exactly what it does before you rely on it. You do not need an SDK — you can integrate directly with the Anis Partner API using the documentation at https://developers.anis.ly.
pip install anis-partners==2.3.0
# or
uv add anis-partners==2.3.0
from anis_partners import AnisPartnersClient, ClientOptions, PemP256Signer
options = ClientOptions("https://<authority Anis gave you>")
signer = PemP256Signer.from_pem_file("/secure/partner-key.pem").for_key("<active key id>")
with AnisPartnersClient(options, signer) as anis:
profile = anis.profile.get()
wallets = list(anis.wallets.list()) # follows every cursor page
print(profile.application.id if profile.application else "No application")
print(f"Found {len(wallets)} wallets")
if wallets:
print(wallets[0].balance.currency)
The async client returns the same results. Run the whole flow inside an event loop:
import asyncio
from anis_partners import AsyncAnisPartnersClient, ClientOptions, PemP256Signer
async def main() -> None:
options = ClientOptions("https://<authority Anis gave you>")
signer = PemP256Signer.from_pem_file("/secure/partner-key.pem").for_key("<active key id>")
async with AsyncAnisPartnersClient(options, signer) as anis:
profile = await anis.profile.get()
wallets = [wallet async for wallet in anis.wallets.list()]
print(profile.application.id if profile.application else "No application")
print(f"Found {len(wallets)} wallets")
if __name__ == "__main__":
asyncio.run(main())
For order creation and recovery, persist the operation id and exact request before calling the SDK. See Orders and recovery for the complete outcome rules.
anis.meter_charges lists packages (get_meter_packages) and charges (get_meter_charges), creates a charge under your own operation id, and reads the receipt, tokens, taxes and refund state. A lost answer is recovered with resume using the same id and body. idempotency_conflict on a create or resume is an unknown outcome (the charge may already be placed), never "not placed": read the operation with get first. get of an operation closed with a recorded refusal raises the typed error with is_replayed set. A failed charge whose refund is still pending is not final.anis.direct_recharge_products lists products, shows their recipient fields and locations, and quotes a payout in LYD or in the foreign amount. anis.direct_recharges creates, resumes and reads a direct recharge, and update_recipient corrects the recipient while the direct recharge is paused (suspendedDataError). It returns the same DirectRechargeProcessing result as a 202 create, with the DirectRechargeAccepted body in recharge and the signed location header on the result, without a direct recharge body. Read the operation later or wait for its webhook.anis.webhook_endpoint sets, reads and tests your endpoint; anis.webhook_events lists deliveries and asks for one again. PartnerWebhookVerifier checks the signature, your URL and your application over the raw bytes before anything is read. See Webhooks.Creating a meter charge or a direct recharge uses the same rules as an order: persist the operation id and exact request first, and resume with the same id. Changing the endpoint, correcting a recipient, sending a test and asking for redelivery are signed changes that are never retried automatically.
This is the beginning of the README. Read the rest at the original. Read the full README ↗