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.
A project needs a card on file before it can do billable work; until then those calls raise PaymentRequiredError (402, code == "payment_method_required") with err.url, the console billing page. See Billing.

Create a client

Every API area is an attribute: 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.
Parameters whose names are Python keywords get a trailing underscore (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

Every POST carries an Idempotency-Key header. The SDK makes a random one per call; pass your own to make a retry safe across process restarts:
See Idempotency and limits.

Errors

Non-2xx answers raise a subclass of APIError 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: