克劳德代币计数器,现在提供模型比较功能
Claude Token Counter, now with model comparisons

原始链接: https://simonwillison.net/2026/Apr/20/claude-token-counts/

## Claude Token 计数器更新 - 2026年4月20日 Claude Token 计数器工具的最新升级现在允许直接比较 Claude 模型之间的 token 数量——Opus 4.7、Opus 4.6、Sonnet 4.6 和 Haiku 4.5。 这尤其重要,因为 Opus 4.7 引入了新的 tokenizer。 测试表明,与 4.6 相比,Opus 4.7 通常使用 **1.46 倍** 的 token 来处理文本,尽管定价保持不变(输入 5 美元/百万,输出 25 美元/百万)。 这有效地转化为约 **40% 的成本增加**。 对于图像,影响更为显著。 Opus 4.7 支持更高分辨率的图像(高达 3.75MP),但高分辨率图像(3456x2234)的 token 数量比 4.6 **高 3.01 倍**。 然而,对于较低分辨率的图像,两种模型之间的 token 使用量仍然可比。 此次更新强调了在选择 Claude 模型时考虑 token 使用量的重要性,尤其是在 Opus 4.7 中引入新的 tokenizer 之后。

黑客新闻 新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Claude Token 计数器,现在带有模型比较 (simonwillison.net) 13 分,来自 twapi 2 小时前 | 隐藏 | 过去 | 收藏 | 1 条评论 帮助 tomglynch 6 分钟前 [–] 有趣的结果。可能需要在上传时缩小图像尺寸以降低成本。回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

20th April 2026 - Link Blog

Claude Token Counter, now with model comparisons. I upgraded my Claude Token Counter tool to add the ability to run the same count against different models in order to compare them.

As far as I can tell Claude Opus 4.7 is the first model to change the tokenizer, so it's only worth running comparisons between 4.7 and 4.6. The Claude token counting API accepts any Claude model ID though so I've included options for all four of the notable current models (Opus 4.7 and 4.6, Sonnet 4.6, and Haiku 4.5).

In the Opus 4.7 announcement Anthropic said:

Opus 4.7 uses an updated tokenizer that improves how the model processes text. The tradeoff is that the same input can map to more tokens—roughly 1.0–1.35× depending on the content type.

I pasted the Opus 4.7 system prompt into the token counting tool and found that the Opus 4.7 tokenizer used 1.46x the number of tokens as Opus 4.6.

Screenshot of a token comparison tool. Models to compare: claude-opus-4-7 (checked), claude-opus-4-6 (checked), claude-opus-4-5, claude-sonnet-4-6, claude-haiku-4-5. Note: "These models share the same tokenizer". Blue "Count Tokens" button. Results table — Model | Tokens | vs. lowest. claude-opus-4-7: 7,335 tokens, 1.46x (yellow badge). claude-opus-4-6: 5,039 tokens, 1.00x (green badge).

Opus 4.7 uses the same pricing is Opus 4.6 - $5 per million input tokens and $25 per million output tokens - but this token inflation means we can expect it to be around 40% more expensive.

The token counter tool also accepts images. Opus 4.7 has improved image support, described like this:

Opus 4.7 has better vision for high-resolution images: it can accept images up to 2,576 pixels on the long edge (~3.75 megapixels), more than three times as many as prior Claude models.

I tried counting tokens for a 3456x2234 pixel 3.7MB PNG and got an even bigger increase in token counts - 3.01x times the number of tokens for 4.7 compared to 4.6:

Same UI, this time with an uploaded screenshot PNG image. claude-opus-4-7: 4,744 tokens, 3.01x (yellow badge). claude-opus-4-6: 1,578 tokens, 1.00x (green badge).

Update: That 3x increase for images is entirely due to Opus 4.7 being able to handle higher resolutions. I tried that again with a 682x318 pixel image and it took 314 tokens with Opus 4.7 and 310 with Opus 4.6, so effectively the same cost.

联系我们 contact @ memedata.com