Docs · Guide

Token usage and cost per agent

Every request through packinggoods is recorded: the agent, the model asked for and the one that answered, the account, the tokens, an estimated cost, the time and the status. The Usage page sums them per agent, model and subscription account, and the Requests page lists each one. With Claude Code, Codex and the rest, you see where the money goes without another tracking tool.

On the command line

The same numbers are on the command line, the last 30 days by default:

Terminal
packinggoods usage                      # the last 30 days: tokens and cost per agent, model and account
packinggoods usage today                # or 7d, 30d, all
packinggoods usage --last 24h           # a window ending now (90m, 1.5 days…)
packinggoods usage --csv 7d             # every request as CSV
packinggoods usage --csv --account  30d

--last and --days count a window ending now, not from a midnight. Each CSV row is one request: the model asked for, sent and served, tokens, cost, time, status and account.

What each session cost

The Sessions page and packinggoods sessions list the latest Claude Code, Codex, OpenCode, Pi and other agents' sessions with what each cost, filtered by model or project folder:

Terminal
packinggoods sessions                   # the latest sessions, with what each cost
packinggoods sessions --days 7          # what every session spent, day by day
packinggoods sessions --model  --folder  --json
packinggoods sessions read              # which agents' history packinggoods may read

An agent's own session files are read only once you allow that agent; none are read until then. Once allowed, calls that didn't go through packinggoods (Claude Code signed in to claude.ai directly, say) reach Usage from those files too.

Search what was said

The Sessions page's search, packinggoods sessions search and the Packinggoods Sessions MCP server (Library → MCP) find the sessions of every agent whose prompts or replies say the words, newest first, each with a snippet. packinggoods sessions show prints one as text, from where the words were said, so an agent can look up an earlier conversation, decision or fix by itself:

Terminal
packinggoods sessions search login bug                 # every agent's sessions that said it
packinggoods sessions search "rate limit" --agent codex --days 7 --limit 5
packinggoods sessions search login --json
packinggoods sessions show claude:<id> --find login    # that session, from where it was said
packinggoods sessions show claude:<id> --from 40 --json

They read only the agents you allow packinggoods to read. The first search on a long history builds an index of what was said, kept for the next one.

Where a price comes from

A call is counted at its effective price: what you set for that provider and model if you did, otherwise what the provider's own catalogue lists, otherwise what models.dev lists for the model's maker.

A relay that resells at a discount or a multiplier isn't charging the maker's price. Say what it actually charges, and Usage and the session totals use that:

Terminal
packinggoods model price relay-a/gpt-5.5                        # what it is counted at, and where that came from
packinggoods model price relay-a/gpt-5.5 0.12,0.60,0.01,0.15   # input,output,cache read,cache write
packinggoods model price relay-a/gpt-5.5 --reset
packinggoods model prices                                       # every model you priced

Calls with no price

A call with no price is left out of a total's cost, never counted as free. The Usage page says how many calls it couldn't price beside the sum (3 unpriced, say), and packinggoods usage says so after its totals. packinggoods doesn't guess a variant's price from a similar name: -auto, -max and -fast can each cost differently, so give it one with packinggoods model price.

Claude Code's status line

packinggoods statusline prints one line for Claude Code's status line: the model the session's latest turn went to, then each subscription account's windows, with * on the one that answered last. Turn it on from Claude Code's row on the Agents page, or:

Terminal
packinggoods claude statusline on
# → claude/claude-opus-5-5 | claude [email protected]* 5h 62% 7d 41% | claude B 5h 8% 7d 30%

A status line of your own (claude-hud, a script) is never written over. It works however Claude Code signs in to the gateway.

From other programs

The Usage page's summary and request list are served by the gateway too, read-only and without conversation text:

Terminal
GET /v1/packinggoods/usage
GET /v1/packinggoods/usage/requests

From another computer they need a gateway key. A key held to a budget, models or accounts is refused the summary and gets only its own requests in the list.

FAQ

How do I see what Claude Code costs?

With Claude Code going through packinggoods, every request is recorded with its tokens and an estimated cost. See it per agent on the Usage page or with packinggoods usage, and per session on the Sessions page or with packinggoods sessions.

My relay charges less than list price. How do I get the cost right?

Set what it charges with packinggoods model price / input,output,cache read,cache write (USD per million tokens), and Usage and the session totals use it.

Can I export every request?

Yes. packinggoods usage --csv exports each request with its models, tokens, cost, time, status and account; --account limits it to one account.

Why do some calls have no cost?

A call with no known price is left out of the total, and the Usage page says how many are unpriced. Give the model a price and they are counted.

Related: Quota left on every subscription and key, Round robin and failover across accounts, keys and providers. Hit an error? See Fixing common errors: 401, 429, 502, 504 and more, or ask on Discord.