Spend Attribution

How do I chargeback AI spend to the right department or GL account?

AI spend attributed to the exact department, GL account, cost centre, and business unit that generated it — ready for your ERP, your board deck, or your client invoice. No spreadsheet. No manual allocation.

Cognocient attributes every AI call to the department, GL account, and cost centre that generated it — automatically, using the headers you already set. Monthly chargeback reports are ready to import into your ERP without any spreadsheet work.

StatDetail
Attribution accuracy100% when headers are set correctly
Report generation15 seconds — full department PDF
ERP export formats3 — FOCUS 1.1, CSV, JSON
Approval workflowBuilt in — finance review before posting

What AI chargeback solves

Most organisations with multiple teams using AI face the same problem: a single AI provider invoice arrives with one number. Finance has to allocate it manually, usually by asking engineering to estimate, usually wrong.

Cognocient solves this at the proxy layer. Every API call is tagged with a department, GL account, and cost centre at the moment it is made — not allocated after the fact. By month-end you have a line-item breakdown that goes directly into your ERP without any manual work.

Without CognocientWith Cognocient
One line on the invoice: "OpenAI — $12,400"Every call tagged: GL 6420 · Dept: Customer Success
Finance emails engineering for an estimateReal-time department breakdown in dashboard
Engineering guesses based on feature usageOne-click PDF report per department
3–5 days to close the monthFOCUS export ready for ERP posting
CFO approves without confidenceCFO signs off with full line-item detail

Step 1 — Tag calls with GL and department data

Chargeback accuracy is only as good as your tagging. Use the following headers on every AI call.

X-Cost-Department: customer-success (required) The business department this call belongs to. Use consistent slugs that match your GL chart of accounts (e.g., customer-success, engineering, sales, finance).

X-Cost-GL-Account: 6420 Your GL account code for AI software expenses. Cognocient includes this in FOCUS exports so finance can post directly to the correct GL without mapping.

X-Cost-Team: tier2-support Sub-team within a department. Useful when multiple teams within one department share a GL account but need separate budget tracking.

X-Cost-Cost-Centre: CC-104 Your internal cost centre code. Passed through to FOCUS exports for ERP systems that use cost centre allocation.

X-Cost-Business-Unit: EMEA Business unit or region. Required for global organisations that need chargeback at the BU level before department level.

from openai import OpenAI
 
client = OpenAI(
    api_key="sk-cog-YOUR-PROXY-KEY",
    base_url="https://api.cognocient.com/v1",
)
 
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": user_message}],
    extra_headers={
        # Core attribution
        "X-Cost-Feature":     "ticket-resolver",
        "X-Cost-Session":     f"ticket_{ticket_id}",
        "X-Cost-User":        user_id,
 
        # Chargeback headers
        "X-Cost-Department":  "customer-success",
        "X-Cost-GL-Account":  "6420",
        "X-Cost-Team":        "tier2-support",
        "X-Cost-Cost-Centre": "CC-104",
        "X-Cost-Business-Unit": "EMEA",
    },
)

Set department defaults on the API key

For teams that always use the same department and GL account, set these as default headers on the API key in Control → API Keys. Every call made with that key will automatically carry the correct chargeback data — no per-call headers required. This is the easiest way to attribute legacy code without changes.

Step 2 — Review the Chargeback view

Navigate to Control → Chargeback. The view shows:

Department summary table — One row per department, showing total spend, % of total, waste identified, efficiency score, and trend vs. last cycle. Sort by any column. Click a department to drill down to team and feature level.

GL account breakdown — Below the department table, a GL account view maps spend to your chart of accounts. This is the view your finance team uses for journal entries.

Unattributed spend indicator — A banner shows the $ value and % of calls that arrived without department headers. Click to see which features are untagged — these calls are allocated to an "Unattributed" line item and need header remediation.

Period selector — Switch between current cycle, previous cycle, and custom date range. Side-by-side comparison mode shows current vs. prior period for each department.

Step 3 — Generate department chargeback reports

From the Chargeback view, click Generate Report next to any department. Select the billing period and report format:

FormatBest forContains
PDF — ExecutiveDepartment heads, finance reviewNarrative summary, spend breakdown chart, efficiency score, MoM trend, waste recovered
PDF — Line-item DetailAccountants, audit trailsEvery session with cost, feature, GL account, timestamp, and model used
FOCUS 1.1 CSVERP posting, FinOps platformsFinOps Open Cost and Usage Specification — importable to Apptio, Cloudability, SAP
JSONCustom integrations, billing systemsStructured JSON matching the FOCUS schema — for programmatic processing

Step 4 — Export to your ERP

The FOCUS 1.1 CSV export is structured to match the journal entry format most ERPs accept. The file includes an x_gl_account column populated from your X-Cost-GL-Account headers, so your finance team can import it directly without remapping.

# FOCUS 1.1 export (CSV excerpt)
BillingPeriodStart,ServiceName,ResourceId,Cost,x_department,x_gl_account,x_team
2026-05-01,OpenAI/gpt-4o,ticket-resolver,$2100.00,customer-success,6420,tier2-support
2026-05-01,OpenAI/gpt-4o-mini,intent-detect,$430.00,customer-success,6420,tier2-support
2026-05-01,Anthropic/claude-sonnet,doc-analysis,$890.00,engineering,6410,platform-eng
ERPImport method
SAP S/4HANAUpload via FICA transaction — GL account column maps directly to G/L account field
Oracle FusionImport via Payables Journal — map cost_centre column to Cost Center segment
NetSuiteImport via Journal Entry CSV — standard format accepted without custom mapping
QuickBooksImport via Bills CSV — department column maps to Class field

Automate with the API

The Cognocient API exposes a /v1/chargeback/export endpoint that returns the FOCUS CSV programmatically. Schedule a monthly cron job to pull the report and push it to your ERP automatically — no manual downloads required.

Step 5 — Chargeback to enterprise clients

For B2B SaaS products that want to pass AI costs through to enterprise clients, use the client's account ID as the X-Cost-Department value. Each client account then appears as a separate "department" in the Chargeback view.

def handle_request(request, account_id: str):
    response = client.chat.completions.create(
        model="gpt-4o",
        messages=request.messages,
        extra_headers={
            "X-Cost-Feature":    "ai-assistant",
            "X-Cost-Department": f"client-{account_id}",   # client as department
            "X-Cost-User":       request.user_id,
            "X-Cost-Session":    request.session_id,
        },
    )
    return response

At month-end, generate a Line-item Detail PDF per client account from the Chargeback view. This gives you an invoice-ready breakdown of AI costs by feature and usage type that you can include in your client invoice or usage report.

If your pricing model includes an AI usage markup, export the JSON report and apply your markup programmatically before generating the client-facing invoice. The JSON schema includes per-feature cost breakdowns that make this straightforward.

Finance approval workflow

On the Business plan, enable the Approval Workflow in Settings → Finance. This adds a review step before any chargeback report is finalised:

  1. Cognocient generates the draft report at the configured date (e.g., 25th of the month)
  2. Finance reviewer receives an email with a review link
  3. Reviewer can annotate, reject line items, or approve with one click
  4. Approved report is locked and exported automatically
  5. Audit trail records who reviewed, when, and any modifications made

Next steps: FOCUS 1.1 Export · Attribution Headers · Reports

On this page