Understand AI tokens in Bolt

Understanding tokens and token usage is critical to using Bolt effectively.

A simple definition of tokens:

Tokens are small pieces of text

“I”, “love”, “cats”, ”!” are all examples of a token.

LLMs process text as tokens, analyze them, and then predict the next tokens to generate a response.

AI tokens are a complex topic related to all AI apps, not just Bolt. For detailed background on tokens in AI, check out Nvidia blog | Explaining Tokens — the Language and Currency of AI.

Token limits

LLMs can only handle a certain number of tokens at a time and the total includes both:

  • The input you give (for example, a long question or document)
  • The output it generates (for example, the response, or the code you get back)

Costs

If you’re using an LLM through a paid service (like you are with Bolt), costs are often calculated based on the number of tokens processed. Fewer tokens means lower cost.

In this table, you can find an approximate guide for estimating token costs for code tasks:

TaskApprox. token cost
Simple function (10 lines)50-100 tokens
Medium script (50 lines)300-500 tokens
Complex logic (100+ lines)1000+ tokens
Full application (~1000 lines)8000+ tokens

For Bolt specifically, it’s important to note that the majority of token usage is related to syncing your project’s file system to the AI: the larger the project, the more tokens used per message.

Costs can grow very quickly, so refer to Maximizing token efficiency to learn how to keep costs down.

Reduce your token usage

Refer to the resources on prompting effectively and maximizing token efficiency.

Buy more tokens

You can upgrade to higher-tier plans that include more tokens in My Subscription. You can also purchase token reloads there, although upgrading your plan is usually more cost-effective.

Token reloads versus monthly tokens

Here is a clip of our CEO Eric explaining token reload pricing. We’d love to hear your feedback on this topic!

Token reload isn’t available on Teams plans.

Token rollover

Tokens associated with a paid subscription don’t roll over from month to month.

Tokens associated with a token reload do rollover from month to month, but you must have a paid subscription to use these tokens.

To provide better token pricing through volume discounting, Bolt reserves GPUs from the upstream inference providers. The providers bill for this regardless of whether the compute is used.