TokenPolice
Docs
Integrations

CrewAI

CrewAI is a Python integration — install its own extra and TokenPolice meters every model call your crews make.

CrewAI is a Python integration. Install the extra and init as usual — see init parameters. There is no CrewAI-specific code: once the extra is in place, your crews are metered and enforced like any other traffic.

pip install "token-police[crewai]"

CrewAI has its own extra and is deliberately not part of token-police[all]: CrewAI supports Python 3.10–3.13 but not 3.14 yet, and keeping it out is what lets [all] install everywhere. Install [crewai] on its own, or alongside [all].

Install caveats

  • Installs may print a benign resolver warning — safe to ignore.
  • Strict resolvers (uv, Poetry, pip-tools) sometimes need a two-step install: CrewAI first, then token-police[crewai].
  • Set CREWAI_DISABLE_TELEMETRY=true to quiet CrewAI's own tracing noise. Never set OTEL_SDK_DISABLED=true to silence it — that disables TokenPolice too, and nothing gets metered.

Tool calls

Tool spans are manual with CrewAI: the model calls a crew makes are metered and enforced normally, but the tool steps themselves don't get their own entry in the trace.

Next