Claude Fable 5.1 Tokenizer:同一文本多付 30% _tokens 的隐藏成本 · 干货攻略
- 链接: https://x.com/simonw/status/2094938927727804684
- 分类: x-tips
- 来源: X @simonw
- 作者: Jay
- 更新: 2026-09-06
这是什么
Claude Fable 5.1 使用的是与 Claude Fable 5 相同的 tokenizer(该 tokenizer 首次随 Claude Opus 4.7 引入)。相比 Opus 4.7 之前的模型(如 Fable 4、Sonnet 4.6 等),相同文本会多产生约 30% 的 token。
这不是 API 接口的变化——请求格式、流式事件结构完全不变,代码无需修改。但它直接影响你的 token 计数和费用账单。如果你按 token 预算的项目(Fable 5 早期用户、长期对话场景、代码补全工具等),你会发现账单比预期高出一截。
Token 数量变多,不代表模型变强或变弱——这只是计量方式的变化。但它意味着:相同的文字输入,Fable 5.1 会消耗更多 token,从而在相同 token 计价下实际成本更高。
为什么值得关注
谁在分享、解决什么问题
@simonw(Simon Willison)是知名 LLM 实践者、数据记者,运营 llm-prices.com,长期追踪模型定价变化。他在 2026 年 6 月 30 日发布了对 Claude Sonnet 5 新 tokenizer 的实测分析,后续在 9 月 2 日评论 Fable 5.1 时再次引用这组数据。
这条发现的实用价值在于:大多数用户只看官方挂牌价($/M tokens)做预算,但忽视了 tokenizer 变更导致的 token 数量膨胀。Fable 5.1 虽然价格与 Fable 5 相同,但相同文本的计费 token 数增加了约 30%,实际成本隐性上升。
这对以下群体影响最大: - 按 token 配额计费的 SaaS 产品(需要重新校准定价模型) - 长程 Agent 系统(输入 token 量随对话累积,影响最终费用) - 代码补全插件开发者(Fable 系列最常用场景之一) - 预算敏感的独立开发者和小型团队
核验过程
官方来源
主来源(Anthropic 官方文档):
-
Platform Doc - What's new in Claude Fable 5.1
https://platform.claude.com/docs/en/models/fable-5-1/whats-new-fable-5-1"Tokenizer: the same as Claude Fable 5 (introduced with Claude Opus 4.7). Compared with models older than Claude Opus 4.7, the same text produces roughly 30% more tokens."
-
Platform Doc - Migration Guide to Fable 5.1
https://platform.claude.com/docs/en/models/fable-5-1/migration-guide"The API surface, limits, per-token pricing, tokenizer, always-on adaptive thinking... all match Claude Fable 5."
-
Platform Doc - Token Counting
https://platform.claude.com/docs/en/build-with-claude/token-counting"Claude Fable 5 uses the tokenizer introduced with Claude Opus 4.7, which produces roughly 30 percent more tokens than models before Claude Opus 4.7 for the same text."
-
Anthropic 官方发布页
https://www.anthropic.com/claude-fable-and-mythos-5-1确认 Fable 5.1 定价 $10/$50 per MTok,cache read 降至 $0.25/MTok(降 75%),但未提及 tokenizer 数字。
交叉验证(第三方实测)
Simon Willison 实测数据(simonwillison.net,2026-06-30): 使用 Universal Declaration of Human Rights 多语言版本 + Python 代码库,测量同一文本在不同 tokenizer 下的 token 数量:
| 文档 | Sonnet 4.6 token 数 | Sonnet 5 token 数 | 增量 |
|---|---|---|---|
| 英语(Universal Declaration) | 2,356 | 3,341 | 1.42x |
| 西班牙语 | 3,572 | 4,747 | 1.33x |
| 简体中文(简体) | 3,334 | 3,360 | 1.01x |
| Python 代码(sqlite_utils/db.py) | 44,014 | 56,113 | 1.27x |
注:Sonnet 5 使用的是与 Opus 4.7/Fable 5 同一代的 tokenizer(Anthropic 官方确认),所以这些比例适用于 Fable 5.1。
第三方验证:
- SynthoraAI (synthorai.io) 独立测量:Sonnet 5 对同一英语 prompt tokenizes 为 2,245 tokens,而 Sonnet 4.6 为 1,594 tokens——41% 增量,与 Simon 的 1.42x 一致。
- CosmicJS 博客确认:"Sonnet 5 ships a new tokenizer that counts the same text as 1.0x to 1.35x more tokens",并给出具体例子验证。
⚠️ 不确定处
- Fable 5.1 是否使用与 Sonnet 5 完全相同的 tokenizer:Anthropic 官方仅确认 "Fable 5.1 tokenizer = Fable 5 tokenizer(源自 Opus 4.7)",未确认是否等同于 Sonnet 5 的 tokenizer。但从 Opus 4.7→Sonnet 5→Fable 5 的演进时间线来看,三者共享同一 tokenizer 词汇表的可能性极高(否则 Fable 5.1 迁移指南中会单独注明差异)。Simon 的语言比率数据为强力旁证但非官方数据,攻略中以"原帖实测,比率供参考"方式引用。
上手步骤:测量你的文本实际 token 增量
方法一:官方 Token Counting API
# 对比 Fable 5(新版 tokenizer)和 Sonnet 4.6(旧版 tokenizer)
curl -s https://api.anthropic.com/v1/messages/count_tokens \
-H "x-api-key: YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-6-20250514",
"messages": [{"role": "user", "content": "你的文本内容..."}]
}'
curl -s https://api.anthropic.com/v1/messages/count_tokens \
-H "x-api-key: YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-fable-5-1",
"messages": [{"role": "user", "content": "你的文本内容..."}]
}'
方法二:Simon Willison 的 Token Counter 工具
在线工具,直接测量多语言文本在新旧 tokenizer 下的差异:
https://tools.simonwillison.net/claude-token-counter
输入你的代码样本或文档,系统返回 token 数和增量倍数。
方法三:Python 脚本(本地测量)
import anthropic
client = anthropic.Anthropic()
text = open("your_codebase.py").read()
# 旧 tokenizer(用 Sonnet 4.6 测)
old_count = client.count_tokens(
text,
model=anthropic.MODELS["claude-sonnet-4-6-20250514"]
)
# 新 tokenizer(用 Fable 5.1 测)
new_count = client.count_tokens(
text,
model=anthropic.MODELS["claude-fable-5-1"]
)
ratio = new_count / old_count
print(f"旧 tokenizer: {old_count} tokens")
print(f"新 tokenizer: {new_count} tokens")
print(f"增量: {ratio:.2f}x")
print(f"实际成本增幅: {(ratio - 1) * 100:.0f}%")
坑与适用边界
主要坑:按旧 tokenizer 估算的预算全错
如果你在 Fable 5 推出后做了成本模型,现在切换到 Fable 5.1 时需要把 token 数乘以约 1.3x(英文)或对应语言的实际倍数。官方说法是"约 30% 增量",但不同语言差异明显:
| 语言/内容 | 实际增量 | 实际成本影响 |
|---|---|---|
| 英语(European languages) | ~1.30–1.42x | 最贵,需重点关注 |
| 西班牙语等拉丁语系 | ~1.33x | 明显更贵 |
| Python/代码 | ~1.27x | 次高影响 |
| 简体中文 | ~1.01x | 基本不变 ✅ |
| Python 代码 | ~1.27x | 次高影响 |
对中文用户的直接意义:如果你主要处理中文内容(Fable 5.1 作为中文写作或分析助手),tokenizer 变化对你几乎无额外成本影响。但如果你做代码补全、长英文文档处理,成本会增加 30–40%。
Cache 读取可抵消部分成本
Fable 5.1 的 cache read 价格降至 $0.25/MTok(相比 Fable 5 的 $3/MTok 降低约 92%)。如果你的 Agent 系统大量复用相同 system prompt 或上下文模板,cache 能显著降低实际开销,抵消 token 增量带来的成本上升。
并行工具调用行为变化
Fable 5.1 在长 agent 循环中可能将 Fable 5 的一次批量工具调用拆分为多轮,这意味着更多 token 和更多 round trips。Anthropic 官方文档明确标注了这一点,对自定义 coding agent 影响较大,需要重新跑 evals。
一句话结论
Claude Fable 5.1 的 tokenizer 与 Fable 5/Oppus 4.7 同款,相同文本 token 数比旧模型多约 30%,英文最受损(实测可达 1.42x),中文几乎不变——做 Agent 产品预算时必须重新计量,别被相同的 $/M 挂牌价骗了。