Skip to main content

allternit-platform

Python SDK for the Allternit Platform API: agents, conversations, numbers, messaging, webhooks and usage.

Not yet published to PyPI. Publishing needs Eoj's OK. Until then, install it from this repo (see below).

  • Python 3.9+, standard library only.
  • Typed responses (TypedDicts) and one method per API operation, generated from cmd/allternit-cloud-api/openapi/platform-v1.yaml.
  • Sends an Idempotency-Key on every POST (random unless you pass one).
  • Errors are typed exceptions (NotFoundError, RateLimitError, …).
  • Cursor pagination helpers and streaming replies.

Install (from the repo, until it is published)

pip install /path/to/allternit/sdk/platform-python

Quickstart

from allternit_platform import AllternitPlatform, MessageDelta

client = AllternitPlatform()  # reads ALLTERNIT_API_KEY (alt_test_... or alt_live_...)

account = client.accounts.create(name="Lakeside Dental")
agent = client.agents.create(
    account_id=account["id"],
    name="Front desk",
    instructions="Answer questions about Lakeside Dental and book cleanings.",
)
conversation = client.conversations.create(agent["id"])

# Whole reply
reply = client.conversations.send_message(conversation["id"], content="Are you open Saturday?")
print(reply["content"])

# Streamed reply
stream = client.conversations.stream(conversation["id"], content="Can I book a cleaning?")
for event in stream:
    if isinstance(event, MessageDelta):
        print(event.delta, end="", flush=True)
print(stream.final_message["id"])

Errors

from allternit_platform import APIError, NotFoundError, RateLimitError

try:
    client.agents.get("agent_missing")
except NotFoundError as e:
    print(e.code)  # "agent_not_found"
except RateLimitError as e:
    print(f"retry in {e.retry_after}s")
except APIError as e:
    print(e.status, e.type, e.code, e.param, e.request_id)

503 with code == "runtime_starting" (an InternalServerError) means the project's hosted runtime is starting; retry after a few seconds.

Pagination

page = client.agents.list(limit=50)       # {"data": [...], "has_more": ..., "next_cursor": ...}
for agent in client.agents.list_all():   # every agent, page by page
    ...

Options

AllternitPlatform(api_key=None, *, base_url=None, timeout=60.0, default_headers=None). Every method takes timeout= and extra_headers=; POST methods also take idempotency_key=. Parameters whose names are Python keywords get a trailing underscore (from_=).

Regenerate and test

python3 scripts/platform-sdk/generate.py           # from the repo root, after editing platform-v1.yaml
python3 scripts/platform-sdk/generate.py --check   # fails if the generated code is stale
cd sdk/platform-python && python3 -m unittest discover -s tests

allternit_platform/_generated.py is generated; edit the other modules by hand.

Metadata

Release files for allternit-platform 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for allternit-platform 0.3.0
File Size Uploaded Provenance Actions
allternit_platform-0.3.0.tar.gz 26.7 kB With provenance Details for allternit_platform-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for allternit-platform 0.3.0
File Interpreter ABI Platform Actions
allternit_platform-0.3.0-py3-none-any.whl Python 3 none any Details for allternit_platform-0.3.0-py3-none-any.whl

Total release size: 51.4 kB

Release files / allternit_platform-0.3.0.tar.gz

Download URL allternit_platform-0.3.0.tar.gz
Size 26.7 kB
Tags Source
SHA-256 checksum
How to use checksums
97477c5b14c1c334b3a8eb2b80a7e2a626db8746e4bc0bd46684b8c5e87b6d92
BLAKE2b-256 checksum
How to use checksums
82bac367e732cdb087c523b835f14bf37cc8296e8e7dfcc5b34625be6a928c9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / allternit_platform-0.3.0-py3-none-any.whl

Download URL allternit_platform-0.3.0-py3-none-any.whl
Size 24.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7cfa3efd9d91d87d9ebd6db0efdb9b67405900a43bc3ca62a2653e2eb2d9f7a
BLAKE2b-256 checksum
How to use checksums
6b8b1214a768be93e15edd81d09e8b94a4d3b7816148c1f5095b4b1981ba113b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for allternit-platform 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for allternit_platform-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page