Skip to content

Caveman Cloud· HostedGovernance & Billing

Allocate AI spend to teams, people, and cost centers

Attribute Caveman Cloud model spend to people, teams, workflows, and customers with personal keys, key labels, projects, and headers for chargeback.

Caveman Cloud attributes every gateway request to the key that signed it, the project it ran under, and any workflow, agent, or end-user labels it carries. Set these up deliberately and the Spend page becomes a ready-made showback or chargeback report: cost per team, per developer, per product feature, or per customer. This page shows which signals to set and how they map to report axes.

Attribution signals#

SignalHow you set itSpend axis
ProjectEvery request runs under a projectProjects
API keyThe key that authenticated the requestKeys
Key labelsLabels on the key in Governance → KeysLabels
PersonBind a personal key to a member under Belongs toPeople
Workflowx-cave-workflow header, the SDK workflow option, --workflow, or the key's default workflowWorkflows
Coding agentx-cave-agent header, or a wrapped coding agentCoding agents
End userx-cave-user-hash header with an opaque hash you supplyEnd users

Model, provider, endpoint, and task type are recorded automatically and show what the money bought rather than who spent it.

Set up chargeback#

  1. Use one project per cost center

    Split projects by product line or environment (for example support-bot-prod and support-bot-staging). Projects are the cleanest subtotal finance can charge, and each one gets its own budget.

  2. Label every key

    Add consistent lowercase labels such as team-payments, env-prod, and cc-4120. Agree on a naming scheme up front so reports group cleanly.

  3. Give developers personal keys

    Bind a key to each developer for local work and coding agents. Their spend then appears under their name on the People axis.

  4. Tag workflows in code

    Send x-cave-workflow with the job name (resolve-ticket, summarize-thread), or set a default workflow on the key. Workflows are the closest unit to a cost object a finance team can price.

  5. Send end-user hashes for per-customer cost

    If you resell AI features, send x-cave-user-hash with a stable, opaque customer identifier. It is stored as sent and never linked to a member of your organization.

Example request with attribution headers
curl "${CAVE_GATEWAY_URL}/openai/v1/chat/completions" \
-H "authorization: Bearer ${CAVE_API_KEY}" \
-H "x-cave-upstream-key: ${OPENAI_API_KEY}" \
-H "x-cave-workflow: resolve-ticket" \
-H "x-cave-user-hash: 8f14e45fceea167a" \
-H "content-type: application/json" \
-d '{"model": "gpt-4o-mini", "messages": [{"role": "user", "content": "Hi"}]}'

See Authentication for the gateway URL and provider key options.

Read the reports#

Open Spend and pick an axis. Axes are split into who spent (People, Coding agents, Keys, Labels, End users, Projects, Workflows) and what it bought (Task types, Models, Providers, Endpoints). Each axis has an unattributed bucket, such as No person attributed or Unlabeled workflow, so you can see how much spend still lacks a label.

For custom reports or exports to a finance system, query spend directly with SQL. More on reading spend in Traces and spend. To chart allocation over time or alert on it, build a custom dashboard.

Who can see per-person spend#

Owners, Admins, and members with the Billing role can read billing and per-person spend. Every member can see the traffic on their own personal key.

Esc

Start here