Good point on max_tokens. A limit tuned on one tokenizer can cut another provider's JSON reply mid-object. To answer your question: OpenAI counts are exact. The o200k_base tokenizer runs in the browser via js-tiktoken. Claude and Gemini are estimates, since their tokenizers can't run client-side. The counter takes the o200k count and applies a per-family ratio: 1.30 for Claude models since 4.7, 1.05 for Haiku 4.5 and 0.95 for Gemini. For exact Claude numbers, Anthropic's count_tokens endpoint is the reliable route. The 30% is an average for English text and shifts with language and content, so I'd still leave some headroom on max_tokens.
