allternit-platform is a client for the Platform API for Python 3.9+, using only the standard library.
The first PyPI release is waiting on PyPI publisher setup. Until
pip install finds it, install from the repository: pip install /path/to/allternit/sdk/platform-python.PaymentRequiredError (402, code == "payment_method_required") with err.url, the console billing page. See Billing.
Create a client
client.accounts, client.agents (also model keys), client.conversations, client.numbers, client.messaging, client.webhooks, client.usage. Path parameters are positional; body fields and query parameters are keyword arguments. Responses are dicts typed as TypedDicts.
from_). Bodies that are free-form objects take body={...}. Every method takes timeout= and extra_headers=. For a route the SDK doesn’t wrap yet: client.http.request("GET", "/v1/…").
Idempotency
EveryPOST carries an Idempotency-Key header. The SDK makes a random one per call; pass your own to make a retry safe across process restarts:
Errors
Non-2xx answers raise a subclass ofAPIError with status, type, code, message, param and request_id:
Network failures raise
APIConnectionError; a timeout raises APITimeoutError. Codes are listed in Errors.
Pagination
Streaming replies
stream.final_message holds the stored reply once the loop ends, and stream.until_done() reads to the end and returns it. An error event raises a typed APIError (for example code == "turn_failed"). timeout applies to each read, so a reply with a pause longer than the timeout raises APITimeoutError; the reply is still stored on the server.
Regenerating
The typed layer (allternit_platform/_generated.py) is generated from cmd/allternit-cloud-api/openapi/platform-v1.yaml: