Platform

How do I see per-user AI spend in Cognocient?

See exactly how much AI each individual user is consuming. The Users view is the foundation of per-seat cost analysis, enterprise chargeback, and detecting users whose usage patterns indicate a problem.

The Users view (Dashboard → Users) shows how much AI spend each individual user is generating over the last 30 days — total cost, sessions, and their most-used feature. Use it for per-seat cost analysis, enterprise chargeback, or finding users with unusual usage patterns.

What the Users view shows

Every row in the Users table represents a unique value passed in the X-Cost-User header. For each user you see:

ColumnWhat it meansWhy it matters
Cost (30d)Sum of AI API costs attributed to this user in the last 30 daysIdentify your top-cost users
SessionsNumber of distinct sessionsUnderstand usage frequency
Cost/SessionAverage cost per sessionFlag users with unusually expensive sessions
Top FeatureThe feature this user calls mostUnderstand what a heavy user is actually doing

How to send user data to Cognocient

Add the X-Cost-User header to every API call that is triggered by a specific user. Use your internal user ID — not an email address, for privacy.

X-Cost-User: usr_8f2a3c91 (required)

Your internal user identifier. Use an opaque ID, not PII. Cognocient never reads prompt content — this header is for cost attribution only.

from openai import OpenAI
 
client = OpenAI(
    api_key="sk-cog-YOUR-PROXY-KEY",
    base_url="https://api.cognocient.com/v1",
)
 
def chat(user_id: str, messages: list):
    return client.chat.completions.create(
        model="gpt-4o",
        messages=messages,
        extra_headers={
            "X-Cost-Feature": "support-chat",
            "X-Cost-Department": "customer-success",
            "X-Cost-User": user_id,  # your internal user ID
        },
    )
import OpenAI from 'openai'
 
const client = new OpenAI({
  apiKey: 'sk-cog-YOUR-PROXY-KEY',
  baseURL: 'https://api.cognocient.com/v1',
})
 
async function chat(userId: string, messages: OpenAI.ChatCompletionMessageParam[]) {
  return client.chat.completions.create({
    model: 'gpt-4o',
    messages,
  }, {
    headers: {
      'X-Cost-Feature': 'support-chat',
      'X-Cost-Department': 'customer-success',
      'X-Cost-User': userId,
    },
  })
}

If you use a session-based system (e.g., cookie sessions, JWT), you can pass the session token as the user ID — Cognocient stores only the value you pass, never decodes it.

How teams use the Users view

SaaS products: per-seat cost validation

If your product charges customers by seat, use the Users view to verify that your AI margin per user is positive. Export the table to CSV and join it against your subscription data. Users costing you more than their seat price are margin-negative and need model optimisation or usage limits.

Example: AI cost/user/month: $12.40 vs. Revenue/seat/month: $15.00 = Margin/user/month: $2.60

Enterprise customers: AI cost chargeback

For B2B SaaS, pass the enterprise account ID as the user ID. The Users view then shows per-account AI spend, which you can export and include in client invoices or usage reports. Pair this with the Chargeback view for GL-level attribution.

Anomaly investigation: outlier users

Look for users with a dramatically higher Cost/Session than the rest of the table — they're likely sending unusually long prompts, potentially copy-pasting entire documents. Set a per-user budget to cap their spend without affecting other users.

Setting per-user budgets

There's no per-user budget action on the Users table itself. To cap one user's spend, go to Budgets → New Budget, set Scope to User, and enter their X-Cost-User value as the scope value. It supports the same Alert, Block, or Degrade enforcement modes as feature- and department-level budgets.

Block mode (HTTP 429) frustrates users when they hit a limit. Degrade mode silently switches them to a cheaper model — they keep working, your costs are capped, and you get a notification to investigate.

On this page