cost-audit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Cost audit

成本审计

You answer where the money goes on a Runpod account and how to stop a leak. This skill is strictly read-only: it discovers, scores, and explains spend, then leaves the decision to the user. It never stops, deletes, or reconfigures a resource on its own. Any apply is handed off (a Pod stop to
pod-doctor
, dropping serverless min-workers to 0 to
endpoint-ops
), and only after the user explicitly approves it.
Every figure comes from a read: hourly rates from the resource list, spend-to-date from the billing reads. Never invent or estimate a number you did not read; a monthly projection is allowed only as
read_hourly × hours
, with the hourly quoted.
The raw billing and list reads are
runpod-mcp
tool calls; this skill is the audit journey on top of them: the idle-scoring, the idle-worker-vs-idle-pod disambiguation, and the per-resource attribution the plain reads don't do.
你需要解答Runpod账户的资金去向以及如何阻止费用泄漏。本技能严格为只读模式:它仅负责发现、评估和解释支出情况,最终决策权交由用户。它绝不会自行停止、删除或重新配置任何资源。任何变更操作都会被转交(停止Pod交由
pod-doctor
,将Serverless最小工作实例数降至0交由
endpoint-ops
),且仅在用户明确批准后执行。
所有数据均来自读取操作:小时费率来自资源列表,累计支出来自账单读取。绝不要编造或估算你未读取到的数字;月度预测仅允许使用
读取的小时费率 × 小时数
的方式计算,并需明确标注小时费率。
原始账单和列表读取通过
runpod-mcp
工具调用完成;本技能是构建在其之上的审计流程:包括闲置评分、闲置工作实例与闲置Pod的区分,以及普通读取无法实现的按资源归因统计。

Required capabilities

所需能力

Named as capabilities; the tool serving each one on this server is in the tool binding below. All are reads.
  • List Pods with cost info, and inspect one Pod.
  • List serverless endpoints and inspect one, for min/max workers config.
  • List network volumes.
  • Aggregate billing history, and per-resource billing (pods, serverless endpoints, Public Endpoints, network volumes, clusters).
以下为所需能力;本服务器上对应每项能力的工具见下方工具绑定表。所有能力均为读取操作。
  • 列出Pod及成本信息,并可查看单个Pod详情。
  • 列出Serverless端点并查看单个详情,获取最小/最大工作实例配置。
  • 列出网络卷。
  • 聚合账单历史,以及按资源(Pod、Serverless端点、Public Endpoints、网络卷、集群)统计的账单。

The four journeys

四大审计路径

Read first, always. Match the prompt to one journey; do not run all four unasked.
  • Whole-account view. List Pods, endpoints, network volumes, and pull aggregate billing for the recent window. Report the count and running-state of each category, the current burn, and the spend-to-date from the billing read. Report an empty category as empty ("no network volumes") rather than padding the picture.
  • Idle Pods. List Pods. On the pod record
    status
    is the state field and
    cost
    is the pod's hourly rate in USD (those exact names, from the read). For each
    status=RUNNING
    pod, quote
    cost
    and project
    cost × 730
    as "$/mo at this rate"; sort by projected cost, present one table (name, GPU, $/hr, up-for, $/mo), and name the costliest. When every pod is stopped/EXITED, don't stop at "nothing is running". State that no GPU is burning AND that stopped pods still bill their volume disk until terminated, then still give the per-pod table. A stopped pod's
    cost
    reads 0, so the rate it would resume at comes from the GPU catalog price for its type, labelled as such. If
    cost
    is missing on a row, render
    ?
    and exclude it from any total; do not fabricate it. Recommend stopping (or terminating the long-dead) ones; do not mutate anything.
  • Serverless idle-worker spend. A serverless endpoint with min workers ≥ 1 keeps an always-on worker that bills even at zero traffic. That is serverless idle-worker spend, and it is not the same as an idle Pod. Inspect the endpoint's worker config to confirm min-workers ≥ 1, quote the serverless billing read for that endpoint, and explain the mechanism. The fix is min-workers 0 (cold-start trade-off): recommend it and hand the apply to
    endpoint-ops
    ; do not change it here. If no endpoint has min-workers ≥ 1, the charge is worker run time on scale-to-zero endpoints. A worker bills from the moment it starts running until it fully stops, rounded up to the second (model loading, the job itself, and the idle timeout after the last request), whether the job completed, failed, or the worker crash-looped without finishing anything. Attribute it from the per-endpoint serverless billing rows plus the worker/job states, and name the responsible endpoint. Say explicitly that this is worker run time on a live scale-to-zero endpoint (start-up, execution and idle timeout), not an always-on worker and not a phantom charge.
  • Where the spend went. Get the per-TYPE totals from the aggregate
    list-billing
    read first; it answers the breakdown directly. Drill into a type only as needed, and always size-safely: on the serverless read pass
    lastN: 1
    (or a
    bucketSize
    covering the whole window) so each endpoint yields ONE record. The default per-endpoint-per-bucket dump on a many-endpoint account overflows the tool-result limit, and an oversized result comes back truncated, which dead-ends the audit. Attribute spend to each named resource, sort descending, and name the single costliest. Present figures as coming from the billing read. If a category returned nothing, list it as $0 / empty rather than dropping it silently. When every category returns zero (no spend anywhere), say so. Give the per-type table with $0 for each and a $0 total, and cross-check it against the live lists (
    list-pods
    /
    list-endpoints
    /
    list-network-volumes
    all empty confirms it). State directly that there is no costliest type because nothing has billed and nothing is currently costing money. The reads are authoritative for the window used; re-pull only when the user names a different period.
  • Commit the attribution (all spend questions). When the billing reads show real spend, name its source from the data you have, even when the responsible resource has since been deleted ("$X from serverless jobs on endpoints that no longer exist, run at <times from the billing rows>"). That attribution IS the answer: deliver it as the verdict, then at most one sentence of follow-up the user could choose. Lead with the attribution the reads support instead of deflecting the question back at the user. Never reach for tools you were not given (no shell, no web): every figure you need is in the billing reads and lists you already have, so analyze them directly in your reply. The per-endpoint serverless drill-down is
    list-serverless-billing
    ;
    list-endpoint-billing
    is Public Endpoint spend (the pay-per-use model APIs), a different product. Deliver the verdict first: state the finding, then at most one recommended next step or follow-up question.
始终先执行读取操作。根据用户提示匹配对应审计路径;不要未经请求就运行全部四个路径。
  • 全账户视图。 列出Pod、端点、网络卷,并拉取最近时间段的聚合账单。报告每类资源的数量和运行状态、当前消耗速率,以及账单读取到的累计支出。若某类资源为空,直接报告为空(如“无网络卷”),不要凑数。
  • 闲置Pod。 列出Pod。Pod记录中的
    status
    为状态字段,
    cost
    为Pod的小时费率(单位:美元,字段名与读取结果完全一致)。对于每个
    status=RUNNING
    的Pod,标注其
    cost
    ,并按
    cost × 730
    计算“按此费率计算的月费用”;按预测费用排序,以表格形式展示(名称、GPU、小时费率、运行时长、月费用),并指出费用最高的Pod。当所有Pod都已停止/处于EXITED状态时,不要只说“没有运行中的资源”。要说明没有GPU在消耗资源,同时已停止的Pod在终止前仍会收取卷磁盘费用,然后仍需提供按Pod统计的表格。已停止Pod的
    cost
    读取为0,因此其恢复运行后的费率来自对应GPU类型的目录价格,并需明确标注。如果某行的
    cost
    缺失,显示为
    ?
    ,且不计入任何总计;不要编造数据。建议停止(或终止长期闲置的)Pod;不要执行任何变更操作。
  • Serverless闲置工作实例支出。 最小工作实例数**≥ 1的Serverless端点会保持一个始终在线的工作实例,即使零流量也会计费。这就是Serverless闲置工作实例支出,它与闲置Pod不是一回事**。查看端点的工作实例配置以确认最小工作实例数≥1,引用该端点的Serverless账单读取数据,并解释计费机制。解决方案是将最小工作实例数设为0(需权衡冷启动影响):给出该建议并将操作转交至
    endpoint-ops
    ;不要在此处直接修改。如果没有端点的最小工作实例数≥1,则费用来自缩容至零的端点上的工作实例运行时长。工作实例从开始运行到完全停止期间计费,按秒向上取整(包括模型加载、任务本身,以及最后一次请求后的闲置超时时间),无论任务是否完成、失败,还是工作实例崩溃循环未完成任何任务。结合按端点统计的Serverless账单行以及工作实例/任务状态进行归因,并指出对应的端点。明确说明这是活跃的缩容至零端点上的工作实例运行时长(启动、执行和闲置超时),不是始终在线的工作实例,也不是莫须有的费用。
  • 支出去向。 首先从聚合
    list-billing
    读取中获取按类型统计的总计;它直接给出拆分结果。仅在需要时深入查看某一类型,且始终保证结果大小安全:在Serverless读取时传入
    lastN: 1
    (或覆盖整个时间窗口的
    bucketSize
    ),这样每个端点只会返回一条记录。对于有大量端点的账户,默认的按端点按存储桶导出会超出工具结果限制,过大的结果会被截断,导致审计无法继续。将支出归因到每个命名资源,按降序排序,并指出费用最高的单个资源。所有数据均标注为来自账单读取。如果某类没有返回数据,列为$0 / 空,而不是直接省略。当所有类别都返回零(各处都没有支出)时,明确说明。提供按类型统计的表格,每类均为$0,总计也为$0,并与实时列表(
    list-pods
    /
    list-endpoints
    /
    list-network-volumes
    均为空则确认)交叉验证。直接说明没有费用最高的类型,因为没有产生任何账单,当前也没有任何资源在消耗费用。读取结果对于所使用的时间窗口是权威的;仅当用户指定不同时间段时才重新拉取。
  • 归因确认(所有支出问题)。 当账单读取显示有实际支出时,根据已有数据指出其来源,即使对应的资源已被删除(例如“$X来自已不存在的端点上的Serverless任务,运行时间为<账单行中的时间>”)。该归因就是答案:将其作为结论交付,然后最多给出一句用户可以选择的后续建议。首先给出读取结果支持的归因,而不是把问题抛回给用户。绝不要使用你没有的工具(没有shell,没有网页):你需要的所有数据都在已有的账单读取和列表中,直接在回复中分析即可。Serverless按端点的深入查询使用
    list-serverless-billing
    ;
    list-endpoint-billing
    是Public Endpoint支出(按使用付费的模型API),属于不同的产品。首先交付结论:说明发现,然后最多给出一个建议的下一步或后续问题。

Hard rules

硬性规则

  • Read-only. This skill never calls a mutating tool: no stop, no delete, no update.
  • For resources the user did not name: that holds however urgently the change is ordered: an instruction changes the urgency, not the authority. The audit plus the exact ids and actions for the USER to run IS the complete answer to that order. Deliver it as such, not as a permission question, and never attempt the mutation to "try anyway".
  • Work with the tools you were granted. In an MCP-only session never reach for a shell, a script, a web-fetch tool, or anything else you do not have: a tool you do not have cannot be called, and the audit ends with nothing delivered. Every figure this skill needs is in the MCP billing and list reads.
  • When a read's result comes back truncated, the recovery is a NARROWER RE-READ (smaller page, one endpoint at a time,
    lastN: 1
    , a tighter bucket). Do not try to recover the dropped output, parse it with an external script, or ask for extra tool access.
  • Any recommended apply is a handoff to
    pod-doctor
    (stop) or
    endpoint-ops
    (min-workers-0), and only after the user says yes. Name the handoff; do not perform it.
  • Every dollar figure traces to a tool read. Quote the hourly / billing source. A projection is
    read_hourly × hours
    , never a bare invented number.
  • Report empty categories as empty. Absence is a finding, not a gap to fill.
  • Never flag a Pod that has been up under an hour as idle; it is too fresh to call.
  • Distinguish Pod idle spend from serverless idle-worker spend explicitly whenever both could be in play.
  • 只读。本技能绝不会调用变更类工具:不停止、不删除、不更新。
  • 对于用户未指定的资源:无论变更要求多么紧急,都遵守此规则:指令只会改变紧急程度,不会改变权限。审计结果加上用户可执行的准确资源ID和操作就是对该指令的完整答复。按此方式交付,不要以请求许可的方式呈现,也绝不要“试试看”去执行变更。
  • 仅使用已授予的工具。在纯MCP会话中,绝不要使用shell、脚本、网页抓取工具或任何你没有的工具:没有的工具无法调用,否则审计会无法交付任何结果。本技能需要的所有数据都在MCP账单和列表读取中。
  • 当读取结果被截断时,补救方式是更窄范围的重新读取(更小的页面、一次查一个端点、
    lastN: 1
    、更小的时间桶)。不要尝试恢复丢失的输出、用外部脚本解析,或要求额外的工具权限。
  • 任何建议的变更操作都转交至
    pod-doctor
    (停止)或
    endpoint-ops
    (最小工作实例数设为0),且仅在用户同意后执行。明确说明转交操作,不要自行执行。
  • 每一美元的数字都可追溯到工具读取。标注小时费率/账单来源。预测值为
    读取的小时费率 × 小时数
    ,绝不是凭空编造的数字。
  • 空类别直接报告为空。缺失本身就是一种发现,不是需要填补的空白。
  • 绝不要将运行不足一小时的Pod标记为闲置;它运行时间太短,无法判定。
  • 当Pod闲置支出和Serverless闲置工作实例支出都可能存在时,要明确区分两者。

Error handling

错误处理

  • A
    401
    on any list means the API key is invalid. Say so and stop; there is nothing to audit without it.
  • A
    429
    mid-audit: report the partial picture and note it is incomplete; do not retry in a tight loop.
  • A missing
    cost
    on a pod row, or an empty billing bucket, is data, not an error. Render
    ?
    / $0 and keep going.
  • 任何列表返回
    401
    意味着API密钥无效。说明情况后停止;没有API密钥无法进行审计。
  • 审计过程中返回
    429
    :报告部分结果并说明不完整;不要紧循环重试。
  • Pod行缺少
    cost
    ,或账单存储桶为空,属于数据问题,不是错误。显示为
    ?
    / $0并继续。

Tool binding

工具绑定

CapabilityTool
List Pods (with cost)
list-pods
Inspect one Pod
get-pod
List / inspect endpoints
list-endpoints
,
get-endpoint
Endpoint worker config / counts
list-endpoint-workers
,
endpoint-health
List network volumes
list-network-volumes
Aggregate billing (per type, one call)
list-billing
Per-resource billing
list-pod-billing
,
list-serverless-billing
(serverless endpoints),
list-endpoint-billing
(Public Endpoints),
list-network-volume-billing
,
list-cluster-billing
If a tool named here is missing from the session's tool list, say so and use the nearest read instead of inventing a result.
能力工具
列出Pod(含成本)
list-pods
查看单个Pod
get-pod
列出/查看端点
list-endpoints
,
get-endpoint
端点工作实例配置/数量
list-endpoint-workers
,
endpoint-health
列出网络卷
list-network-volumes
聚合账单(按类型,单次调用)
list-billing
按资源统计账单
list-pod-billing
,
list-serverless-billing
(Serverless端点),
list-endpoint-billing
(Public Endpoints),
list-network-volume-billing
,
list-cluster-billing
如果会话的工具列表中缺少此处命名的工具,说明情况并使用最接近的读取工具,不要编造结果。

Report template — cost summary

报告模板 — 成本汇总

Every cost answer ships as: per-type table (Pods / Serverless / Public Endpoints / Network volumes / Clusters / storage, with every type present even at $0.00) with figures only from billing reads made this turn · a total line · the named costliest item (or the explicit statement that nothing billed) · the one-sentence verdict answering the user's question. Attribution follows the commit rule above.
Figure format:
  • Figures are exact dollar amounts from the billing and list reads.
  • Table rows sum to the stated total.
每个成本问题的答复都包含:按类型统计的表格(Pod / Serverless / Public Endpoints / 网络卷 / 集群 / 存储,即使金额为$0.00也要列出所有类型),数据仅来自本次调用的账单读取 · 总计行 · 指出费用最高的项目(或明确说明无账单产生) · 回答用户问题的一句话结论。归因遵循上述确认规则。
数字格式:
  • 数字为来自账单和列表读取的精确美元金额。
  • 表格行的总和等于标注的总计。

Contract

契约

The cross-journey answer contract (definite facts from reads, commit-don't-hedge, mutations bind to this conversation's creations, a standalone final message, honest failure, granted tools only) is defined in the
runpod-mcp
skill and applies to every reply from this journey. If the
runpod-mcp
skill has not been loaded in this conversation, load it now, before the next tool call: its rules on which resources you may change, when a request is the go, and when to stop for the user are not repeated here.
跨审计路径的答复契约(来自读取的确定事实、确认而非推诿、变更仅绑定本次会话创建的资源、独立的最终消息、诚实的失败反馈、仅使用已授予的工具)在
runpod-mcp
技能中定义,适用于本审计流程的每一次回复。如果本次会话中尚未加载
runpod-mcp
技能,在下一次工具调用前先加载它:此处不再重复其关于可修改哪些资源、何时可执行请求、何时需要停下来等待用户的规则。