Skip to main content

caspian-sdk

Give an agent an address on real messaging channels. One handler answers Telegram, Slack, Discord, email, SMS, WhatsApp, X and more — hosted through the Caspian gateway, or self-hosted straight against each platform with your own tokens.

pip install caspian-sdk

Version 1.0.0 is a new API. It replaces the legacy CommClient (0.6.x); see the migration note below.

Hosted: the gateway owns credentials

from caspian import Caspian

cx = Caspian(api_key="...")            # key from dashboard.trycaspianai.com
cx.channels.add("telegram", bot_token="...")   # telegram is BYO token

@cx.on_message({"overlap": "queue", "ack": "On it, one moment..."})
def handle(thread, msg, ctx):
    with thread.stream() as out:       # posts once, then edits as it writes
        out.append(answer(msg.text))

cx.run()                               # polls the gateway for inbound

Self-host: your process, your tokens, no gateway

cx = Caspian()
cx.channels.add("telegram", via="self-host", bot_token="...",
                webhook_url="https://your.server/telegram")

# from your own HTTP route:
results = cx.handle("telegram", request_body, request_headers)

Discord and Slack can receive over a held-open socket instead of a webhook — no public URL needed:

cx.channels.add("discord", via="self-host", bot_token="...")
cx.listen("discord")                   # pip install "caspian-sdk[discord]"

What a handler can do

thread.post, reply, send (unthreaded), send_media, send_blocks, typing, edit, react, pin, delete, forward, initiate (cold DM), schedule, and thread.stream() for replies that type themselves out. Rules take filters (channel, kind, command), an overlap policy (queue / debounce / drop / parallel) and an instant ack for channels with no typing indicator.

Your bot is data: cx.app.rules prints every predicate, policy and ack, so programs are inspectable and testable without a network.

Channels

telegram, slack, discord, email, sms, voice, whatsapp, messenger, imessage, x and linear self-host adapters ship in the package. Hosted mode covers any channel the gateway supports.

Optional extras: caspian-sdk[discord] and caspian-sdk[slack-socket] (websocket inbound).

Migrating from 0.6.x

The 0.6.x CommClient API is a different SDK. It remains published and its source is tagged legacy-sdk-0.6.x in the repository. New code should start here; there is no drop-in path between the two.

Metadata

Release files for caspian-sdk 1.0.2

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

Source distribution (sdist)

Source distribution for caspian-sdk 1.0.2
File Size Uploaded Provenance
caspian_sdk-1.0.2.tar.gz 169.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for caspian-sdk 1.0.2
File Interpreter ABI Platform
caspian_sdk-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 271.6 kB

Release files / caspian_sdk-1.0.2.tar.gz

Download URL caspian_sdk-1.0.2.tar.gz
Size 169.0 kB
Tags Source
SHA-256 checksum
How to use checksums
435a25f7b9a8c9ae0e8e804d6c7917cdbb787307757804a9f8cafbd4bdbf90cc
BLAKE2b-256 checksum
How to use checksums
d2112e6853ba7a3ad68c36da6099412925ed80c0a80f121b33a679bcbfc661ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / caspian_sdk-1.0.2-py3-none-any.whl

Download URL caspian_sdk-1.0.2-py3-none-any.whl
Size 102.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
97e40e984d945f063e67b970e154352a4b7a95e18cf9104c2026a0add9ad7d0e
BLAKE2b-256 checksum
How to use checksums
5321e614fc1069f7900cb1fde4d8b62257f0ba763d024c20a1f7127d62d8c5b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for caspian-sdk 1.0.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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