Installation and setup
Composio() needs COMPOSIO_API_KEY. It also reports SDK usage to Composio's telemetry service by default, which allow_tracking=False turns off.
pip install composio 0.21.1
Install the SDK, the OpenAI client used in the project lesson, and pytest.
pip install "composio==0.21.1" openai pytestCalls to Composio's servers need COMPOSIO_API_KEY from the Composio dashboard. The course shows those calls without running them against a real account, so the key is only needed when you connect your own apps.
The key check and telemetry
from composio import Composio
composio = Composio()Without a key the SDK stops at construction with ApiKeyNotProvidedError, before any request. With one, it can list toolkits, create sessions and execute tools for your project.
import inspect
from composio.core.models import _telemetry, base
print(_telemetry.METRIC_ENDPOINT)
print(_telemetry.ERROR_ENDPOINT)
print(base.allow_tracking.get())
print("if not allow_tracking.get():" in inspect.getsource(base.trace_method))From the SDK's source: trace_method wraps SDK methods and, while allow_tracking is True, queues an event with the method's name and timing for telemetry.composio.dev; errors go to a second endpoint. It defaults to True. Pass allow_tracking=False to Composio(...) to turn it off, which every example here does. A customer's security review will ask where these requests go.
from composio import Composio
composio = Composio(allow_tracking=False) # COMPOSIO_API_KEY from the environment- Read
_telemetry.pyand list the fields an event carries. - Find where
allow_trackingis set incomposio/sdk.py. - Print
inspect.signature(Composio.__init__).
Little by little, you're building something great.