技能 数据科学 按会话分析成本费用

按会话分析成本费用

v20260707
cost-conversation
该功能提供按单个会话进行成本分析的详细视图。它列出了每个会话的开始时间、消息数量、主要模型和总成本。这对于识别成本最高的会话至关重要,特别适用于项目回顾和评估现有会话模式的可持续性。
获取技能
450 次下载
概览

Cost per Conversation

cost-report and cost-optimize aggregate by agent and model. This skill aggregates by conversation (session) — a different lens that surfaces which conversations cost the most. Useful for retrospectives ("which sessions ran long on Opus?") and for evaluating whether a given project's session pattern is sustainable.

When to use

  • After multiple sessions, to see total spend per conversation.
  • Before scoping a long session, to understand typical cost-per-conversation.
  • For per-project rollups via CONV_NAMESPACE=cost-tracking-<project>.

Steps

  1. Run the script from anywhere:

    node plugins/ruflo-cost-tracker/scripts/conversation.mjs
    

    Optional env:

    • CONV_FORMAT=json — emit JSON instead of markdown
    • CONV_LIMIT=20 — show only the most recent N conversations
    • CONV_NAMESPACE=cost-tracking — override target namespace
  2. Inspect the markdown table — total cost across all conversations, per-tier rollup, then a per-session table (started-at, sessionId prefix, message count, top model, cost).

Cross-references

  • cost-track — the producer that populates cost-tracking:session-*
  • cost-report — same data, per-agent / per-model lens
  • cost-trend — drift across bench runs (different axis: corpus runs vs conversations)
  • cost-budget-check — sums across conversations to evaluate the budget threshold
信息
Category 数据科学
Name cost-conversation
版本 v20260707
大小 1.61KB
更新时间 2026-07-09
语言