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.
Links
- Integration guide (written for coding agents): https://api.trycaspianai.com/SKILL.md
- Docs: https://www.trycaspianai.com/docs/
- Source and runnable examples for every channel:
https://github.com/TryCaspian/caspian-sdk (
examples/)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file caspian_sdk-1.0.1.tar.gz.
File metadata
- Download URL: caspian_sdk-1.0.1.tar.gz
- Upload date:
- Size: 168.6 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c8295bce9d14fe0b3622ec0d452a758b2f21217235f0b29f8aac026bf468c60
|
|
| MD5 |
e170540cefe7ce470dba5d8bceebb6dc
|
|
| BLAKE2b-256 |
de96e375c725cbcdb1bc91764d577381f878c419db492a103cf97647e677001f
|
File details
Details for the file caspian_sdk-1.0.1-py3-none-any.whl.
File metadata
- Download URL: caspian_sdk-1.0.1-py3-none-any.whl
- Upload date:
- Size: 102.4 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2fdfe72d05976a61995be6877af21ed0e3dc0d238e4c2fc413b45c5a9bda9c2
|
|
| MD5 |
3a3cd1c4924340041a78164fd567a0f7
|
|
| BLAKE2b-256 |
b47777a7b5649b9ef6dd32938ef2bdef9d81319915c9f6fbe51badda315b2773
|