Track and report token usage and cost for conversations. Use when: (1) User asks about token consumption (e.g. "token用了多少", "花了多少钱", "how much did this cost"...
Author: zruler
Blog: https://www.zruler.fun/
Email: zruler@163.com
Feedback: 有问题请及时反馈!Issues and suggestions welcome.
Report token usage and estimated cost for the current conversation.
Call session_status to get current session metrics, then format a user-friendly summary.
After getting session_status, report in this format:
text
📊 本次对话用量
🧮 Tokens: {input} 入 / {output} 出
💵 费用: ${cost}
🗄️ 缓存: {cache_percent}% 命中 ({cached} 缓存 / {new} 新)
📚 上下文: {used}/{max} ({percent}%)
ModelInputOutputCached Inputclaude-sonnet-4-20250514$3$15$0.30claude-opus-4-20250514$15$75$1.50gpt-4o$2.50$10$1.25gpt-4o-mini$0.15$0.60$0.075o1$15$60$7.50o3-mini$1.10$4.40$0.55gemini-2.0-flash$0.10$0.40$0.025gemini-2.5-pro$1.25-$2.50$10-$15-deepseek-chat$0.27$1.10$0.07deepseek-reasoner$0.55$2.19$0.14
Note: Actual cost from session_status is authoritative. This table is for reference only.