We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Token Economics

Bloated context doesn't just cause problems for your model's performance, it can also hurt the ol' pocketbook. As we discussed earlier, AI usage is generally billed by the token (or by a subscription with token caps).

But generally speaking, more tokens mean more cost. And larger context = more input tokens.

Accumulation

How is it even possible to use millions of tokens?!? Well, each agentic step can add tool calls and reasoning steps that you don't even see. So a few prompts can easily balloon into many tens of thousands of tokens underneath your conversation.

Also consider that each time you send a message, the LLM has to reprocess the entire conversation. It doesn't only process the new message like a human would. If your session already has 100,000 tokens in context, sending 10 more messages in that conversation means at least 1 million input tokens, even if no other tool calls are made.

Caching

To be fair, input tokens usually cost far less than output tokens. And a significant percentage of input tokens get cached, which further reduces the cost.

Cache hits are not guaranteed, though, and cached tokens still occupy context space and cost money. For example, Gemini 4 Argon's announced introductory input pricing includes a 95% discount for cached tokens:

  • $2.00 per million uncached input tokens
  • $0.10 per million cached input tokens

After the introductory period, uncached input rises to $4.00 per million tokens; Google hasn't published an end date or long-prompt pricing tiers for Argon.

Don't Shove Everything in Context

Not every session you start needs to have the entirety of your codebase, docs, and session history in context. That's why agent harnesses like OpenCode have tools for fetching files and data on demand. You can keep prompt templates, documentation, and instructions for tool calling elsewhere (like in files on disk) and tell your model to go read them as needed.