💰output-dev-workflow-cost
- プラグイン
- outputai
- ソース
- GitHub で見る ↗
説明
ワークフロー実行の Output SDK 実行コストを計算して表示します。 次のような場合に使用: LLM トークンのコスト、API サービスのコスト、または特定のワークフロー実行の合計費用を確認したい場合。
原文を表示
Calculate and display the cost of an Output SDK workflow execution run. Use when checking LLM token costs, API service costs, or total spend for a specific workflow run.
ユースケース
- ✓ワークフロー実行のコストを確認したい
- ✓LLMトークンの費用を把握したい
- ✓APIサービスの利用料を確認したい
- ✓ワークフロー実行の合計費用を知りたい
本文(日本語訳)
ワークフロー実行コスト
概要
このスキルは、Output CLI を使用して完了したワークフロー実行のコストを計算するのに役立ちます。 LLM モデル(トークン使用量)と外部 API サービス呼び出しごとにコストを内訳表示します。
次のような場合に使用:
- ワークフロー実行に要した LLM トークンのコストを確認したい場合
- ワークフロー実行ごとの API サービス費用を分析したい場合
- ワークフロー実行間のコストを比較したい場合
- デモやレビュー中にコストデータを提示したい場合
ステップ 1: ワークフローの実行 ID を取得する
workflow cost コマンドには、ワークフロー名ではなく ワークフロー実行 ID が必要です。
実行 ID の例: process_transcripts_2026-03-23-19-35-17-000Z_c2biRk_F9rYktF-wagBf5
すでに実行 ID をお持ちの場合は、ステップ 2 へ進んでください。
実行 ID をお持ちでない場合:
オプション A — 最近の実行一覧を取得する(スキル: output-workflow-runs-list を使用):
npx output workflow runs list <workflowName> --limit 5
最新の完了済み実行から実行 ID をコピーします。
オプション B — ワークフローを今すぐ実行して ID を取得する:
入力内容がわかっている場合は、同期実行することで出力に実行 ID が含まれます:
npx output workflow run <workflowName> --input '{"key": "value"}'
または非同期実行する場合(スキル: output-workflow-start を使用):
npx output workflow start <workflowName> --input '{"key": "value"}'
# 返り値: Workflow ID: <runId>
入力内容がわからない場合は、シナリオファイル(スキル: output-dev-scenario-file を使用)または
ワークフローの types.ts 内にある inputSchema を確認してください。
注意: ワークフロー 名(例:
process_transcripts)はワークフローの種類を識別するものです。 ワークフロー 実行 ID(例:process_transcripts_2026-03-23T19:35:17.000Z_abc123)は特定の実行を識別するものです。workflow costには実行 ID が必要です。
ステップ 2: コストを計算する
基本的な使い方(テキスト出力):
npx output workflow cost <runId>
ローカルのトレースファイルを使用する場合:
npx output workflow cost <runId> path/to/trace.json
JSON 出力(プログラムによる処理や表示向け):
npx output workflow cost <runId> --json
Verbose — 呼び出しごとの内訳を表示:
npx output workflow cost <runId> --verbose
全フラグ一覧:
| フラグ | 説明 | デフォルト |
|---|---|---|
--json |
テキストレポートの代わりに機械可読な JSON を出力する | false |
--verbose |
LLM 呼び出しごとの詳細な内訳を表示する | false |
出力の見方
テキスト形式の出力例:
料金の値はあくまで参考例です。以下に示すモデルとトークン単価は 2026-05-04 時点のものです。 実際の料金は models.dev から取得されます。 最新のモデル ID については
output-dev-model-selectionを参照してください。
コストは各行に 2 種類の数値で表示されます。Original(元の値) はトレースイベント
(llm:usage / http:request:cost)に記録された実際の請求コスト、Adjusted(調整済み) は
costs.yml のオーバーライドを適用した後のコストです(オーバーライドがない場合は Original と同じ値になります)。
最終行および JSON の totalCost は Adjusted の合計値となります。
Workflow: process_transcripts
Duration: 12.3s
LLM Costs:
Model | Calls | Original | Adjusted
claude-sonnet-4-6 | 3 | $0.0123 | $0.0123
Subtotal | 3 | $0.0123 | $0.0123
API Costs:
Host | Calls | Original | Adjusted
r.jina.ai | 2 | $0.0040 | $0.0040
Subtotal | 2 | $0.0040 | $0.0040
TOTAL ESTIMATED COST (adjusted) $0.0163
As-charged (from trace) $0.0163
JSON 形式のフィールド:
{
"workflowName": "process_transcripts",
"durationMs": 12300,
"llmOriginalCost": 0.0123,
"llmAdjustedCost": 0.0123,
"totalInputTokens": 1234,
"totalOutputTokens": 567,
"httpCosts": [{ "host": "r.jina.ai", "originalTotalCost": 0.004, "adjustedTotalCost": 0.004 }],
"httpOriginalCost": 0.004,
"httpAdjustedCost": 0.004,
"originalTotalCost": 0.0163,
"totalCost": 0.0163
}
llmCalls および httpCosts[].calls 内の呼び出しごとのエントリには、originalCost と
adjustedCost が含まれます。
(旧バージョンでは llmTotalCost、services[]、serviceTotalCost、unknownModels が
公開されていましたが、上記フィールドに置き換えられました。)
使用例
最後の実行のコストを取得する:
# まず実行 ID を取得する
npx output workflow runs list process_transcripts --limit 1 --json
# 次にコストを取得する
npx output workflow cost process_transcripts_2026-03-23T19:35:17.000Z_abc123
コストを JSON で取得して合計を抽出する:
npx output workflow cost <runId> --json | jq '.totalCost'
呼び出しごとの全内訳を表示する:
npx output workflow cost <runId> --verbose
関連スキル
output-workflow-runs-list— 実行履歴から実行 ID を検索するoutput-workflow-start— ワークフローを開始して実行 ID を取得するoutput-workflow-run— ワークフローを同期実行するoutput-dev-scenario-file— ワークフロー入力用のシナリオファイルを作成または検索する
原文(English)を表示
Workflow Run Cost
Overview
This skill helps you calculate the cost of a completed workflow execution using the Output CLI. It breaks down costs by LLM model (token usage) and external API service calls.
When to Use This Skill
- Checking how much a workflow run cost in LLM tokens
- Analyzing API service spend per workflow execution
- Comparing costs between workflow runs
- Presenting cost data during a demo or review
Step 1: Get a Workflow Run ID
The workflow cost command requires a workflow run ID — not the workflow name.
A run ID looks like: process_transcripts_2026-03-23-19-35-17-000Z_c2biRk_F9rYktF-wagBf5
If you already have a run ID, skip to Step 2.
If you don't have a run ID:
Option A — List recent runs (use skill: output-workflow-runs-list):
npx output workflow runs list <workflowName> --limit 5
Copy the run ID from the most recent completed run.
Option B — Run the workflow now and capture the ID:
If you know the input, run it synchronously and the run ID will be in the output:
npx output workflow run <workflowName> --input '{"key": "value"}'
Or asynchronously (use skill: output-workflow-start):
npx output workflow start <workflowName> --input '{"key": "value"}'
# Returns: Workflow ID: <runId>
If you don't know the input, check for a scenario file (use skill: output-dev-scenario-file) or the workflow's inputSchema in its types.ts.
Note: The workflow name (e.g.
process_transcripts) identifies the workflow type. The workflow run ID (e.g.process_transcripts_2026-03-23T19:35:17.000Z_abc123) identifies a specific execution.workflow costrequires the run ID.
Step 2: Calculate the Cost
Basic usage (text output):
npx output workflow cost <runId>
With a local trace file:
npx output workflow cost <runId> path/to/trace.json
JSON output (for programmatic use or display):
npx output workflow cost <runId> --json
Verbose — show per-call breakdown:
npx output workflow cost <runId> --verbose
All flags:
| Flag | Description | Default |
|---|---|---|
--json |
Output machine-readable JSON instead of the text report | false |
--verbose |
Show detailed per-LLM-call breakdown | false |
Understanding the Output
Text format example:
Pricing values are illustrative — the model and per-token rates shown below were current as of 2026-05-04. Live pricing comes from models.dev. For current model IDs, see
output-dev-model-selection.
Costs come in two figures per row: Original is the as-charged cost recorded
in the trace events (llm:usage / http:request:cost), and Adjusted is the
cost after applying any costs.yml override (equal to Original when no override
applies). The bottom line and JSON totalCost are the Adjusted total.
Workflow: process_transcripts
Duration: 12.3s
LLM Costs:
Model | Calls | Original | Adjusted
claude-sonnet-4-6 | 3 | $0.0123 | $0.0123
Subtotal | 3 | $0.0123 | $0.0123
API Costs:
Host | Calls | Original | Adjusted
r.jina.ai | 2 | $0.0040 | $0.0040
Subtotal | 2 | $0.0040 | $0.0040
TOTAL ESTIMATED COST (adjusted) $0.0163
As-charged (from trace) $0.0163
JSON format fields:
{
"workflowName": "process_transcripts",
"durationMs": 12300,
"llmOriginalCost": 0.0123,
"llmAdjustedCost": 0.0123,
"totalInputTokens": 1234,
"totalOutputTokens": 567,
"httpCosts": [{ "host": "r.jina.ai", "originalTotalCost": 0.004, "adjustedTotalCost": 0.004 }],
"httpOriginalCost": 0.004,
"httpAdjustedCost": 0.004,
"originalTotalCost": 0.0163,
"totalCost": 0.0163
}
Per-call entries in llmCalls and httpCosts[].calls carry originalCost and
adjustedCost. (Older releases exposed llmTotalCost, services[],
serviceTotalCost, and unknownModels — replaced by the fields above.)
Examples
Get cost of the last run:
# First get the run ID
npx output workflow runs list process_transcripts --limit 1 --json
# Then get the cost
npx output workflow cost process_transcripts_2026-03-23T19:35:17.000Z_abc123
Get cost as JSON and extract total:
npx output workflow cost <runId> --json | jq '.totalCost'
Show full per-call breakdown:
npx output workflow cost <runId> --verbose
Related Skills
output-workflow-runs-list— Find run IDs from execution historyoutput-workflow-start— Start a workflow and capture its run IDoutput-workflow-run— Run a workflow synchronouslyoutput-dev-scenario-file— Create or find scenario files for workflow input
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。