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

# Expense Codes: Tag Every AI Dollar to a Client Matter

> Attach your firm's matter number or billing code to each ParleHub project so AI spend exports with the right client code — ready for your billing system.

When AI spend lands on a provider invoice, it arrives as a single line item with no client attribution. Without a way to tag that cost at the source, it falls into overhead — and recovering it from clients requires manual reconciliation after the fact. ParleHub expense codes solve this by letting you attach your firm's own matter number, engagement code, or billing reference directly to each project. That code travels with every token through to your usage export, so the AI cost reaches your billing system already labeled.

## Setting an Expense Code

You can attach an expense code when you create a project or add one at any time afterward.

<Steps>
  <Step title="Set the code at project creation">
    When creating a new project, enter your code in the **Expense Code** field on the creation form. This is optional but recommended — setting it early means all spend is tagged from day one.
  </Step>

  <Step title="Update the code in Settings">
    To add or change a code on an existing project, open the project and go to **Settings → General**. Edit the **Expense Code** field and click **Save**.
  </Step>
</Steps>

<Note>
  Expense codes are free-form text — ParleHub does not validate the format or check for uniqueness. Use exactly the format your billing or matter management system expects.
</Note>

There is no required format. Use whatever matches your billing system:

<CardGroup cols={3}>
  <Card title="Engineering code" icon="code" href="/cost/usage-analytics">
    `ENG-4417`
  </Card>

  <Card title="Client matter" icon="briefcase" href="/cost/usage-analytics">
    `ASHWORTH-MA`
  </Card>

  <Card title="Project number" icon="hashtag" href="/cost/usage-analytics">
    `2024-PROJ-001`
  </Card>
</CardGroup>

<Tip>
  If your firm uses a matter number format (e.g. `12345.001`), use that exact format so the CSV import into your billing system requires no transformation.
</Tip>

## How the Code Flows

Once set, the expense code is automatically attached to every usage record generated by that project. You do not need to re-enter it or tag individual conversations — the code follows the project.

When you export usage data, every row for that project includes the expense code in a dedicated column. Feed that export into your billing system and the AI cost appears alongside other client expenses, already coded, with no manual matching required.

<Info>
  If you update a project's expense code mid-engagement, new usage records reflect the updated code. Historical records retain the code that was active when the spend occurred.
</Info>

## Exporting with Expense Codes

<Steps>
  <Step title="Navigate to Analytics">
    Go to **Analytics** from the main sidebar, or open **Org Settings → Usage & Billing → Analytics**.
  </Step>

  <Step title="Open Export">
    Click the **Export** tab at the top of the Analytics page.
  </Step>

  <Step title="Choose your date range and projects">
    Select the date range and filter to specific projects if needed. Leave the project filter empty to export all projects.
  </Step>

  <Step title="Download CSV">
    Click **Download CSV**. The file is ready immediately for date ranges up to 90 days. Longer ranges generate an email download link within a few minutes.
  </Step>
</Steps>

Each row in the export includes:

| Column          | Description                          |
| --------------- | ------------------------------------ |
| `date`          | UTC date of the usage                |
| `project_name`  | Display name of the project          |
| `expense_code`  | The expense code set on the project  |
| `person`        | Name and email of the team member    |
| `provider`      | AI provider (e.g. Anthropic, OpenAI) |
| `model`         | Specific model used                  |
| `input_tokens`  | Tokens in the prompt                 |
| `output_tokens` | Tokens in the model response         |
| `cost_usd`      | Cost in US dollars                   |
