> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blitzy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Usage Metering

> Understand how platform usage is tracked and billed across projects, teams, and organizations

Blitzy tracks platform usage for billing based on code generation and onboarding activities. Usage metrics aggregate at different organizational levels depending on your subscription type, enabling administrators to monitor consumption and manage quotas.

<Note>
  **Jump to:** [Metered Activities](#metered-activities) | [Delta Ingestion](#delta-ingestion) | [Aggregation](#usage-aggregation-by-subscription) | [Team Attribution](#team-attribution) | [Quotas](#quotas--overages) | [Summary](#usage-summary)
</Note>

## Metered Activities

### Code Generation

Usage is recorded when AI successfully generates code for your projects:

| Metric              | Description                                   |
| ------------------- | --------------------------------------------- |
| **Lines Generated** | Total lines of code added, edited, or removed |
| **Files Touched**   | Number of files modified during generation    |
| **Hours Saved**     | Estimated developer time saved                |

<Note>
  Each pull request includes both the Agent Action Plan (AAP) and the Project Guide under `blitzy/documentation`. Only the Project Guide contributes to your LoC total - the AAP is not counted toward Lines Generated.
</Note>

**When it counts:** Only successful code generation tasks contribute to usage. Failed or incomplete operations are not billed.

### Code Onboarding

Usage is recorded when you successfully onboard an existing codebase:

| Metric              | Description                                  |
| ------------------- | -------------------------------------------- |
| **Lines Onboarded** | Total lines of code imported into the system |
| **Files Onboarded** | Number of files processed during onboarding  |

**When it counts:** Usage is recorded upon successful onboarding completion and project graph updates.

## Delta Ingestion

Blitzy ingests code as a delta - only the lines that changed since the last ingested commit are counted. Forking a branch, renaming a branch, or creating a new project on a different branch of the same repository does not re-count existing code. Only new or modified lines contribute to your LoC total.

This means two projects on different branches of the same repo share a common baseline. Each project is billed only for what it changes, not for the full codebase.

<Warning>
  Rebasing or force-pushing a branch rewrites commit history. When history is rewritten, Blitzy can no longer calculate a clean diff against the previous ingestion point. The next ingestion may re-count lines that were already ingested, temporarily inflating your LoC total.
</Warning>

## Usage Aggregation by Subscription

Usage visibility and aggregation differ by subscription tier:

| Subscription   | Project | User | Team | Company |
| -------------- | ------- | ---- | ---- | ------- |
| **Free**       | Yes     | Yes  | No   | No      |
| **Enterprise** | Yes     | Yes  | Yes  | Yes     |

Enterprise subscriptions provide comprehensive visibility across all organizational levels, enabling administrators to analyze usage patterns and optimize resource allocation.

## Team Attribution

### Attribution Requirements

For Enterprise subscriptions, usage is attributed to teams when both conditions are met:

1. The user is a member of the team
2. The team has access to the project

If either condition is false, usage is tracked only at the project and user levels.

### Multiple Team Membership

When a user belongs to multiple teams with access to the same project:

* Usage is attributed to each qualifying team independently
* Each team's metrics reflect the full usage amount
* This enables accurate tracking for shared project scenarios

**Example:** A developer on both "Frontend Team" and "Platform Team" generates code on a shared project. The usage appears in both teams' metrics.

### Attribution Hierarchy

Usage flows through the following levels:

```
Project → User → Team(s) → Company
```

| Level       | What It Tracks                                           |
| ----------- | -------------------------------------------------------- |
| **Project** | All activity on a specific project                       |
| **User**    | All activity by a specific user across projects          |
| **Team**    | All activity by team members on team-accessible projects |
| **Company** | All activity across the entire organization              |

### No Team Access Scenarios

| Scenario                           | Result                                       |
| ---------------------------------- | -------------------------------------------- |
| User has no team membership        | Usage tracked at project and user level only |
| User's teams lack project access   | Usage tracked at project and user level only |
| Enterprise with no qualifying team | Company-level tracking uses user's company   |

## Quotas & Overages

### Subscription Quotas

Each subscription includes quotas for:

* **Lines Generated** - Maximum code generation capacity
* **Lines Onboarded** - Maximum codebase size for onboarding

### Overage Handling

When usage exceeds plan limits:

1. An overage record is created
2. Platform access continues uninterrupted
3. Overage amounts are tracked separately for billing

Overages are categorized by type (generation vs. onboarding) and tracked with payment status.

<Note>
  Free users will have ingestion blocked if the selected codebase surpasses the current limit.
</Note>

## Excluded Activities

The following activities are not metered:

* Failed or incomplete operations
* File mapping and analysis
* Internal processing steps

Only completed code generation and onboarding operations count toward quotas.

## Usage Summary

| Activity                  | Metered? | Quota Applies? |
| ------------------------- | -------- | -------------- |
| Completed code generation | Yes      | Yes            |
| Completed code onboarding | Yes      | Yes            |
| Failed operations         | No       | No             |
| File analysis             | No       | No             |

## Related Guides

<CardGroup cols={2}>
  <Card title="Teams & Roles" icon="users" href="/administration/teams">
    Team membership and access control
  </Card>

  <Card title="Project Sharing" icon="share-nodes" href="/project-lifecycle/sharing">
    Project access and team collaboration
  </Card>
</CardGroup>
