# Pydantic AI (/docs/integrations/pydantic-ai)



Pydantic AI is a **Python** integration. Install the extra and init as usual — see
[init parameters](/docs/sdk/init). TokenPolice meters each model request and attributes it to
Pydantic AI, so one dashboard entry represents the whole call even though an OpenAI / Anthropic /
Gemini client runs underneath. Tool calls get their own steps in the trace automatically.

```bash
pip install "token-police[pydantic-ai]"
```

<Callout type="info">
  The integration is version-tolerant: if a particular Pydantic AI / provider combination can't be
  wired, it fails open — your app keeps running, that call just isn't metered. Nothing to
  configure.
</Callout>

<Callout type="warn" title="Reroute does not switch the model on Pydantic AI">
  A Reroute rule does not switch the model on Pydantic AI — those calls still run on the original
  model. Metering and blocking work normally. See [Actions](/docs/rules/actions#reroute).
</Callout>

## Next [#next]

<Cards>
  <Card title="Wrapping your app" href="/docs/sdk/wrapping" description="Give runs an identity with session / workflow." />

  <Card title="Support matrix" href="/docs/integrations/matrix" description="Every provider and framework at a glance." />
</Cards>
