agentleFS
yevhens-hueyevhens-hue/claude-skills-starter-kit/skills/enterprise-rag-knowledge-systems/SKILL.md

enterprise-rag-knowledge-systems

Skill4 starsChanged 3 months agoMITView on GitHub

Real-time COGS metering (calculating exact $ cost per voice minute, SMS unit, LLM token, and per-tenant margin analytics) for multi-tenant AI SaaS platforms.

The file

Files
SKILL.md

📊 COGS Metering & Usage Billing Skill

This skill defines the telemetry and real-time cost metering architecture for multi-tenant AI SaaS platforms.


🛠️ COGS Calculation Blueprint

For every voice call, SMS conversation, or AI workflow, compute exact operational cost (COGS):

$$\text{COGS} = (\text{Voice Mins} \times C_{\text{voice}}) + (\text{SMS Units} \times C_{\text{sms}}) + (\text{Tokens}{\text{in}} \times C{\text{in}}) + (\text{Tokens}{\text{out}} \times C{\text{out}})$$

Where default cost rates are:

  • $C_{\text{voice}} = $0.07 / \text{min}$ (Retell AI / Telephony)
  • $C_{\text{sms}} = $0.0079 / \text{msg}$ (Twilio / Telnyx)
  • $C_{\text{in}} = $0.00000025 / \text{token}$ (Claude 3.5 Haiku Input)
  • $C_{\text{out}} = $0.00000125 / \text{token}$ (Claude 3.5 Haiku Output)

💻 Sample Metering Record (JSON)

{
  "tenant_id": "rooftop_881",
  "call_id": "call_abc992",
  "duration_seconds": 184,
  "usage": {
    "voice_minutes": 3.06,
    "voice_cost_usd": 0.214,
    "llm_tokens_total": 3450,
    "llm_cost_usd": 0.0042,
    "telephony_cost_usd": 0.045
  },
  "total_cogs_usd": 0.2632
}

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.