跳到主要内容Skip to main content

TokenToken

Token

  • 核心概念Core concepts
  • 第一站 · 进门Station 1 · Getting In
解决什么问题What problem it solves

模型处理文本的最小单位。计费和长度限制都按它算。The smallest unit a model processes text in. Both billing and length limits are measured in it.

这是什么What it is

模型把文本切成的片段,一个 token 大约是四分之一个英文单词,或一到两个汉字。

上下文长度、API 报价都以 token 为单位。

The pieces a model splits text into. One token is roughly a quarter of an English word, or one to two Chinese characters.

Context length and API pricing are both denominated in tokens.

为什么需要知道Why it matters

这是最容易被忽略却最影响账单的词。「我的上下文够不够」「为什么这么贵」,答案都在它。The most easily overlooked word that most affects your bill. "Is my context enough" and "why is this so expensive" are both answered here.

别名Chinese aliases

词元

出处Sources
  • Anthropic 官方:Token 计数Anthropic: token counting docs ↗