{
  "schemaVersion": "1.0",
  "item": {
    "slug": "tokflow",
    "name": "TokFlow",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/wangyaok1/tokflow",
    "canonicalUrl": "https://clawhub.ai/wangyaok1/tokflow",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/tokflow",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=tokflow",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "README.md",
      "SKILL.md",
      "_meta.json",
      "scripts/tokflow_query.py"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/tokflow"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/tokflow",
    "agentPageUrl": "https://openagent3.xyz/skills/tokflow/agent",
    "manifestUrl": "https://openagent3.xyz/skills/tokflow/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/tokflow/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "TokFlow - Token 消耗监控与优化",
        "body": "TokFlow 是一个本地运行的 LLM Token 消耗监控和优化平台，自动追踪 OpenClaw 中所有付费模型的使用情况，并支持提问方式监控与优化（v0.5.0）。"
      },
      {
        "title": "能力概述",
        "body": "查询总览数据（今日/本月 Token 消耗、费用、活跃模型数）\n查看所有模型和付费渠道的详细统计\n获取各渠道实时余额（DeepSeek、硅基流动等）\n获取智能优化建议（模型替换、缓存优化、调用模式优化、提问方式优化）\n提问方式分析：提问轮次、平均提问长度、长度分布、预估节省\n生成优化报告"
      },
      {
        "title": "使用方法",
        "body": "所有查询通过调用 TokFlow 的本地 API（http://localhost:8001/api）完成。"
      },
      {
        "title": "1. 查询总览",
        "body": "scripts/tokflow_query.py dashboard\n\n返回：今日 Token 消耗、本月消耗、活跃模型数、本月费用、模型分布。"
      },
      {
        "title": "2. 查询所有模型",
        "body": "scripts/tokflow_query.py models\n\n返回：所有已配置的付费模型列表，含消耗量、费用、效率评分、使用状态。"
      },
      {
        "title": "3. 查询渠道统计",
        "body": "scripts/tokflow_query.py providers\n\n返回：按付费渠道分组的汇总数据（minimax / deepseek / siliconflow 等各自独立统计）。"
      },
      {
        "title": "4. 查询单个模型详情",
        "body": "scripts/tokflow_query.py model-detail <model_id> [--days 7]\n\n返回：指定模型的每日趋势、调用时段分布、P95 统计等详细数据。"
      },
      {
        "title": "5. 查询渠道余额",
        "body": "scripts/tokflow_query.py balance\n\n返回：各付费渠道的实时账户余额（从各平台 API 实时查询）。"
      },
      {
        "title": "6. 获取优化建议",
        "body": "scripts/tokflow_query.py suggestions\n\n返回：待处理的优化建议列表，包含预估节省金额。"
      },
      {
        "title": "7. 生成新的优化建议",
        "body": "scripts/tokflow_query.py generate\n\n触发优化引擎重新分析，生成最新的优化建议。"
      },
      {
        "title": "8. 消耗分析",
        "body": "scripts/tokflow_query.py analysis [--days 30]\n\n返回：费用趋势、模型费用对比、环比变化、异常检测。"
      },
      {
        "title": "9. 提问方式统计（v0.5.0）",
        "body": "scripts/tokflow_query.py prompt-stats [--days 30]\n\n返回：提问轮次、平均/中位提问长度、长度分桶、总费用、预估可节省金额。"
      },
      {
        "title": "应答格式",
        "body": "脚本输出 JSON 格式数据。请将数据解读为自然语言回答用户的问题。例如：\n\n用户问\"我这个月花了多少钱\" → 调用 dashboard，读取 month_cost.value\n用户问\"哪个模型最费钱\" → 调用 models，按 total_cost 排序\n用户问\"有什么优化建议\" → 调用 suggestions\n用户问\"各渠道还剩多少钱\" → 调用 balance"
      },
      {
        "title": "注意",
        "body": "TokFlow 服务必须在本地 8001 端口运行\n数据来源是 OpenClaw 本地 JSONL 会话文件，实时同步\n费用数据直接取自 OpenClaw 原始计算值，精度到 6 位小数"
      }
    ],
    "body": "TokFlow - Token 消耗监控与优化\n\nTokFlow 是一个本地运行的 LLM Token 消耗监控和优化平台，自动追踪 OpenClaw 中所有付费模型的使用情况，并支持提问方式监控与优化（v0.5.0）。\n\n能力概述\n查询总览数据（今日/本月 Token 消耗、费用、活跃模型数）\n查看所有模型和付费渠道的详细统计\n获取各渠道实时余额（DeepSeek、硅基流动等）\n获取智能优化建议（模型替换、缓存优化、调用模式优化、提问方式优化）\n提问方式分析：提问轮次、平均提问长度、长度分布、预估节省\n生成优化报告\n使用方法\n\n所有查询通过调用 TokFlow 的本地 API（http://localhost:8001/api）完成。\n\n1. 查询总览\nscripts/tokflow_query.py dashboard\n\n\n返回：今日 Token 消耗、本月消耗、活跃模型数、本月费用、模型分布。\n\n2. 查询所有模型\nscripts/tokflow_query.py models\n\n\n返回：所有已配置的付费模型列表，含消耗量、费用、效率评分、使用状态。\n\n3. 查询渠道统计\nscripts/tokflow_query.py providers\n\n\n返回：按付费渠道分组的汇总数据（minimax / deepseek / siliconflow 等各自独立统计）。\n\n4. 查询单个模型详情\nscripts/tokflow_query.py model-detail <model_id> [--days 7]\n\n\n返回：指定模型的每日趋势、调用时段分布、P95 统计等详细数据。\n\n5. 查询渠道余额\nscripts/tokflow_query.py balance\n\n\n返回：各付费渠道的实时账户余额（从各平台 API 实时查询）。\n\n6. 获取优化建议\nscripts/tokflow_query.py suggestions\n\n\n返回：待处理的优化建议列表，包含预估节省金额。\n\n7. 生成新的优化建议\nscripts/tokflow_query.py generate\n\n\n触发优化引擎重新分析，生成最新的优化建议。\n\n8. 消耗分析\nscripts/tokflow_query.py analysis [--days 30]\n\n\n返回：费用趋势、模型费用对比、环比变化、异常检测。\n\n9. 提问方式统计（v0.5.0）\nscripts/tokflow_query.py prompt-stats [--days 30]\n\n\n返回：提问轮次、平均/中位提问长度、长度分桶、总费用、预估可节省金额。\n\n应答格式\n\n脚本输出 JSON 格式数据。请将数据解读为自然语言回答用户的问题。例如：\n\n用户问\"我这个月花了多少钱\" → 调用 dashboard，读取 month_cost.value\n用户问\"哪个模型最费钱\" → 调用 models，按 total_cost 排序\n用户问\"有什么优化建议\" → 调用 suggestions\n用户问\"各渠道还剩多少钱\" → 调用 balance\n注意\nTokFlow 服务必须在本地 8001 端口运行\n数据来源是 OpenClaw 本地 JSONL 会话文件，实时同步\n费用数据直接取自 OpenClaw 原始计算值，精度到 6 位小数"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/wangyaok1/tokflow",
    "publisherUrl": "https://clawhub.ai/wangyaok1/tokflow",
    "owner": "wangyaok1",
    "version": "0.5.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/tokflow",
    "downloadUrl": "https://openagent3.xyz/downloads/tokflow",
    "agentUrl": "https://openagent3.xyz/skills/tokflow/agent",
    "manifestUrl": "https://openagent3.xyz/skills/tokflow/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/tokflow/agent.md"
  }
}