Skip to main content
Pre-release

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 113 operations, including the 64 operations published by Stainless and 49 additive operations generated from the checked-in OpenAPI document.

The September 2026 schema adds client.session_configs.list() and client.session_configs.retrieve(id), premium usage settings, workbench tool-execution controls, and trigger egress overrides. Generated public request and response types include new fields while retaining existing Stainless declarations.

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 from_env when configuration must come from a specific mapping instead of os.environ:

client = Composio.from_env(config, environment="staging")

Explicit keyword arguments replace mapped values. The factory recognizes COMPOSIO_API_KEY, COMPOSIO_USER_API_KEY, COMPOSIO_ORG_API_KEY, COMPOSIO_BASE_URL, and COMPOSIO_CUSTOM_HEADERS. Clients created with with_options() keep using the resolved mapping and do not fall back to ambient values.

Identify the calling product

A product built on the client passes a ClientIdentity instead of setting headers by hand:

from composio_client import ClientIdentity, Composio

client = Composio(
    identity=ClientIdentity(product="composio", version="0.9.0", source="PYTHON_SDK", framework="openai"),
)

product and version are sent as x-client-provenance and x-client-version (version also as x-sdk-version); source, framework and runtime as x-source, x-framework and x-runtime. The library headers (x-client-library, x-client-library-version, x-client-language) are the package's own and are refused in default_headers, COMPOSIO_CUSTOM_HEADERS and request_options headers; once identity is set, so is every identity header. A refused name raises ComposioError. ClientIdentity is frozen and validates that every value is non-empty printable ASCII.

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.

Metadata

Release files for composio-client 2.0.0rc17

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

Source distribution (sdist)

Source distribution for composio-client 2.0.0rc17
File Size Uploaded Provenance Actions
composio_client-2.0.0rc17.tar.gz 620.9 kB With provenance Details for composio_client-2.0.0rc17.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for composio-client 2.0.0rc17
File Interpreter ABI Platform Actions
composio_client-2.0.0rc17-py3-none-any.whl Python 3 none any Details for composio_client-2.0.0rc17-py3-none-any.whl

Total release size: 1.1 MB

Release files / composio_client-2.0.0rc17.tar.gz

Download URL composio_client-2.0.0rc17.tar.gz
Size 620.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9e6f3df1910518f4cd7c65c9a573986e11f0dbe02be0ec72175616fc3d7a45b1
BLAKE2b-256 checksum
How to use checksums
4f5b46db80356fd2fe5c4b47256bf2f8f8d0821609eafb6f9016a36c4aceb90f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release files / composio_client-2.0.0rc17-py3-none-any.whl

Download URL composio_client-2.0.0rc17-py3-none-any.whl
Size 448.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf12b509818fe077d58def2e5ca9c6931c5e7646e43506283204e3b823207f3a
BLAKE2b-256 checksum
How to use checksums
0538078d855a7c0f7edd24786e184a032a14333042367f0434b9beab5ecfa16e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Security for composio-client 2.0.0rc17

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for composio_client-2.0.0rc17.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
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