Toolvito

Calculates on this device using reference data from Toolvito.

AI Token & Cost Calculator

Enter the token counts for one request to estimate its cost at the published Claude or OpenAI API rates. You can also count text locally using a named encoding, save its token IDs or compare prices across models.

Enter your values

The cost of input and output tokens for a number of requests, at the published prices of the Claude API or the OpenAI API.

Your values

More options

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose the button below them.

The calculator works in your browser. It loads checked reference data (for example time zones or official rates) from the Toolvito server; nothing you type is sent.

How to use it

  1. Choose Estimate the cost, the provider and the model.
  2. Enter the input and output tokens of one request (from the provider’s usage report or its token counting API) and the number of requests. Under More options add cached input tokens or the Batch API.
  3. Choose Count text tokens, select the encoding and enter your text. You can download every token ID in reading order. Size of a text measures characters, words, lines and UTF-8 bytes.
  4. Choose Compare model prices for the provider’s table. For an estimate, select your processing speed and enter any cache reads or writes under More options.

How the cost is worked out

Cost = (input tokens × input price + output tokens × output price) ÷ 1,000,000, with cached input tokens at their own price. The Anthropic Batch API halves input and output prices, as the page states. Prices are in US dollars per million tokens.

Worked example

1,000 requests of 2,000 input and 500 output tokens on a model at $2 input and $10 output per million tokens cost 1,000 × (2,000 × 2 + 500 × 10) ÷ 1,000,000 = $9.

Limits you should know

  • The model and speed you select determine which published text rates apply. Separate charges for regions, tools, images or audio require the provider’s pricing details.
  • The text counter supports ordinary text in o200k_base and cl100k_base. For another encoding or the complete billed request, enter the usage counts reported by the provider.
  • Only the Claude API and the OpenAI API are covered.

Related tools