user_id)
that you set once on the client. Memory files are scoped to a namespace you
choose, shared by the API key. See
Memory namespaces.
Building in JavaScript or TypeScript? The JavaScript SDK
tracks the same API.
Quickstart
Task-by-task examples, each with runnable code on GitHub.
Guides
Concepts behind capabilities, memory namespaces, and tool-round caps.
Use cases
Recipes that show what a capability changes.
Reference
Every resource, model, event, and exception.
GitHub
Source, issues, and the full
examples/ directory.API reference
The HTTP endpoints the SDK calls, with a live playground.
Package
) ·
import
cominty-sdk (cominty_sdk · Python 3.9+ · style async-only
(httpx), fully typed.Install
1.2.0 or later. To require it, use pip install "cominty-sdk>=1.2.0".
Authenticate
You need two credentials, both from platform.cominty.ai:1
Get your API key
Open the API keys page and create a key. A key created now starts with
sk-cmt-. Copy it when you create it: it is shown once. Use the string
as is. Do not add a second sk-cmt- prefix. A key created before the
prefix existed has no sk-cmt- and still works.2
Get your user id
Open your avatar → Profile. It looks like
user_31HPTBuBvX20xlQNAbvxjOxPbKB.3
Export both
AsyncCominty() picks them up automatically. No arguments
needed.agent_id from platform.cominty.ai/agents
(for example __cominty_agents::agent.chat). See
Built-in agents for what Chat, Hive, and Planner can do.
Your first call
Core concepts
Client: one user per client
Client: one user per client
AsyncCominty is bound to a single user_id, validated at construction.
Chat and thread requests send it. Memory requests do not. Resource methods
never take user_id. Use it
as an async context manager (async with) or call await client.close()
when done. See Client for all settings.Resources: chat, threads, memory, and configuration
Resources: chat, threads, memory, and configuration
client.chat starts and continues conversations, streams progress,
cancels or exports a message, and uploads/downloads files.
client.threads lists, fetches, updates, and archives threads.
client.memory creates, lists, reads, updates, and deletes memory files in
a namespace you choose. See Memory namespaces and
Resources.Five more resources configure the organization (SDK 1.2.0):
client.mcp lists MCP integrations, client.agents manages custom agents
and their models, client.skills manages skills, client.sources turns
local files into an indexed source, and client.documents resolves a cited
document. See Custom agents,
Skills, and Sources.The API key: an admin of its organization
The API key: an admin of its organization
An API key acts as an admin of its own organization. What it creates is
owned by the user who created the key. It never sees another member’s
private agents, skills, or drives, and a read by id raises
NotFoundError.
See What an API key can do.Runs: the assistant's in-progress reply
Runs: the assistant's in-progress reply
chat.start and chat.send return a run: the assistant’s reply as it
is being produced. Iterate it for live progress events, or just
await run.text() for the final answer. A run’s stream is single-use. See
The run handle.Capabilities: what the agent can use
Capabilities: what the agent can use
Web search, document search, MCP connections, skills, media generation, and
memory are capabilities. They follow the agent’s setup by default. Change
them for a whole thread with
thread_capabilities (chat.start only), or for
one message with message_scope. See
Capabilities and the
reference.Configuration
Resolution order is explicit argument → environment variable → default. The
SDK does not auto-load
.env files.
api_token and COMINTY_API_KEY hold the key string exactly as the platform
gave it to you, sk-cmt-... included. A wrong or archived key comes back as a
403 and raises PermissionError. For the detail text of each case, see
Authentication errors.