Skip to content

How costs are calculated

AI providers charge per token: roughly ¾ of a word. You pay for the tokens you send (input: your message plus the conversation so far) and the tokens you get back (output: the answer).

cost = input tokens × input price + output tokens × output price

Prices are per million tokens, in US dollars, then converted to your display currency.

Most providers tell kunji exactly how many tokens each answer used. When one doesn’t, kunji estimates (about 4 characters per token) and marks the numbers with ~.

kunji looks for a price in this order and uses the first it finds:

  1. Your own price in config.toml ([pricing."provider:model"])
  2. kunji’s curated list in the project repository
  3. OpenRouter’s public model list, matched to your model’s name

Lists are downloaded at most once a day and cached. If no price is found, the cost shows as —.

Each message sends the whole conversation so far as input, so long chats cost more per message. Start a fresh one with /new when you change topic.

Usually close, but it’s an estimate: prices change, some providers charge differently for cached input or long contexts, and name matching can miss. Your provider’s billing page is the real number.