{
  "id": 12549622,
  "title": "Measure Cost per Handled Enquiry: A Small Logging Pattern for LLM Workflows",
  "url": "https://urgent.news/2026/10/07/measure-cost-per-handled-enquiry-a-small-logging-pattern-for-llm",
  "topic": "ai",
  "section": "AI",
  "published": "2026-10-07T05:03:01.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/ujjwal_dubey_9/measure-cost-per-handled-enquiry-a-small-logging-pattern-for-llm-workflows-51ni"
  },
  "original_language": "en",
  "account": "Calculating the cost per handled enquiry in AI automation for small businesses can provide valuable insights. To measure this, record the model tokens used in and out for each enquiry, along with messaging events, automation-platform runs, and human minutes spent on approvals or rewriting drafts. Organize this data in an append-only JSONL format using a simple log_event function. Roll up the costs using your own rates from invoices, matching quantities and units. The cost per enquiry metric reveals that human minutes often dominate the cost, suggesting a need to analyze rejected drafts and improve approval processes. Long prompts can also significantly impact costs, so monitoring token usage is crucial. Retries and platform runs can hide additional expenses, making it essential to track these as well. By keeping the tracking simple and consistent, small businesses can gain a clear understanding of their AI automation costs and make informed decisions about custom versus off-the-shelf solutions.",
  "summary": "Pre-build cost estimates are guesses. After launch you can measure. The most useful number I know for a small-business workflow is cost per handled enquiry in AI automation : everything it cost to take one customer message from arrival to a resolved state. Disclosure: I run NxFlowAI, an automation agency. The pattern below is generic. What to count For each enquiry, record: model tokens in and…",
  "key_points": [
    "Record model tokens, messaging events, and human minutes for each enquiry",
    "Use append-only JSONL format and logevent function for data organization",
    "Human minutes often dominate costs, suggesting approval process improvement"
  ],
  "editors_take": "This approach helps small businesses understand and manage AI automation costs by identifying key contributors, such as human time spent on approvals and long prompts, to inform cost-effective decisions.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}