Live prompt cost meter
Write prompts with a price tag in view. As you type, this meter shows a running token count and dollar cost for your selected model and expected completion length — so you feel the cost of a verbose system prompt before it ships to production.
How it works
The meter estimates tokens locally from your text, blending a character-based rule (≈1 token per 4 characters) with a word count for stability across short and long inputs. It then prices the call:
prompt_cost = (prompt_tokens / 1,000,000) × input_price
output_cost = (expected_completion / 1,000,000) × output_price
total = prompt_cost + output_cost
Because output is priced several times higher than input, the completion-length
field often dominates the total — a useful reminder that capping max_tokens is
the cheapest optimization.
Tips
- Trim the system prompt. A bloated system message is paid on every single call; the meter makes that cost visible.
- Set a realistic completion length. Estimate your typical answer size so the total reflects real usage, not just the prompt.
- Verify before launch. For exact, billable counts, confirm with a provider-backed token counter before locking in a budget.