免费工具
免费 AI Token 计算器
计算任意文本的 token 数、字符数和单词数。选择提供商和模型,即可查看 80 多个模型(包括 GPT、Claude、Gemini、Qwen、DeepSeek 和 Llama)的预估 API 费用。
估算模型费用
输入的 80% · 约 0 个输出 token
各提供商费用*
按提供商显示你的输入加上 80% 输出的费用。可在卡片中选择任意模型。
Anthropic
OpenAI
xAI
Z.AI
MiniMax
DeepSeek
Moonshot (Kimi)
显示 16 个提供商中的 8 个
Model prices change weekly. Get the delta in one email.
One short email whenever a major model's pricing moves. No spam.
Token 计算器的工作原理
大语言模型并不直接读取字符或单词,而是读取token, , 模型训练所依据的文本小片段。由于每个 API 都是按 token 计费,了解你的 token 数量是在发送请求前预测费用的唯一可靠方法。
在上方粘贴文本,本工具即可实时计算 token 数。OpenAI 模型会在你的浏览器中进行精确分词。对于 Anthropic、Google、xAI、DeepSeek、Mistral、Cohere 和 Perplexity,由于这些提供商未公开精确的分词器,计数为估算值。对比表格展示了同一段文本在十二个最热门模型上的定价,方便你一眼找出最划算的选项。
按内容类型划分的 Token 比率
相同字数的文本,根据内容类型不同,所消耗的 token 数量也会或多或少。以下为使用 GPT分词器测得的典型范围,请将其视为估算值而非精确数字。
| 内容类型 | 示例 | 比率 | 每 1,000 词约合 Token 数 | 说明 |
|---|---|---|---|---|
| 英语散文 | The quick brown fox jumps over the lazy dog. | 约每词 1.3 个 token | 约 1,300 | 日常写作。GPT 分词器针对此类文本进行了优化,因此可作为基准。 |
| 技术文档 | The endpoint returns a 200 status on success. | 约每词 1.5 个 token | 约 1,500 | 术语和不常见词汇会被拆分成更多子词片段。 |
| 源代码 | for (let i = 0; i < n; i++) { run(i); } | 约每词 2 到 3 个 token | 约 2,000 到 3,000 | 括号、运算符和缩进通常各自成为独立的 token。 |
| JSON 或 XML | { "id": 42, "active": true } | 约每词 3 到 4 个 token | 约 3,000 到 4,000 | 大括号、引号、冒号等结构性标点非常消耗 token。 |
| 中文、日文、韩文 | 東京タワーは高い | 约每字符 1.5 到 2.5 个 token | 按字符计数 | 非拉丁文字每个 token 承载的内容更少,因此表达相同含义的成本更高。 |
| 数字和 ID | 1234567890, 550e8400-e29b | 因数字拆分方式而异 | 视情况而定 | 较长的数字和标识符通常会被拆分成多个 token。 |
Token 定价机制:输入、输出、缓存与批量
几乎所有主流 LLM API 都会分别对输入和输出 token计费。输入 token 是你的提示词、系统消息以及提供的任何上下文中的 token;输出 token 是模型生成的内容。由于生成文本比读取文本更消耗算力,输出 token 的定价通常比输入 token 高出数倍。在许多前沿模型上,输出费率是输入费率的两到四倍,因此以生成为主的工作负载成本可能远高于原始 token 数所暗示的水平。
缓存输入定价是提供商在你反复发送相同提示词前缀(例如较长的系统提示词或静态文档)时提供的折扣。提供商会缓存首次调用生成的键值表示,并在后续调用中以较低费率计费,通常比标准输入定价低 50% 到 90%。这使得缓存定价对于在多次请求中使用固定上下文的应用非常有价值。
批量 API(由 OpenAI、Anthropic 等提供商推出)允许你异步提交大量请求。与实时响应不同,结果会在设定的时间窗口内返回,通常长达 24 小时。作为接受这种延迟的交换,提供商通常会收取约为标准单 token 价格一半的费用。批量 API 非常适合不需要即时结果的离线工作负载,例如文档分类、生成嵌入向量或评测任务。
上方计算器中的对比表格并列展示了输入、输出、缓存和批量价格,方便你在确定模型之前选择适合自身使用场景的定价层级。
这个工具适合谁使用?
看看你的角色、业务或工作流程是否符合人们实际使用这个工具的方式。
Indie AI app developers
You need to know the real per-request cost of a GPT wrapper app before shipping it, so you run an openai api cost calculator against sample prompts and responses.
Prompt engineers
You need to trim a system prompt so it stops overflowing the model's limit, so you search for a token counter for prompts to see the exact count per model.
RAG and embeddings engineers
You need to pick a chunk size that stays under the embedding model's token ceiling, so you search chunk size token calculator while splitting documents for a vector database.
Startup founders and product managers
You need to model gross margin on a new AI feature before setting a price, so you search llm api cost calculator to compare input and output token cost across providers.
AI automation agency owners and consultants
You need a defensible number to quote a client for an automation build, so you search ai project cost estimator using the client's actual prompt volume.
Customer support and chatbot builders
You need to budget a support bot handling thousands of daily conversations, so you search chatbot token cost calculator to project monthly API spend.
ML and fine-tuning engineers
You need to size a training set correctly before uploading it, so you search count tokens for fine-tuning to check a JSONL file against the provider's limits.
Content marketers and SEO teams
You need the true cost of generating hundreds of AI articles before greenlighting a batch run, so you search ai content generation cost calculator to price it out first.
Localization and multilingual product teams
You need to see how much more a non-English prompt costs to run, so you search multilingual token cost calculator and paste the same sentence in several languages.
Students and AI self-learners
You're new to how LLMs work and want a hands-on answer, so you search what is a token in ChatGPT and paste text in to watch it split apart.
No-code automation builders (n8n, Zapier, Make)
You need to know if a node's output will overflow the next step's input cap, so you search token limit calculator before wiring an AI action into your workflow.
Custom GPT and GPTs Store builders
You need your custom instructions to fit OpenAI's character cap, so you search gpt instructions character limit while trimming a system prompt down.
Technical writers and documentation teams
You need to know if an entire manual will fit in a model's context window before pasting it in, so you check a context window calculator against the doc's word count.
Finance, ops, and procurement staff
You need to forecast AI software spend for a budget review, so you search ai api budget calculator to turn expected usage into a monthly dollar figure.
AI researchers and data scientists
You need to compare context window size and price across providers before picking a model for a new project, so you search compare llm context window sizes.
常见问题
Token是语言模型读取和计费的基本单位,通常是几个字符长度的词语片段。对于英文文本而言,一个 token 大约相当于四个字符,或约 0.75 个单词。
对于英语散文而言约为 1,333 个 token(一个单词约合 1.33 个 token)。请参阅下方的按内容类型划分的 token 比率,因为代码和其他格式的情况会有所不同。
对于英语散文而言约为 75 个单词。一个 token 大约相当于 0.75 个单词,即约四个字符。
每个模型系列都使用自己的分词器,因此计数通常会有约 5% 到 15% 的差异。OpenAI 使用基于字节对编码(BPE)的 tiktoken,而 Anthropic 和 Google 使用不同的分词器实现,对同一输入可能产生略有差异的计数结果。
对于 OpenAI 模型是精确的(真实的 GPT 分词器直接在你的浏览器中运行)。对于 Anthropic、Google、DeepSeek 等其他提供商,由于它们未公开分词器,计数是通过对 GPT 计数按比例换算得出的估算值。请将这些估算值视为接近但不完全精确的数字。
上下文窗口是模型一次能够处理的最大 token 数量,既包括你的输入提示词,也包括模型生成的输出。一旦超出该限制,对话中较早的部分就会被丢弃。
输入 token是你在提示词中发送的 token。输出 token 则是模型生成的响应内容。由于生成比处理输入更消耗算力,输出 token 通常按更高的费率计费,往往是输入价格的两到四倍。
缓存输入定价是针对提供商在服务器端缓存的重复提示词前缀所提供的折扣。当你反复发送相同的系统提示词时,被缓存的部分会按较低费率计费,这对高频使用的应用能显著降低成本。
将提示词粘贴到上方计算器中,即可在发送 API 请求前查看所选模型的 token 数和预估费用。需要测试用的提示词吗?浏览我们的提示词库,获取数千个现成提示词。
Vantaige 提供提示词库,包含 1,000 多个免费提示词,以及包含数万个提示词的付费套装,随时可粘贴到计算器或你喜欢的 AI 工具中使用。
不会。Token 计数完全在你的浏览器中运行,你的文本从不会被上传或存储。仅会获取模型价格数据,该请求不包含任何文本内容。
* 价格单位为美元,按每 1,000,000 个 token 计算,数据来源于 Portkey-AI/models. 价格更新于 2026-09-27。 (catalog: 2026-09-27) OpenAI 的计数是精确的;其他提供商的计数是根据 GPT 分词器估算得出,可能与最终账单存在差异。