crestapps-core-ai-usage-metering

crestapps-core-ai-usage-metering is a skill for Claude Code from CrestApps/CrestApps.AgentSkills. It costs 194 tokens per session (2,212 once invoked), scanned A, original, MIT.

An AI request tracking feature for CrestApps.Core that records usage details for each request sent to an AI provider. It can cover chat, embeddings, image, speech, and realtime clients created through the client factory.

In plain words
What is it for?
Use it to turn on usage tracking, record provider-reported units, count individual provider requests, and label calls for reporting or billing analysis.
Why use it?
It gives you a request-by-request record of AI usage instead of making you estimate consumption from user conversations. Labels let you connect records to your own services or operations without sending those labels to the AI provider.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions subagents.

Part of the crestapps-core plugin — 47 skills shipped together

Good fit Use it to turn on usage tracking, record provider-reported units, count individual provider requests, and label calls for reporting or billing analysis.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/crestapps/crestapps.agentskills/crestapps-core-ai-usage-metering
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add CrestApps/CrestApps.AgentSkills --skill crestapps-core-ai-usage-metering
Clone the repo
git clone --depth 1 https://github.com/CrestApps/CrestApps.AgentSkills

Made for: Claude Code.

Or install crestapps-core, the plugin that ships this one along with the rest of its 47 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for crestapps-core-ai-usage-metering

README.md
[![agentmods](https://agentmods.dev/badge/skills/crestapps/crestapps.agentskills/crestapps-core-ai-usage-metering/github.svg)](https://agentmods.dev/skills/crestapps/crestapps.agentskills/crestapps-core-ai-usage-metering)
Your own site
<a href="https://agentmods.dev/skills/crestapps/crestapps.agentskills/crestapps-core-ai-usage-metering"><img src="https://agentmods.dev/badge/skills/crestapps/crestapps.agentskills/crestapps-core-ai-usage-metering/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for crestapps-core-ai-usage-metering

Your own site · 80×15
<a href="https://agentmods.dev/skills/crestapps/crestapps.agentskills/crestapps-core-ai-usage-metering"><img src="https://agentmods.dev/badge/skills/crestapps/crestapps.agentskills/crestapps-core-ai-usage-metering.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 194 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,212 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00194 $0.02212
Opus 5.5 $0.00078 $0.00885
Sonnet 5.5 $0.00039 $0.00442
Haiku 4.5 $0.00019 $0.00221

Measured yesterday against content hash f51eb53a6546, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

crestapps-core-ai-usage-metering scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/crestapps-core/skills/crestapps-core-ai-usage-metering/SKILL.md · 180 lines

How it starts

The opening of the file, as written. The whole thing — 180 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CrestApps.Core AI Usage Metering

Every client IAIClientFactory returns meters its own requests by wrapping the provider's client and reading the provider-agnostic UsageDetails on each response. That covers every provider, including custom IAIClientProvider implementations, with no provider code.

Guidelines

  • Turn metering on with GeneralAIOptions.EnableAIUsageTracking = true. It is off by default.
  • A record is written per request sent to the provider, not per user turn. Planning, query rewrites, vision calls, each tool-calling round trip, each embedding batch and each realtime response are separate records, so the request count equals billed requests.
  • Metering sits below every middleware you add, so UseFunctionInvocation() yields one record per round trip and a cached response yields none.
  • Label your own requests with UseUsageLabels(...) on the client pipeline, or an AIUsageScope around a call into a service that creates the client for you. Labels never reach the provider.
  • A client you build without the factory is not metered until you wrap it with AIUsageMetering.Meter(...).

Enable Metering and Storage

using CrestApps.Core.AI.Models;

builder.Services.Configure<GeneralAIOptions>(options =>
{
    options.EnableAIUsageTracking = true;
});

Each record goes to every registered IAICompletionUsageObserver. The default IAICompletionUsageService is one of them and saves through IAICompletionUsageStore. The YesSql chat-session stores (AddCoreAIChatSessionStoresYesSql(), which calls AddCoreAICompletionUsageStoresYesSql()) and the EntityCore chat-session stores (AddCoreAIChatSessionStoresEntityCore()) register a store. A record whose scope was already disposed when the response finished is dropped rather than failing the answer.

What a Record Holds

Property Meaning
OperationType AIUsageOperationTypes.Chat, Embedding, Image, SpeechToText, TextToSpeech, Realtime or RealtimeTranscription
ClientName, ConnectionName, DeploymentName, ModelName Where the request went; ModelName is what the provider reported, else the deployment
InputTokenCount, OutputTokenCount, TotalTokenCount Tokens in and out
CachedInputTokenCount, ReasoningTokenCount Discounted cached input; reasoning output tokens
InputAudioTokenCount, OutputAudioTokenCount Audio tokens, billed at their own rate
AudioDurationMs, CharacterCount, ImageCount Duration-, character- and image-billed units
ContextType, Purpose Category of feature and reason for the request
SessionId, ProfileId, InteractionId, UserId, VisitorId, ResponseLatencyMs, IsStreaming Attribution and timing

Read the full file on GitHub · 180 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 180 lines · 194 tokens per session scan A f51eb53a6546

Subscribe to this mod's changes

crestapps-core-ai-usage-metering is a skill published in the GitHub repository CrestApps/CrestApps.AgentSkills (13 stars, last pushed yesterday), licensed MIT. It adds 194 tokens to every session and 2,212 once invoked, about $0.0008 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-22.

Related

Other skills, from other repositories

powerpoint-cli

Discover and use the PowerPoint CLI plugin to automate a live PowerPoint desktop session. Use for terminal, PowerShell, batch, and coding-agent tasks; not general presentation design. Triggers: pptcli, PowerPoint command line, presentation automation script.

sbroenne/mcp-server-powerpoint · 55 tokens

powerpoint-deck-design

Plan or improve the visual design of a PowerPoint presentation: layout, typography, color, hierarchy, accessibility, and consistency. Use when the user asks to create, redesign, or review how a deck looks; not for general PowerPoint automation or content-only edits.

sbroenne/mcp-server-powerpoint · 59 tokens

home-memory-documentation

Do not load unless the request or established context explicitly identifies Home Memory (HM) and requires a documentation decision about record boundaries, relationships or information placement. If the product is ambiguous, ask whether the user means Home Memory or Smartconstruct and load neither product skill first.…

impactjo/home-memory · 112 tokens

dotnet-debugging

Debug .NET applications using debug-mcp MCP tools — launch processes, set breakpoints, step through code, inspect variables, evaluate expressions, and analyze exceptions. Use this skill when debugging .NET/C# applications, investigating runtime behavior, diagnosing exceptions, inspecting object state, or performing…

jkolo/debug-mcp · 70 tokens

sast-missingauth

Detect missing authentication and broken function-level authorization vulnerabilities in a codebase using a three-phase approach: recon (map endpoints and the role/permission system), batched verify (check auth/authz in parallel subagents, 3 endpoints each), and merge (consolidate batch results). Covers…

capture0x/YeepForge · 121 tokens

sast-analysis

Perform codebase analysis and architecture mapping as the first phase of a security assessment. Explores the tech stack, frameworks, entry points, data flows, and trust boundaries. Outputs sast/architecture.md. Run this before any vulnerability detection skill. Use when asked to analyze a codebase for security or when…

capture0x/YeepForge · 73 tokens