Python SDK: CrewAI Integration
Keito does not ship KeitoTaskCallback or a keito.integrations.crewai module. Wrap the run or task you choose to measure with ordinary SDK methods.
Record one crew run
Define the application helper in Python Agent Integration, then wrap your configured crew:
from keito import Keito
from keito_tracking import record_completed_work
# crew is configured by your application using CrewAI.
with Keito() as client:
result = record_completed_work(
client,
project_id="YOUR_PROJECT_ID",
task_id="YOUR_TASK_ID",
spent_date="2026-10-30",
work=lambda: crew.kickoff(inputs={"topic": "Implementation review"}),
)
This records the whole run once, after success. To record separate tasks, measure each task at one chosen lifecycle boundary and use a distinct operation ID. Do not record both every nested task and the entire run unless you intentionally want overlapping time.
Identity and costs
A key records work as the Keito identity it belongs to. A CrewAI agent’s role name in metadata does not make it another Keito user or grant permission to track on their behalf.
Record provider costs separately through Expenses. Your application chooses cost attribution, category, billability and failure handling. SDK calls do not automatically capture token usage or infer prices.