Skip to main content
The Cominty Python SDK wraps the chat API: start a conversation with an agent, stream its progress, continue the thread, and manage threads. Everything is scoped to a single end user (user_id) that you set once on the client.

Quickstart

Task-by-task examples, each with runnable code on GitHub.

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 cominty-sdk (PyPI) · import cominty_sdk · version 0.3.0 · Python 3.9+ · style async-only (httpx), fully typed.

Install

Authenticate

You need two credentials, both from platform.cominty.ai:
1

Get your API key

Open the API keys page and create a key.
2

Get your user id

Open your avatar → Profile. It looks like user_31HPTBuBvX20xlQNAbvxjOxPbKB.
3

Export both

With both set, AsyncCominty() picks them up automatically — no arguments needed.
Pick an agent_id from platform.cominty.ai/agents (for example __cominty_agents::agent.chat).

Your first call

Core concepts

AsyncCominty is bound to a single user_id, validated at construction and applied to every request. 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.
client.chat starts and continues conversations and streams progress. client.threads lists, fetches, updates, and archives threads — all scoped to the client’s user. See Resources.
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.
Web search, company-document retrieval, and any MCP servers connected to the agent are enabled automatically. You only ever turn things off, with disabled_tools. See disabled_tools.

Configuration

Resolution order is explicit argument → environment variable → default. The SDK does not auto-load .env files.