costs
Aggregate project cost breakdown by model, provider, or day
costs reports a project's aggregate spend over a window, grouped by model, provider, or day. Alongside the priced total, each group carries an unpriced count and a local count — calls Solwyn recorded but did not cost, kept visible rather than settled as a fabricated $0.
solwyn --project <project_id> costs [--range 7d|30d|90d|365d] [--group-by day|model|provider]Resolve the project with --project, SOLWYN_PROJECT_ID, or a default_project in your config file.
Options
| Option | Type | Default | Purpose |
|---|---|---|---|
--range | 7d | 30d | 90d | 365d | 7d | Aggregation window. |
--group-by | day | model | provider | model | Dimension to aggregate on. |
| Contract | |
|---|---|
| Auth | any (project key or JWT) |
| Exit codes | 0 success · 1 generic/API · 2 usage · 3 auth · 5 not found |
| JSON schema | solwyn.costs.v1 |
Output
Each row is one group. Cost is the priced total in USD; Unpriced and Local count calls that were recorded without a price.
$ solwyn --project proj_abc12345 costs --range 30d --group-by model
Group Provider Cost Input Output Calls Unpriced Local
gpt-4o openai 8.420000 420000 84000 312 0 0
gpt-4o-mini openai 1.200000 600000 120000 480 0 0
claude-sonnet-4-5 anthropic 6.150000 205000 41000 156 2 0
llama-3.3-70b ollama 0.000000 88000 17600 40 0 40| Column | Meaning |
|---|---|
| Group | The grouping key — a model name, provider, or day depending on --group-by |
| Provider | Provider for the group (- when grouping by day) |
| Cost | Priced total in USD for the group |
| Input / Output | Total input and output tokens |
| Calls | Number of calls in the group |
| Unpriced | Calls recorded with no observable billable quantity — never a fabricated $0 |
| Local | Calls to zero-cost local providers (ollama, vllm, lmstudio), recorded for visibility |
The Unpriced and Local lanes exist because Solwyn records only quantities and selectors, never content — so a call whose billable quantity is unobservable is shown, not invented. See Surface coverage for which calls land in each lane.
Grouped by provider
$ solwyn --project proj_abc12345 costs --range 90d --group-by provider
Group Provider Cost Input Output Calls Unpriced Local
openai openai 38.240000 1920000 384000 1204 0 0
anthropic anthropic 24.600000 820000 164000 387 2 0JSON output
$ solwyn --project proj_abc12345 --json costs --range 30d --group-by provider
{
"schema": "solwyn.costs.v1",
"project_id": "proj_abc12345",
"range": "30d",
"group_by": "provider",
"groups": [
{
"group_key": "openai",
"provider": "openai",
"total_cost": 38.24,
"total_input_tokens": 1920000,
"total_output_tokens": 384000,
"call_count": 1204,
"unpriced_call_count": 0,
"local_call_count": 0
}
]
}Pretty-printed here; the CLI emits the envelope as a single line. See Scripting for the envelope and exit-code contract.