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 shows how much AI spend each individual user is generating — total cost, call count, average cost per call, and spend trend. 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
Total spendSum of all AI API costs attributed to this userIdentify your top-cost users
CallsNumber of API calls this user triggeredDistinguish power users from cost outliers
Avg cost/callMean cost per individual API callFlag users sending unusually large prompts
SessionsNumber of distinct conversation sessionsUnderstand usage frequency
Waste attributedRecoverable waste linked to this user's callsFind users with inefficient patterns
Last activeTimestamp of most recent callIdentify dormant users still incurring cost

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

Sort by "Avg cost/call" descending. Users with a dramatically higher cost-per-call than the median are 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

From any user row, click Set budget to open the budget configuration panel. You can set a monthly spend cap per user in Alert, Block, or Degrade mode — just like feature-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.


Next steps: Sessions · Chargeback · Budget Enforcement

On this page