Cost
cmd/crewship/cmd_cost.go is a high-density single-screen cost summary for the impatient. crewship paymaster ... exposes the underlying rollups in full fidelity; cost is what you reach for when you just want to know “how much am I spending and on what?” without remembering which subcommand to run.
Composes three paymaster endpoints into one view:
GET /api/v1/paymaster/top-spenders— N highest-spend scopesGET /api/v1/paymaster/spend/by-crew— per-crew rollupGET /api/v1/paymaster/subscriptions— subscription-plan usage (best-effort; not every workspace has plans)
crewship cost
| Flag | Type | Default | Effect |
|---|---|---|---|
--range <window> | string | 24h | Time window: 1h, 24h, 7d, 30d. Threaded into every underlying call. |
--limit <n> | int | 5 | Number of top spenders to print. |
--watch <duration> | string | "" | Auto-refresh every <duration> (e.g. 5s, 1m; min 1s). Empty disables. Shared addWatchFlag helper. |
Examples
Output
cost_usd regardless of server return order, so the highest-spend crew is always at the top.
crewship cost forecast
Project the cost of a future run before sending it. Two modes — pick by which flag you set:
| Flag | Type | Default | Effect |
|---|---|---|---|
--prompt <text|@file|@-> | string | Prompt-mode source: literal text, @path to read a file, or @- for stdin. | |
--from-history <agent-slug> | string | History-mode source: averages the last 20 runs of the named agent. | |
--output-ratio <float> | float | 2.0 | Output tokens projected as this multiple of input tokens (prompt mode only). Most agent runs return less than the input on average — 2.0 is a generous safety margin. |
--prompt and --from-history are mutually exclusive and exactly one is required. Both modes print the same row layout (provider, input ) so the output is directly comparable across modes.
History mode walks /api/v1/runs?agent_id=<id>&limit=20, sums usage.input_tokens / usage.output_tokens out of each run’s metadata, and averages. Metadata blobs lacking the usage keys are skipped silently — runs from providers that don’t report usage simply don’t contribute to the average.
See also
crewship paymaster— full-fidelity rollups (top, by-crew, by-agent, by-mission, subscriptions).crewship history— recent runs to correlate with cost spikes.