Reports & Exports

How do I track cost per business outcome in Cognocient?

Link AI spend to business outcomes — ticket resolutions, conversions, documents processed — and calculate true cost-per-outcome ROI with the X-Cost-Outcome header.

The X-Cost-Outcome header links each AI call to the business result it produced — a resolved ticket, a signed contract, a generated report. Cognocient aggregates these into cost-per-outcome metrics that answer the CFO's core question: what did we get for this AI spend?

Why cost per outcome changes the conversation

Without outcome tracking, you have AI spend. With it, you have AI ROI.

Without outcomes: "We spent $12,000 on AI last month. Is that a lot?" — No answer. You have a cost with no context.

With outcomes: "We spent $12,000 on AI and resolved 28,500 support tickets at $0.42 each. Our human agents cost $8.40 per ticket." — AI delivers 20× cost efficiency per ticket. ROI is obvious.

Quick setup — X-Cost-Outcome header

The fastest way to track outcomes is the X-Cost-Outcome attribution header. Add it alongside your existing X-Cost-Feature header:

response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": prompt}],
    extra_headers={
        "X-Cost-Feature":  "ticket-resolver",
        "X-Cost-Outcome":  "ticket-resolved",   # ← outcome tag
        "X-Cost-User":     f"user_{user_id}",
    }
)

Only tag successful outcomes. Cognocient aggregates spend by outcome and shows you cost-per-call for each outcome category in Dashboard → Cost/Outcome.

Use lowercase hyphen-separated names that describe what happened: ticket-resolved, document-processed, lead-qualified. Avoid generic names like chatbot-call or llm-used.

Step 1 — Define an outcome (advanced)

Go to Executive → Outcomes → New Outcome. An outcome definition has three parts:

Outcome name — What you're measuring. Examples: "Support ticket resolved," "Contract drafted," "Document processed," "Sales email sent," "Code review completed."

Sessions that count — Which session IDs constitute one outcome. Use a feature filter (e.g., all sessions tagged with X-Cost-Feature = "ticket-resolver") or a prefix pattern (e.g., session IDs starting with "ticket_").

Success condition (optional) — How to distinguish a successful outcome from an abandoned one. You can mark sessions as successful via the Outcome API — pass the outcome event when your application registers a resolved ticket, signed contract, etc.

Step 2 — Mark sessions as successful outcomes

The simplest outcome tracking uses Cognocient's outcome API. Call this endpoint from your application when a positive outcome occurs — ticket resolved, contract signed, document approved.

import httpx
 
COGNOCIENT_KEY = "sk-cog-YOUR-PROXY-KEY"
 
def mark_ticket_resolved(session_id: str, ticket_id: str):
    """Call this when a support ticket is marked resolved in your ticketing system."""
    httpx.post(
        "https://api.cognocient.com/api/outcomes",
        headers={"Authorization": f"Bearer {COGNOCIENT_KEY}"},
        json={
            "session_id": session_id,
            "outcome_type": "ticket_resolved",
            "outcome_id": ticket_id,          # your internal ID for deduplication
            "metadata": {
                "resolution_time_minutes": 4,
                "csat_score": 5,
            },
        },
    )
import fetch from 'node-fetch'
 
async function markContractDrafted(sessionId: string, contractId: string) {
  await fetch('https://api.cognocient.com/api/outcomes', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.COGNOCIENT_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      session_id: sessionId,
      outcome_type: 'contract_drafted',
      outcome_id: contractId,
      metadata: {
        contract_value_usd: 45000,
        turnaround_minutes: 8,
      },
    }),
  })
}

If you already have session IDs in your existing application, you can add outcome tracking by calling this endpoint from your downstream business logic — the webhook that fires when a ticket closes, the callback when a contract is signed. No changes to AI call code needed.

Step 3 — Reading outcome data in the dashboard

The Outcomes view shows a table with one row per outcome type. For each:

ColumnWhat it shows
Outcomes this periodCount of successful outcomes recorded
Total AI costSum of AI spend from sessions that led to this outcome
Cost per outcomeTotal AI cost ÷ successful outcomes — your primary ROI metric
Success rate% of sessions that resulted in an outcome (vs abandoned)
Cost per failed outcomeAI spend on sessions that did not result in an outcome — waste in the business sense
TrendCost per outcome over the past 30 days — declining means you're getting more efficient

Industry benchmarks for cost per outcome

Use these benchmarks to calibrate your own metrics and frame the ROI conversation for your board:

Outcome typeTypical AI costHuman cost equivalentAI advantage
Support ticket (L1)$0.15–$0.50$6–$1212–80×
Support ticket (L2)$0.80–$2.00$20–$3510–40×
Contract first draft$1.50–$4.00$150–$40050–100×
Document classification$0.01–$0.05$1.50–$3.0030–300×
Code PR review$0.40–$1.20$40–$8035–200×
Sales outreach email$0.05–$0.20$5–$1525–300×

Benchmarks are illustrative ranges. Actual costs vary by model, prompt complexity, and task definition. Your Cognocient data will give you the precise figure for your implementation.


Next steps: Executive View · Sessions · Feature Intelligence

On this page