Token Usage

Tokens are the basic units used by models to represent natural language text, and also the units used for billing. They can be intuitively understood as "characters" or "words". Typically, a Chinese character, an English word, a number, or a symbol is counted as a token.

Conversion Ratios

  • • 1 English character ≈ 0.3 token
  • • 1 Chinese character ≈ 0.6 token

Due to different tokenization methods, actual ratios may vary. The actual number of tokens is based on the model's response usage field.

"usage": {
  "prompt_tokens": 9,
  "completion_tokens": 12,
  "total_tokens": 21,
  "prompt_cache_hit_tokens": 0,
  "prompt_cache_miss_tokens": 9
}