AI Reporting dbt Package
This dbt package combines data from Fivetran's Claude and OpenAI dbt packages into unified, cross-vendor AI usage and cost reporting models.
Resources
- Number of materialized models¹: 4
- Connector documentation
- dbt package documentation
- dbt Core™ supported versions
>=1.3.0, <3.0.0
What does this dbt package do?
This package creates unified reporting models for AI cost, coding-assistant activity, enterprise (seat-level) usage, and per-user summaries across different vendors.
Currently supports the following Fivetran connectors:
The individual Claude and OpenAI tables have additional platform-specific metrics better suited for deep-dive analyses.
Output schema
Final output tables are generated in the following target schema:
<your_database>.<target_schema>_ai_reporting
Final output tables
By default, this package materializes the following final tables:
| Table | Description |
|---|---|
ai_reporting__cost_report | One row per platform, source_relation, date_day, account (workspace for Claude, project for OpenAI), model, cost_type, and token_unit_type. Combines Claude and OpenAI cost and token usage; cost is real USD on both platforms. Example Analytics Questions:
|
ai_reporting__code_report | One row per platform, source_relation, date_day, and user. Combines Claude Code and Codex CLI lines-of-code and token usage. Claude cost is always in USD when claude__using_claude_code_usage_report_model_breakdown is enabled; OpenAI's estimated_cost is null unless you set openai__code_report_credit_rate to convert its credits into an estimated USD figure, and OpenAI credits are always available in their own column.Example Analytics Questions:
|
ai_reporting__enterprise_report | One row per platform, source_relation, date_day, actor, model, and product. Combines Claude and OpenAI enterprise (seat-level) usage; cost is populated only on Claude rows. Example Analytics Questions:
|
ai_reporting__user_summary | One row per platform, source_relation, and user. Combines lifetime and month-to-date usage summaries; tokens and active days are populated on both platforms, cost only on Claude. 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.
Materialized Models
Each Quickstart transformation job run materializes the following model counts for each selected connector. The total model count represents 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/Anthropic connection or Fivetran OpenAI connection syncing data into your destination. Each platform's models are conditionally enabled, so the package builds with only one platform active.
- 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.
Opinionated Decisions
Building a package that combines two independently designed source packages required a few opinionated calls, for example how we handle Claude's USD cost alongside OpenAI's non-USD credit unit, and how we roll up Claude Code's grain to match Codex CLI's. We've documented these choices in DECISIONLOG.md and welcome feedback on them.
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.