Claude dbt Package
This dbt package transforms data from Fivetran's Claude connector into analytics-ready tables covering API cost reporting, message usage, Claude Code activity, and enterprise user management.
Resources
- Number of materialized models¹: 30
- Connector documentation
- dbt package documentation
- dbt Core™ supported versions
>=1.3.0, <3.0.0
What does this dbt package do?
This package enables you to understand Claude API cost and usage, Claude Code developer activity, and enterprise user cost and engagement at your company. It allocates organization-level cost down to the API key that consumed it, joins per-user enterprise cost to per-user token usage, and rolls up cost, usage, and product activity into a single summary per enterprise user.
This package is also designed to roll up alongside Fivetran's OpenAI dbt package into the AI Reporting package, which combines Claude and OpenAI data into unified, cross-vendor AI usage and cost reporting models.
Output schema
Final output tables are generated in the following target schema:
<your_database>.<connector/schema_name>_claude
Final output tables
By default, this package materializes the following final tables:
| Table | Description |
|---|---|
| claude__platform_cost_usage_report | Organization cost allocated down to the API key that consumed it, joined with API message usage. One row per API key, day, model, cost type and token type. Example Analytics Questions:
|
| claude__enterprise_cost_usage_report | Enterprise per-user cost joined to per-user token usage. One row per actor, day, product, model, cost type and token type. Example Analytics Questions:
|
| claude__code_report | Claude Code activity, one row per actor, day, terminal type and customer type. Example Analytics Questions:
|
| claude__user_summary | One row per enterprise actor, summarizing cost, usage and product activity over two windows: all time and the current calendar month. Example Analytics Questions:
|
¹ Each Quickstart transformation job run materializes these models if all components of this data model are enabled. This count includes all staging, intermediate, and final models materialized as view, table, or incremental.
Prerequisites
To use this dbt package, you must have the following:
- At least one Fivetran Claude connection syncing data into your destination.
- A BigQuery, Snowflake, Redshift, PostgreSQL, Databricks, or DuckDB destination.
How do I use the dbt package?
You can either add this dbt package in the Fivetran dashboard or import it into your dbt project:
- To add the package in the Fivetran dashboard, follow our Quickstart guide.
- To add the package to your dbt project, follow the setup instructions in the dbt package's README file to use this package.
How is this package maintained and can I contribute?
Package Maintenance
The Fivetran team maintaining this package only maintains the latest version of the package. We highly recommend you stay consistent with the latest version of the package and refer to the CHANGELOG and release notes for more information on changes across versions.
Contributions
A small team of analytics engineers at Fivetran develops these dbt packages. However, the packages are made better by community contributions.
We highly encourage and welcome contributions to this package. Learn how to contribute to a package in dbt's Contributing to an external dbt package article.