Measure prompt tokens locally and compare estimated API input and output costs for GPT-4o, GPT-4o mini, Claude 3.5 Sonnet, Gemini Flash, and other listed models. Your prompt remains in the browser throughout the calculation.
GPT counts are calculated synchronously with gpt-tokenizer, a pure JavaScript BPE implementation compatible with modern OpenAI o200k_base tokenization. Other providers use proprietary tokenizers, so their billed count can differ. Price figures are estimates and should be confirmed before production billing decisions.