Overview
The gk tokens command displays token usage analysis for the current session, showing consumption breakdown and cost estimates.
Usage
bash
Alias: gk t
Options
| Option | Description |
|---|---|
--json | Output in JSON format |
Output
Formatted Output (default)
Displays a styled box interface with:
Session Metadata:
- Session ID
- Start time
- Duration
- Models used
- Message count
Token Breakdown:
- Input tokens
- Output tokens
- Cached tokens
- Thoughts tokens
- Tool tokens
Cost Analysis:
- Estimated cost for each token type
- Total cost
Averages:
- Tokens per message
- Cost per message
JSON Output
Returns structured data:
json
Examples
bash
Token Types
| Type | Description |
|---|---|
| Input | Tokens sent to the model (context + prompt) |
| Output | Tokens generated by the model |
| Cached | Previously cached tokens reused |
| Thoughts | Tokens used for model reasoning |
| Tool | Tokens used for tool calls |
Related Commands
gk session- View session detailsgk agent- Spawn agentsgk office- Visual analytics