Przejdź do treści
Biblioteka skilli
AI i agenci · Analiza

output-dev-workflow-cost

/output-dev-workflow-cost

Oblicza i pokazuje koszt wykonania workflow Output SDK: tokeny LLM, usługi API i całkowite wydatki dla wskazanego uruchomienia.

Repozytorium
output ↗
Licencja
Apache-2.0
Ostatnia zmiana repozytorium
26.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
1
Przestarzałość

Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

Co robi i kiedy

Oblicza i pokazuje koszt wykonania workflow Output SDK: tokeny LLM, usługi API i całkowite wydatki dla wskazanego uruchomienia.

Oryginalny opis (EN)

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.

Jak działa

  1. Overview
  2. When to Use This Skill
  3. Step 1: Get a Workflow Run ID
  4. Step 2: Calculate the Cost
  5. Understanding the Output
  6. Examples
  7. Related Skills
Sekcje z nagłówków SKILL.md, w oryginale · 167 linii, 730 słów
Podgląd SKILL.md
---
name: output-dev-workflow-cost
description: 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.
allowed-tools: [Bash]
---

# 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-23T19: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`):
```bash
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:
```bash
npx output workflow run <workflowName> --input '{"key": "value"}'
```

Or asynchronously (use skill: `output-workflow-start`):
```bash
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 cost` requires the run ID.

---

## Step 2: Calculate the Cost

### Basic usage (text output):
```bash
npx output workflow cost <runId>
```

### With a local trace file:
```bash
npx output workflow cost <runId> path/to/trace.json
```

### JSON output (for programmatic use or display):
```bash
npx output workflow cost <runId> --json
```

### Verbose — show per-call breakdown:
```bash
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](https://models.dev). For current model IDs, see [`output-dev-model-selection`](../output-dev-model-selection/SKILL.md).

Costs come in two figures per row: **Original** is the as-charged cost recorded
in the trace attributes (`llm:generation:cost` / `http:request:cost`, with
`llm:generation:usage` and legacy `llm:usage` fallbacks), 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
```

API Costs only include calls where the client attached a dollar amount with `addRequestCost` (see `output-dev-http-client-create`, "Attaching Request Cost (Paid APIs)"). An HTTP call that never calls `addRequestCost` is still traced but contributes nothing here — that's expected for free or internal services, and a gap to fix for paid ones.

### JSON format fields:
```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
}
```

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:**
```bash
# 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:**
```bash
npx output workflow cost <runId> --json | jq '.totalCost'
```

**Show full per-call breakdown:**
```bash
npx output workflow cost <runId> --verbose
```

---

## Related Skills

- `output-workflow-runs-list` — Find run IDs from execution history
- `output-workflow-start` — Start a workflow and capture its run ID
- `output-workflow-run` — Run a workflow synchronously
- `output-dev-scenario-file` — Create or find scenario files for workflow input

Wersje

W bazie nie ma innych skilli o nazwie output-dev-workflow-cost.

Migawka bazy z 13.11.2026 · wersja paczki 317645426c98 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100output-dev-cost-hooks
    Subskrybuje zdarzenia kosztowe (cost:http:request, llm:generation:metering), by przekazywać wydatki na LLM i API do własnego systemu obserwowalności.
  • 95exploring-llm-costs
    Analizuje wydatki na LLM w PostHog: koszt w czasie, wg modelu, dostawcy i użytkownika, a także ekonomię tokenów i cache.
  • 100output-workflow-result
    Pobiera wynik wykonania workflow Output SDK po zakończeniu asynchronicznego uruchomienia, w tym wartość zwracaną.
  • 100cost-tracking
    Mierzy koszt API tokenów dla wybranych operacji w Claude Code: zlicza tokeny wejścia, wyjścia i cache na każde wywołanie i przelicza je na USD według aktualnego cennika Anthropic.
  • 100token-cost-analyzer
    Analizuje i optymalizuje koszty API LLM: zużycie tokenów, audyt kosztów i prompty pod kątem wydatków na AI.
  • 100llm-cost-optimizer
    Obniża wydatki na API LLM: kontroluje zużycie tokenów, kieruje ruch między modelami według kosztu i jakości, wdraża prompt caching i buduje obserwowalność kosztów funkcji AI.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.