GA
Global API
DocsGet Started

Token Calculation

Token Calculation

Tokens = words + special characters + overhead.

Quick Estimate

  • 1 token ≈ 4 characters in English
  • 1 token ≈ 1-2 characters in Chinese
  • 1 token ≈ 0.75 words in English
  • Formula

    Total Cost = (Input Tokens × Input Price) + (Output Tokens × Output Price)

    Tips

  • Use `ga-economy` or `Qwen/Qwen3-8B` for simple tasks (free or cheaper)
  • Set `max_tokens` to avoid runaway outputs
  • Include all `messages` history in context cost
  • For long conversations, summarize older messages
  • Get Started Free →