Skip to content

Token System

Tokens are the currency that powers every AI interaction in Primio. Understanding how they work helps you build more efficiently and avoid surprises.

Every interaction with the AI consumes tokens. This includes sending a message, the AI reading your project files, generating code, and fixing errors. The total cost of an interaction depends on how much the AI reads and writes.

Different models consume tokens at different rates:

ModelToken costBest for
SonnetLower per interactionBalanced work (features, iteration, simple tasks)
OpusHighest per interactionComplex tasks, best code and UI quality
AutoVariesSystem picks the optimal model for each request

See Model Selection for detailed guidance on when to use each model.

Builds and exports have fixed token costs, independent of which AI model you use:

ActionToken cost
Web hosting (PWA)Free
PWA export20,000
Android APK20,000
Android AAB40,000
iOS IPA40,000

See Publishing Overview for details on each build type.

You need at least 20,000 tokens to create a new project. If your balance is below this threshold, the app will prompt you to upgrade your plan before you can start a new project.

When your balance drops below 100,000 tokens, a warning appears in the chat input area. Click Add tokens to open the pricing modal directly.

The warning can be dismissed for the current session. It reappears when you reload the page.

Your token balance refreshes automatically and updates immediately when a task completes.

This is the most common source of questions. Here’s what drives token usage and how to stay in control.

AI error loops. When the AI encounters a compilation error, it tries to fix it automatically. Sometimes it enters a loop of repeated fix attempts. If you see the AI making similar changes over and over, interrupt it by sending a new message with clearer direction, or use Rollback to revert to a known good state.

Complex refactors. Large operations like splitting files, restructuring navigation, or reworking state management consume more tokens because the AI reads and rewrites many files in a single pass.

Vague prompts. Unspecific requests like “fix everything” or “make it better” cause the AI to explore broadly, reading many files and making scattered changes. This burns tokens without focused results.

Long conversations. As your project grows, each interaction includes more context about your codebase. More context means more tokens per message.

Be specific. Clear, focused prompts consume fewer tokens. Instead of “improve the design,” say “change the header background to dark blue and increase the font size to 18px.” See Prompting Fundamentals.

One feature per message. Don’t batch multiple unrelated requests into a single prompt. Each focused request is cheaper and produces better results.

Use Sonnet for simple changes. Text updates, color changes, and small tweaks cost less on Sonnet than on Opus. Switch models as needed. See Model Selection.

Rollback early. If the AI is heading in the wrong direction, rollback immediately rather than sending multiple corrective messages. Each correction costs tokens.

Use @file references. Point the AI at specific files instead of letting it scan the whole project. This reduces the context it needs to process. See Attaching Context.

What to do if tokens are depleted unexpectedly

Section titled “What to do if tokens are depleted unexpectedly”
  1. Check your token balance in the chat input area or in Personal Settings under Plans.
  2. Review your recent conversation to identify what consumed the most tokens (look for long AI responses, error fix loops, or broad refactors).
  3. Upgrade your plan for more tokens via the pricing modal.
  4. If you believe there’s an error, contact support at support@primio.dev with your project details.

Your token balance is visible in two places:

  • Chat input area — always visible while you work
  • Personal Settings — under the Plans section, with your billing period dates

The balance updates automatically.

Plans & Pricing

Compare plans and find the right token allocation for your needs.

Getting the Best Results

Practical strategies for saving tokens and working effectively with the AI agent.