Estimate AI API input and output tokens, context-window usage, and potential model costs.
Estimate prompt and response tokens, context usage, and API costs using your own model pricing. No text is sent to a server by this calculator.
Context window utilization:
Estimated input plus output exceeds the context window. Reduce tokens or select a model with a larger context limit.
Formula: request cost = (input tokens × input price + output tokens × output price) ÷ 1,000,000; total cost = request cost × requests. Context usage = input + reserved output tokens. Actual usage and bills may differ due to tokenizer behavior, cached token pricing, tool calls, hidden reasoning tokens, system prompts, provider limits, and other fees. This estimator does not automatically fetch model pricing.