This release is a pre-release and may not be stable for production use.
composio-client for Python
composio-client replaces the Stainless-generated package without requiring you to rewrite existing
1.43.x calls.
from composio_client import Composio
client = Composio(api_key="ak_...")
session = client.tool_router.session.create(user_id="user@example.com")
result = client.tool_router.session.execute(
session.session_id,
tool_slug="GITHUB_CREATE_ISSUE",
arguments={"owner": "composiohq", "repo": "composio", "title": "Example"},
)
The owned client preserves the public Python contract from composio-client==1.43.0 and adds the
rest of the v3.1 API. You get all 104 released operations, including the 64 operations published by
Stainless and 40 additive operations generated from the checked-in OpenAPI document.
Install the client
pip install composio-client
With uv:
uv add composio-client
Set COMPOSIO_API_KEY or pass api_key when you construct the client.
Use the async client
import asyncio
from composio_client import AsyncComposio
async def main() -> None:
async with AsyncComposio(api_key="ak_...") as client:
session = await client.tool_router.session.create(user_id="user@example.com")
print(session.session_id)
asyncio.run(main())
Read raw response metadata
Every released resource keeps the Stainless raw and streaming accessors:
from composio_client import Composio
client = Composio(api_key="ak_...")
response = client.tool_router.session.with_raw_response.retrieve("sess_123")
print(response.status_code)
session = response.parse()
with client.tool_router.session.with_streaming_response.retrieve("sess_123") as response:
print(response.headers)
The async resource exposes the corresponding async response objects and context managers.
Handle API errors
The exception hierarchy matches the Stainless package. Existing except blocks keep working:
from composio_client import Composio, NotFoundError
client = Composio(api_key="ak_...")
try:
client.tool_router.session.retrieve("missing")
except NotFoundError as error:
print(error.status_code)
Migrate pre-release owned-client calls
Earlier owned-client builds accepted aggregate body, query, and headers values. Those calls
remain valid during the transition:
client.tool_router.session.create({"user_id": "user@example.com"})
client.tool_router.session.config_history("sess_123", query={"limit": 25})
Prefer the flat Stainless form in new code:
client.tool_router.session.create(user_id="user@example.com")
client.tool_router.session.config_history("sess_123", limit=25)
See the Python migration guide for compatibility details and the stricter credential transport rules.
Develop the Python package
Generate from the repository root:
pnpm generate:python
pnpm codegen:check
Run Python checks from python/:
uv run ruff check
uv run ruff format --check
uv run mypy src scripts
uv run pytest
uv run python scripts/check_stainless_compatibility.py
uv build
uv run python scripts/check_stainless_compatibility.py --wheel dist/*.whl
The normal compatibility check is offline. It reads the committed 1.43.0 fixture and does not
install or call the Stainless client.
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 composio_client-2.0.0rc1.tar.gz.
File metadata
- Download URL: composio_client-2.0.0rc1.tar.gz
- Upload date:
- Size: 387.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f5e0ddef05f976b4ab7e7a69b49b1cdc4b7efc1c3088a692020da108d956b23
|
|
| MD5 |
ff81435cfb4337f844a439fc8790353a
|
|
| BLAKE2b-256 |
616e22aa29ac1f9504f7a15e2034fa7132907337f8e4e2446f0277962b6dde61
|
Provenance
The following attestation bundles were made for composio_client-2.0.0rc1.tar.gz:
Publisher:
release.yml on ComposioHQ/composio-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
composio_client-2.0.0rc1.tar.gz -
Subject digest:
6f5e0ddef05f976b4ab7e7a69b49b1cdc4b7efc1c3088a692020da108d956b23 - Sigstore transparency entry: 2467362900
- Sigstore integration time:
-
Permalink:
ComposioHQ/composio-client@0b2834e8528bf309f713d5d943e815ace79b36a6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ComposioHQ
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0b2834e8528bf309f713d5d943e815ace79b36a6 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file composio_client-2.0.0rc1-py3-none-any.whl.
File metadata
- Download URL: composio_client-2.0.0rc1-py3-none-any.whl
- Upload date:
- Size: 318.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59beb5be06b3fb4aafb464f994443f7bfbea4dcf6126b09ce0363186aae0605e
|
|
| MD5 |
37772f58885f46ca7359650a251fc04e
|
|
| BLAKE2b-256 |
23337f7c6e4f8010a882189fbeb65b1a05a10dec221b0b3e976d30c0851ee058
|
Provenance
The following attestation bundles were made for composio_client-2.0.0rc1-py3-none-any.whl:
Publisher:
release.yml on ComposioHQ/composio-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
composio_client-2.0.0rc1-py3-none-any.whl -
Subject digest:
59beb5be06b3fb4aafb464f994443f7bfbea4dcf6126b09ce0363186aae0605e - Sigstore transparency entry: 2467363011
- Sigstore integration time:
-
Permalink:
ComposioHQ/composio-client@0b2834e8528bf309f713d5d943e815ace79b36a6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ComposioHQ
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0b2834e8528bf309f713d5d943e815ace79b36a6 -
Trigger Event:
workflow_dispatch
-
Statement type: