Commands
health
Section titled “health”Check if the server is reachable.
bun run cli healthServer: http://localhost:3501Status: okAuthenticate via browser. Opens a sign-in page, creates an API key, and saves it locally.
bun run cli loginOpening browser for authentication...Authenticated as user@example.comAPI key saved to /Users/you/.config/codecosts/config.jsonFor headless/CI environments, pass an API key directly:
bun run cli login --api-key sk_your_api_key| Flag | Required | Description |
|---|---|---|
--api-key | No | Use an existing API key (skips browser flow) |
logout
Section titled “logout”Clear the saved API key.
bun run cli logoutLogged out. API key cleared.status
Section titled “status”Show the current authentication state.
bun run cli statusServer: http://localhost:3501API key: setConfig: /Users/you/.config/codecosts/config.jsonShow the authenticated user’s profile. Requires authentication.
bun run cli meID: 550e8400-e29b-41d4-a716-446655440000Email: user@example.comName: Jane DoeCreated: 2026-01-15T10:30:00.000ZUpdated: 2026-02-20T14:15:00.000ZList recent usage logs in a table. Requires authentication.
bun run cli usageTimestamp Model In Out Cost Duration Status2026-03-17 01:19:55 claude-opus-4-6 3 15 $0.0222 3,159ms 2002026-03-17 01:19:49 claude-haiku-4-5 8 1 $0.0000 1,219ms 200| Flag | Description |
|---|---|
--model <name> | Filter by model |
--limit <n> | Number of results (default 20) |
--endpoint <id> | Filter by proxy endpoint |
--from <date> | Only logs after this date |
--to <date> | Only logs before this date |
usage:detail
Section titled “usage:detail”Show full detail for a single trace, including request and response bodies.
bun run cli usage:detail <id>Trace: ae3c796c-18fe-49df-8ae0-25013a6c040cModel: claude-opus-4-6 Status: 200 Duration: 3,159msCost: $0.0222 Input: 3 tokens Output: 15 tokens
── Request ──────────────────────────────────────{request body JSON, pretty-printed}
── Response ─────────────────────────────────────{response body, pretty-printed or SSE events}usage:summary
Section titled “usage:summary”Show aggregated usage statistics with per-model breakdown.
bun run cli usage:summaryTotal Cost: $5.56Total Requests: 7Input Tokens: 40Output Tokens: 100
By Model: claude-opus-4-6 $5.50 (2 requests, 30 tokens) claude-haiku-4-5 $0.06 (5 requests, 110 tokens)